java.lang.Object
org.bouncycastle.pqc.crypto.mlkem.Symmetric
org.bouncycastle.pqc.crypto.mlkem.Symmetric.ShakeSymmetric
- Enclosing class:
Symmetric
SHAKE-based symmetric implementation for ML-KEM operations. Uses SHAKE extendable output functions for cryptographic hashing.
Nested Class Summary
Nested classes/interfaces inherited from class Symmetric
Symmetric.ShakeSymmetricModifier and TypeClassDescription(package private) static classSHAKE-based symmetric implementation for ML-KEM operations.Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SHA3DigestThe hash H', SHA3-256.private final SHA3DigestThe hash H, SHA3-512.private final SHAKEDigestThe extendable output function J.private final SHAKEDigestThe extendable output function G.Fields inherited from class Symmetric
xofBlockBytesModifier and TypeFieldDescription(package private) final intBytes produced per call to the XOF squeeze, i.e.Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescription(package private) voidhash_g(byte[] out, byte[] in) Hash g operation, the spec's G applied to a 128-byte input.(package private) voidhash_h(byte[] out, byte[] in, int outOffset) Hash h operation, the spec's H applied to a 64-byte input.(package private) voidkdf(byte[] out, byte[] in) KDF operation, deriving out.length bytes from in.(package private) voidprf(byte[] out, byte[] seed, byte nonce) PRF operation, producing out.length bytes keyed by key and nonce.(package private) voidxofAbsorb(byte[] seed, byte a, byte b) XOF absorb operation, seeding the extendable output function.(package private) voidxofSqueezeBlocks(byte[] out, int outOffset, int outLen) XOF squeeze operation, emitting whole rate-sized blocks at a time.
Field Details
xof
The extendable output function G.sha3Digest512
The hash H, SHA3-512.sha3Digest256
The hash H', SHA3-256.shakeDigest
The extendable output function J.
Constructor Details
ShakeSymmetric
ShakeSymmetric()Create shake symmetric.
Method Details
hash_h
void hash_h(byte[] out, byte[] in, int outOffset) Description copied from class:SymmetricHash h operation, the spec's H applied to a 64-byte input.hash_g
xofAbsorb
void xofAbsorb(byte[] seed, byte a, byte b) Description copied from class:SymmetricXOF absorb operation, seeding the extendable output function.xofSqueezeBlocks
void xofSqueezeBlocks(byte[] out, int outOffset, int outLen) Description copied from class:SymmetricXOF squeeze operation, emitting whole rate-sized blocks at a time.- Specified by:
xofSqueezeBlocksin classSymmetric- Parameters:
out- the buffer to write the expanded bytes intooutOffset- the offset into out at which to writeoutLen- the number of bytes to write, a multiple of xofBlockBytes
prf
void prf(byte[] out, byte[] seed, byte nonce) Description copied from class:SymmetricPRF operation, producing out.length bytes keyed by key and nonce.kdf