java.lang.Object
org.bouncycastle.pqc.crypto.mlkem.CBD
Central Binomial Distribution (CBD) sampling for ML-KEM operations. Provides polynomial coefficient sampling from binomial distribution for noise generation.
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionprivate static longconvertByteTo24BitUnsignedInt(byte[] x, int offset) Converts an Array of Bytes to a 24-bit Unsigned Integer Returns a 24-bit unsigned integer as a long from byte xprivate static longconvertByteTo32BitUnsignedInt(byte[] x, int offset) Converts an Array of Bytes to a 32-bit Unsigned Integer Returns a 32-bit unsigned integer as a longstatic voidPerform ML-KEM CBD sampling.
Constructor Details
CBD
private CBD()unused
Method Details
mlkemCBD
Perform ML-KEM CBD sampling.- Parameters:
r- the output polynomialbytes- the input byte arrayeta- the CBD parameter (2 or 3)
convertByteTo32BitUnsignedInt
private static long convertByteTo32BitUnsignedInt(byte[] x, int offset) Converts an Array of Bytes to a 32-bit Unsigned Integer Returns a 32-bit unsigned integer as a long- Parameters:
x- the byte array to convertoffset- the index of the first byte to convert- Returns:
- the converted 32-bit unsigned integer as a long
convertByteTo24BitUnsignedInt
private static long convertByteTo24BitUnsignedInt(byte[] x, int offset) Converts an Array of Bytes to a 24-bit Unsigned Integer Returns a 24-bit unsigned integer as a long from byte x- Parameters:
x- the byte array to convertoffset- the index of the first byte to convert- Returns:
- the converted 24-bit unsigned integer as a long