# module ed25519 ## Contents - [Constants](#Constants) - [generate_key](#generate_key) - [new_key_from_seed](#new_key_from_seed) - [sign](#sign) - [verify](#verify) - [PrivateKey](#PrivateKey) - [seed](#seed) - [public_key](#public_key) - [equal](#equal) - [sign](#sign) - [PublicKey](#PublicKey) - [equal](#equal) ## Constants ```v const public_key_size = 32 ``` public_key_size is the sizeof public keys in bytes [[Return to contents]](#Contents) ```v const private_key_size = 64 ``` private_key_size is the sizeof private keys in bytes [[Return to contents]](#Contents) ```v const signature_size = 64 ``` signature_size is the size of signatures generated and verified by this modules, in bytes. [[Return to contents]](#Contents) ```v const seed_size = 32 ``` seed_size is the size of private key seeds in bytes [[Return to contents]](#Contents) ## generate_key ```v fn generate_key() !(PublicKey, PrivateKey) ``` generate_key generates a public/private key pair entropy using `crypto.rand`. [[Return to contents]](#Contents) ## new_key_from_seed ```v 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]](#Contents) ## sign ```v fn sign(privatekey PrivateKey, message []u8) ![]u8 ``` sign`signs the message with privatekey and returns a signature [[Return to contents]](#Contents) ## verify ```v fn verify(publickey PublicKey, message []u8, sig []u8) !bool ``` verify reports whether sig is a valid signature of message by publickey. [[Return to contents]](#Contents) ## PrivateKey ```v type PrivateKey = []u8 ``` PrivateKey is Ed25519 private keys [[Return to contents]](#Contents) ## seed ```v 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]](#Contents) ## public_key ```v fn (priv PrivateKey) public_key() PublicKey ``` public_key returns the []u8 corresponding to priv. [[Return to contents]](#Contents) ## equal ```v fn (priv PrivateKey) equal(x []u8) bool ``` currentyly x not `crypto.PrivateKey` [[Return to contents]](#Contents) ## sign ```v fn (priv PrivateKey) sign(message []u8) ![]u8 ``` sign signs the given message with priv. [[Return to contents]](#Contents) ## PublicKey ```v type PublicKey = []u8 ``` `PublicKey` is Ed25519 public keys. [[Return to contents]](#Contents) ## equal ```v fn (p PublicKey) equal(x []u8) bool ``` equal reports whether p and x have the same value. [[Return to contents]](#Contents) #### Powered by vdoc. Generated on: 2 Sep 2025 07:18:17