Module crypto.ed25519 stdlib

crypto.ed25519
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
4
Imported by:
0
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imported by

This section is empty.

Overview

README

This module implements ed25519 public key digital signature algorithm for V Language ported
from Go version of crypto.ed25519. See Ed25519 for more detail about ed25519.

Aliases

#type PublicKey

type PublicKey = []u8

PublicKey is Ed25519 public keys.

#fn (PublicKey) equal

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

equal reports whether p and x have the same value.

#type PrivateKey

type PrivateKey = []u8

PrivateKey is Ed25519 private keys

#fn (PrivateKey) 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.

#fn (PrivateKey) public_key

fn (priv PrivateKey) public_key() PublicKey

public_key returns the []u8 corresponding to priv.

#fn (PrivateKey) equal

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

currentyly x not crypto.PrivateKey

#fn (PrivateKey) sign

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

sign signs the given message with priv.

Constants

#constant public_key_size

pub const public_key_size = 32

public_key_size is the sizeof public keys in bytes

#constant private_key_size

pub const private_key_size = 64

private_key_size is the sizeof private keys in bytes

#constant signature_size

pub const signature_size = 64

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

#constant seed_size

pub const seed_size = 32

seed_size is the size of private key seeds in bytes

Sum types

This section is empty.

Functions

#fn generate_key

fn generate_key() !(PublicKey, PrivateKey)

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

#fn 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

#fn sign

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

sign`signs the message with privatekey and returns a signature

#fn verify

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

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

Structs

This section is empty.

Interfaces

This section is empty.

Enums

This section is empty.