Skip to content

Commit 6068468

Browse files
committed
minimal documentation
1 parent 4bfca1b commit 6068468

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ However, I have not implemented AES itself, instead I import this from `pycrypto
8787

8888
To install dependencies, run `pip -r install requirements`.
8989

90+
The support for reading and writing the keys into PKCS formats requires
91+
the python-ecdsa package. It can be installed using `pip install ecdsa`,
92+
or by installing this package with the `pip install 'kyber-py[pkcs]'`
93+
command.
94+
9095
## Using kyber-py
9196

9297
### ML-KEM
@@ -100,6 +105,18 @@ use:
100105
- `ML_KEM.encaps(ek)`: generate a key and ciphertext pair `(key, ct)`
101106
- `ML_KEM.decaps(dk, ct)`: generate the shared key `key`
102107

108+
Additionally there are few methods for reading and writing both types of keys
109+
in the `ml_kem.pkcs` module:
110+
111+
- `ek_to_der`: for serialising the encapsulation key to a DER byte string
112+
- `ek_to_pem`: for serialising the encapsulation key to a PEM string
113+
- `ek_from_der`: for extracting the encapsulation key from a DER encoding
114+
- `ek_from_pem`: for extracting the encapsulation key from a PEM encoding
115+
- `dk_to_der`: for serialising the decapsulation key to a DER byte string
116+
- `dk_to_pem`: for serialising the decapsulation key to a PEM string
117+
- `dk_from_der`: for extracting the decapsulation key from a DER encoding
118+
- `dk_from_pem`: for extracting the decapsulation key from a PEM encoding
119+
103120
Those, together with the `ML_KEM_512`, `ML_KEM_768`, and `ML_KEM_1024`
104121
objects comprise the kyber-py library stable API.
105122

0 commit comments

Comments
 (0)