package core:crypto/ed25519
Overview
package ed25519 implements the 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
Index
Types (2)
Constants (3)
Variables (0)
This section is empty.
Procedure Groups (0)
This section is empty.
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
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-12 (vendor "odin") Windows_amd64 @ 2024-12-17 21:11:00.937220100 +0000 UTC