diff --git a/crypto/XKCP/CMakeLists.txt b/crypto/XKCP/CMakeLists.txt index 18dad53dc513060df4bf7159173e0a09adad5b52..03a785e637bc70ccec12cc384f36ade89f298f5b 100644 --- a/crypto/XKCP/CMakeLists.txt +++ b/crypto/XKCP/CMakeLists.txt @@ -6,20 +6,14 @@ project (dap_crypto_XKCP) add_library(${PROJECT_NAME} STATIC IMPORTED GLOBAL) -option(DAP_CRYPTO_XKCP_USE_PREBUILDS "Use prebuilded optimizations" ON) option(DAP_CRYPTO_XKCP_REFERENCE "Use xkcp reference implemintation" OFF) -IF (DAP_CRYPTO_XKCP_USE_PREBUILDS) - #all prebuilds are done with gcc, it support -march=native +#if building from src - check for compiller support +include(CheckCCompilerFlag) +unset(COMPILER_SUPPORTS_MARCH_NATIVE CACHE) +CHECK_C_COMPILER_FLAG(-march=native COMPILER_SUPPORTS_MARCH_NATIVE) +if(COMPILER_SUPPORTS_MARCH_NATIVE) SET(TARGET_POSTFIX "-native") -else() - #if building from src - check for compiller support - include(CheckCCompilerFlag) - unset(COMPILER_SUPPORTS_MARCH_NATIVE CACHE) - CHECK_C_COMPILER_FLAG(-march=native COMPILER_SUPPORTS_MARCH_NATIVE) - if(COMPILER_SUPPORTS_MARCH_NATIVE) - SET(TARGET_POSTFIX "-native") - endif() endif() @@ -38,37 +32,29 @@ endif() IF (DAP_CRYPTO_XKCP_REFERENCE) SET(XKCP_TARGET libdap-XKCP-ref${TARGET_POSTFIX}.a) message("[!] XKCP: Force use reference impl for ${TARGET_ARCH}") - set(DAP_CRYPTO_XKCP_USE_PREBUILDS OFF) endif() -IF (NOT DAP_CRYPTO_XKCP_USE_PREBUILDS) - - SET(XKCP_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/xkcp_build_src/) - message("[*] XKCP build from src") - message("[*] XKCP target: ${TARGET_ARCH} ${XKCP_TARGET}") - message("[*] XKCP build dir: ${XKCP_BUILD_DIR}") - message("[*] XKCP make command: ${CMAKE_MAKE_PROGRAM}") - message("[*] XKCP make CC: ${CMAKE_C_COMPILER}") - message("[*] XKCP make AR: ${CMAKE_AR}") - message("[*] XKCP compiller supports -march=native: ${COMPILER_SUPPORTS_MARCH_NATIVE}") - message("[*] XKCP SYSROOT: ${CMAKE_OSX_SYSROOT}") - - - file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${XKCP_BUILD_DIR}) - add_custom_target(BuildXKCP ALL - COMMAND ${CMAKE_COMMAND} -E env AR=${CMAKE_AR} CC=${CMAKE_C_COMPILER} SDKROOT=${CMAKE_OSX_SYSROOT} ${CMAKE_MAKE_PROGRAM} -C ./xkcp_build_src ${XKCP_TARGET} - ) - - SET(XKCP_BUILD_INCLUDES ${XKCP_BUILD_DIR}/bin/${XKCP_TARGET}.headers/) - SET(XKCP_BUILD_LIB ${XKCP_BUILD_DIR}/bin/${XKCP_TARGET}) - file(MAKE_DIRECTORY ${XKCP_BUILD_INCLUDES}) - - add_dependencies(${PROJECT_NAME} BuildXKCP) -else() - message("[*] XKCP use optimized prebuilds for ${TARGET_ARCH}") - SET(XKCP_BUILD_LIB ${CMAKE_CURRENT_SOURCE_DIR}/prebuilds/${TARGET_ARCH}/${XKCP_TARGET}) - SET(XKCP_BUILD_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/prebuilds/${TARGET_ARCH}/${XKCP_TARGET}.headers/) -endif() +SET(XKCP_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/xkcp_build_src/) +message("[*] XKCP build from src") +message("[*] XKCP target: ${TARGET_ARCH} ${XKCP_TARGET}") +message("[*] XKCP build dir: ${XKCP_BUILD_DIR}") +message("[*] XKCP make command: ${CMAKE_MAKE_PROGRAM}") +message("[*] XKCP make CC: ${CMAKE_C_COMPILER}") +message("[*] XKCP make AR: ${CMAKE_AR}") +message("[*] XKCP compiller supports -march=native: ${COMPILER_SUPPORTS_MARCH_NATIVE}") +message("[*] XKCP SYSROOT: ${CMAKE_OSX_SYSROOT}") + + +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${XKCP_BUILD_DIR}) +add_custom_target(BuildXKCP ALL + COMMAND ${CMAKE_COMMAND} -E env AR=${CMAKE_AR} CC=${CMAKE_C_COMPILER} SDKROOT=${CMAKE_OSX_SYSROOT} ${CMAKE_MAKE_PROGRAM} -C ./xkcp_build_src ${XKCP_TARGET} +) + +SET(XKCP_BUILD_INCLUDES ${XKCP_BUILD_DIR}/bin/${XKCP_TARGET}.headers/) +SET(XKCP_BUILD_LIB ${XKCP_BUILD_DIR}/bin/${XKCP_TARGET}) +file(MAKE_DIRECTORY ${XKCP_BUILD_INCLUDES}) + +add_dependencies(${PROJECT_NAME} BuildXKCP) #hack to create a path for INTERFACE_INCLUDE_DIRECTORIES, with will be populated later diff --git a/crypto/XKCP/libdap-xkcp-armv8.build b/crypto/XKCP/libdap-xkcp-armv8.build index 9e405d2c92e40c1b30a00dd773810eaa92304ee1..ee8a334f7006878edb4781e3151dda8a8cdabfec 100644 --- a/crypto/XKCP/libdap-xkcp-armv8.build +++ b/crypto/XKCP/libdap-xkcp-armv8.build @@ -1,5 +1,5 @@ <?xml version="1.0"?> <group> - <target name="libdap-XKCP-armv8.a" inherits="FIPS202 K1600-ARMv8A"/> - <target name="libdap-XKCP-armv8-native.a" inherits="FIPS202 K1600-ARMv8A optimized-march-native"/> + <target name="libdap-XKCP-armv8.a" inherits="FIPS202 K1600-plain-64bits-lcua"/> + <target name="libdap-XKCP-armv8-native.a" inherits="FIPS202 K1600-plain-64bits-lcua optimized-march-native"/> </group> \ No newline at end of file diff --git a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a b/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a deleted file mode 100644 index 4c535358df8f62aa34b723679eaab0a925d6882a..0000000000000000000000000000000000000000 Binary files a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a and /dev/null differ diff --git a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/KeccakHash.h b/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/KeccakHash.h deleted file mode 100644 index e99d99dbc08abb18cac9438fc2f8107e3f41e774..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/KeccakHash.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Keccak, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. - -Implementation by the designers, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _KeccakHashInterface_h_ -#define _KeccakHashInterface_h_ - -#include "config.h" -#ifdef XKCP_has_KeccakP1600 - -#include <stdint.h> -#include <string.h> -#include "KeccakSponge.h" - -#ifndef _Keccak_BitTypes_ -#define _Keccak_BitTypes_ -typedef uint8_t BitSequence; - -typedef size_t BitLength; -#endif - -typedef enum { KECCAK_SUCCESS = 0, KECCAK_FAIL = 1, KECCAK_BAD_HASHLEN = 2 } HashReturn; - -typedef struct { - KeccakWidth1600_SpongeInstance sponge; - unsigned int fixedOutputLength; - unsigned char delimitedSuffix; -} Keccak_HashInstance; - -/** - * Function to initialize the Keccak[r, c] sponge function instance used in sequential hashing mode. - * @param hashInstance Pointer to the hash instance to be initialized. - * @param rate The value of the rate r. - * @param capacity The value of the capacity c. - * @param hashbitlen The desired number of output bits, - * or 0 for an arbitrarily-long output. - * @param delimitedSuffix Bits that will be automatically appended to the end - * of the input message, as in domain separation. - * This is a byte containing from 0 to 7 bits - * formatted like the @a delimitedData parameter of - * the Keccak_SpongeAbsorbLastFewBits() function. - * @pre One must have r+c=1600 and the rate a multiple of 8 bits in this implementation. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashInitialize(Keccak_HashInstance *hashInstance, unsigned int rate, unsigned int capacity, unsigned int hashbitlen, unsigned char delimitedSuffix); - -/** Macro to initialize a SHAKE128 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHAKE128(hashInstance) Keccak_HashInitialize(hashInstance, 1344, 256, 0, 0x1F) - -/** Macro to initialize a SHAKE256 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHAKE256(hashInstance) Keccak_HashInitialize(hashInstance, 1088, 512, 0, 0x1F) - -/** Macro to initialize a SHA3-224 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_224(hashInstance) Keccak_HashInitialize(hashInstance, 1152, 448, 224, 0x06) - -/** Macro to initialize a SHA3-256 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_256(hashInstance) Keccak_HashInitialize(hashInstance, 1088, 512, 256, 0x06) - -/** Macro to initialize a SHA3-384 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_384(hashInstance) Keccak_HashInitialize(hashInstance, 832, 768, 384, 0x06) - -/** Macro to initialize a SHA3-512 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_512(hashInstance) Keccak_HashInitialize(hashInstance, 576, 1024, 512, 0x06) - -/** - * Function to give input data to be absorbed. - * @param hashInstance Pointer to the hash instance initialized by Keccak_HashInitialize(). - * @param data Pointer to the input data. - * When @a databitLen is not a multiple of 8, the last bits of data must be - * in the least significant bits of the last byte (little-endian convention). - * In this case, the (8 - @a databitLen mod 8) most significant bits - * of the last byte are ignored. - * @param databitLen The number of input bits provided in the input data. - * @pre In the previous call to Keccak_HashUpdate(), databitlen was a multiple of 8. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashUpdate(Keccak_HashInstance *hashInstance, const BitSequence *data, BitLength databitlen); - -/** - * Function to call after all input blocks have been input and to get - * output bits if the length was specified when calling Keccak_HashInitialize(). - * @param hashInstance Pointer to the hash instance initialized by Keccak_HashInitialize(). - * If @a hashbitlen was not 0 in the call to Keccak_HashInitialize(), the number of - * output bits is equal to @a hashbitlen. - * If @a hashbitlen was 0 in the call to Keccak_HashInitialize(), the output bits - * must be extracted using the Keccak_HashSqueeze() function. - * @param hashval Pointer to the buffer where to store the output data. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashFinal(Keccak_HashInstance *hashInstance, BitSequence *hashval); - - /** - * Function to squeeze output data. - * @param hashInstance Pointer to the hash instance initialized by Keccak_HashInitialize(). - * @param data Pointer to the buffer where to store the output data. - * @param databitlen The number of output bits desired (must be a multiple of 8). - * @pre Keccak_HashFinal() must have been already called. - * @pre @a databitlen is a multiple of 8. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashSqueeze(Keccak_HashInstance *hashInstance, BitSequence *data, BitLength databitlen); - -#else -#error This requires an implementation of Keccak-p[1600] -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/KeccakP-1600-SnP.h b/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/KeccakP-1600-SnP.h deleted file mode 100644 index 9a652f40b56595a5ba960d17a3038e347e0fb2d7..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/KeccakP-1600-SnP.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -The Keccak-p permutations, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. - -Implementation by Ronny Van Keer, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ - ---- - -Please refer to SnP-documentation.h for more details. -*/ - -#ifndef _KeccakP_1600_SnP_h_ -#define _KeccakP_1600_SnP_h_ - -#include <stdint.h> -#include "align.h" - -typedef struct { - ALIGN(32) uint64_t A[25]; -} KeccakP1600_align256plain64_state; - -typedef KeccakP1600_align256plain64_state KeccakP1600_state; - -#define KeccakP1600_implementation "64-bit optimized ARM assembler implementation" -#define KeccakP1600_stateAlignment 32 - -/* void KeccakP1600_StaticInitialize( void ); */ -#define KeccakP1600_StaticInitialize() -void KeccakP1600_Initialize(KeccakP1600_align256plain64_state *state); -/* void KeccakP1600_AddByte(KeccakP1600_align256plain64_state *state, unsigned char data, unsigned int offset); */ -#define KeccakP1600_AddByte(argS, argData, argOffset) ((unsigned char*)argS)[argOffset] ^= (argData) -void KeccakP1600_AddBytes(KeccakP1600_align256plain64_state *state, const unsigned char *data, unsigned int offset, unsigned int length); -void KeccakP1600_OverwriteBytes(KeccakP1600_align256plain64_state *state, const unsigned char *data, unsigned int offset, unsigned int length); -void KeccakP1600_OverwriteWithZeroes(KeccakP1600_align256plain64_state *state, unsigned int byteCount); -void KeccakP1600_Permute_Nrounds(KeccakP1600_align256plain64_state *state, unsigned int nrounds); -void KeccakP1600_Permute_12rounds(KeccakP1600_align256plain64_state *state); -void KeccakP1600_Permute_24rounds(KeccakP1600_align256plain64_state *state); -void KeccakP1600_ExtractBytes(const KeccakP1600_align256plain64_state *state, unsigned char *data, unsigned int offset, unsigned int length); -void KeccakP1600_ExtractAndAddBytes(const KeccakP1600_align256plain64_state *state, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length); - -#endif diff --git a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/KeccakSponge.h b/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/KeccakSponge.h deleted file mode 100644 index 4d4d83f21ee1908e9869ace42b1105c91999cf29..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/KeccakSponge.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Keccak, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. - -Implementation by the designers, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _KeccakSponge_h_ -#define _KeccakSponge_h_ - -/* For the documentation, please follow the link: */ -/* #include "KeccakSponge-documentation.h" */ - -#include <string.h> -#include "align.h" -#include "config.h" - -#define XKCP_DeclareSpongeStructure(prefix, state_t) \ - typedef struct prefix##_SpongeInstanceStruct { \ - state_t state; \ - unsigned int rate; \ - unsigned int byteIOIndex; \ - int squeezing; \ - } prefix##_SpongeInstance; - -#define XKCP_DeclareSpongeFunctions(prefix) \ - int prefix##_Sponge(unsigned int rate, unsigned int capacity, const unsigned char *input, size_t inputByteLen, unsigned char suffix, unsigned char *output, size_t outputByteLen); \ - int prefix##_SpongeInitialize(prefix##_SpongeInstance *spongeInstance, unsigned int rate, unsigned int capacity); \ - int prefix##_SpongeAbsorb(prefix##_SpongeInstance *spongeInstance, const unsigned char *data, size_t dataByteLen); \ - int prefix##_SpongeAbsorbLastFewBits(prefix##_SpongeInstance *spongeInstance, unsigned char delimitedData); \ - int prefix##_SpongeSqueeze(prefix##_SpongeInstance *spongeInstance, unsigned char *data, size_t dataByteLen); - -#ifdef XKCP_has_KeccakP200 - #include "KeccakP-200-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth200, KeccakP200_stateSizeInBytes, KeccakP200_stateAlignment) - XKCP_DeclareSpongeFunctions(KeccakWidth200) - #define XKCP_has_Sponge_Keccak_width200 -#endif - -#ifdef XKCP_has_KeccakP400 - #include "KeccakP-400-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth400, KeccakP400_stateSizeInBytes, KeccakP400_stateAlignment) - XKCP_DeclareSpongeFunctions(KeccakWidth400) - #define XKCP_has_Sponge_Keccak_width400 -#endif - -#ifdef XKCP_has_KeccakP800 - #include "KeccakP-800-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth800, KeccakP800_stateSizeInBytes, KeccakP800_stateAlignment) - XKCP_DeclareSpongeFunctions(KeccakWidth800) - #define XKCP_has_Sponge_Keccak_width800 -#endif - -#ifdef XKCP_has_KeccakP1600 - #include "KeccakP-1600-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth1600, KeccakP1600_state) - XKCP_DeclareSpongeFunctions(KeccakWidth1600) - #define XKCP_has_Sponge_Keccak_width1600 -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/SimpleFIPS202.h b/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/SimpleFIPS202.h deleted file mode 100644 index ec4644030d547b5d70a134ff692ca2c184847d64..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/SimpleFIPS202.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Keccak, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. - -Implementation by Gilles Van Assche, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _SimpleFIPS202_h_ -#define _SimpleFIPS202_h_ - -#include "config.h" -#ifdef XKCP_has_KeccakP1600 - -#include <string.h> - -/** Implementation of the SHAKE128 extendable output function (XOF) [FIPS 202]. - * @param output Pointer to the output buffer. - * @param outputByteLen The desired number of output bytes. - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHAKE128(unsigned char *output, size_t outputByteLen, const unsigned char *input, size_t inputByteLen); - -/** Implementation of the SHAKE256 extendable output function (XOF) [FIPS 202]. - * @param output Pointer to the output buffer. - * @param outputByteLen The desired number of output bytes. - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHAKE256(unsigned char *output, size_t outputByteLen, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-224 [FIPS 202]. - * @param output Pointer to the output buffer (28 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_224(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-256 [FIPS 202]. - * @param output Pointer to the output buffer (32 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_256(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-384 [FIPS 202]. - * @param output Pointer to the output buffer (48 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_384(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-512 [FIPS 202]. - * @param output Pointer to the output buffer (64 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_512(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -#else -#error This requires an implementation of Keccak-p[1600] -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/align.h b/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/align.h deleted file mode 100644 index 82ad2f90516cd4e9975c641a5f284a8cb90c1bd6..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/align.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Implementation by Gilles Van Assche and Ronny Van Keer, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _align_h_ -#define _align_h_ - -/* on Mac OS-X and possibly others, ALIGN(x) is defined in param.h, and -Werror chokes on the redef. */ -#ifdef ALIGN -#undef ALIGN -#endif - -#if defined(__GNUC__) -#define ALIGN(x) __attribute__ ((aligned(x))) -#elif defined(_MSC_VER) -#define ALIGN(x) __declspec(align(x)) -#elif defined(__ARMCC_VERSION) -#define ALIGN(x) __align(x) -#else -#define ALIGN(x) -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/brg_endian.h b/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/brg_endian.h deleted file mode 100644 index 7c640b90ea64d1437ffdacda51de1725ac956911..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/brg_endian.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - --------------------------------------------------------------------------- - Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved. - - LICENSE TERMS - - The redistribution and use of this software (with or without changes) - is allowed without the payment of fees or royalties provided that: - - 1. source code distributions include the above copyright notice, this - list of conditions and the following disclaimer; - - 2. binary distributions include the above copyright notice, this list - of conditions and the following disclaimer in their documentation; - - 3. the name of the copyright holder is not used to endorse products - built using this software without specific written permission. - - DISCLAIMER - - This software is provided 'as is' with no explicit or implied warranties - in respect of its properties, including, but not limited to, correctness - and/or fitness for purpose. - --------------------------------------------------------------------------- - Issue Date: 20/12/2007 - Changes for ARM 9/9/2010 -*/ - -#ifndef _BRG_ENDIAN_H -#define _BRG_ENDIAN_H - -#define IS_BIG_ENDIAN 4321 /* byte 0 is most significant (mc68k) */ -#define IS_LITTLE_ENDIAN 1234 /* byte 0 is least significant (i386) */ - -#if 0 -/* Include files where endian defines and byteswap functions may reside */ -#if defined( __sun ) -# include <sys/isa_defs.h> -#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ ) -# include <sys/endian.h> -#elif defined( BSD ) && ( BSD >= 199103 ) || defined( __APPLE__ ) || \ - defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ ) -# include <machine/endian.h> -#elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ ) -# if !defined( __MINGW32__ ) && !defined( _AIX ) -# include <endian.h> -# if !defined( __BEOS__ ) -# include <byteswap.h> -# endif -# endif -#endif -#endif - -/* Now attempt to set the define for platform byte order using any */ -/* of the four forms SYMBOL, _SYMBOL, __SYMBOL & __SYMBOL__, which */ -/* seem to encompass most endian symbol definitions */ - -#if defined( BIG_ENDIAN ) && defined( LITTLE_ENDIAN ) -# if defined( BYTE_ORDER ) && BYTE_ORDER == BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( BYTE_ORDER ) && BYTE_ORDER == LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( _BIG_ENDIAN ) && defined( _LITTLE_ENDIAN ) -# if defined( _BYTE_ORDER ) && _BYTE_ORDER == _BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( _BYTE_ORDER ) && _BYTE_ORDER == _LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( _BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( _LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( __BIG_ENDIAN ) && defined( __LITTLE_ENDIAN ) -# if defined( __BYTE_ORDER ) && __BYTE_ORDER == __BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( __BYTE_ORDER ) && __BYTE_ORDER == __LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( __BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( __LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( __BIG_ENDIAN__ ) && defined( __LITTLE_ENDIAN__ ) -# if defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __BIG_ENDIAN__ -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __LITTLE_ENDIAN__ -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( __BIG_ENDIAN__ ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( __LITTLE_ENDIAN__ ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -/* if the platform byte order could not be determined, then try to */ -/* set this define using common machine defines */ -#if !defined(PLATFORM_BYTE_ORDER) - -#if defined( __alpha__ ) || defined( __alpha ) || defined( i386 ) || \ - defined( __i386__ ) || defined( _M_I86 ) || defined( _M_IX86 ) || \ - defined( __OS2__ ) || defined( sun386 ) || defined( __TURBOC__ ) || \ - defined( vax ) || defined( vms ) || defined( VMS ) || \ - defined( __VMS ) || defined( _M_X64 ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN - -#elif defined( AMIGA ) || defined( applec ) || defined( __AS400__ ) || \ - defined( _CRAY ) || defined( __hppa ) || defined( __hp9000 ) || \ - defined( ibm370 ) || defined( mc68000 ) || defined( m68k ) || \ - defined( __MRC__ ) || defined( __MVS__ ) || defined( __MWERKS__ ) || \ - defined( sparc ) || defined( __sparc) || defined( SYMANTEC_C ) || \ - defined( __VOS__ ) || defined( __TIGCC__ ) || defined( __TANDEM ) || \ - defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX ) || \ - defined( __s390__ ) || defined( __s390x__ ) || defined( __zarch__ ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN - -#elif defined(__arm__) -# ifdef __BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# else -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif 1 /* **** EDIT HERE IF NECESSARY **** */ -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#elif 0 /* **** EDIT HERE IF NECESSARY **** */ -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#else -# error Please edit lines 132 or 134 in brg_endian.h to set the platform byte order -#endif - -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/config.h b/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/config.h deleted file mode 100644 index 97f857dd1420d0fea1274907d8812af57bd1703d..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv7/libdap-XKCP-armv7-native.a.headers/config.h +++ /dev/null @@ -1,5 +0,0 @@ -/* File generated by ToTargetConfigFile.xsl */ - -#define XKCP_has_Sponge_Keccak -#define XKCP_has_FIPS202 -#define XKCP_has_KeccakP1600 diff --git a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a b/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a deleted file mode 100644 index 389e8e2ec767c25b8544f15d8d09ed059b00c574..0000000000000000000000000000000000000000 Binary files a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a and /dev/null differ diff --git a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/KeccakHash.h b/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/KeccakHash.h deleted file mode 100644 index e99d99dbc08abb18cac9438fc2f8107e3f41e774..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/KeccakHash.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Keccak, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. - -Implementation by the designers, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _KeccakHashInterface_h_ -#define _KeccakHashInterface_h_ - -#include "config.h" -#ifdef XKCP_has_KeccakP1600 - -#include <stdint.h> -#include <string.h> -#include "KeccakSponge.h" - -#ifndef _Keccak_BitTypes_ -#define _Keccak_BitTypes_ -typedef uint8_t BitSequence; - -typedef size_t BitLength; -#endif - -typedef enum { KECCAK_SUCCESS = 0, KECCAK_FAIL = 1, KECCAK_BAD_HASHLEN = 2 } HashReturn; - -typedef struct { - KeccakWidth1600_SpongeInstance sponge; - unsigned int fixedOutputLength; - unsigned char delimitedSuffix; -} Keccak_HashInstance; - -/** - * Function to initialize the Keccak[r, c] sponge function instance used in sequential hashing mode. - * @param hashInstance Pointer to the hash instance to be initialized. - * @param rate The value of the rate r. - * @param capacity The value of the capacity c. - * @param hashbitlen The desired number of output bits, - * or 0 for an arbitrarily-long output. - * @param delimitedSuffix Bits that will be automatically appended to the end - * of the input message, as in domain separation. - * This is a byte containing from 0 to 7 bits - * formatted like the @a delimitedData parameter of - * the Keccak_SpongeAbsorbLastFewBits() function. - * @pre One must have r+c=1600 and the rate a multiple of 8 bits in this implementation. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashInitialize(Keccak_HashInstance *hashInstance, unsigned int rate, unsigned int capacity, unsigned int hashbitlen, unsigned char delimitedSuffix); - -/** Macro to initialize a SHAKE128 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHAKE128(hashInstance) Keccak_HashInitialize(hashInstance, 1344, 256, 0, 0x1F) - -/** Macro to initialize a SHAKE256 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHAKE256(hashInstance) Keccak_HashInitialize(hashInstance, 1088, 512, 0, 0x1F) - -/** Macro to initialize a SHA3-224 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_224(hashInstance) Keccak_HashInitialize(hashInstance, 1152, 448, 224, 0x06) - -/** Macro to initialize a SHA3-256 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_256(hashInstance) Keccak_HashInitialize(hashInstance, 1088, 512, 256, 0x06) - -/** Macro to initialize a SHA3-384 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_384(hashInstance) Keccak_HashInitialize(hashInstance, 832, 768, 384, 0x06) - -/** Macro to initialize a SHA3-512 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_512(hashInstance) Keccak_HashInitialize(hashInstance, 576, 1024, 512, 0x06) - -/** - * Function to give input data to be absorbed. - * @param hashInstance Pointer to the hash instance initialized by Keccak_HashInitialize(). - * @param data Pointer to the input data. - * When @a databitLen is not a multiple of 8, the last bits of data must be - * in the least significant bits of the last byte (little-endian convention). - * In this case, the (8 - @a databitLen mod 8) most significant bits - * of the last byte are ignored. - * @param databitLen The number of input bits provided in the input data. - * @pre In the previous call to Keccak_HashUpdate(), databitlen was a multiple of 8. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashUpdate(Keccak_HashInstance *hashInstance, const BitSequence *data, BitLength databitlen); - -/** - * Function to call after all input blocks have been input and to get - * output bits if the length was specified when calling Keccak_HashInitialize(). - * @param hashInstance Pointer to the hash instance initialized by Keccak_HashInitialize(). - * If @a hashbitlen was not 0 in the call to Keccak_HashInitialize(), the number of - * output bits is equal to @a hashbitlen. - * If @a hashbitlen was 0 in the call to Keccak_HashInitialize(), the output bits - * must be extracted using the Keccak_HashSqueeze() function. - * @param hashval Pointer to the buffer where to store the output data. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashFinal(Keccak_HashInstance *hashInstance, BitSequence *hashval); - - /** - * Function to squeeze output data. - * @param hashInstance Pointer to the hash instance initialized by Keccak_HashInitialize(). - * @param data Pointer to the buffer where to store the output data. - * @param databitlen The number of output bits desired (must be a multiple of 8). - * @pre Keccak_HashFinal() must have been already called. - * @pre @a databitlen is a multiple of 8. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashSqueeze(Keccak_HashInstance *hashInstance, BitSequence *data, BitLength databitlen); - -#else -#error This requires an implementation of Keccak-p[1600] -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/KeccakP-1600-SnP.h b/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/KeccakP-1600-SnP.h deleted file mode 100644 index e22e17d9b99ca566eab9f8c68be036a0c8b392e1..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/KeccakP-1600-SnP.h +++ /dev/null @@ -1,39 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Implementation by Andre Moraes - ---- - -Please refer to SnP-documentation.h for more details. -*/ - -#ifndef _KeccakP_1600_SnP_h_ -#define _KeccakP_1600_SnP_h_ - -#include <stdint.h> -#include "align.h" - -typedef struct { - ALIGN(64) uint64_t A[25]; -} KeccakP1600_align512plain64_state; - -typedef KeccakP1600_align512plain64_state KeccakP1600_state; - -#define KeccakP1600_implementation "64-bit optimized ARMv8a assembler implementation" -#define KeccakP1600_stateAlignment 64 - -#define KeccakP1600_StaticInitialize() -void KeccakP1600_Initialize(KeccakP1600_align512plain64_state *state); -void KeccakP1600_AddByte(KeccakP1600_align512plain64_state *state, unsigned char data, unsigned int offset); -void KeccakP1600_AddBytes(KeccakP1600_align512plain64_state *state, const unsigned char *data, unsigned int offset, unsigned int length); -void KeccakP1600_OverwriteBytes(KeccakP1600_align512plain64_state *state, const unsigned char *data, unsigned int offset, unsigned int length); -void KeccakP1600_OverwriteWithZeroes(KeccakP1600_align512plain64_state *state, unsigned int byteCount); -void KeccakP1600_Permute_Nrounds(KeccakP1600_align512plain64_state *state, unsigned int nrounds); -void KeccakP1600_Permute_12rounds(KeccakP1600_align512plain64_state *state); -void KeccakP1600_Permute_24rounds(KeccakP1600_align512plain64_state *state); -void KeccakP1600_ExtractBytes(const KeccakP1600_align512plain64_state *state, unsigned char *data, unsigned int offset, unsigned int length); -void KeccakP1600_ExtractAndAddBytes(const KeccakP1600_align512plain64_state *state, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length); - -#endif diff --git a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/KeccakSponge.h b/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/KeccakSponge.h deleted file mode 100644 index 4d4d83f21ee1908e9869ace42b1105c91999cf29..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/KeccakSponge.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Keccak, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. - -Implementation by the designers, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _KeccakSponge_h_ -#define _KeccakSponge_h_ - -/* For the documentation, please follow the link: */ -/* #include "KeccakSponge-documentation.h" */ - -#include <string.h> -#include "align.h" -#include "config.h" - -#define XKCP_DeclareSpongeStructure(prefix, state_t) \ - typedef struct prefix##_SpongeInstanceStruct { \ - state_t state; \ - unsigned int rate; \ - unsigned int byteIOIndex; \ - int squeezing; \ - } prefix##_SpongeInstance; - -#define XKCP_DeclareSpongeFunctions(prefix) \ - int prefix##_Sponge(unsigned int rate, unsigned int capacity, const unsigned char *input, size_t inputByteLen, unsigned char suffix, unsigned char *output, size_t outputByteLen); \ - int prefix##_SpongeInitialize(prefix##_SpongeInstance *spongeInstance, unsigned int rate, unsigned int capacity); \ - int prefix##_SpongeAbsorb(prefix##_SpongeInstance *spongeInstance, const unsigned char *data, size_t dataByteLen); \ - int prefix##_SpongeAbsorbLastFewBits(prefix##_SpongeInstance *spongeInstance, unsigned char delimitedData); \ - int prefix##_SpongeSqueeze(prefix##_SpongeInstance *spongeInstance, unsigned char *data, size_t dataByteLen); - -#ifdef XKCP_has_KeccakP200 - #include "KeccakP-200-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth200, KeccakP200_stateSizeInBytes, KeccakP200_stateAlignment) - XKCP_DeclareSpongeFunctions(KeccakWidth200) - #define XKCP_has_Sponge_Keccak_width200 -#endif - -#ifdef XKCP_has_KeccakP400 - #include "KeccakP-400-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth400, KeccakP400_stateSizeInBytes, KeccakP400_stateAlignment) - XKCP_DeclareSpongeFunctions(KeccakWidth400) - #define XKCP_has_Sponge_Keccak_width400 -#endif - -#ifdef XKCP_has_KeccakP800 - #include "KeccakP-800-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth800, KeccakP800_stateSizeInBytes, KeccakP800_stateAlignment) - XKCP_DeclareSpongeFunctions(KeccakWidth800) - #define XKCP_has_Sponge_Keccak_width800 -#endif - -#ifdef XKCP_has_KeccakP1600 - #include "KeccakP-1600-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth1600, KeccakP1600_state) - XKCP_DeclareSpongeFunctions(KeccakWidth1600) - #define XKCP_has_Sponge_Keccak_width1600 -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/SimpleFIPS202.h b/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/SimpleFIPS202.h deleted file mode 100644 index ec4644030d547b5d70a134ff692ca2c184847d64..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/SimpleFIPS202.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Keccak, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. - -Implementation by Gilles Van Assche, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _SimpleFIPS202_h_ -#define _SimpleFIPS202_h_ - -#include "config.h" -#ifdef XKCP_has_KeccakP1600 - -#include <string.h> - -/** Implementation of the SHAKE128 extendable output function (XOF) [FIPS 202]. - * @param output Pointer to the output buffer. - * @param outputByteLen The desired number of output bytes. - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHAKE128(unsigned char *output, size_t outputByteLen, const unsigned char *input, size_t inputByteLen); - -/** Implementation of the SHAKE256 extendable output function (XOF) [FIPS 202]. - * @param output Pointer to the output buffer. - * @param outputByteLen The desired number of output bytes. - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHAKE256(unsigned char *output, size_t outputByteLen, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-224 [FIPS 202]. - * @param output Pointer to the output buffer (28 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_224(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-256 [FIPS 202]. - * @param output Pointer to the output buffer (32 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_256(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-384 [FIPS 202]. - * @param output Pointer to the output buffer (48 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_384(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-512 [FIPS 202]. - * @param output Pointer to the output buffer (64 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_512(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -#else -#error This requires an implementation of Keccak-p[1600] -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/align.h b/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/align.h deleted file mode 100644 index 82ad2f90516cd4e9975c641a5f284a8cb90c1bd6..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/align.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Implementation by Gilles Van Assche and Ronny Van Keer, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _align_h_ -#define _align_h_ - -/* on Mac OS-X and possibly others, ALIGN(x) is defined in param.h, and -Werror chokes on the redef. */ -#ifdef ALIGN -#undef ALIGN -#endif - -#if defined(__GNUC__) -#define ALIGN(x) __attribute__ ((aligned(x))) -#elif defined(_MSC_VER) -#define ALIGN(x) __declspec(align(x)) -#elif defined(__ARMCC_VERSION) -#define ALIGN(x) __align(x) -#else -#define ALIGN(x) -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/brg_endian.h b/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/brg_endian.h deleted file mode 100644 index 7c640b90ea64d1437ffdacda51de1725ac956911..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/brg_endian.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - --------------------------------------------------------------------------- - Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved. - - LICENSE TERMS - - The redistribution and use of this software (with or without changes) - is allowed without the payment of fees or royalties provided that: - - 1. source code distributions include the above copyright notice, this - list of conditions and the following disclaimer; - - 2. binary distributions include the above copyright notice, this list - of conditions and the following disclaimer in their documentation; - - 3. the name of the copyright holder is not used to endorse products - built using this software without specific written permission. - - DISCLAIMER - - This software is provided 'as is' with no explicit or implied warranties - in respect of its properties, including, but not limited to, correctness - and/or fitness for purpose. - --------------------------------------------------------------------------- - Issue Date: 20/12/2007 - Changes for ARM 9/9/2010 -*/ - -#ifndef _BRG_ENDIAN_H -#define _BRG_ENDIAN_H - -#define IS_BIG_ENDIAN 4321 /* byte 0 is most significant (mc68k) */ -#define IS_LITTLE_ENDIAN 1234 /* byte 0 is least significant (i386) */ - -#if 0 -/* Include files where endian defines and byteswap functions may reside */ -#if defined( __sun ) -# include <sys/isa_defs.h> -#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ ) -# include <sys/endian.h> -#elif defined( BSD ) && ( BSD >= 199103 ) || defined( __APPLE__ ) || \ - defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ ) -# include <machine/endian.h> -#elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ ) -# if !defined( __MINGW32__ ) && !defined( _AIX ) -# include <endian.h> -# if !defined( __BEOS__ ) -# include <byteswap.h> -# endif -# endif -#endif -#endif - -/* Now attempt to set the define for platform byte order using any */ -/* of the four forms SYMBOL, _SYMBOL, __SYMBOL & __SYMBOL__, which */ -/* seem to encompass most endian symbol definitions */ - -#if defined( BIG_ENDIAN ) && defined( LITTLE_ENDIAN ) -# if defined( BYTE_ORDER ) && BYTE_ORDER == BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( BYTE_ORDER ) && BYTE_ORDER == LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( _BIG_ENDIAN ) && defined( _LITTLE_ENDIAN ) -# if defined( _BYTE_ORDER ) && _BYTE_ORDER == _BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( _BYTE_ORDER ) && _BYTE_ORDER == _LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( _BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( _LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( __BIG_ENDIAN ) && defined( __LITTLE_ENDIAN ) -# if defined( __BYTE_ORDER ) && __BYTE_ORDER == __BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( __BYTE_ORDER ) && __BYTE_ORDER == __LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( __BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( __LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( __BIG_ENDIAN__ ) && defined( __LITTLE_ENDIAN__ ) -# if defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __BIG_ENDIAN__ -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __LITTLE_ENDIAN__ -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( __BIG_ENDIAN__ ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( __LITTLE_ENDIAN__ ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -/* if the platform byte order could not be determined, then try to */ -/* set this define using common machine defines */ -#if !defined(PLATFORM_BYTE_ORDER) - -#if defined( __alpha__ ) || defined( __alpha ) || defined( i386 ) || \ - defined( __i386__ ) || defined( _M_I86 ) || defined( _M_IX86 ) || \ - defined( __OS2__ ) || defined( sun386 ) || defined( __TURBOC__ ) || \ - defined( vax ) || defined( vms ) || defined( VMS ) || \ - defined( __VMS ) || defined( _M_X64 ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN - -#elif defined( AMIGA ) || defined( applec ) || defined( __AS400__ ) || \ - defined( _CRAY ) || defined( __hppa ) || defined( __hp9000 ) || \ - defined( ibm370 ) || defined( mc68000 ) || defined( m68k ) || \ - defined( __MRC__ ) || defined( __MVS__ ) || defined( __MWERKS__ ) || \ - defined( sparc ) || defined( __sparc) || defined( SYMANTEC_C ) || \ - defined( __VOS__ ) || defined( __TIGCC__ ) || defined( __TANDEM ) || \ - defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX ) || \ - defined( __s390__ ) || defined( __s390x__ ) || defined( __zarch__ ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN - -#elif defined(__arm__) -# ifdef __BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# else -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif 1 /* **** EDIT HERE IF NECESSARY **** */ -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#elif 0 /* **** EDIT HERE IF NECESSARY **** */ -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#else -# error Please edit lines 132 or 134 in brg_endian.h to set the platform byte order -#endif - -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/config.h b/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/config.h deleted file mode 100644 index 97f857dd1420d0fea1274907d8812af57bd1703d..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/armv8/libdap-XKCP-armv8-native.a.headers/config.h +++ /dev/null @@ -1,5 +0,0 @@ -/* File generated by ToTargetConfigFile.xsl */ - -#define XKCP_has_Sponge_Keccak -#define XKCP_has_FIPS202 -#define XKCP_has_KeccakP1600 diff --git a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a b/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a deleted file mode 100644 index 6b71810ab287c1dc1e920974e36f4f7b6bb8e240..0000000000000000000000000000000000000000 Binary files a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a and /dev/null differ diff --git a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/KeccakHash.h b/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/KeccakHash.h deleted file mode 100644 index e99d99dbc08abb18cac9438fc2f8107e3f41e774..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/KeccakHash.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Keccak, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. - -Implementation by the designers, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _KeccakHashInterface_h_ -#define _KeccakHashInterface_h_ - -#include "config.h" -#ifdef XKCP_has_KeccakP1600 - -#include <stdint.h> -#include <string.h> -#include "KeccakSponge.h" - -#ifndef _Keccak_BitTypes_ -#define _Keccak_BitTypes_ -typedef uint8_t BitSequence; - -typedef size_t BitLength; -#endif - -typedef enum { KECCAK_SUCCESS = 0, KECCAK_FAIL = 1, KECCAK_BAD_HASHLEN = 2 } HashReturn; - -typedef struct { - KeccakWidth1600_SpongeInstance sponge; - unsigned int fixedOutputLength; - unsigned char delimitedSuffix; -} Keccak_HashInstance; - -/** - * Function to initialize the Keccak[r, c] sponge function instance used in sequential hashing mode. - * @param hashInstance Pointer to the hash instance to be initialized. - * @param rate The value of the rate r. - * @param capacity The value of the capacity c. - * @param hashbitlen The desired number of output bits, - * or 0 for an arbitrarily-long output. - * @param delimitedSuffix Bits that will be automatically appended to the end - * of the input message, as in domain separation. - * This is a byte containing from 0 to 7 bits - * formatted like the @a delimitedData parameter of - * the Keccak_SpongeAbsorbLastFewBits() function. - * @pre One must have r+c=1600 and the rate a multiple of 8 bits in this implementation. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashInitialize(Keccak_HashInstance *hashInstance, unsigned int rate, unsigned int capacity, unsigned int hashbitlen, unsigned char delimitedSuffix); - -/** Macro to initialize a SHAKE128 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHAKE128(hashInstance) Keccak_HashInitialize(hashInstance, 1344, 256, 0, 0x1F) - -/** Macro to initialize a SHAKE256 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHAKE256(hashInstance) Keccak_HashInitialize(hashInstance, 1088, 512, 0, 0x1F) - -/** Macro to initialize a SHA3-224 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_224(hashInstance) Keccak_HashInitialize(hashInstance, 1152, 448, 224, 0x06) - -/** Macro to initialize a SHA3-256 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_256(hashInstance) Keccak_HashInitialize(hashInstance, 1088, 512, 256, 0x06) - -/** Macro to initialize a SHA3-384 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_384(hashInstance) Keccak_HashInitialize(hashInstance, 832, 768, 384, 0x06) - -/** Macro to initialize a SHA3-512 instance as specified in the FIPS 202 standard. - */ -#define Keccak_HashInitialize_SHA3_512(hashInstance) Keccak_HashInitialize(hashInstance, 576, 1024, 512, 0x06) - -/** - * Function to give input data to be absorbed. - * @param hashInstance Pointer to the hash instance initialized by Keccak_HashInitialize(). - * @param data Pointer to the input data. - * When @a databitLen is not a multiple of 8, the last bits of data must be - * in the least significant bits of the last byte (little-endian convention). - * In this case, the (8 - @a databitLen mod 8) most significant bits - * of the last byte are ignored. - * @param databitLen The number of input bits provided in the input data. - * @pre In the previous call to Keccak_HashUpdate(), databitlen was a multiple of 8. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashUpdate(Keccak_HashInstance *hashInstance, const BitSequence *data, BitLength databitlen); - -/** - * Function to call after all input blocks have been input and to get - * output bits if the length was specified when calling Keccak_HashInitialize(). - * @param hashInstance Pointer to the hash instance initialized by Keccak_HashInitialize(). - * If @a hashbitlen was not 0 in the call to Keccak_HashInitialize(), the number of - * output bits is equal to @a hashbitlen. - * If @a hashbitlen was 0 in the call to Keccak_HashInitialize(), the output bits - * must be extracted using the Keccak_HashSqueeze() function. - * @param hashval Pointer to the buffer where to store the output data. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashFinal(Keccak_HashInstance *hashInstance, BitSequence *hashval); - - /** - * Function to squeeze output data. - * @param hashInstance Pointer to the hash instance initialized by Keccak_HashInitialize(). - * @param data Pointer to the buffer where to store the output data. - * @param databitlen The number of output bits desired (must be a multiple of 8). - * @pre Keccak_HashFinal() must have been already called. - * @pre @a databitlen is a multiple of 8. - * @return KECCAK_SUCCESS if successful, KECCAK_FAIL otherwise. - */ -HashReturn Keccak_HashSqueeze(Keccak_HashInstance *hashInstance, BitSequence *data, BitLength databitlen); - -#else -#error This requires an implementation of Keccak-p[1600] -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/KeccakP-1600-SnP.h b/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/KeccakP-1600-SnP.h deleted file mode 100644 index 4274d07d28e0a62bdceb3533be44afb4067db2b2..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/KeccakP-1600-SnP.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -The Keccak-p permutations, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. - -Implementation by Ronny Van Keer, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ - ---- - -Please refer to SnP-documentation.h for more details. -*/ - -#ifndef _KeccakP_1600_SnP_h_ -#define _KeccakP_1600_SnP_h_ - -#include <stddef.h> -#include <stdint.h> - -#ifdef __MINGW32__ -#define FORCE_SYSV __attribute__((sysv_abi)) -#else -#define FORCE_SYSV -#endif - -typedef struct { - uint64_t Aba, Abe, Abi, Abo, Abu; - uint64_t Aka, Asa, Aga, Ama; - uint64_t Ame, Agi, Aso, Aku; - uint64_t Ake, Asi, Ago, Amu; - uint64_t Ase, Ami, Ako, Agu; - uint64_t Age, Aki, Amo, Asu; -} KeccakP1600_AVX2_state; - -typedef KeccakP1600_AVX2_state KeccakP1600_state; - -#define KeccakP1600_implementation "AVX2 optimized implementation" -#define KeccakF1600_FastLoop_supported -#define KeccakP1600_12rounds_FastLoop_supported - -#define KeccakP1600_StaticInitialize() -FORCE_SYSV void KeccakP1600_Initialize(KeccakP1600_AVX2_state *state); -FORCE_SYSV void KeccakP1600_AddByte(KeccakP1600_AVX2_state *state, unsigned char data, unsigned int offset); -FORCE_SYSV void KeccakP1600_AddBytes(KeccakP1600_AVX2_state *state, const unsigned char *data, unsigned int offset, unsigned int length); -FORCE_SYSV void KeccakP1600_OverwriteBytes(KeccakP1600_AVX2_state *state, const unsigned char *data, unsigned int offset, unsigned int length); -FORCE_SYSV void KeccakP1600_OverwriteWithZeroes(KeccakP1600_AVX2_state *state, unsigned int byteCount); -FORCE_SYSV void KeccakP1600_Permute_Nrounds(KeccakP1600_AVX2_state *state, unsigned int nrounds); -FORCE_SYSV void KeccakP1600_Permute_12rounds(KeccakP1600_AVX2_state *state); -FORCE_SYSV void KeccakP1600_Permute_24rounds(KeccakP1600_AVX2_state *state); -FORCE_SYSV void KeccakP1600_ExtractBytes(const KeccakP1600_AVX2_state *state, unsigned char *data, unsigned int offset, unsigned int length); -FORCE_SYSV void KeccakP1600_ExtractAndAddBytes(const KeccakP1600_AVX2_state *state, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length); -FORCE_SYSV size_t KeccakF1600_FastLoop_Absorb(KeccakP1600_AVX2_state *state, unsigned int laneCount, const unsigned char *data, size_t dataByteLen); -FORCE_SYSV size_t KeccakP1600_12rounds_FastLoop_Absorb(KeccakP1600_AVX2_state *state, unsigned int laneCount, const unsigned char *data, size_t dataByteLen); - -#endif diff --git a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/KeccakSponge.h b/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/KeccakSponge.h deleted file mode 100644 index 4d4d83f21ee1908e9869ace42b1105c91999cf29..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/KeccakSponge.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Keccak, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. - -Implementation by the designers, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _KeccakSponge_h_ -#define _KeccakSponge_h_ - -/* For the documentation, please follow the link: */ -/* #include "KeccakSponge-documentation.h" */ - -#include <string.h> -#include "align.h" -#include "config.h" - -#define XKCP_DeclareSpongeStructure(prefix, state_t) \ - typedef struct prefix##_SpongeInstanceStruct { \ - state_t state; \ - unsigned int rate; \ - unsigned int byteIOIndex; \ - int squeezing; \ - } prefix##_SpongeInstance; - -#define XKCP_DeclareSpongeFunctions(prefix) \ - int prefix##_Sponge(unsigned int rate, unsigned int capacity, const unsigned char *input, size_t inputByteLen, unsigned char suffix, unsigned char *output, size_t outputByteLen); \ - int prefix##_SpongeInitialize(prefix##_SpongeInstance *spongeInstance, unsigned int rate, unsigned int capacity); \ - int prefix##_SpongeAbsorb(prefix##_SpongeInstance *spongeInstance, const unsigned char *data, size_t dataByteLen); \ - int prefix##_SpongeAbsorbLastFewBits(prefix##_SpongeInstance *spongeInstance, unsigned char delimitedData); \ - int prefix##_SpongeSqueeze(prefix##_SpongeInstance *spongeInstance, unsigned char *data, size_t dataByteLen); - -#ifdef XKCP_has_KeccakP200 - #include "KeccakP-200-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth200, KeccakP200_stateSizeInBytes, KeccakP200_stateAlignment) - XKCP_DeclareSpongeFunctions(KeccakWidth200) - #define XKCP_has_Sponge_Keccak_width200 -#endif - -#ifdef XKCP_has_KeccakP400 - #include "KeccakP-400-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth400, KeccakP400_stateSizeInBytes, KeccakP400_stateAlignment) - XKCP_DeclareSpongeFunctions(KeccakWidth400) - #define XKCP_has_Sponge_Keccak_width400 -#endif - -#ifdef XKCP_has_KeccakP800 - #include "KeccakP-800-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth800, KeccakP800_stateSizeInBytes, KeccakP800_stateAlignment) - XKCP_DeclareSpongeFunctions(KeccakWidth800) - #define XKCP_has_Sponge_Keccak_width800 -#endif - -#ifdef XKCP_has_KeccakP1600 - #include "KeccakP-1600-SnP.h" - XKCP_DeclareSpongeStructure(KeccakWidth1600, KeccakP1600_state) - XKCP_DeclareSpongeFunctions(KeccakWidth1600) - #define XKCP_has_Sponge_Keccak_width1600 -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/SimpleFIPS202.h b/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/SimpleFIPS202.h deleted file mode 100644 index ec4644030d547b5d70a134ff692ca2c184847d64..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/SimpleFIPS202.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Keccak, designed by Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche. - -Implementation by Gilles Van Assche, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _SimpleFIPS202_h_ -#define _SimpleFIPS202_h_ - -#include "config.h" -#ifdef XKCP_has_KeccakP1600 - -#include <string.h> - -/** Implementation of the SHAKE128 extendable output function (XOF) [FIPS 202]. - * @param output Pointer to the output buffer. - * @param outputByteLen The desired number of output bytes. - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHAKE128(unsigned char *output, size_t outputByteLen, const unsigned char *input, size_t inputByteLen); - -/** Implementation of the SHAKE256 extendable output function (XOF) [FIPS 202]. - * @param output Pointer to the output buffer. - * @param outputByteLen The desired number of output bytes. - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHAKE256(unsigned char *output, size_t outputByteLen, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-224 [FIPS 202]. - * @param output Pointer to the output buffer (28 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_224(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-256 [FIPS 202]. - * @param output Pointer to the output buffer (32 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_256(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-384 [FIPS 202]. - * @param output Pointer to the output buffer (48 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_384(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -/** Implementation of SHA3-512 [FIPS 202]. - * @param output Pointer to the output buffer (64 bytes). - * @param input Pointer to the input message. - * @param inputByteLen The length of the input message in bytes. - * @return 0 if successful, 1 otherwise. - */ -int SHA3_512(unsigned char *output, const unsigned char *input, size_t inputByteLen); - -#else -#error This requires an implementation of Keccak-p[1600] -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/align.h b/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/align.h deleted file mode 100644 index 82ad2f90516cd4e9975c641a5f284a8cb90c1bd6..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/align.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -The eXtended Keccak Code Package (XKCP) -https://github.com/XKCP/XKCP - -Implementation by Gilles Van Assche and Ronny Van Keer, hereby denoted as "the implementer". - -For more information, feedback or questions, please refer to the Keccak Team website: -https://keccak.team/ - -To the extent possible under law, the implementer has waived all copyright -and related or neighboring rights to the source code in this file. -http://creativecommons.org/publicdomain/zero/1.0/ -*/ - -#ifndef _align_h_ -#define _align_h_ - -/* on Mac OS-X and possibly others, ALIGN(x) is defined in param.h, and -Werror chokes on the redef. */ -#ifdef ALIGN -#undef ALIGN -#endif - -#if defined(__GNUC__) -#define ALIGN(x) __attribute__ ((aligned(x))) -#elif defined(_MSC_VER) -#define ALIGN(x) __declspec(align(x)) -#elif defined(__ARMCC_VERSION) -#define ALIGN(x) __align(x) -#else -#define ALIGN(x) -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/brg_endian.h b/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/brg_endian.h deleted file mode 100644 index 7c640b90ea64d1437ffdacda51de1725ac956911..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/brg_endian.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - --------------------------------------------------------------------------- - Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved. - - LICENSE TERMS - - The redistribution and use of this software (with or without changes) - is allowed without the payment of fees or royalties provided that: - - 1. source code distributions include the above copyright notice, this - list of conditions and the following disclaimer; - - 2. binary distributions include the above copyright notice, this list - of conditions and the following disclaimer in their documentation; - - 3. the name of the copyright holder is not used to endorse products - built using this software without specific written permission. - - DISCLAIMER - - This software is provided 'as is' with no explicit or implied warranties - in respect of its properties, including, but not limited to, correctness - and/or fitness for purpose. - --------------------------------------------------------------------------- - Issue Date: 20/12/2007 - Changes for ARM 9/9/2010 -*/ - -#ifndef _BRG_ENDIAN_H -#define _BRG_ENDIAN_H - -#define IS_BIG_ENDIAN 4321 /* byte 0 is most significant (mc68k) */ -#define IS_LITTLE_ENDIAN 1234 /* byte 0 is least significant (i386) */ - -#if 0 -/* Include files where endian defines and byteswap functions may reside */ -#if defined( __sun ) -# include <sys/isa_defs.h> -#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ ) -# include <sys/endian.h> -#elif defined( BSD ) && ( BSD >= 199103 ) || defined( __APPLE__ ) || \ - defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ ) -# include <machine/endian.h> -#elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ ) -# if !defined( __MINGW32__ ) && !defined( _AIX ) -# include <endian.h> -# if !defined( __BEOS__ ) -# include <byteswap.h> -# endif -# endif -#endif -#endif - -/* Now attempt to set the define for platform byte order using any */ -/* of the four forms SYMBOL, _SYMBOL, __SYMBOL & __SYMBOL__, which */ -/* seem to encompass most endian symbol definitions */ - -#if defined( BIG_ENDIAN ) && defined( LITTLE_ENDIAN ) -# if defined( BYTE_ORDER ) && BYTE_ORDER == BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( BYTE_ORDER ) && BYTE_ORDER == LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( _BIG_ENDIAN ) && defined( _LITTLE_ENDIAN ) -# if defined( _BYTE_ORDER ) && _BYTE_ORDER == _BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( _BYTE_ORDER ) && _BYTE_ORDER == _LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( _BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( _LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( __BIG_ENDIAN ) && defined( __LITTLE_ENDIAN ) -# if defined( __BYTE_ORDER ) && __BYTE_ORDER == __BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( __BYTE_ORDER ) && __BYTE_ORDER == __LITTLE_ENDIAN -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( __BIG_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( __LITTLE_ENDIAN ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -#if defined( __BIG_ENDIAN__ ) && defined( __LITTLE_ENDIAN__ ) -# if defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __BIG_ENDIAN__ -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# elif defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __LITTLE_ENDIAN__ -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif defined( __BIG_ENDIAN__ ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#elif defined( __LITTLE_ENDIAN__ ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#endif - -/* if the platform byte order could not be determined, then try to */ -/* set this define using common machine defines */ -#if !defined(PLATFORM_BYTE_ORDER) - -#if defined( __alpha__ ) || defined( __alpha ) || defined( i386 ) || \ - defined( __i386__ ) || defined( _M_I86 ) || defined( _M_IX86 ) || \ - defined( __OS2__ ) || defined( sun386 ) || defined( __TURBOC__ ) || \ - defined( vax ) || defined( vms ) || defined( VMS ) || \ - defined( __VMS ) || defined( _M_X64 ) -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN - -#elif defined( AMIGA ) || defined( applec ) || defined( __AS400__ ) || \ - defined( _CRAY ) || defined( __hppa ) || defined( __hp9000 ) || \ - defined( ibm370 ) || defined( mc68000 ) || defined( m68k ) || \ - defined( __MRC__ ) || defined( __MVS__ ) || defined( __MWERKS__ ) || \ - defined( sparc ) || defined( __sparc) || defined( SYMANTEC_C ) || \ - defined( __VOS__ ) || defined( __TIGCC__ ) || defined( __TANDEM ) || \ - defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX ) || \ - defined( __s390__ ) || defined( __s390x__ ) || defined( __zarch__ ) -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN - -#elif defined(__arm__) -# ifdef __BIG_ENDIAN -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -# else -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -# endif -#elif 1 /* **** EDIT HERE IF NECESSARY **** */ -# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN -#elif 0 /* **** EDIT HERE IF NECESSARY **** */ -# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN -#else -# error Please edit lines 132 or 134 in brg_endian.h to set the platform byte order -#endif - -#endif - -#endif diff --git a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/config.h b/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/config.h deleted file mode 100644 index 97f857dd1420d0fea1274907d8812af57bd1703d..0000000000000000000000000000000000000000 --- a/crypto/XKCP/prebuilds/x86_64/libdap-XKCP-x8664-native.a.headers/config.h +++ /dev/null @@ -1,5 +0,0 @@ -/* File generated by ToTargetConfigFile.xsl */ - -#define XKCP_has_Sponge_Keccak -#define XKCP_has_FIPS202 -#define XKCP_has_KeccakP1600