1.0.0 ā€¢ Published 3 years ago

newhope-ts v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

šŸ¤ 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