package core:crypto/shake

⌘K
Ctrl+K
or
/

    Overview

    package shake implements the SHAKE and cSHAKE XOF algorithm families.

    The SHA3 hash algorithm can be found in the crypto/sha3.

    See: https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.202.pdf https://nvlpubs.nist.gov/nistpubs/specialpublications/nist.sp.800-185.pdf

    Index

    Types (1)
    Constants (0)

    This section is empty.

    Variables (0)

    This section is empty.

    Procedure Groups (0)

    This section is empty.

    Types

    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 SHAKE128, SHAKE256, cSHAKE128, or cSHAKE256 instance.

    Related Procedures With Parameters

    Constants

    This section is empty.

    Variables

    This section is empty.

    Procedures

    clone ¶

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

    clone clones the Context other into ctx.

    init_128 ¶

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

    init_128 initializes a Context for SHAKE128.

    init_256 ¶

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

    init_256 initializes a Context for SHAKE256.

    init_cshake_128 ¶

    init_cshake_128 :: proc(ctx: ^Context, domain_sep: []u8) {…}
     

    init_cshake_128 initializes a Context for cSHAKE128.

    init_cshake_256 ¶

    init_cshake_256 :: proc(ctx: ^Context, domain_sep: []u8) {…}
     

    init_cshake_256 initializes a Context for cSHAKE256.

    read ¶

    read :: proc(ctx: ^Context, dst: []u8) {…}
     

    read reads output from the SHAKE instance. There is no practical upper limit to the amount of data that can be read from SHAKE. After read has been called one or more times, further calls to write will panic.

    reset ¶

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

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

    write ¶

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

    write writes more data into the SHAKE instance. This MUST not be called after any reads have been done, and attempts to do so will panic.

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-20 21:10:45.870514700 +0000 UTC