`Ed25519` EdDSA signature algorithm. See: - [[ https://datatracker.ietf.org/doc/html/rfc8032 ]] - [[ https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf ]] - [[ https://eprint.iacr.org/2020/1244.pdf ]]

Collection Info

View Source
Collection
core
Path
crypto/ed25519
Entries
18

Source Files

Constants

3

PRIVATE_KEY_SIZE #

Source
PRIVATE_KEY_SIZE :: 32

PRIVATE_KEY_SIZE is the byte-encoded private key size.

PUBLIC_KEY_SIZE #

Source
PUBLIC_KEY_SIZE :: 32

PUBLIC_KEY_SIZE is the byte-encoded public key size.

SIGNATURE_SIZE #

Source
SIGNATURE_SIZE :: 64

SIGNATURE_SIZE is the byte-encoded signature size.

Types

2

Procedures

13

private_key_bytes #

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

private_key_bytes sets dst to byte-encoding of priv_key.

private_key_clear #

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

private_key_clear clears priv_key to the uninitialized state.

private_key_generate #

Source
private_key_generate :: proc(priv_key: ^Private_Key) -> bool {…}

private_key_generate uses the system entropy source to generate a new Private_Key. This will only fail if and only if (⟺) the system entropy source is missing or broken.

private_key_set_bytes #

Source
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 if and only if (⟺) the operation was successful.

public_key_bytes #

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

public_key_bytes sets dst to byte-encoding of pub_key.

public_key_clear #

Source
public_key_clear :: proc "contextless" (pub_key: ^Public_Key) {…}

public_key_clear clears pub_key to the uninitialized state.

public_key_equal #

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

public_key_equal returns true if and only if (⟺) pub_key is equal to other.

public_key_set_bytes #

Source
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 if and only if (⟺) the operation was successful.

public_key_set_priv #

Source
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.

verify #

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

verify returns true if and only if (⟺) 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.