Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrates MSR's RLWE Latticecrypto library into OQS. #58

Merged
merged 30 commits into from
Nov 23, 2016

Conversation

christianpaquin
Copy link
Contributor

This integrates MSR's implementation of Peikert's RLWE key exchange, based on the newhope implementation and using new algorithms for the underlying Number Theoretic Transform (NTT). https://www.microsoft.com/en-us/research/project/lattice-cryptography-library/

The ASM/AVX2 mode, supported in the LatticeCrypto library, is currently not enabled in OQS. This will be done in a subsequent commit.

Conflicts:
	src/kex_rlwe_bcns15/kex_rlwe_bcns15.c
	src/rand_urandom_chacha20/rand_urandom_chacha20.c

Merged winbuild with master.
@@ -105,7 +106,7 @@ Over the next few months, we plan to be making the following updates:

- Building on more systems, including building of assembly code / optimizations
- Inclusion of a McEliece-based key exchange method
- Inclusion of a supersingular isogeny Diffie–Hellman key exchange method
- Inclusion of a supersingular isogeny Diffie–Hellman key exchange method
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding is incorrect here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -127,7 +129,7 @@ The Open Quantum Safe project is lead by [Michele Mosca](http://faculty.iqc.uwat

### Contributors

- Tancrède Lepoint (SRI)
- Tancrède Lepoint (SRI)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding is incorrect here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

/****************************************************************************************
* LatticeCrypto: an efficient post-quantum Ring-Learning With Errors cryptography library
*
* Copyright (c) Microsoft Corporation. All rights reserved.
Copy link
Contributor

@tlepoint tlepoint Nov 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the license of the implementation? (Maybe it should be added to the README too)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The library is released under the MIT license (same as OQS). This is noted in the main Readme.md and in src/kex_rlwe_latticecrypto/LICENCE.txt.

@@ -26,6 +26,7 @@ liboqs currently contains:
- `rand_urandom_chacha20`: pseudorandom number generator seeded from /dev/urandom and expanded using the ChaCha20 stream cipher
- `kex_rlwe_bcns15`: key exchange from the ring learning with errors problem (Bos, Costello, Naehrig, Stebila, *IEEE Symposium on Security & Privacy 2015*, [https://eprint.iacr.org/2014/599](https://eprint.iacr.org/2014/599))
- `kex_rlwe_newhope`: "NewHope": key exchange from the ring learning with errors problem (Alkim, Ducas, Pöppelmann, Schwabe, *USENIX Security 2016*, [https://eprint.iacr.org/2015/1092](https://eprint.iacr.org/2015/1092)) (using the reference C implementation of NewHope from [https://github.com/tpoeppelmann/newhope](https://github.com/tpoeppelmann/newhope))
- `kex_rlwe_latticecrypto`: MSR implementation of Peikert's RLWE key exchange, based on the implementation of Alkim, Ducas, Pöppelmann, and Schwabe, [https://www.microsoft.com/en-us/research/project/lattice-cryptography-library/](https://www.microsoft.com/en-us/research/project/lattice-cryptography-library/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding error here too. And on the line above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

* @param outputByteLen The number of output bytes desired.
* @pre One must have r+c=1600 and the rate a multiple of 8 bits in this implementation.
*/
void Keccak(unsigned int rate, unsigned int capacity, const unsigned char *input, unsigned long long int inputByteLen, unsigned char delimitedSuffix, unsigned char *output, unsigned long long int outputByteLen);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will eventually be "incompatible" with #47 which factors out sha3/shake128. Depending on the timeline, you might have to rebase this PR.

Conflicts:
	Makefile

Merged-in updated upstrea/master branch and fixed conflict in Makefile.
@@ -25,7 +25,8 @@ liboqs currently contains:

- `rand_urandom_chacha20`: pseudorandom number generator seeded from /dev/urandom and expanded using the ChaCha20 stream cipher
- `kex_rlwe_bcns15`: key exchange from the ring learning with errors problem (Bos, Costello, Naehrig, Stebila, *IEEE Symposium on Security & Privacy 2015*, [https://eprint.iacr.org/2014/599](https://eprint.iacr.org/2014/599))
- `kex_rlwe_newhope`: "NewHope": key exchange from the ring learning with errors problem (Alkim, Ducas, Pöppelmann, Schwabe, *USENIX Security 2016*, [https://eprint.iacr.org/2015/1092](https://eprint.iacr.org/2015/1092)) (using the reference C implementation of NewHope from [https://github.com/tpoeppelmann/newhope](https://github.com/tpoeppelmann/newhope))
- `kex_rlwe_newhope`: "NewHope": key exchange from the ring learning with errors problem (Alkim, Ducas, P�ppelmann, Schwabe, *USENIX Security 2016*, [https://eprint.iacr.org/2015/1092](https://eprint.iacr.org/2015/1092)) (using the reference C implementation of NewHope from [https://github.com/tpoeppelmann/newhope](https://github.com/tpoeppelmann/newhope))
- `kex_rlwe_latticecrypto`: MSR implementation of Peikert's RLWE key exchange, based on the implementation of Alkim, Ducas, Pöppelmann, and Schwabe, [https://www.microsoft.com/en-us/research/project/lattice-cryptography-library/](https://www.microsoft.com/en-us/research/project/lattice-cryptography-library/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still an encoding error here.


LatticeCrypto is a post-quantum secure cryptography library based on the Ring-Learning with Errors (R-LWE)
problem. The version 1.0 of the library implements the instantiation of Peikert's key exchange [1] due to
Alkim, Ducas, P�ppelmann and Schwabe [2], and incorporates novel techniques to provide higher performance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Encoding


[1] C. Peikert, "Lattice cryptography for the internet", in Post-Quantum Cryptography - 6th International
Workshop (PQCrypto 2014), LNCS 8772, pp. 197-219. Springer, 2014.
[2] E. Alkim, L. Ducas, T. P�ppelmann and P. Schwabe, "Post-quantum key exchange - a new hope", IACR Cryp-
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encoding

@dstebila dstebila mentioned this pull request Nov 22, 2016
@dstebila dstebila merged commit 7fcf29d into open-quantum-safe:master Nov 23, 2016
@christianpaquin christianpaquin deleted the add-latticecrypto branch December 6, 2016 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants