package core:crypto/sha3



    package sha3 implements the SHA3 hash algorithm family.

    The SHAKE XOF can be found in crypto/shake. While discouraged if the pre-standardization Keccak algorithm is required, it can be found in crypto/legacy/keccak.



    Types (1)
    Variables (0)

    This section is empty.

    Procedure Groups (0)

    This section is empty.


    Context ¶

    Context :: struct {
    	st:             struct #raw_union {
    		b: [200]u8,
    		q: [25]u64,
    	pt:             int,
    	rsiz:           int,
    	mdlen:          int,
    	dsbyte:         u8,
    	is_initialized: bool,
    	is_finalized:   bool,

    Context is a SHA3 instance.

    Related Procedures With Parameters


    BLOCK_SIZE_224 ¶

    BLOCK_SIZE_224 :: _sha3.RATE_224

    BLOCK_SIZE_224 is the SHA3-224 block size in bytes.

    BLOCK_SIZE_256 ¶

    BLOCK_SIZE_256 :: _sha3.RATE_256

    BLOCK_SIZE_256 is the SHA3-256 block size in bytes.

    BLOCK_SIZE_384 ¶

    BLOCK_SIZE_384 :: _sha3.RATE_384

    BLOCK_SIZE_384 is the SHA3-384 block size in bytes.

    BLOCK_SIZE_512 ¶

    BLOCK_SIZE_512 :: _sha3.RATE_512

    BLOCK_SIZE_512 is the SHA3-512 block size in bytes.

    DIGEST_SIZE_224 ¶

    DIGEST_SIZE_224 :: 28

    DIGEST_SIZE_224 is the SHA3-224 digest size.

    DIGEST_SIZE_256 ¶

    DIGEST_SIZE_256 :: 32

    DIGEST_SIZE_256 is the SHA3-256 digest size.

    DIGEST_SIZE_384 ¶

    DIGEST_SIZE_384 :: 48

    DIGEST_SIZE_384 is the SHA3-384 digest size.

    DIGEST_SIZE_512 ¶

    DIGEST_SIZE_512 :: 64

    DIGEST_SIZE_512 is the SHA3-512 digest size.


    This section is empty.


    clone ¶

    clone :: proc(ctx, other: ^Context) {…}

    clone clones the Context other into ctx.

    final ¶

    final :: proc(ctx: ^Context, hash: []u8, finalize_clone: bool = false) {…}

    final finalizes the Context, writes the digest to hash, and calls reset on the Context.

    Iff finalize_clone is set, final will work on a copy of the Context, which is useful for for calculating rolling digests.

    init_224 ¶

    init_224 :: proc(ctx: ^Context) {…}

    init_224 initializes a Context for SHA3-224.

    init_256 ¶

    init_256 :: proc(ctx: ^Context) {…}

    init_256 initializes a Context for SHA3-256.

    init_384 ¶

    init_384 :: proc(ctx: ^Context) {…}

    init_384 initializes a Context for SHA3-384.

    init_512 ¶

    init_512 :: proc(ctx: ^Context) {…}

    init_512 initializes a Context for SHA3-512.

    reset ¶

    reset :: proc(ctx: ^Context) {…}

    reset sanitizes the Context. The Context must be re-initialized to be used again.

    update ¶

    update :: proc(ctx: ^Context, data: []u8) {…}

    update adds more data to the Context.

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2024-04 (vendor "odin") Windows_amd64 @ 2024-04-26 21:08:58.359243500 +0000 UTC