package core:crypto/chacha20poly1305

⌘K
Ctrl+K
or
/

    Overview

    package chacha20poly1305 implements the AEAD_CHACHA20_POLY1305 Authenticated Encryption with Additional Data algorithm.

    See: https://www.rfc-editor.org/rfc/rfc8439

    Index

    Types (0)

    This section is empty.

    Constants (3)
    Variables (0)

    This section is empty.

    Procedures (2)
    Procedure Groups (0)

    This section is empty.

    Types

    This section is empty.

    Constants

    KEY_SIZE ¶

    KEY_SIZE :: chacha20.KEY_SIZE
     

    KEY_SIZE is the chacha20poly1305 key size in bytes.

    NONCE_SIZE ¶

    NONCE_SIZE :: chacha20.NONCE_SIZE
     

    NONCE_SIZE is the chacha20poly1305 nonce size in bytes.

    TAG_SIZE ¶

    TAG_SIZE :: poly1305.TAG_SIZE
     

    TAG_SIZE is the chacha20poly1305 tag size in bytes.

    Variables

    This section is empty.

    Procedures

    decrypt ¶

    decrypt :: proc(
    	plaintext, tag, key, nonce, aad, 
    	ciphertext:                      []u8, 
    ) -> bool {…}
     

    decrypt authenticates the aad and ciphertext, and decrypts the ciphertext, with the provided key, nonce, and tag, and stores the output in plaintext, returning true iff the authentication was successful.

    If authentication fails, the destination plaintext buffer will be zeroed.

    encrypt ¶

    encrypt :: proc(
    	ciphertext, tag, key, nonce, aad, 
    	plaintext:                        []u8, 
    ) {…}
     

    encrypt encrypts the plaintext and authenticates the aad and ciphertext, with the provided key and nonce, stores the output in ciphertext and tag.

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2024-04 (vendor "odin") Windows_amd64 @ 2024-04-17 21:10:29.259929100 +0000 UTC