safequard-api-for-react-native
    Preparing search index...

    Function safequard_dlms_key_agreement_decap

    • Parameters

      • context: Uint8Array
      • other_info: Uint8Array
      • ciphertext: Uint8Array
      • ss_context: Uint8Array

      Returns void

      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

      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.

      @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.

      if ciphertext has invalid size or context is invalid.

      if ss_context is too small.