package core:crypto

⌘K
Ctrl+K
or
/

    Overview

    package crypto implements a selection of cryptography algorithms and useful helper routines.

    Index

    Types (0)

    This section is empty.

    Constants (1)
    Variables (0)

    This section is empty.

    Procedure Groups (0)

    This section is empty.

    Types

    This section is empty.

    Constants

    HAS_RAND_BYTES ¶

    HAS_RAND_BYTES :: true

    Variables

    This section is empty.

    Procedures

    compare_byte_ptrs_constant_time ¶

    compare_byte_ptrs_constant_time :: proc "contextless" (a, b: ^u8, n: int) -> int {…}
     

    compare_byte_ptrs_constant_time returns 1 iff the bytes pointed to by a and b are equal, 0 otherwise.

    The execution time of this routine is constant regardless of the contents of the memory being compared.

    compare_constant_time ¶

    compare_constant_time :: proc "contextless" (a, b: []u8) -> int {…}
     

    compare_constant_time returns 1 iff a and b are equal, 0 otherwise.

    The execution time of this routine is constant regardless of the contents of the slices being compared, as long as the length of the slices is equal. If the length of the two slices is different, it will early-return 0.

    rand_bytes ¶

    rand_bytes :: proc(dst: []u8) {…}
     

    rand_bytes fills the dst buffer with cryptographic entropy taken from the system entropy source. This routine will block if the system entropy source is not ready yet. All system entropy source failures are treated as catastrophic, resulting in a panic.

    Support for the system entropy source can be checked with the HAS_RAND_BYTES boolean constant.

    random_generator ¶

    random_generator :: proc() -> runtime.Random_Generator {…}
     

    random_generator returns a runtime.Random_Generator backed by the system entropy source.

    Support for the system entropy source can be checked with the HAS_RAND_BYTES boolean constant.

    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.853459300 +0000 UTC