curve25519_vrf 1.0.0 copy "curve25519_vrf: ^1.0.0" to clipboard
curve25519_vrf: ^1.0.0 copied to clipboard

outdated

Curve25519 Library for cryptographic signing and verifying. Supports VRF signatures and agreements.

Curve25519 Dart #

A native Dart Library for Curve25519 suite, including x25519 key pairs, shared secrets, x25519 signatures and the XVEdDSA VRF signature algorithm.

Installing #

import 'curve25519/curve25519.dart';

The package requires the following dependencies:

dependencies:
  pointycastle:
  collection:

Usage #

Below is the syntax for using the Curve25519 Package.

Messages

All messages must be given in the form of Uint8List.

var message = "message".codeUnits;

Key Pairs

All KeyPairs are stored in the KeyPair object.

var keyPair = Curve25519().newKeyPair();

var publicKey = keyPair.publicKey;
var privateKey = keyPair.privateKey;

var publicKeyBytes = publicKey.bytes;
var privateKeyBytes = privateKey.bytes;

Signing

var signatureStandard = Curve25519().sign(keyPair, message, SignatureType.STANDARD);
var signatureVRF = Curve25519().sign(keyPair, message, SignatureType.VRF);

Verifying

Standard verification returns Boolean.

VRF verification returns false if failure or VRF output byte array if valid.

var isValid = signature.isValid(message);

License #

Licensed under the FreeBSD License: https://opensource.org/licenses/bsd-license.php

3
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Curve25519 Library for cryptographic signing and verifying. Supports VRF signatures and agreements.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

Dependencies

collection, pointycastle

More

Packages that depend on curve25519_vrf