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

    Function safequard_dlms_key_agreement_encap

    • Parameters

      • encap_key: Uint8Array
      • other_info: Uint8Array
      • ciphertext: Uint8Array
      • context: Uint8Array

      Returns void

      Encap an ML-KEM-768 encapsulation key for DLMS key agreement.

      Encap an ML-KEM-768 encapsulation key to obtain a shared AES-256-GCM key with the DLMS server. Internally, the shared secret resulting from the encapsulated key goes through a key derivation function with other_info to obtain the traffic secret key.

      @param[in] encap_key The buffer to the encapsulation key. Must have size 1184. @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[out] ciphertext An allocated buffer for the ciphertext. Must have size 1088. @param[out] context An allocated buffer for the shared secret key context.

      if any argument has invalid size.

      if context is too small.