package core:crypto/ed25519

⌘K
Ctrl+K
or
/

    Types

    Private_Key ¶

    Private_Key :: struct {
    	// WARNING: All of the members are to be treated as internal (ie:
    	// the Private_Key structure is intended to be opaque).  There are
    	// subtle vulnerabilities that can be introduced if the internal
    	// values are allowed to be altered.
    	// 
    	// See: https://github.com/MystenLabs/ed25519-unsafe-libs
    	_b:              [32]u8,
    	_s:              field_scalar25519.Montgomery_Domain_Field_Element,
    	_hdigest2:       [32]u8,
    	_pub_key:        Public_Key,
    	_is_initialized: bool,
    }
     

    Private_Key is an Ed25519 private key.

    Related Procedures With Parameters

    Public_Key ¶

    Public_Key :: struct {
    	// WARNING: All of the members are to be treated as internal (ie:
    	// the Public_Key structure is intended to be opaque).
    	_b:              [32]u8,
    	_neg_A:          _edwards25519.Group_Element,
    	_is_valid:       bool,
    	_is_initialized: bool,
    }
     

    Public_Key is an Ed25519 public key.

    Related Procedures With Parameters

    Constants

    PRIVATE_KEY_SIZE ¶

    PRIVATE_KEY_SIZE :: 32
     

    PRIVATE_KEY_SIZE is the byte-encoded private key size.

    PUBLIC_KEY_SIZE ¶

    PUBLIC_KEY_SIZE :: 32
     

    PUBLIC_KEY_SIZE is the byte-encoded public key size.

    SIGNATURE_SIZE ¶

    SIGNATURE_SIZE :: 64
     

    SIGNATURE_SIZE is the byte-encoded signature size.

    Variables

    This section is empty.

    Procedures

    private_key_bytes ¶

    private_key_bytes :: proc(priv_key: ^Private_Key, dst: []u8) {…}
     

    private_key_bytes sets dst to byte-encoding of priv_key.

    private_key_clear ¶

    private_key_clear :: proc "contextless" (priv_key: ^Private_Key) {…}
     

    private_key_clear clears priv_key to the uninitialized state.

    private_key_set_bytes ¶

    private_key_set_bytes :: proc(priv_key: ^Private_Key, b: []u8) -> bool {…}
     

    private_key_set_bytes decodes a byte-encoded private key, and returns true iff the operation was successful.

    public_key_bytes ¶

    public_key_bytes :: proc(pub_key: ^Public_Key, dst: []u8) {…}
     

    public_key_bytes sets dst to byte-encoding of pub_key.

    public_key_equal ¶

    public_key_equal :: proc(pub_key, other: ^Public_Key) -> bool {…}
     

    public_key_equal returns true iff pub_key is equal to other.

    public_key_set_bytes ¶

    public_key_set_bytes :: proc "contextless" (pub_key: ^Public_Key, b: []u8) -> bool {…}
     

    public_key_set_bytes decodes a byte-encoded public key, and returns true iff the operation was successful.

    public_key_set_priv ¶

    public_key_set_priv :: proc(pub_key: ^Public_Key, priv_key: ^Private_Key) {…}
     

    public_key_set_priv sets pub_key to the public component of priv_key.

    sign ¶

    sign :: proc(priv_key: ^Private_Key, msg, sig: []u8) {…}
     

    sign writes the signature by priv_key over msg to sig.

    verify ¶

    verify :: proc(pub_key: ^Public_Key, msg, sig: []u8, allow_small_order_A: bool = false) -> bool {…}
     

    verify returns true iff sig is a valid signature by pub_key over msg.

    The optional allow_small_order_A parameter will make this implementation strictly compatible with FIPS 186-5, at the expense of SBS-security. Doing so is NOT recommended, and the disallowed public keys all have a known discrete-log.

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