diff --git a/docs/main/classes/MlKem1024.html b/docs/main/classes/MlKem1024.html index 95c5107..0706bfd 100644 --- a/docs/main/classes/MlKem1024.html +++ b/docs/main/classes/MlKem1024.html @@ -4,7 +4,7 @@
// Using jsr:
import { MlKem1024 } from "@dajiaji/mlkem";
// Using npm:
// import { MlKem1024 } from "mlkem"; // or "crystals-kyber-js"
const recipient = new MlKem1024();
const [pkR, skR] = await recipient.generateKeyPair();
const sender = new MlKem1024();
const [ct, ssS] = await sender.encap(pkR);
const ssR = await recipient.decap(ct, skR);
// ssS === ssR
-Protected
_compressedUSizeProtected
_compressedVSizeProtected
_pkProtected
_skProtected
_compressULossily compresses and serializes a vector of polynomials.
+Protected
_compressedUSizeProtected
_compressedVSizeProtected
_pkProtected
_skProtected
_compressUProtected
_compressVLossily compresses and serializes a polynomial.
+Protected
_compressVProtected
_decompressUDeserializes and decompresses a vector of polynomials. +
Protected
_decompressUDeserializes and decompresses a vector of polynomials.
This is the approximate inverse of the _compressU
method.
Since compression is lossy, the decompressed data may not match the original vector of polynomials.
The compressed and serialized data as a Uint8Array.
The decompressed vector of polynomials.
-Protected
_decompressVDecompresses a given polynomial, representing the approximate inverse of +
Protected
_decompressVDecompresses a given polynomial, representing the approximate inverse of compress2, in Uint8Array into an array of numbers.
Note that compression is lossy, and thus decompression will not match the original input.
The Uint8Array to decompress.
An array of numbers obtained from the decompression process.
-Protected
_sampleGenerates a 2D array of noise samples.
+Protected
_sampleProtected
_sampleGenerates a 2-dimensional array of noise samples.
+Protected
_sampleGenerates a 2-dimensional array of noise samples.
The noise parameter.
The offset value.
The size of the array.
The generated 2-dimensional array of noise samples.
-Generates a ciphertext for the public key and a shared secret.
+Generates a ciphertext for the public key and a shared secret.
If an error occurred, throws MlKemError.
A ciphertext generated by encap.
A private key.
@@ -62,7 +62,7 @@// Using jsr:
import { MlKem768 } from "@dajiaji/mlkem";
// Using npm:
// import { MlKem768 } from "mlkem"; // or "crystals-kyber-js"
const kyber = new MlKem768();
const [pk, sk] = await kyber.generateKeyPair();
const [ct, ssS] = await kyber.encap(pk);
const ssR = await kyber.decap(ct, sk);
// ssS === ssR
-Derives a keypair [publicKey, privateKey] deterministically from a 64-octet seed.
If an error occurred, throws MlKemError.
A 64-octet seed for the deterministic key generation.
A kaypair [publicKey, privateKey].
@@ -70,7 +70,7 @@// Using jsr:
import { MlKem768 } from "@dajiaji/mlkem";
// Using npm:
// import { MlKem768 } from "mlkem"; // or "crystals-kyber-js"
const kyber = new MlKem768();
const seed = new Uint8Array(64);
globalThis.crypto.getRandomValues(seed);
const [pk, sk] = await kyber.deriveKeyPair(seed);
-Generates a shared secret from the encapsulated ciphertext and the private key.
If an error occurred, throws MlKemError.
A public key.
Optional
seed: Uint8ArrayAn optional 32-octet seed for the deterministic shared secret generation.
@@ -79,11 +79,11 @@Generates a keypair [publicKey, privateKey].
If an error occurred, throws MlKemError.
A kaypair [publicKey, privateKey].
Constructs a new instance of the MlKem1024 class.
-