@assemblyvoting/av-crypto
v1.1.1
Published
The JavaScript based cryptographic library of Assembly Voting
Downloads
9,337
Maintainers
Keywords
Readme
Assembly Voting JavaScript Crypto
This is the main cryptographic library used in Assembly Voting's JavaScript applications.
Installing
Install directly from Github into your Javascript project.
npm install @assemblyvoting/av-cryptoUsage
This library exposes a number of high level flows, which can be used to "encrypt a vote", "verify a signature", "decrypt
a vote", etc. These are all exposed in an instance of AVCrypto, which can be constructed providing an elliptic curve
name. Currently supported curves are secp256k1, secp256r1, secp384r1 and secp521r1. Example:
import { AVCrypto } from "@assemblyvoting/av-crypto"
crypto = new AVCrypto("secp256k1")
private_key = "c5ff9a9bf89ff96b03a1af5ac04e46ded73ecfe19ea104c6ad9e0f7c42e0584e"
crypto.sign("hello", private_key)
# => "<32 byte hex>,<32 byte hex>"Testing
To run tests:
yarn run testTo generate HTML documentation for external usage:
yarn run docsPublishing
Publishing it done automatically by the pipeline. Check the pipeline to see if the publish was successful.
Remember to update the package.json version.
