Skip to content

Commit

Permalink
Updated to SIKE v3.5.1 (#1231)
Browse files Browse the repository at this point in the history
* Updated to SIKE v3.5.1

* Prettyprint

* Newline at the end of the file (to avoid error from -Wnewline-eof)

* Wrap logical not check in parenthesis, to avoid error from -Wlogical-not-parentheses

* Added empty functions to avoid unused errors on macOS

* Adding extra empty line at the end of assembly files to avoid newline-eof errors

* Fixing missing newlines at the end of the .S files

* Initialized some sike values

* Initialized a sike value

* Small edits

* Initialized some more SIKE variables

* sike cmake update

* include for windows

Co-authored-by: Basil Hess <bhe@zurich.ibm.com>
  • Loading branch information
christianpaquin and bhess authored Jul 30, 2022
1 parent 478ccba commit fb0edb7
Show file tree
Hide file tree
Showing 64 changed files with 9,631 additions and 8,925 deletions.
2 changes: 1 addition & 1 deletion docs/algorithms/kem/sike.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- **Authors' website**: https://sike.org
- **Specification version**: NIST Round 3 submission.
- **Primary Source**<a name="primary-source"></a>:
- **Source**: https://github.com/microsoft/PQCrypto-SIDH/commit/effa607f244768cdd38f930887076373604eaa78
- **Source**: https://github.com/microsoft/PQCrypto-SIDH/tree/v3.5.1
- **Implementation license (SPDX-Identifier)**: MIT


Expand Down
30 changes: 14 additions & 16 deletions src/kem/sike/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,19 @@ if(

if(ARCH_X86_64)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
if(OQS_ENABLE_KEM_sike_p503 OR OQS_ENABLE_KEM_sidh_p503 OR OQS_ENABLE_KEM_sike_p503_compressed OR OQS_ENABLE_KEM_sidh_p503_compressed)
set(SRCS ${SRCS} external/P503/AMD64/fp_x64_asm.S)
endif()
if(OQS_ENABLE_KEM_sike_p751 OR OQS_ENABLE_KEM_sidh_p751 OR OQS_ENABLE_KEM_sike_p751_compressed OR OQS_ENABLE_KEM_sidh_p751_compressed)
set(SRCS ${SRCS} external/P751/AMD64/fp_x64_asm.S)
endif()
if(OQS_USE_BMI2_INSTRUCTIONS)
# The p434 and p610 fp_x64_asm.S files support x64+BMI2 and x64+BMI2+ADX, but not x64
if(OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_ADX_INSTRUCTIONS)
if(OQS_ENABLE_KEM_sike_p434 OR OQS_ENABLE_KEM_sidh_p434 OR OQS_ENABLE_KEM_sike_p434_compressed OR OQS_ENABLE_KEM_sidh_p434_compressed)
set(SRCS ${SRCS} external/P434/AMD64/fp_x64_asm.S)
endif()
if(OQS_ENABLE_KEM_sike_p503 OR OQS_ENABLE_KEM_sidh_p503 OR OQS_ENABLE_KEM_sike_p503_compressed OR OQS_ENABLE_KEM_sidh_p503_compressed)
set(SRCS ${SRCS} external/P503/AMD64/fp_x64_asm.S)
endif()
if(OQS_ENABLE_KEM_sike_p610 OR OQS_ENABLE_KEM_sidh_p610 OR OQS_ENABLE_KEM_sike_p610_compressed OR OQS_ENABLE_KEM_sidh_p610_compressed)
set(SRCS ${SRCS} external/P610/AMD64/fp_x64_asm.S)
endif()
if(OQS_ENABLE_KEM_sike_p751 OR OQS_ENABLE_KEM_sidh_p751 OR OQS_ENABLE_KEM_sike_p751_compressed OR OQS_ENABLE_KEM_sidh_p751_compressed)
set(SRCS ${SRCS} external/P751/AMD64/fp_x64_asm.S)
endif()
endif()
endif()
elseif(ARCH_ARM64v8)
Expand Down Expand Up @@ -104,20 +103,19 @@ if(
endif()
endif()
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
if(OQS_ENABLE_KEM_sike_p503 OR OQS_ENABLE_KEM_sidh_p503 OR OQS_ENABLE_KEM_sike_p503_compressed OR OQS_ENABLE_KEM_sidh_p503_compressed)
target_compile_definitions(sike PRIVATE USE_SIKEP503_ASM)
endif()
if(OQS_ENABLE_KEM_sike_p751 OR OQS_ENABLE_KEM_sidh_p751 OR OQS_ENABLE_KEM_sike_p751_compressed OR OQS_ENABLE_KEM_sidh_p751_compressed)
target_compile_definitions(sike PRIVATE USE_SIKEP751_ASM)
endif()
if(OQS_USE_BMI2_INSTRUCTIONS)
# The p434 and p610 fp_x64_asm.S files support x64+BMI2 and x64+BMI2+ADX, but not x64
if(OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_ADX_INSTRUCTIONS)
if(OQS_ENABLE_KEM_sike_p434 OR OQS_ENABLE_KEM_sidh_p434 OR OQS_ENABLE_KEM_sike_p434_compressed OR OQS_ENABLE_KEM_sidh_p434_compressed)
target_compile_definitions(sike PRIVATE USE_SIKEP434_ASM)
endif()
if(OQS_ENABLE_KEM_sike_p503 OR OQS_ENABLE_KEM_sidh_p503 OR OQS_ENABLE_KEM_sike_p503_compressed OR OQS_ENABLE_KEM_sidh_p503_compressed)
target_compile_definitions(sike PRIVATE USE_SIKEP503_ASM)
endif()
if(OQS_ENABLE_KEM_sike_p610 OR OQS_ENABLE_KEM_sidh_p610 OR OQS_ENABLE_KEM_sike_p610_compressed OR OQS_ENABLE_KEM_sidh_p610_compressed)
target_compile_definitions(sike PRIVATE USE_SIKEP610_ASM)
endif()
if(OQS_ENABLE_KEM_sike_p751 OR OQS_ENABLE_KEM_sidh_p751 OR OQS_ENABLE_KEM_sike_p751_compressed OR OQS_ENABLE_KEM_sidh_p751_compressed)
target_compile_definitions(sike PRIVATE USE_SIKEP751_ASM)
endif()
endif()
endif()
elseif(ARCH_ARM32v7)
Expand Down
Loading

0 comments on commit fb0edb7

Please sign in to comment.