Raku Land

Ed25519

github:grondilu

Ed25519

Ed25519 in raku

Synopsis

use Ed25519;

# create a key
# - randomly :
my Ed25519::Key $key .= new;
# - from a seed :
my blob8 $secret-seed .= new: (^256).roll: 32;
my Ed25519::Key $key .= new: $secret-seed;

# use key to sign a message
my $signature = $key.sign: "Hello world!";

# verify signature
use Test;
lives-ok { Ed25519::verify "foo", $key.sign("foo"), $key.point };
dies-ok  { Ed25519::verify "foo", $key.sign("bar"), $key.point };

References