Optional
secretSeed: Uint8ArrayOptional
prng: RandomSourceReadonly
acceptAccept message length in bytes
Readonly
offerOffer message length in bytes
Readonly
savedSaved state length in bytes *
Readonly
sharedShared key length in bytes *
Serializes secret offering party state into byte array.
This function should be called after offer() if the offering party cannot keep KeyAgreement instance in memory. When it receives accept message, it can create a new instance and call restoreState() on it with the serialized state to recover to continue the agreement.
NewHope provides post-quantum Ring-LWE-based key exchange between two peers.
One peer generates an "offer message"" by calling offer(), and sends it to the other peer. The other peer accepts the offer and generates "accept message" by calling accept() with the received offer message. It then send the result to the first peer, which calls finish(). After completing these steps, both peers call getSharedKey() to get the established shared key.
This is a reference version, which uses SHAKE-128 and SHA-3-256. You can create a custom version by requiring "lib/custom" and extending CustomNewHope class.
Reference:
Erdem Alkim, Léo Ducas, Thomas Pöppelmann, and Peter Schwabe: Post-quantum key exchange – a new hope.
https://cryptojedi.org/papers/#newhope