libslug 0.12.0

A Rust Library For Cryptography Intended For Slug20 That Supports X59 Certificate Format and Post-Quantum Cryptography
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use libslug::slugcrypt::internals::signature::schnorr::{SchnorrPublicKey,SchnorrSecretKey,SchnorrSignature,SchnorrIO,SchnorrPreout,SchnorrVRFProof};

fn main() {
    let sk = SchnorrSecretKey::generate();
    let pk = sk.public_key().unwrap();
    let message = "This is a message";
    let context = "SigningContext";

    let output: (SchnorrIO, SchnorrVRFProof, SchnorrPreout) = sk.vrf(message, context);

    println!("Randomness: {:?}", output.0);
    let last_verify = pk.verify_vrf(output.2, output.0, output.1, context, message);

    let x = last_verify.unwrap();

    println!("Randomness: {:?}", x.0);
}