Contents

open(inPlace:using:nonce:authenticating:tag:)

Decrypts the message and verifies its authenticity.

Declaration

static func open(inPlace message: inout MutableRawSpan, using key: SymmetricKey, nonce: AES.GCM.Nonce, authenticating authenticatedData: RawSpan? = nil, tag: RawSpan) throws

Parameters

  • message:

    The message, which will be decrypted in place.

  • key:

    The cryptographic key that was used to seal the message.

  • nonce:

    The nonce used to encrypt the message.

  • authenticatedData:

    Additional data that was authenticated.

Discussion

The call throws an error if decryption or authentication fail.