package core:crypto/argon2id

⌘K
Ctrl+K
or
/

    Overview

    package argon2id implements the Argon2id password hashing algorithm.

    See: https://datatracker.ietf.org/doc/rfc9106/

    Types

    Parameters ¶

    Parameters :: struct {
    	memory_size: u32,
    	// m (KiB)
    	passes:      u32,
    	// t
    	parallelism: u32,
    }
     

    Parameters is an Argon2id parameter set.

    Related Procedures With Parameters

    Constants

    MAX_INPUT_SIZE ¶

    MAX_INPUT_SIZE: int : (1 << 32) - 1
     

    MAX_INPUT_SIZE is the mamximum size of the various inputs (password, salt, secret, ad) in bytes.

    MAX_PARALLELISM ¶

    MAX_PARALLELISM: int : (1 << 24) - 1
     

    MAX_PARALLELISM is the maximum allowed parallelism.

    MAX_TAG_SIZE ¶

    MAX_TAG_SIZE: int : (1 << 32) - 1
     

    MAX_TAG_SIZE is the maximum digest size in bytes.

    MIN_PARALLELISM ¶

    MIN_PARALLELISM: int : 1
     

    MIN_PARALLELISM is the minimum allowed parallelism.

    MIN_TAG_SIZE ¶

    MIN_TAG_SIZE: int : 4
     

    MIN_TAG_SIZE is the minimum digest size in bytes.

    RECOMMENDED_SALT_SIZE: int : 16
     

    RECOMMENDNED_SALT_SIZE is the recommended salt size in bytes.

    RECOMMENTED_TAG_SIZE ¶

    RECOMMENTED_TAG_SIZE: int : 32
     

    RECOMMENDED_TAG_SIZE is the recommended tag size in bytes.

    Variables

    PARAMS_OWASP ¶

    @(rodata)
    PARAMS_OWASP: Parameters = …
     

    PARAMS_OWASP is one of the recommended parameter set from the OWASP Password Storage Cheat Sheet (as of 2026/02). The cheat sheet contains additional variations to this parameter set with various trade-offs between memory_size and passes that are intended to provide equivalent security.

    See: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html

    PARAMS_OWASP_SMALL ¶

    @(rodata)
    PARAMS_OWASP_SMALL: Parameters = …
     

    PARAMS_OWASP_SMALL is equivalent in strength to PARAMS_OWASP, but trades off less memory use for more CPU usage.

    PARAMS_RFC9106 ¶

    @(rodata)
    PARAMS_RFC9106: Parameters = …
     

    PARAMS_RFC9106 is the first recommended "uniformly safe" parameter set per RFC 9106.

    PARAMS_RFC9106_SMALL ¶

    @(rodata)
    PARAMS_RFC9106_SMALL: Parameters = …
     

    PARAMS_RFC9106_SMALL is the second recommended "uniformly safe" parameter set per RFC 9106 tailored for memory constrained environments.

    Procedures

    derive ¶

    derive :: proc(
    	parameters: ^Parameters, 
    	password:   []u8, 
    	salt:       []u8, 
    	dst:        []u8, 
    	secret:     []u8 = nil, 
    	ad:         []u8 = nil, 
    	sanitize:   bool = true, 
    	allocator := context.allocator, 
    ) -> runtime.Allocator_Error {…}
     

    derive invokes Argon2id with the specified parameter set and inputs, and outputs the derived key to dst.

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2026-03 (vendor "odin") Windows_amd64 @ 2026-03-08 21:15:22.954028300 +0000 UTC