-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ad3816
commit e2d8a76
Showing
7 changed files
with
49 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# ed25519 | ||
|
||
Motoko implementation of [ed25519](https://en.wikipedia.org/wiki/EdDSA). | ||
|
||
The library is a motoko version of [noble-ed25519](https://github.com/paulmillr/noble-ed25519). | ||
|
||
## Usage | ||
|
||
Vessel are supported: | ||
> Setting of [dfx.json](https://github.com/nirvana369/ed25519-demo/blob/main/dfx.json) : | ||
```json | ||
{ | ||
"defaults": { | ||
"build": { | ||
"packtool": "vessel sources" | ||
} | ||
}, | ||
"version": 1 | ||
} | ||
``` | ||
> Setting of [package-set.dhall](https://github.com/nirvana369/ed25519-demo/blob/main/package-set.dhall) : | ||
``` | ||
let additions = [ | ||
{ name = "ed25519" | ||
, version = "v1.0.0" | ||
, repo = "https://github.com/nirvana369/ed25519.git" | ||
, dependencies = [ "base" ] : List Text | ||
} | ||
] | ||
``` | ||
|
||
> How to use : | ||
``` | ||
import Lib "mo:ed25519"; | ||
let privateKey = Lib.Utils.randomPrivateKey(); | ||
let message : [Nat8] = [0xab, 0xbc, 0xcd, 0xde]; | ||
let publicKey = Lib.ED25519.getPublicKey(privateKey); | ||
let signature = Lib.ED25519.sign(message, privateKey); | ||
let isValid = Lib.ED25519.verify(signature, message, publicKey); | ||
``` | ||
|
||
## Demo | ||
[(https://github.com/nirvana369/ed25519-demo)](https://github.com/nirvana369/ed25519-demo). | ||
|
||
## License | ||
[MIT (c) nirvana369](https://github.com/nirvana369/ed25519/blob/main/LICENSE). |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters