package core:crypto/sm3

⌘K
Ctrl+K
or
/

    Overview

    package sm3 implements the SM3 hash algorithm.

    See: https://datatracker.ietf.org/doc/html/draft-sca-cfrg-sm3-02

    Index

    Types (1)
    Constants (2)
    Variables (0)

    This section is empty.

    Procedures (5)
    Procedure Groups (0)

    This section is empty.

    Types

    Context ¶

    Context :: struct {
    	state:          [8]u32,
    	x:              [64]u8,
    	bitlength:      u64,
    	length:         u64,
    	is_initialized: bool,
    }
     

    Context is a SM3 instance.

    Related Procedures With Parameters

    Constants

    BLOCK_SIZE ¶

    BLOCK_SIZE :: 64
     

    BLOCK_SIZE is the SM3 block size in bytes.

    DIGEST_SIZE ¶

    DIGEST_SIZE :: 32
     

    DIGEST_SIZE is the SM3 digest size in bytes.

    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 ¶

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

    init initializes a Context.

    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-11 (vendor "odin") Windows_amd64 @ 2024-11-16 21:10:09.824346000 +0000 UTC