Skip to content

Java implementation of the New Hope Ring Learning With Errors Key Exchange

License

Notifications You must be signed in to change notification settings

Art3misOne/rlwe

Repository files navigation

Note: This repository will no longer be maintained. It is being replaced by: https://github.com/Art3misOne/newhope

This software is an implementation of the Ring Learning With Errors (RLWE) key exchange using the style guide from Open Whisper Systems. This implementation originally followed the one published by Singh and Chopra:

More recent work was published by Microsoft introducing additional optimizations for Number Theoretic Transform computations. These have now been incorporated making the average runtime per exchange about 2.75 times faster.

With these optimizations, a new parameter has been introduced to support regression testing and facilitate compatibility between different Fourier optimizations. Keys can either be transmitted in the Fourier domain (for greater efficiency) or the Ordinary domain (for interoperability). Preliminary tests indicate that it takes about 1.17 times as long to complete an exchange transmitting in the ordinary domain than in the Fourier domain.

Note of caution: This implementation (and the RLWE key exchange in general) is not a drop-in replacement for ECDH. In ECDH, both parties generate a key pair, transmit their public keys, and compute the shared agreement from their own private key and the other party's public key.

   Generate key pair                               Generate key pair
   Transmit public key                             Transmit public key
   Wait (receive public key)                       Wait (receive public key)
   Agreement (their public, my private)            Agreement (their public, my private)

The only required synchronicity is that one must receive the other party's public key before computing the shared agreement. In RLWE, one party must compute the reconciliation data which both parties use for computing the shared key.

   Generate key pair                               Generate key pair
   Transmit public key
                                                   Wait (receive public key)
                                                   Compute rec data
                                                   Transmit public key and rec data
   Wait (receive pub key, rec data)                Agreement (their public, my private, rec data)
   Agreement (their public, my private, rec data)

Greater synchronicity is required and care must be taken when replacing an existing key exchange with RLWE.

About

Java implementation of the New Hope Ring Learning With Errors Key Exchange

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages