Files
herolib/aiprompts/v_core/crypto/ed25519.md
2025-09-02 07:28:13 +02:00

2.6 KiB

module ed25519

Contents

Constants

const public_key_size = 32

public_key_size is the sizeof public keys in bytes

[Return to contents]

const private_key_size = 64

private_key_size is the sizeof private keys in bytes

[Return to contents]

const signature_size = 64

signature_size is the size of signatures generated and verified by this modules, in bytes.

[Return to contents]

const seed_size = 32

seed_size is the size of private key seeds in bytes

[Return to contents]

generate_key

fn generate_key() !(PublicKey, PrivateKey)

generate_key generates a public/private key pair entropy using crypto.rand.

[Return to contents]

new_key_from_seed

fn new_key_from_seed(seed []u8) PrivateKey

new_key_from_seed calculates a private key from a seed. private keys of RFC 8032 correspond to seeds in this module

[Return to contents]

sign

fn sign(privatekey PrivateKey, message []u8) ![]u8

sign`signs the message with privatekey and returns a signature

[Return to contents]

verify

fn verify(publickey PublicKey, message []u8, sig []u8) !bool

verify reports whether sig is a valid signature of message by publickey.

[Return to contents]

PrivateKey

type PrivateKey = []u8

PrivateKey is Ed25519 private keys

[Return to contents]

seed

fn (priv PrivateKey) seed() []u8

seed returns the private key seed corresponding to priv. RFC 8032's private keys correspond to seeds in this module.

[Return to contents]

public_key

fn (priv PrivateKey) public_key() PublicKey

public_key returns the []u8 corresponding to priv.

[Return to contents]

equal

fn (priv PrivateKey) equal(x []u8) bool

currentyly x not crypto.PrivateKey

[Return to contents]

sign

fn (priv PrivateKey) sign(message []u8) ![]u8

sign signs the given message with priv.

[Return to contents]

PublicKey

type PublicKey = []u8

PublicKey is Ed25519 public keys.

[Return to contents]

equal

fn (p PublicKey) equal(x []u8) bool

equal reports whether p and x have the same value.

[Return to contents]

Powered by vdoc. Generated on: 2 Sep 2025 07:18:17