newhope-ts
v1.0.0
Published
NewHope Post-Quantum-Cryptography algorithm
Downloads
3
Readme
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 [email protected]
- 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