Skip to content

Commit

Permalink
Add Rainbow from PQClean (open-quantum-safe#662)
Browse files Browse the repository at this point in the history
* Add Rainbow from PQClean

* Adapt CircleCI config to handle larger number of local files
  • Loading branch information
dstebila authored Mar 16, 2020
1 parent a4d3753 commit 4c3016f
Show file tree
Hide file tree
Showing 230 changed files with 18,259 additions and 69 deletions.
11 changes: 11 additions & 0 deletions .CMake/alg_support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ option(OQS_ENABLE_SIG_MQDSS "" ON)
cmake_dependent_option(OQS_ENABLE_SIG_mqdss_31_48 "" ON "OQS_ENABLE_SIG_MQDSS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_mqdss_31_64 "" ON "OQS_ENABLE_SIG_MQDSS" OFF)

option(OQS_ENABLE_SIG_RAINBOW "" ON)
cmake_dependent_option(OQS_ENABLE_SIG_rainbow_Ia_classic "" ON "OQS_ENABLE_SIG_RAINBOW" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_rainbow_Ia_cyclic "" ON "OQS_ENABLE_SIG_RAINBOW" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_rainbow_Ia_cyclic_compressed "" ON "OQS_ENABLE_SIG_RAINBOW" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_rainbow_IIIc_classic "" ON "OQS_ENABLE_SIG_RAINBOW" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_rainbow_IIIc_cyclic "" ON "OQS_ENABLE_SIG_RAINBOW" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_rainbow_IIIc_cyclic_compressed "" ON "OQS_ENABLE_SIG_RAINBOW" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_rainbow_Vc_classic "" ON "OQS_ENABLE_SIG_RAINBOW" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_rainbow_Vc_cyclic "" ON "OQS_ENABLE_SIG_RAINBOW" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_rainbow_Vc_cyclic_compressed "" ON "OQS_ENABLE_SIG_RAINBOW" OFF)

option(OQS_ENABLE_SIG_SPHINCS "" ON)
cmake_dependent_option(OQS_ENABLE_SIG_sphincs_haraka_128f_robust "" ON "OQS_ENABLE_SIG_SPHINCS" OFF)
cmake_dependent_option(OQS_ENABLE_SIG_sphincs_haraka_128f_simple "" ON "OQS_ENABLE_SIG_SPHINCS" OFF)
Expand Down
12 changes: 11 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
version: 2

# CircleCI doesn't handle large file sets properly for local builds
# https://github.com/CircleCI-Public/circleci-cli/issues/281#issuecomment-472808051
localCheckout: &localCheckout
run: |-
PROJECT_PATH=$(cd ${CIRCLE_WORKING_DIRECTORY}; pwd)
mkdir -p ${PROJECT_PATH}
cd /tmp/_circleci_local_build_repo
git ls-files -z | xargs -0 -s 2090860 tar -c | tar -x -C ${PROJECT_PATH}
cp -a /tmp/_circleci_local_build_repo/.git ${PROJECT_PATH}
.oqsjob: &oqsjob
docker:
- image: ${IMAGE}
steps:
- checkout
- checkout # change this from "checkout" to "*localCheckout" when running CircleCI locally
- run:
name: Configure
command: scripts/git_no_checkin_in_last_day.sh || (mkdir build && cd build && cmake -GNinja ${CONFIGURE_ARGS} ..)
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ endif()
if(OQS_ENABLE_SIG_MQDSS)
set(PUBLIC_HEADERS ${PUBLIC_HEADERS} ${PROJECT_SOURCE_DIR}/src/sig/mqdss/sig_mqdss.h)
endif()
if(OQS_ENABLE_SIG_RAINBOW)
set(PUBLIC_HEADERS ${PUBLIC_HEADERS} ${PROJECT_SOURCE_DIR}/src/sig/rainbow/sig_rainbow.h)
endif()
if(OQS_ENABLE_SIG_SPHINCS)
set(PUBLIC_HEADERS ${PUBLIC_HEADERS} ${PROJECT_SOURCE_DIR}/src/sig/sphincs/sig_sphincs.h)
endif()
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ More information on OQS can be found [here](https://openquantumsafe.org/) and in
- **MQDSS**: MQDSS-31-48, MQDSS-31-64
- **Picnic**: Picnic-L1-FS, Picnic-L1-UR, Picnic-L3-FS, Picnic-L3-UR, Picnic-L5-FS, Picnic-L5-UR, Picnic2-L1-FS, Picnic2-L3-FS, Picnic2-L5-FS
- **qTesla**: qTesla-p-I, qTesla-p-III
- **Rainbow**: Rainbow-Ia-Classic, Rainbow-Ia-Cyclic, Rainbow-Ia-Cyclic-Compressed, Rainbow-IIIc-Classic, Rainbow-IIIc-Cyclic, Rainbow-IIIc-Cyclic-Compressed, Rainbow-Vc-Classic, Rainbow-Vc-Cyclic, Rainbow-Vc-Cyclic-Compressed
- **SPHINCS+-Haraka**: SPHINCS+-Haraka-128f-robust, SPHINCS+-Haraka-128f-simple, SPHINCS+-Haraka-128s-robust, SPHINCS+-Haraka-128s-simple, SPHINCS+-Haraka-192f-robust, SPHINCS+-Haraka-192f-simple, SPHINCS+-Haraka-192s-robust, SPHINCS+-Haraka-192s-simple, SPHINCS+-Haraka-256f-robust, SPHINCS+-Haraka-256f-simple, SPHINCS+-Haraka-256s-robust, SPHINCS+-Haraka-256s-simple
- **SPHINCS+-SHA256**: SPHINCS+-SHA256-128f-robust, SPHINCS+-SHA256-128f-simple, SPHINCS+-SHA256-128s-robust, SPHINCS+-SHA256-128s-simple, SPHINCS+-SHA256-192f-robust, SPHINCS+-SHA256-192f-simple, SPHINCS+-SHA256-192s-robust, SPHINCS+-SHA256-192s-simple, SPHINCS+-SHA256-256f-robust, SPHINCS+-SHA256-256f-simple, SPHINCS+-SHA256-256s-robust, SPHINCS+-SHA256-256s-simple
- **SPHINCS+-SHAKE256**: SPHINCS+-SHAKE256-128f-robust, SPHINCS+-SHAKE256-128f-simple, SPHINCS+-SHAKE256-128s-robust, SPHINCS+-SHAKE256-128s-simple, SPHINCS+-SHAKE256-192f-robust, SPHINCS+-SHAKE256-192f-simple, SPHINCS+-SHAKE256-192s-robust, SPHINCS+-SHAKE256-192s-simple, SPHINCS+-SHAKE256-256f-robust, SPHINCS+-SHAKE256-256f-simple, SPHINCS+-SHAKE256-256s-robust, SPHINCS+-SHAKE256-256s-simple
Expand Down
3 changes: 2 additions & 1 deletion docs/algorithms/sig_falcon.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ liboqs algorithm datasheet: `sig_falcon`
- **Main cryptographic assumption**: hardness of NTRU lattice problems
- **NIST submission URL**: https://csrc.nist.gov/CSRC/media/Projects/Post-Quantum-Cryptography/documents/round-2/submissions/Falcon-Round2.zip
- **Submitters (to NIST competition)**: Thomas Prest, Pierre-Alain Fouque, Jeffrey Hoffstein, Paul Kirchner, Vadim Lyubashevsky, Thomas Pornin, Thomas Ricosset, Gregor Seiler, William Whyte, Zhenfei Zhang
- **Submitters' website**: https://falcon-sign.info
- **Added to liboqs by**: Dimitrios Sikeridis, Douglas Stebila

Parameter sets
--------------

| Parameter set | Security model | Claimed NIST security level | Public key size (bytes) | Secret key size (bytes) | Signature size (bytes) |
Parameter set | Security model | Claimed NIST security level | Public key size (bytes) | Secret key size (bytes) | Signature size (bytes) |
|---------------|:--------------:|:---------------------------:|:-----------------------:|:-----------------------:|:----------------------:|
| Falcon-512 | EUF-CMA | 1 | 897 | 1281 | 690 |
| Falcon-1024 | EUF-CMA | 5 | 1793 | 2305 | 1330 |
Expand Down
36 changes: 36 additions & 0 deletions docs/algorithms/sig_rainbow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
liboqs algorithm datasheet: `sig_rainbow`
=========================================

Summary
-------

- **Name**: Rainbow
- **Algorithm type**: signature
- **Main cryptographic assumption**: multivariable polynomials, unbalanced oil and vinegatr
- **NIST submission URL**: https://csrc.nist.gov/CSRC/media/Projects/Post-Quantum-Cryptography/documents/round-2/submissions/Rainbow-Round2.zip
- **Submitters (to NIST competition)**: Jintai Ding, Ming-Shing Chen, Albrecht Petzoldt, Dieter Schmidt, Bo-Yin Yang
- **Added to liboqs by**: Douglas Stebila

Parameter sets
--------------

| Parameter set | Security model | Claimed NIST security level | Public key size (bytes) | Secret key size (bytes) | Signature size (bytes) |
|--------------------------------|:--------------:|:---------------------------:|:-----------------------:|:-----------------------:|:----------------------:|
| Rainbow-Ia-Classic | EUF-CMA | 1 | 148992 | 92960 | 64 |
| Rainbow-Ia-Cyclic | EUF-CMA | 1 | 58144 | 92960 | 64 |
| Rainbow-Ia-Cyclic-Compressed | EUF-CMA | 1 | 58144 | 64 | 64 |
| Rainbow-IIIc-Classic | EUF-CMA | 3 | 710640 | 511448 | 156 |
| Rainbow-IIIc-Cyclic | EUF-CMA | 3 | 206744 | 511448 | 156 |
| Rainbow-IIIc-Cyclic-Compressed | EUF-CMA | 3 | 206744 | 64 | 156 |
| Rainbow-Vc-Classic | EUF-CMA | 5 | 1705536 | 1227104 | 204 |
| Rainbow-Vc-Cyclic | EUF-CMA | 5 | 491936 | 1227104 | 204 |
| Rainbow-Vc-Cyclic-Compressed | EUF-CMA | 5 | 491936 | 64 | 204 |

Implementation
--------------

- **Source of implementation:** https://github.com/PQClean/PQClean
- **Implementation version:** https://github.com/PQClean/PQClean/commit/9023fef55861faccd82146cf599b9e46fb9606aa
- **License:** CC0 1.0
- **Language:** C
- **Constant-time:** Yes
132 changes: 66 additions & 66 deletions scripts/copy_from_pqclean/copy_from_pqclean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,72 +283,72 @@ sigs:
implementation: clean
sources: ['gf31.c', 'mq.c', 'sign.c']
signed_msg_order: sig_then_msg
# -
# name: rainbow
# schemes:
# -
# scheme: "Ia_classic"
# pqclean_scheme: rainbowIa-classic
# pretty_name_full: Rainbow-Ia-Classic
# implementation: clean
# sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas_u32.c', 'gf.c']
# signed_msg_order: msg_then_sig
# -
# scheme: "Ia_cyclic"
# pqclean_scheme: rainbowIa-cyclic
# pretty_name_full: Rainbow-Ia-Cyclic
# implementation: clean
# sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas_u32.c', 'gf.c']
# signed_msg_order: msg_then_sig
# -
# scheme: "Ia_cyclic_compressed"
# pqclean_scheme: rainbowIa-cyclic-compressed
# pretty_name_full: Rainbow-Ia-Cyclic-Compressed
# implementation: clean
# sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas_u32.c', 'gf.c']
# signed_msg_order: msg_then_sig
# -
# scheme: "IIIc_classic"
# pqclean_scheme: rainbowIIIc-classic
# pretty_name_full: Rainbow-IIIc-Classic
# implementation: clean
# sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas_u32.c', 'gf.c']
# signed_msg_order: msg_then_sig
# -
# scheme: "IIIc_cyclic"
# pqclean_scheme: rainbowIIIc-cyclic
# pretty_name_full: Rainbow-IIIc-Cyclic
# implementation: clean
# sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas_u32.c', 'gf.c']
# signed_msg_order: msg_then_sig
# -
# scheme: "IIIc_cyclic_compressed"
# pqclean_scheme: rainbowIIIc-cyclic-compressed
# pretty_name_full: Rainbow-IIIc-Cyclic-Compressed
# implementation: clean
# sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas_u32.c', 'gf.c']
# signed_msg_order: msg_then_sig
# -
# scheme: "Vc_classic"
# pqclean_scheme: rainbowVc-classic
# pretty_name_full: Rainbow-Vc-Classic
# implementation: clean
# sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas_u32.c', 'gf.c']
# signed_msg_order: msg_then_sig
# -
# scheme: "Vc_cyclic"
# pqclean_scheme: rainbowVc-cyclic
# pretty_name_full: Rainbow-Vc-Cyclic
# implementation: clean
# sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas_u32.c', 'gf.c']
# signed_msg_order: msg_then_sig
# -
# scheme: "Vc_cyclic_compressed"
# pqclean_scheme: rainbowVc-cyclic-compressed
# pretty_name_full: Rainbow-Vc-Cyclic-Compressed
# implementation: clean
# sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas_u32.c', 'gf.c']
# signed_msg_order: msg_then_sig
-
name: rainbow
schemes:
-
scheme: "Ia_classic"
pqclean_scheme: rainbowIa-classic
pretty_name_full: Rainbow-Ia-Classic
implementation: clean
sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas.c', 'gf.c']
signed_msg_order: msg_then_sig
-
scheme: "Ia_cyclic"
pqclean_scheme: rainbowIa-cyclic
pretty_name_full: Rainbow-Ia-Cyclic
implementation: clean
sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas.c', 'gf.c']
signed_msg_order: msg_then_sig
-
scheme: "Ia_cyclic_compressed"
pqclean_scheme: rainbowIa-cyclic-compressed
pretty_name_full: Rainbow-Ia-Cyclic-Compressed
implementation: clean
sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas.c', 'gf.c']
signed_msg_order: msg_then_sig
-
scheme: "IIIc_classic"
pqclean_scheme: rainbowIIIc-classic
pretty_name_full: Rainbow-IIIc-Classic
implementation: clean
sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas.c', 'gf.c']
signed_msg_order: msg_then_sig
-
scheme: "IIIc_cyclic"
pqclean_scheme: rainbowIIIc-cyclic
pretty_name_full: Rainbow-IIIc-Cyclic
implementation: clean
sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas.c', 'gf.c']
signed_msg_order: msg_then_sig
-
scheme: "IIIc_cyclic_compressed"
pqclean_scheme: rainbowIIIc-cyclic-compressed
pretty_name_full: Rainbow-IIIc-Cyclic-Compressed
implementation: clean
sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas.c', 'gf.c']
signed_msg_order: msg_then_sig
-
scheme: "Vc_classic"
pqclean_scheme: rainbowVc-classic
pretty_name_full: Rainbow-Vc-Classic
implementation: clean
sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas.c', 'gf.c']
signed_msg_order: msg_then_sig
-
scheme: "Vc_cyclic"
pqclean_scheme: rainbowVc-cyclic
pretty_name_full: Rainbow-Vc-Cyclic
implementation: clean
sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas.c', 'gf.c']
signed_msg_order: msg_then_sig
-
scheme: "Vc_cyclic_compressed"
pqclean_scheme: rainbowVc-cyclic-compressed
pretty_name_full: Rainbow-Vc-Cyclic-Compressed
implementation: clean
sources: ['blas_comm.c', 'parallel_matrix_op.c', 'rainbow.c', 'rainbow_keypair.c', 'rainbow_keypair_computation.c', 'sign.c', 'utils_hash.c', 'utils_prng.c', 'blas.c', 'gf.c']
signed_msg_order: msg_then_sig
-
name: sphincs
schemes:
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ if(OQS_ENABLE_SIG_MQDSS)
add_subdirectory(sig/mqdss)
set(SIG_OBJS ${SIG_OBJS} $<TARGET_OBJECTS:mqdss>)
endif()
if(OQS_ENABLE_SIG_RAINBOW)
add_subdirectory(sig/rainbow)
set(SIG_OBJS ${SIG_OBJS} $<TARGET_OBJECTS:rainbow>)
endif()
if(OQS_ENABLE_SIG_SPHINCS)
add_subdirectory(sig/sphincs)
set(SIG_OBJS ${SIG_OBJS} $<TARGET_OBJECTS:sphincs>)
Expand Down
11 changes: 11 additions & 0 deletions src/oqsconfig.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@
#cmakedefine OQS_ENABLE_SIG_mqdss_31_48 1
#cmakedefine OQS_ENABLE_SIG_mqdss_31_64 1

#cmakedefine OQS_ENABLE_SIG_RAINBOW
#cmakedefine OQS_ENABLE_SIG_rainbow_Ia_classic 1
#cmakedefine OQS_ENABLE_SIG_rainbow_Ia_cyclic 1
#cmakedefine OQS_ENABLE_SIG_rainbow_Ia_cyclic_compressed 1
#cmakedefine OQS_ENABLE_SIG_rainbow_IIIc_classic 1
#cmakedefine OQS_ENABLE_SIG_rainbow_IIIc_cyclic 1
#cmakedefine OQS_ENABLE_SIG_rainbow_IIIc_cyclic_compressed 1
#cmakedefine OQS_ENABLE_SIG_rainbow_Vc_classic 1
#cmakedefine OQS_ENABLE_SIG_rainbow_Vc_cyclic 1
#cmakedefine OQS_ENABLE_SIG_rainbow_Vc_cyclic_compressed 1

#cmakedefine OQS_ENABLE_SIG_SPHINCS
#cmakedefine OQS_ENABLE_SIG_sphincs_haraka_128f_robust 1
#cmakedefine OQS_ENABLE_SIG_sphincs_haraka_128f_simple 1
Expand Down
Loading

0 comments on commit 4c3016f

Please sign in to comment.