sr25519

Creator: coderz1093

Last updated:

0 purchases

sr25519 Image
sr25519 Images

Languages

Categories

Add to Cart

Description:

sr25519

sr25519 #
Imports #
import 'dart:convert';
import 'package:merlin/merlin.dart' as merlin;
import 'package:sr25519/sr25519.dart';
copied to clipboard
Example #
void main() {
final msg = utf8.encode('hello friends');
final signingCtx = utf8.encode('example');

final merlin.Transcript signingTranscript = Sr25519.newSigningContext(signingCtx, msg);

final merlin.Transcript verifyTranscript = Sr25519.newSigningContext(signingCtx, msg);

final keypair = Sr25519.generateKeyPair();

final (priv, pub) = (keypair.secretKey, keypair.publicKey);

final Signature sig = priv.sign(signingTranscript);

final (ok, _) = pub.verify(sig, verifyTranscript);

assert(ok == true);
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.