EC

Elliptic curve cryptography in raku

Elliptic Curves Cryptography in raku

secp256k1 and ed25519 in raku

Synopsis

{
    use secp256k1;

    say key-range;
    say $_*G for 1..10;

    use Test;
    is 35*G + 5*G, 40*G;
}

{
    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

EC v0.6.0

Elliptic curve cryptography in raku

Authors

  • Lucien Grondin

License

MIT

Dependencies

DigestFiniteFields

Test Dependencies

Provides

  • ed25519
  • secp256k1

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.