package core:crypto/legacy/keccak

⌘K
Ctrl+K
or
/

    Overview

    package keccak implements the Keccak hash algorithm family.

    During the SHA-3 standardization process, the padding scheme was changed thus Keccac and SHA-3 produce different outputs. Most users should use SHA-3 and/or SHAKE instead, however the legacy algorithm is provided for backward compatibility purposes.

    Index

    Types (1)
    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 Keccak instance.

    Related Procedures With Parameters

    Constants

    BLOCK_SIZE_224 ¶

    BLOCK_SIZE_224 :: _sha3.RATE_224
     

    BLOCK_SIZE_224 is the Keccak-224 block size in bytes.

    BLOCK_SIZE_256 ¶

    BLOCK_SIZE_256 :: _sha3.RATE_256
     

    BLOCK_SIZE_256 is the Keccak-256 block size in bytes.

    BLOCK_SIZE_384 ¶

    BLOCK_SIZE_384 :: _sha3.RATE_384
     

    BLOCK_SIZE_384 is the Keccak-384 block size in bytes.

    BLOCK_SIZE_512 ¶

    BLOCK_SIZE_512 :: _sha3.RATE_512
     

    BLOCK_SIZE_512 is the Keccak-512 block size in bytes.

    DIGEST_SIZE_224 ¶

    DIGEST_SIZE_224 :: 28
     

    DIGEST_SIZE_224 is the Keccak-224 digest size.

    DIGEST_SIZE_256 ¶

    DIGEST_SIZE_256 :: 32
     

    DIGEST_SIZE_256 is the Keccak-256 digest size.

    DIGEST_SIZE_384 ¶

    DIGEST_SIZE_384 :: 48
     

    DIGEST_SIZE_384 is the Keccak-384 digest size.

    DIGEST_SIZE_512 ¶

    DIGEST_SIZE_512 :: 64
     

    DIGEST_SIZE_512 is the Keccak-512 digest size.

    Variables

    This section is empty.

    Procedures

    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 Keccak-224.

    init_256 ¶

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

    init_256 initializes a Context for Keccak-256.

    init_384 ¶

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

    init_384 initializes a Context for Keccak-384.

    init_512 ¶

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

    init_512 initializes a Context for Keccak-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-10 (vendor "odin") Windows_amd64 @ 2024-10-05 21:10:06.084522900 +0000 UTC