seal(_:authenticating:)
Encrypts the given cleartext message and attaches additional authenticated data.
Declaration
mutating func seal<M, AD>(_ msg: M, authenticating aad: AD) throws -> Data where M : DataProtocol, AD : DataProtocolParameters
- msg:
The cleartext message to encrypt.
- aad:
Additional data that the
Senderauthenticates and adds to the message in cleartext.
Return Value
The ciphertext for the recipient to decrypt.
Discussion
You can call this method multiple times to encrypt a series of messages. When using this method, you need to supply ciphertext messages to the decryption code on the receiving side in the same order as you encrypt them.