1.0.0 ā¢ Published 3 years ago
newhope-ts v1.0.0
Ethersdcan API library with typescript
š Homepage
Install
npm i newhope-ts
yarn add newhope-ts
Run tests
yarn test
Usage
const newHopeAlice = new NewHope();
newHopeAlice.generateKeyPair();
const sharedRandomness = newHopeAlice.sharedRandomness;
const newHopeBob = new NewHope();
newHopeBob.sharedRandomness = sharedRandomness;
newHopeBob.generateKeyPair();
// newHopeBob.vector = errorDistribution;
const aliceShared = newHopeAlice.generateSharedSecret(
newHopeBob.publicKey,
Encoding.MATRIX
);
newHopeBob.vector = newHopeAlice.vector;
const bobShared = newHopeBob.generateSharedSecret(
newHopeAlice.publicKey,
Encoding.MATRIX
);
console.log("Alice");
console.log(aliceShared.toString());
console.log("Bob");
console.log(bobShared.toString());
if (aliceShared.toString() === bobShared.toString()) {
console.log("Success!");
} else {
console.log("Failed");
}
Author
š¤ CuteWisp sweatpotato13@gmail.com
- Website: Cutewisp.com
- Github: @sweatpotato13
š¤ Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page.
Show your support
Give a āļø if this project helped you!
This README was generated with ā¤ļø by readme-md-generator
1.0.0
3 years ago