|
LibSWIFFT
1.2.0
|
LibSWIFFT public C implementation. More...
#include "libswifft/swifft.h"#include "libswifft/swifft_avx.h"#include "libswifft/swifft_avx2.h"#include "libswifft/swifft_avx512.h"#include "swifft_ops.inl"
Macros | |
| #define | SWIFFT_ISET() SWIFFT_INSTRUCTION_SET |
| #define | SWIFFT_OUTPUT_Z1_SIZE (SWIFFT_N / SWIFFT_W) |
| #define | SWIFFT_COMPACT_TRANSPOSE_SIZE 8 |
Functions | |
| void | SWIFFT_fft (const BitSequence *LIBSWIFFT_RESTRICT input, const BitSequence *LIBSWIFFT_RESTRICT sign, int m, int16_t *LIBSWIFFT_RESTRICT fftout) |
| Computes the FFT phase of SWIFFT. More... | |
| void | SWIFFT_fftsum (const int16_t *LIBSWIFFT_RESTRICT ikey, const int16_t *LIBSWIFFT_RESTRICT ifftout, int m, int16_t *LIBSWIFFT_RESTRICT iout) |
| Computes the FFT-sum phase of SWIFFT. More... | |
| LIBSWIFFT_STATIC_ASSERT (8 *SWIFFT_W==SWIFFT_N, SWIFFT_N_must_be_8_times_SWIFFT_W) | |
| void | SWIFFT_Compact (const BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE], BitSequence compact[SWIFFT_COMPACT_BLOCK_SIZE]) |
| Compacts a hash value of SWIFFT. The result is not composable with other compacted hash values. More... | |
| void | SWIFFT_ConstSet (BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE], const int16_t operand) |
| Sets a constant value at each SWIFFT hash value element. More... | |
| void | SWIFFT_ConstAdd (BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE], const int16_t operand) |
| Adds a constant value to each SWIFFT hash value element. More... | |
| void | SWIFFT_ConstSub (BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE], const int16_t operand) |
| Subtracts a constant value from each SWIFFT hash value element. More... | |
| void | SWIFFT_ConstMul (BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE], const int16_t operand) |
| Multiply a constant value into each SWIFFT hash value element. More... | |
| void | SWIFFT_Set (BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE], const BitSequence operand[SWIFFT_OUTPUT_BLOCK_SIZE]) |
| Sets a SWIFFT hash value to another, element-wise. More... | |
| void | SWIFFT_Add (BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE], const BitSequence operand[SWIFFT_OUTPUT_BLOCK_SIZE]) |
| Adds a SWIFFT hash value to another, element-wise. More... | |
| void | SWIFFT_Sub (BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE], const BitSequence operand[SWIFFT_OUTPUT_BLOCK_SIZE]) |
| Subtracts a SWIFFT hash value from another, element-wise. More... | |
| void | SWIFFT_Mul (BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE], const BitSequence operand[SWIFFT_OUTPUT_BLOCK_SIZE]) |
| Multiplies a SWIFFT hash value from another, element-wise. More... | |
| void | SWIFFT_Compute (const BitSequence input[SWIFFT_INPUT_BLOCK_SIZE], BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE]) |
| Computes the result of a SWIFFT operation. The result is composable with other hash values. More... | |
| void | SWIFFT_ComputeSigned (const BitSequence input[SWIFFT_INPUT_BLOCK_SIZE], const BitSequence sign[SWIFFT_INPUT_BLOCK_SIZE], BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE]) |
| Computes the result of a SWIFFT operation. The result is composable with other hash values. More... | |
| void | SWIFFT_fftMultiple (int nblocks, const BitSequence *LIBSWIFFT_RESTRICT input, const BitSequence *LIBSWIFFT_RESTRICT sign, int m, int16_t *LIBSWIFFT_RESTRICT fftout) |
| Computes the FFT phase of SWIFFT for multiple blocks. More... | |
| void | SWIFFT_fftsumMultiple (int nblocks, const int16_t *LIBSWIFFT_RESTRICT ikey, const int16_t *LIBSWIFFT_RESTRICT ifftout, int m, int16_t *LIBSWIFFT_RESTRICT iout) |
| Computes the FFT-sum phase of SWIFFT for multiple blocks. More... | |
| void | SWIFFT_CompactMultiple (int nblocks, const BitSequence output[SWIFFT_OUTPUT_BLOCK_SIZE], BitSequence compact[SWIFFT_COMPACT_BLOCK_SIZE]) |
| Compacts a hash value of SWIFFT for multiple blocks. The result is not composable with other compacted hash values. More... | |
| void | SWIFFT_ConstSetMultiple (int nblocks, BitSequence *output, const int16_t *operand) |
| Sets a constant value at each SWIFFT hash value element for multiple blocks. More... | |
| void | SWIFFT_ConstAddMultiple (int nblocks, BitSequence *output, const int16_t *operand) |
| Adds a constant value to each SWIFFT hash value element for multiple blocks. More... | |
| void | SWIFFT_ConstSubMultiple (int nblocks, BitSequence *output, const int16_t *operand) |
| Subtracts a constant value from each SWIFFT hash value element for multiple blocks. More... | |
| void | SWIFFT_ConstMulMultiple (int nblocks, BitSequence *output, const int16_t *operand) |
| Multiply a constant value into each SWIFFT hash value element for multiple blocks. More... | |
| void | SWIFFT_SetMultiple (int nblocks, BitSequence *output, const BitSequence *operand) |
| Sets a SWIFFT hash value to another, element-wise, for multiple blocks. More... | |
| void | SWIFFT_AddMultiple (int nblocks, BitSequence *output, const BitSequence *operand) |
| Adds a SWIFFT hash value to another, element-wise, for multiple blocks. More... | |
| void | SWIFFT_SubMultiple (int nblocks, BitSequence *output, const BitSequence *operand) |
| Subtracts a SWIFFT hash value from another, element-wise, for multiple blocks. More... | |
| void | SWIFFT_MulMultiple (int nblocks, BitSequence *output, const BitSequence *operand) |
| Multiplies a SWIFFT hash value from another, element-wise, for multiple blocks. More... | |
| void | SWIFFT_ComputeMultiple (int nblocks, const BitSequence *input, BitSequence *output) |
| Computes the result of multiple SWIFFT operations. The result is composable with other hash values. More... | |
| void | SWIFFT_ComputeMultipleSigned (int nblocks, const BitSequence *input, const BitSequence *sign, BitSequence *output) |
| Computes the result of multiple SWIFFT operations. The result is composable with other hash values. More... | |
Variables | |
| LIBSWIFFT_BEGIN_EXTERN_C SWIFFT_ALIGN const BitSequence | SWIFFT_sign0 [SWIFFT_INPUT_BLOCK_SIZE] = {0} |
LibSWIFFT public C implementation.
Implementation using the best instruction set available at build time.
| #define SWIFFT_COMPACT_TRANSPOSE_SIZE 8 |
| #define SWIFFT_ISET | ( | ) | SWIFFT_INSTRUCTION_SET |
| LIBSWIFFT_STATIC_ASSERT | ( | 8 * | SWIFFT_W = =SWIFFT_N, |
| SWIFFT_N_must_be_8_times_SWIFFT_W | |||
| ) |
| void SWIFFT_Add | ( | BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE], |
| const BitSequence | operand[SWIFFT_OUTPUT_BLOCK_SIZE] | ||
| ) |
Adds a SWIFFT hash value to another, element-wise.
| [in,out] | output | the hash value of SWIFFT to modify. |
| [in] | operand | the hash value to add. |
| void SWIFFT_AddMultiple | ( | int | nblocks, |
| BitSequence * | output, | ||
| const BitSequence * | operand | ||
| ) |
Adds a SWIFFT hash value to another, element-wise, for multiple blocks.
| [in] | nblocks | the number of blocks to operate on. |
| [in,out] | output | the hash value of SWIFFT to modify, per block. |
| [in] | operand | the hash value to add, per block. |
| void SWIFFT_Compact | ( | const BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE], |
| BitSequence | compact[SWIFFT_COMPACT_BLOCK_SIZE] | ||
| ) |
Compacts a hash value of SWIFFT. The result is not composable with other compacted hash values.
| [in] | output | the hash value of SWIFFT, of size 128 bytes (1024 bit). |
| [out] | compact | the compacted hash value of SWIFFT, of size 64 bytes (512 bit). |
| void SWIFFT_CompactMultiple | ( | int | nblocks, |
| const BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE], | ||
| BitSequence | compact[SWIFFT_COMPACT_BLOCK_SIZE] | ||
| ) |
Compacts a hash value of SWIFFT for multiple blocks. The result is not composable with other compacted hash values.
| [in] | nblocks | the number of blocks to operate on. |
| [in] | output | the hash value of SWIFFT, of size 128 bytes (1024 bit). |
| [out] | compact | the compacted hash value of SWIFFT, of size 64 bytes (512 bit). |
| void SWIFFT_Compute | ( | const BitSequence | input[SWIFFT_INPUT_BLOCK_SIZE], |
| BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE] | ||
| ) |
Computes the result of a SWIFFT operation. The result is composable with other hash values.
| [in] | input | the input of 256 bytes (2048 bit). |
| [out] | output | the resulting hash value of SWIFFT, of size 128 bytes (1024 bit). |
| void SWIFFT_ComputeMultiple | ( | int | nblocks, |
| const BitSequence * | input, | ||
| BitSequence * | output | ||
| ) |
Computes the result of multiple SWIFFT operations. The result is composable with other hash values.
| [in] | nblocks | the number of blocks to operate on. |
| [in] | input | the blocks of input, each of 256 bytes (2048 bit). |
| [out] | output | the resulting blocks of hash values of SWIFFT, each of size 128 bytes (1024 bit). |
| void SWIFFT_ComputeMultipleSigned | ( | int | nblocks, |
| const BitSequence * | input, | ||
| const BitSequence * | sign, | ||
| BitSequence * | output | ||
| ) |
Computes the result of multiple SWIFFT operations. The result is composable with other hash values.
| [in] | nblocks | the number of blocks to operate on. |
| [in] | input | the blocks of input, each of 256 bytes (2048 bit). |
| [in] | sign | the blocks of sign bits corresponding to blocks of input of 256 bytes (2048 bit). |
| [out] | output | the resulting blocks of hash values of SWIFFT, each of size 128 bytes (1024 bit). |
| void SWIFFT_ComputeSigned | ( | const BitSequence | input[SWIFFT_INPUT_BLOCK_SIZE], |
| const BitSequence | sign[SWIFFT_INPUT_BLOCK_SIZE], | ||
| BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE] | ||
| ) |
Computes the result of a SWIFFT operation. The result is composable with other hash values.
| [in] | input | the input of 256 bytes (2048 bit). |
| [in] | sign | the sign bits corresponding to the input of 256 bytes (2048 bit). |
| [out] | output | the resulting hash value of SWIFFT, of size 128 bytes (1024 bit). |
| void SWIFFT_ConstAdd | ( | BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE], |
| const int16_t | operand | ||
| ) |
Adds a constant value to each SWIFFT hash value element.
| [in,out] | output | the hash value of SWIFFT to modify. |
| [in] | operand | the constant value to add. |
| void SWIFFT_ConstAddMultiple | ( | int | nblocks, |
| BitSequence * | output, | ||
| const int16_t * | operand | ||
| ) |
Adds a constant value to each SWIFFT hash value element for multiple blocks.
| [in] | nblocks | the number of blocks to operate on. |
| [in,out] | output | the hash value of SWIFFT to modify, per block. |
| [in] | operand | the constant value to add, per block. |
| void SWIFFT_ConstMul | ( | BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE], |
| const int16_t | operand | ||
| ) |
Multiply a constant value into each SWIFFT hash value element.
| [in,out] | output | the hash value of SWIFFT to modify. |
| [in] | operand | the constant value to multiply by. |
| void SWIFFT_ConstMulMultiple | ( | int | nblocks, |
| BitSequence * | output, | ||
| const int16_t * | operand | ||
| ) |
Multiply a constant value into each SWIFFT hash value element for multiple blocks.
| [in] | nblocks | the number of blocks to operate on. |
| [in,out] | output | the hash value of SWIFFT to modify, per block. |
| [in] | operand | the constant value to multiply by, per block. |
| void SWIFFT_ConstSet | ( | BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE], |
| const int16_t | operand | ||
| ) |
Sets a constant value at each SWIFFT hash value element.
| [out] | output | the hash value of SWIFFT to modify. |
| [in] | operand | the constant value to set. |
| void SWIFFT_ConstSetMultiple | ( | int | nblocks, |
| BitSequence * | output, | ||
| const int16_t * | operand | ||
| ) |
Sets a constant value at each SWIFFT hash value element for multiple blocks.
| [in] | nblocks | the number of blocks to operate on. |
| [out] | output | the hash value of SWIFFT to modify, per block. |
| [in] | operand | the constant value to set, per block. |
| void SWIFFT_ConstSub | ( | BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE], |
| const int16_t | operand | ||
| ) |
Subtracts a constant value from each SWIFFT hash value element.
| [in,out] | output | the hash value of SWIFFT to modify. |
| [in] | operand | the constant value to subtract. |
| void SWIFFT_ConstSubMultiple | ( | int | nblocks, |
| BitSequence * | output, | ||
| const int16_t * | operand | ||
| ) |
Subtracts a constant value from each SWIFFT hash value element for multiple blocks.
| [in] | nblocks | the number of blocks to operate on. |
| [in,out] | output | the hash value of SWIFFT to modify, per block. |
| [in] | operand | the constant value to subtract, per block. |
| void SWIFFT_fft | ( | const BitSequence *LIBSWIFFT_RESTRICT | input, |
| const BitSequence *LIBSWIFFT_RESTRICT | sign, | ||
| int | m, | ||
| int16_t *LIBSWIFFT_RESTRICT | fftout | ||
| ) |
Computes the FFT phase of SWIFFT.
| [in] | input | the blocks of input, each of 256 bytes (2048 bits). |
| [in] | sign | the blocks of sign bits corresponding to blocks of input of 256 bytes (2048 bits). |
| [in] | m | number of 8-elements in the input. |
| [out] | fftout | the blocks of FFT-output elements, totaling N*m. |
| void SWIFFT_fftMultiple | ( | int | nblocks, |
| const BitSequence *LIBSWIFFT_RESTRICT | input, | ||
| const BitSequence *LIBSWIFFT_RESTRICT | sign, | ||
| int | m, | ||
| int16_t *LIBSWIFFT_RESTRICT | fftout | ||
| ) |
Computes the FFT phase of SWIFFT for multiple blocks.
| [in] | nblocks | the number of blocks to operate on. |
| [in] | input | the blocks of input, each of 256 bytes (2048 bits). |
| [in] | sign | the blocks of sign bits corresponding to blocks of input of 256 bytes (2048 bits). |
| [in] | m | number of 8-elements in the input. |
| [out] | fftout | the blocks of FFT-output elements, totaling N*m. |
| void SWIFFT_fftsum | ( | const int16_t *LIBSWIFFT_RESTRICT | ikey, |
| const int16_t *LIBSWIFFT_RESTRICT | ifftout, | ||
| int | m, | ||
| int16_t *LIBSWIFFT_RESTRICT | iout | ||
| ) |
Computes the FFT-sum phase of SWIFFT.
| [in] | ikey | the SWIFFT key. |
| [in] | ifftout | the blocks of FFT-output elements, totaling N*m |
| [in] | m | number of 8-elements in the input. |
| [out] | iout | the blocks of output elements, each of 64 double-bytes (1024 bits). |
| void SWIFFT_fftsumMultiple | ( | int | nblocks, |
| const int16_t *LIBSWIFFT_RESTRICT | ikey, | ||
| const int16_t *LIBSWIFFT_RESTRICT | ifftout, | ||
| int | m, | ||
| int16_t *LIBSWIFFT_RESTRICT | iout | ||
| ) |
Computes the FFT-sum phase of SWIFFT for multiple blocks.
| [in] | nblocks | the number of blocks to operate on. |
| [in] | ikey | the SWIFFT key. |
| [in] | ifftout | the blocks of FFT-output elements, totaling N*m |
| [in] | m | number of 8-elements in the input. |
| [out] | iout | the blocks of output elements, each of 64 double-bytes (1024 bits). |
| void SWIFFT_Mul | ( | BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE], |
| const BitSequence | operand[SWIFFT_OUTPUT_BLOCK_SIZE] | ||
| ) |
Multiplies a SWIFFT hash value from another, element-wise.
| [in,out] | output | the hash value of SWIFFT to modify. |
| [in] | operand | the hash value to multiply by. |
| void SWIFFT_MulMultiple | ( | int | nblocks, |
| BitSequence * | output, | ||
| const BitSequence * | operand | ||
| ) |
Multiplies a SWIFFT hash value from another, element-wise, for multiple blocks.
| [in] | nblocks | the number of blocks to operate on. |
| [in,out] | output | the hash value of SWIFFT to modify, per block. |
| [in] | operand | the hash value to multiply by, per block. |
| void SWIFFT_Set | ( | BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE], |
| const BitSequence | operand[SWIFFT_OUTPUT_BLOCK_SIZE] | ||
| ) |
Sets a SWIFFT hash value to another, element-wise.
| [in,out] | output | the hash value of SWIFFT to modify. |
| [in] | operand | the hash value to set to. |
| void SWIFFT_SetMultiple | ( | int | nblocks, |
| BitSequence * | output, | ||
| const BitSequence * | operand | ||
| ) |
Sets a SWIFFT hash value to another, element-wise, for multiple blocks.
| [in] | nblocks | the number of blocks to operate on. |
| [in,out] | output | the hash value of SWIFFT to modify, per block. |
| [in] | operand | the hash value to set to, per block. |
| void SWIFFT_Sub | ( | BitSequence | output[SWIFFT_OUTPUT_BLOCK_SIZE], |
| const BitSequence | operand[SWIFFT_OUTPUT_BLOCK_SIZE] | ||
| ) |
Subtracts a SWIFFT hash value from another, element-wise.
| [in,out] | output | the hash value of SWIFFT to modify. |
| [in] | operand | the hash value to subtract. |
| void SWIFFT_SubMultiple | ( | int | nblocks, |
| BitSequence * | output, | ||
| const BitSequence * | operand | ||
| ) |
Subtracts a SWIFFT hash value from another, element-wise, for multiple blocks.
| [in] | nblocks | the number of blocks to operate on. |
| [in,out] | output | the hash value of SWIFFT to modify, per block. |
| [in] | operand | the hash value to subtract, per block. |
| LIBSWIFFT_BEGIN_EXTERN_C SWIFFT_ALIGN const BitSequence SWIFFT_sign0[SWIFFT_INPUT_BLOCK_SIZE] = {0} |
1.8.13