Decap an ML-KEM-768 decapsulation key for DLMS key agreement.
Decap an ML-KEM-768 decapsulation key to obtain a shared AES-256-GCM key with the DLMS client.
Internally, the shared secret resulting from the decapsulated key goes through a key derivation
function with other_info to obtain the traffic secret key.
The caller should call safequard_mlkem768_finalise() with context when no further
decapsulation is needed with this key, and then context can be freed.
The caller should call safequard_mlkem768_finalise() with ss_context when no further
encryption or decryption is needed with this key, and then ss_context can be freed.
@param[in] context The buffer to the context from safequard_mlkem768_init().
@param[in] other_info
Brief
Decap an ML-KEM-768 decapsulation key for DLMS key agreement.
Decap an ML-KEM-768 decapsulation key to obtain a shared AES-256-GCM key with the DLMS client. Internally, the shared secret resulting from the decapsulated key goes through a key derivation function with
other_infoto obtain the traffic secret key.The caller should call safequard_mlkem768_finalise() with
contextwhen no further decapsulation is needed with this key, and thencontextcan be freed.The caller should call safequard_mlkem768_finalise() with
ss_contextwhen no further encryption or decryption is needed with this key, and thenss_contextcan be freed.@param[in] context The buffer to the context from safequard_mlkem768_init(). @param[in] other_info
Parblock
The buffer constructed as:
AlgorithmID || PartyUInfo || PartyVInfo {||SuppPubInfo}{||SuppPrivInfo}noting that AlgorithmID should be AES-256-GCM / 2.16.756.5.8.3.1 / 60 85 74 05 08 03 01.
See 9.2.3.4.6.5 Key Derivation Function in DLMS UA 1000-2 Ed.11 V1.0 for full details.
Endparblock
@param[in] ciphertext The buffer to the ciphertext. Mush have size 1184. @param[out] ss_context An allocated buffer for the shared secret key context.
Throws
if
ciphertexthas invalid size orcontextis invalid.Throws
if
ss_contextis too small.