ed25519 0.0.1

  • Readme
  • Changelog
  • Installing
  • 62

ed25519 #

a dart implement of ed25519

usage #

Uint8List blake2bHashFunc(Uint8List m) {
  Uint8List bytes = Uint8List(64);
  var b = Blake2b(512);
  b.update(m, 0, m.length);
  b.digest(bytes, 0);
  return bytes;

void main() {
  test('adds one to input values', () {
    String expectPk = "c9f52a9ae9683a8d304c65dd87d88f1a7628eb55bd7aaba6d5d4067dde804f9c";
    String expectSign = "0029e755645c11dce87d6c16a1af9ba6559fca97c98fe282b0683708d8a6067fc5e3b007826b2d6e95c5a0c31b82e340e165679ff6cefb7de5aa744bc670df0c";

    String hsk = "11E2A3D65792FFA9E8ED15857EF13C562CF7C9BFBBFFD66FFA9B08EC709C8F0A";
    List<int> isk = HEX.decode(hsk);
    var sk = butils.Utils.int8list2uint8list(Int8List.fromList(isk));

    var pk = Ed25519.publickey(blake2bHashFunc, sk);
    var hexpk = HEX.encode(pk);
    assert(hexpk == expectPk);

    Uint8List msg = Uint8List.fromList("This is a message".codeUnits);
    Uint8List sign = Ed25519.signature(blake2bHashFunc, msg, sk, pk);
    String hexSign = HEX.encode(sign);
    assert(hexSign == expectSign);

    var valid = Ed25519.checkvalid(blake2bHashFunc, sign, msg, pk);
    assert(valid == true);


ref #

[0.0.1] - implement it #

  • ref from python and java implement

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  ed25519: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:ed25519/ed25519.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Format lib/ed25519.dart.

Run flutter format to format lib/ed25519.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and ed25519.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
blake2b ^0.1.1 0.1.2
flutter 0.0.0
hex ^0.1.2 0.1.2
Transitive dependencies
collection 1.14.11 1.14.12
fixnum 0.10.11
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies