Enumeration

ChaChaPoly

An implementation of the ChaCha20-Poly1305 cipher.

Declaration

enum ChaChaPoly

Topics

Storing the Output

struct ChaChaPoly.SealedBox

A secure container for your data that you access using a cipher.

Getting a Nonce

struct ChaChaPoly.Nonce

A value used once during a cryptographic operation, and then discarded.

Securing the Plaintext Message

static func seal<Plaintext>(Plaintext, using: SymmetricKey, nonce: ChaChaPoly.Nonce?) -> ChaChaPoly.SealedBox

Secures the given plaintext message with encryption and an authentication tag.

static func seal<Plaintext, AuthenticatedData>(Plaintext, using: SymmetricKey, nonce: ChaChaPoly.Nonce?, authenticating: AuthenticatedData) -> ChaChaPoly.SealedBox

Secures the given plaintext message with encryption and an authentication tag that covers both the encrypted data and additional data.

Decrypting and Verifying the Message

static func open(ChaChaPoly.SealedBox, using: SymmetricKey) -> Data

Decrypts the message and verifies its authenticity.

static func open<AuthenticatedData>(ChaChaPoly.SealedBox, using: SymmetricKey, authenticating: AuthenticatedData) -> Data

Decrypts the message and verifies the authenticity of both the encrypted message and additional data.

See Also

Ciphers

enum AES

A container for Advanced Encryption Standard (AES) ciphers.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software