Skip to content

Commit 3e9b338

Browse files
kianmengsybrenstuvel
authored andcommitted
Fix typos
1 parent a038aef commit 3e9b338

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

doc/cli.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on how to use them. Here is a short overview:
1616
+-------------------------+--------------------------------------------------+-----------------------------------------+
1717
| Command | Usage | Core function |
1818
+=========================+==================================================+=========================================+
19-
| pyrsa-keygen | Generates a new RSA keypair in PEM or DER format | :py:func:`rsa.newkeys` |
19+
| pyrsa-keygen | Generates a new RSA key pair in PEM or DER format | :py:func:`rsa.newkeys` |
2020
+-------------------------+--------------------------------------------------+-----------------------------------------+
2121
| pyrsa-encrypt | Encrypts a file. The file must be shorter than | :py:func:`rsa.encrypt` |
2222
| | the key length in order to be encrypted. | |

doc/usage.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ after signing.
2727
Generating keys
2828
---------------
2929

30-
You can use the :py:func:`rsa.newkeys` function to create a keypair:
30+
You can use the :py:func:`rsa.newkeys` function to create a key pair:
3131

3232
>>> import rsa
3333
>>> (pubkey, privkey) = rsa.newkeys(512)
@@ -44,7 +44,7 @@ Alternatively you can use :py:meth:`rsa.PrivateKey.load_pkcs1` and
4444
Time to generate a key
4545
++++++++++++++++++++++
4646

47-
Generating a keypair may take a long time, depending on the number of
47+
Generating a key pair may take a long time, depending on the number of
4848
bits required. The number of bits determines the cryptographic
4949
strength of the key, as well as the size of the message you can
5050
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.
9898
:py:func:`rsa.decrypt`. Let's say that Alice wants to send a message
9999
that only Bob can read.
100100

101-
#. Bob generates a keypair, and gives the public key to Alice. This is
101+
#. Bob generates a key pair, and gives the public key to Alice. This is
102102
done such that Alice knows for sure that the key is really Bob's
103103
(for example by handing over a USB stick that contains the key).
104104

rsa/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def keygen() -> None:
3636
# Parse the CLI options
3737
parser = optparse.OptionParser(
3838
usage="usage: %prog [options] keysize",
39-
description='Generates a new RSA keypair of "keysize" bits.',
39+
description='Generates a new RSA key pair of "keysize" bits.',
4040
)
4141

4242
parser.add_option(

rsa/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ def extended_gcd(a: int, b: int) -> typing.Tuple[int, int, int]:
120120
(x, lx) = ((lx - (q * x)), x)
121121
(y, ly) = ((ly - (q * y)), y)
122122
if lx < 0:
123-
lx += ob # If neg wrap modulo orignal b
123+
lx += ob # If neg wrap modulo original b
124124
if ly < 0:
125-
ly += oa # If neg wrap modulo orignal a
125+
ly += oa # If neg wrap modulo original a
126126
return a, lx, ly # Return only positive values
127127

128128

rsa/key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ def find_p_q(
629629
) -> typing.Tuple[int, int]:
630630
"""Returns a tuple of two different primes of nbits bits each.
631631
632-
The resulting p * q has exacty 2 * nbits bits, and the returned p and q
632+
The resulting p * q has exactly 2 * nbits bits, and the returned p and q
633633
will not be equal.
634634
635635
:param nbits: the number of bits in each of p and q.

rsa/pkcs1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def decrypt(crypto: bytes, priv_key: key.PrivateKey) -> bytes:
273273
# padding from the actual message. The padding should be at least 8 bytes
274274
# long (see https://tools.ietf.org/html/rfc8017#section-7.2.2 step 3), which
275275
# means the separator should be at least at index 10 (because of the
276-
# `\x00\x02` marker that preceeds it).
276+
# `\x00\x02` marker that precedes it).
277277
sep_idx_bad = sep_idx < 10
278278

279279
anything_bad = cleartext_marker_bad | sep_idx_bad

rsa/prime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def getprime(nbits: int) -> int:
157157
True
158158
"""
159159

160-
assert nbits > 3 # the loop wil hang on too small numbers
160+
assert nbits > 3 # the loop will hang on too small numbers
161161

162162
while True:
163163
integer = rsa.randnum.read_random_odd_int(nbits)

0 commit comments

Comments
 (0)