summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKian-Meng, Ang <kianmeng@cpan.org>2021-10-23 10:15:21 +0800
committerSybren A. Stüvel <sybren@stuvel.eu>2021-11-24 10:28:25 +0100
commit3e9b33834ea005b76001d1d439fe0c1c02e7017c (patch)
tree0904328b6f7db51fc2135a7d0dfe5c7250c3a9da
parenta038aef614c656d24c5dfede07e8efe5106ed72e (diff)
downloadrsa-git-3e9b33834ea005b76001d1d439fe0c1c02e7017c.tar.gz
Fix typos
-rw-r--r--doc/cli.rst2
-rw-r--r--doc/usage.rst6
-rw-r--r--rsa/cli.py2
-rw-r--r--rsa/common.py4
-rw-r--r--rsa/key.py2
-rw-r--r--rsa/pkcs1.py2
-rw-r--r--rsa/prime.py2
7 files changed, 10 insertions, 10 deletions
diff --git a/doc/cli.rst b/doc/cli.rst
index 30864d7..e06d5ee 100644
--- a/doc/cli.rst
+++ b/doc/cli.rst
@@ -16,7 +16,7 @@ on how to use them. Here is a short overview:
+-------------------------+--------------------------------------------------+-----------------------------------------+
| Command | Usage | Core function |
+=========================+==================================================+=========================================+
-| pyrsa-keygen | Generates a new RSA keypair in PEM or DER format | :py:func:`rsa.newkeys` |
+| pyrsa-keygen | Generates a new RSA key pair in PEM or DER format | :py:func:`rsa.newkeys` |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| pyrsa-encrypt | Encrypts a file. The file must be shorter than | :py:func:`rsa.encrypt` |
| | the key length in order to be encrypted. | |
diff --git a/doc/usage.rst b/doc/usage.rst
index 5cb5ae7..a55a2bc 100644
--- a/doc/usage.rst
+++ b/doc/usage.rst
@@ -27,7 +27,7 @@ after signing.
Generating keys
---------------
-You can use the :py:func:`rsa.newkeys` function to create a keypair:
+You can use the :py:func:`rsa.newkeys` function to create a key pair:
>>> import rsa
>>> (pubkey, privkey) = rsa.newkeys(512)
@@ -44,7 +44,7 @@ Alternatively you can use :py:meth:`rsa.PrivateKey.load_pkcs1` and
Time to generate a key
++++++++++++++++++++++
-Generating a keypair may take a long time, depending on the number of
+Generating a key pair may take a long time, depending on the number of
bits required. The number of bits determines the cryptographic
strength of the key, as well as the size of the message you can
encrypt. If you don't mind having a slightly smaller key than you
@@ -98,7 +98,7 @@ To encrypt or decrypt a message, use :py:func:`rsa.encrypt` resp.
:py:func:`rsa.decrypt`. Let's say that Alice wants to send a message
that only Bob can read.
-#. Bob generates a keypair, and gives the public key to Alice. This is
+#. Bob generates a key pair, and gives the public key to Alice. This is
done such that Alice knows for sure that the key is really Bob's
(for example by handing over a USB stick that contains the key).
diff --git a/rsa/cli.py b/rsa/cli.py
index 5a9c797..4db3f0b 100644
--- a/rsa/cli.py
+++ b/rsa/cli.py
@@ -36,7 +36,7 @@ def keygen() -> None:
# Parse the CLI options
parser = optparse.OptionParser(
usage="usage: %prog [options] keysize",
- description='Generates a new RSA keypair of "keysize" bits.',
+ description='Generates a new RSA key pair of "keysize" bits.',
)
parser.add_option(
diff --git a/rsa/common.py b/rsa/common.py
index 59d5e62..ca732e5 100644
--- a/rsa/common.py
+++ b/rsa/common.py
@@ -120,9 +120,9 @@ def extended_gcd(a: int, b: int) -> typing.Tuple[int, int, int]:
(x, lx) = ((lx - (q * x)), x)
(y, ly) = ((ly - (q * y)), y)
if lx < 0:
- lx += ob # If neg wrap modulo orignal b
+ lx += ob # If neg wrap modulo original b
if ly < 0:
- ly += oa # If neg wrap modulo orignal a
+ ly += oa # If neg wrap modulo original a
return a, lx, ly # Return only positive values
diff --git a/rsa/key.py b/rsa/key.py
index e4644d1..1284ffc 100644
--- a/rsa/key.py
+++ b/rsa/key.py
@@ -629,7 +629,7 @@ def find_p_q(
) -> typing.Tuple[int, int]:
"""Returns a tuple of two different primes of nbits bits each.
- The resulting p * q has exacty 2 * nbits bits, and the returned p and q
+ The resulting p * q has exactly 2 * nbits bits, and the returned p and q
will not be equal.
:param nbits: the number of bits in each of p and q.
diff --git a/rsa/pkcs1.py b/rsa/pkcs1.py
index 5992c7f..3837a69 100644
--- a/rsa/pkcs1.py
+++ b/rsa/pkcs1.py
@@ -273,7 +273,7 @@ def decrypt(crypto: bytes, priv_key: key.PrivateKey) -> bytes:
# padding from the actual message. The padding should be at least 8 bytes
# long (see https://tools.ietf.org/html/rfc8017#section-7.2.2 step 3), which
# means the separator should be at least at index 10 (because of the
- # `\x00\x02` marker that preceeds it).
+ # `\x00\x02` marker that precedes it).
sep_idx_bad = sep_idx < 10
anything_bad = cleartext_marker_bad | sep_idx_bad
diff --git a/rsa/prime.py b/rsa/prime.py
index d8980d0..ec486bc 100644
--- a/rsa/prime.py
+++ b/rsa/prime.py
@@ -157,7 +157,7 @@ def getprime(nbits: int) -> int:
True
"""
- assert nbits > 3 # the loop wil hang on too small numbers
+ assert nbits > 3 # the loop will hang on too small numbers
while True:
integer = rsa.randnum.read_random_odd_int(nbits)