6 Commits

Author SHA1 Message Date
Amir Ayupov
3dd478e157 [NFCI] Move Keccak rhotates tables to rodata
rhotates tables are placed to .text section which confuses tools such as
BOLT. Move them to rodata to unbreak and avoid polluting icache/iTLB
with data.

1. Update patch file using the steps in scripts/copy_from_xkcp/README
2. Apply the updated patch with scripts/copy_from_xkcp/package.sh

Sync with XKCP upstream: https://github.com/XKCP/XKCP/pull/137
Similar fix in OpenSSL: https://github.com/openssl/openssl/pull/21440
Redo of https://github.com/open-quantum-safe/liboqs/pull/1508

Signed-off-by: Amir Ayupov <aaupov@fb.com>
2024-04-02 10:49:03 -04:00
John Schanck
4d938b1d04
Update XKCP and avoid assembler .ifdef directives (#1173)
* copy_from_xkcp: Update to latest version and fix merge conflicts

* Add macOS gcc-11 CI job

Co-authored-by: Douglas Stebila <dstebila@uwaterloo.ca>
2022-01-03 07:25:23 +01:00
John Schanck
f1673911c3
KeccakP-1600times4/avx2: Switch a memmove to a memcpy for musl libc (#972) 2021-04-18 06:55:39 +02:00
John Schanck
f99556ddda
Add SHA3 call dispatching (#957)
* Move copy_from_xkcp/CMakeLists.txt out of copy_from_xkcp/package.sh

* Namespace xkcp_low implementations for dist builds

* Run-time dispatching of sha3 calls

* Disable sha3 avx2 on windows
2021-04-06 10:34:45 -04:00
John Schanck
b36ff9f17c
Replace OQS_PORTABLE_BUILD and OQS_USE_CPU_EXTENSIONS (#951)
* Replace OQS_PORTABLE_BUILD with OQS_DIST_BUILD

Also introduces OQS_OPT_TARGET and removes OQS_USE_CPU_EXTENSIONS

* Only compile sha3 avx2 code on Linux|Darwin

* Use new ARCH_ARM[X] flags in SIKE CMakeLists

* Update test_portability and rename to test_distbuild

* Update documentation for building Windows AMD64 from Ubuntu Bionic

* Update scripts/build-android.sh

* More specific CMAKE_SYSTEM_PROCESSOR for rasppi toolchain

* CI: Use OQS_DIST_BUILD in some jobs

* Replace OQS_get_available_CPU_extensions by OQS_CPU_has_extension

* ARM64v8/ARM32v7 runtime cpu feature detection

* Compile-time detection of some ARM features

* Toolchain files to cross compile for ARM32v7 and ARM64v8

* Remove unnecessary references to CMAKE_BUILD_TYPE=Release

* Use OQS_DIST_BUILD=ON on Windows
2021-03-31 16:30:54 -04:00
John Schanck
7dc4b378d6
Refactor SHA3 implementations and improve API (#922)
* sha3: remove old implementations

* sha3: new implementations

* picnic: use liboqs sha3 and sha3x4

* frodo: use new sha3x4 interface

* sphincs: use liboqs sha3x4

* fixup

* skip test_spdx on xkcp_low directory
* xkcp_sha3: explicit casts to avoid narrowing warnings
* xkcp_sha3x4: explicit casts to avoid narrowing warnings
* sha3: disable platform specific xkcp if OQS_PORTABLE_BUILD
* sha3: fix Wcast-qual warnings on clang-9
* fix 'reset' functions
* xkcp_sha3: skip fastloop call if input is not long enough
* xkcp_low: Enable lane complementing for plain-64bits
* xkcp_low: remove Kravatte definitions from times4/avx2

* Add common OQS_MEM_aligned_alloc and OQS_MEM_aligned_free

* Require both OQS_USE_OPENSSL and OQS_USE_SHA3_OPENSSL to enable OpenSSL's SHA3

* Fix some undefined behaviour in KeccakP-1600/plain-64bits

* Fix some undefined behaviour in KeccakP-1600times4/avx2

* Expand shake tests

* Add sha3x4.h include to oqs.h

* Add xkcp_low license info to readme [skip-ci]

* Add copy_from_xkcp scripts [skip-ci]

* SPDX License Info for new scripts [skip-ci]
2021-03-22 19:54:32 -04:00