Generate an encapsulation/decapsulation key pair (ek, dk):
(ek,dk)<--KeyGen()
Namespace: CryptoSysPQCAssembly: diCrSysPQCNet (in diCrSysPQCNet.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic static KemKeyPair KeyGen(
KemAlg alg,
string paramstr = ""
)
Public Shared Function KeyGen (
alg As KemAlg,
Optional paramstr As String = ""
) As KemKeyPair
Parameters
- alg KemAlg
- KEM algorithm.
- paramstr String (Optional)
- Optional parameters string.
Use to pass a known test random seed (d||z) representing exactly 64 bytes
encoded in hexadecimal.
[Default = use a fresh random value]
Return Value
KemKeyPairKeypair (ek, dk) in a
KemKeyPair object, where ek is the encapsulation ("public") key
and dk the decapsulation ("private") key.
RemarksIf provided, the known test seed (d||z) must consist of two concatenated 32-byte values
where d is the 32-byte "randomness" for the key generation and z is the 32-byte
"implicit rejection value" to be used on a Decaps failure.
Example
Kem.KeyPair kp = Kem.KeyGen(Kem.Alg.ML_KEM_512,
"2CB843A02EF02EE109305F39119FABF49AB90A57FFECB3A0E75E179450F52761"
+ "84CC9121AE56FBF39E67ADBD83AD2D3E3BB80843645206BDD9F2F629E3CC49B7");
Kem.KeyPair kp = Kem.KeyGen(Kem.Alg.ML_KEM_512);
See Also