Skip to content

Commit d90a8f7

Browse files
committed
move all glossary items to single file
1 parent e3a6ffb commit d90a8f7

File tree

3 files changed

+68
-68
lines changed

3 files changed

+68
-68
lines changed

docs/source/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
# so a file named "default.css" will overwrite the builtin "default.css".
6262
html_static_path = ["_static"]
6363

64+
# Example configuration for intersphinx: refer to the Python standard library.
65+
intersphinx_mapping = {'https://docs.python.org/': None}
66+
6467
autodoc_default_options = {
6568
"undoc-members": True,
6669
"inherited-members": True,

docs/source/glossary.rst

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,68 @@ Glossary
2121
ECDH
2222
Elliptic Curve Diffie-Hellman
2323

24+
raw encoding
25+
Conversion of public, private keys and signatures (which in
26+
mathematical sense are integers or pairs of integers) to strings of
27+
bytes that does not use any special tags or encoding rules.
28+
For any given curve, all keys of the same type or signatures will be
29+
encoded to byte strings of the same length. In more formal sense,
30+
the integers are encoded as big-endian, constant length byte strings,
31+
where the string length is determined by the curve order (e.g.
32+
for NIST256p the order is 256 bits long, so the private key will be 32
33+
bytes long while public key will be 64 bytes long). The encoding of a
34+
single integer is zero-padded on the left if the numerical value is
35+
low. In case of public keys and signatures, which are comprised of two
36+
integers, the integers are simply concatenated.
37+
38+
uncompressed
39+
The most common formatting specified in PKIX standards. Specified in
40+
X9.62 and SEC1 standards. The only difference between it and
41+
:term:`raw encoding` is the prepending of a 0x04 byte. Thus an
42+
uncompressed NIST256p public key encoding will be 65 bytes long.
43+
44+
compressed
45+
The public point representation that uses half of bytes of the
46+
:term:`uncompressed` encoding (rounded up). It uses the first byte of
47+
the encoding to specify the sign of the y coordinate and encodes the
48+
x coordinate as-is. The first byte of the encoding is equal to
49+
0x02 or 0x03. Compressed encoding of NIST256p public key will be 33
50+
bytes long.
51+
52+
hybrid
53+
A combination of :term:`uncompressed` and :term:`compressed` encodings.
54+
Both x and y coordinates are stored just as in :term:`compressed`
55+
encoding, but the first byte reflects the sign of the y coordinate. The
56+
first byte of the encoding will be equal to 0x06 or 0x7. Hybrid
57+
encoding of NIST256p public key will be 65 bytes long.
58+
59+
PEM
60+
The acronym stands for Privacy Enhanced Email, but currently it is used
61+
primarily as the way to encode :term:`DER` objects into text that can
62+
be either easily copy-pasted or transferred over email.
63+
It uses headers like ``-----BEGIN <type of contents>-----`` and footers
64+
like ``-----END <type of contents>-----`` to separate multiple
65+
types of objects in the same file or the object from the surrounding
66+
comments. The actual object stored is base64 encoded.
67+
68+
DER
69+
Distinguished Encoding Rules, the way to encode :term:`ASN.1` objects
70+
deterministically and uniquely into byte strings.
71+
72+
ASN.1
73+
Abstract Syntax Notation 1 is a standard description language for
74+
specifying serialisation and deserialisation of data structures in a
75+
portable and cross-platform way.
76+
77+
bytes-like object
78+
All the types that implement the buffer protocol. That includes
79+
``str`` (only on python2), ``bytes``, ``bytesarray``, ``array.array``
80+
and ``memoryview`` of those objects.
81+
Please note that ``array.array`` serialisation (converting it to byte
82+
string) is endianess dependant! Signature computed over ``array.array``
83+
of integers on a big-endian system will not be verified on a
84+
little-endian system and vice-versa.
85+
86+
set-like object
87+
All the types that support the ``in`` operator, like ``list``,
88+
``tuple``, ``set``, ``frozenset``, etc.

src/ecdsa/keys.py

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,5 @@
11
"""
22
Primary classes for performing signing and verification operations.
3-
4-
.. glossary::
5-
6-
raw encoding
7-
Conversion of public, private keys and signatures (which in
8-
mathematical sense are integers or pairs of integers) to strings of
9-
bytes that does not use any special tags or encoding rules.
10-
For any given curve, all keys of the same type or signatures will be
11-
encoded to byte strings of the same length. In more formal sense,
12-
the integers are encoded as big-endian, constant length byte strings,
13-
where the string length is determined by the curve order (e.g.
14-
for NIST256p the order is 256 bits long, so the private key will be 32
15-
bytes long while public key will be 64 bytes long). The encoding of a
16-
single integer is zero-padded on the left if the numerical value is
17-
low. In case of public keys and signatures, which are comprised of two
18-
integers, the integers are simply concatenated.
19-
20-
uncompressed
21-
The most common formatting specified in PKIX standards. Specified in
22-
X9.62 and SEC1 standards. The only difference between it and
23-
:term:`raw encoding` is the prepending of a 0x04 byte. Thus an
24-
uncompressed NIST256p public key encoding will be 65 bytes long.
25-
26-
compressed
27-
The public point representation that uses half of bytes of the
28-
:term:`uncompressed` encoding (rounded up). It uses the first byte of
29-
the encoding to specify the sign of the y coordinate and encodes the
30-
x coordinate as-is. The first byte of the encoding is equal to
31-
0x02 or 0x03. Compressed encoding of NIST256p public key will be 33
32-
bytes long.
33-
34-
hybrid
35-
A combination of :term:`uncompressed` and :term:`compressed` encodings.
36-
Both x and y coordinates are stored just as in :term:`compressed`
37-
encoding, but the first byte reflects the sign of the y coordinate. The
38-
first byte of the encoding will be equal to 0x06 or 0x7. Hybrid
39-
encoding of NIST256p public key will be 65 bytes long.
40-
41-
PEM
42-
The acronym stands for Privacy Enhanced Email, but currently it is used
43-
primarily as the way to encode :term:`DER` objects into text that can
44-
be either easily copy-pasted or transferred over email.
45-
It uses headers like ``-----BEGIN <type of contents>-----`` and footers
46-
like ``-----END <type of contents>-----`` to separate multiple
47-
types of objects in the same file or the object from the surrounding
48-
comments. The actual object stored is base64 encoded.
49-
50-
DER
51-
Distinguished Encoding Rules, the way to encode :term:`ASN.1` objects
52-
deterministically and uniquely into byte strings.
53-
54-
ASN.1
55-
Abstract Syntax Notation 1 is a standard description language for
56-
specifying serialisation and deserialisation of data structures in a
57-
portable and cross-platform way.
58-
59-
bytes-like object
60-
All the types that implement the buffer protocol. That includes
61-
``str`` (only on python2), ``bytes``, ``bytesarray``, ``array.array``
62-
and ``memoryview`` of those objects.
63-
Please note that ``array.array`` serialisation (converting it to byte
64-
string) is endianess dependant! Signature computed over ``array.array``
65-
of integers on a big-endian system will not be verified on a
66-
little-endian system and vice-versa.
67-
68-
set-like object
69-
All the types that support the ``in`` operator, like ``list``,
70-
``tuple``, ``set``, ``frozenset``, etc.
713
"""
724

735
import binascii

0 commit comments

Comments
 (0)