LibSWIFFT  1.2.0
Macros | Functions
swifft.inl File Reference

LibSWIFFT internal C code expansion. More...

#include <stddef.h>
#include <string.h>
#include "libswifft/swifft_iset.inl"
#include "swifft_ops.inl"
Include dependency graph for swifft.inl:

Macros

#define SWIFFT_BLOCKS_PARALLELIZATION_THRESHOLD   8
 

Functions

LIBSWIFFT_BEGIN_EXTERN_C void SWIFFT_ISET_NAME() 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_ISET_NAME() 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...
 
void SWIFFT_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() SWIFFT_CompactMultiple_ (int nblocks, const BitSequence *output, BitSequence *compact)
 Compacts a hash value of SWIFFT for multiple blocks. The result is not composable with other compacted hash values. More...
 
void SWIFFT_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() 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_ISET_NAME() SWIFFT_SetMultiple_ (int nblocks, BitSequence *output, const BitSequence *operand)
 Sets a SWIFFT hash value to another, element-wise, for multiple blocks. More...
 
void SWIFFT_ISET_NAME() SWIFFT_AddMultiple_ (int nblocks, BitSequence *output, const BitSequence *operand)
 Adds a SWIFFT hash value to another, element-wise, for multiple blocks. More...
 
void SWIFFT_ISET_NAME() SWIFFT_SubMultiple_ (int nblocks, BitSequence *output, const BitSequence *operand)
 Subtracts a SWIFFT hash value from another, element-wise, for multiple blocks. More...
 
void SWIFFT_ISET_NAME() SWIFFT_MulMultiple_ (int nblocks, BitSequence *output, const BitSequence *operand)
 Multiplies a SWIFFT hash value from another, element-wise, for multiple blocks. More...
 
void SWIFFT_ISET_NAME() 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_ISET_NAME() 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...
 

Detailed Description

LibSWIFFT internal C code expansion.

Macro Definition Documentation

◆ SWIFFT_BLOCKS_PARALLELIZATION_THRESHOLD

#define SWIFFT_BLOCKS_PARALLELIZATION_THRESHOLD   8

Function Documentation

◆ SWIFFT_Add_()

void SWIFFT_ISET_NAME() SWIFFT_Add_ ( BitSequence  output[SWIFFT_OUTPUT_BLOCK_SIZE],
const BitSequence  operand[SWIFFT_OUTPUT_BLOCK_SIZE] 
)

Adds a SWIFFT hash value to another, element-wise.

Parameters
[in,out]outputthe hash value of SWIFFT to modify.
[in]operandthe hash value to add.

◆ SWIFFT_AddMultiple_()

void SWIFFT_ISET_NAME() SWIFFT_AddMultiple_ ( int  nblocks,
BitSequence output,
const BitSequence operand 
)

Adds a SWIFFT hash value to another, element-wise, for multiple blocks.

Parameters
[in]nblocksthe number of blocks to operate on.
[in,out]outputthe hash value of SWIFFT to modify, per block..
[in]operandthe hash value to add, per block.

◆ SWIFFT_CompactMultiple_()

void SWIFFT_ISET_NAME() SWIFFT_CompactMultiple_ ( int  nblocks,
const BitSequence output,
BitSequence compact 
)

Compacts a hash value of SWIFFT for multiple blocks. The result is not composable with other compacted hash values.

Parameters
[in]nblocksthe number of blocks to operate on.
[in]outputthe hash value of SWIFFT, of size 128 bytes (1024 bit) per block.
[out]compactthe compacted hash value of SWIFFT, of size 64 bytes (512 bit) per block.

◆ SWIFFT_Compute_()

void SWIFFT_ISET_NAME() 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.

Parameters
[in]inputthe input of 256 bytes (2048 bit).
[out]outputthe resulting hash value of SWIFFT, of size 128 bytes (1024 bit).

◆ SWIFFT_ComputeMultiple_()

void SWIFFT_ISET_NAME() SWIFFT_ComputeMultiple_ ( int  nblocks,
const BitSequence input,
BitSequence output 
)

Computes the result of multiple SWIFFT operations. The result is composable with other hash values.

Parameters
[in]nblocksthe number of blocks to operate on.
[in]inputthe blocks of input, each of 256 bytes (2048 bit).
[out]outputthe resulting blocks of hash values of SWIFFT, each of size 128 bytes (1024 bit).

◆ SWIFFT_ComputeMultipleSigned_()

void SWIFFT_ISET_NAME() 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.

Parameters
[in]nblocksthe number of blocks to operate on.
[in]inputthe blocks of input, each of 256 bytes (2048 bit).
[in]signthe blocks of sign bits corresponding to blocks of input of 256 bytes (2048 bit).
[out]outputthe resulting blocks of hash values of SWIFFT, each of size 128 bytes (1024 bit).

◆ SWIFFT_ComputeSigned_()

void SWIFFT_ISET_NAME() 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.

Parameters
[in]inputthe input of 256 bytes (2048 bit).
[in]signthe sign bits corresponding to the input of 256 bytes (2048 bit).
[out]outputthe resulting hash value of SWIFFT, of size 128 bytes (1024 bit).

◆ SWIFFT_ConstAdd_()

void SWIFFT_ISET_NAME() SWIFFT_ConstAdd_ ( BitSequence  output[SWIFFT_OUTPUT_BLOCK_SIZE],
const int16_t  operand 
)

Adds a constant value to each SWIFFT hash value element.

Parameters
[in,out]outputthe hash value of SWIFFT to modify.
[in]operandthe constant value to add.

◆ SWIFFT_ConstAddMultiple_()

void SWIFFT_ISET_NAME() SWIFFT_ConstAddMultiple_ ( int  nblocks,
BitSequence output,
const int16_t *  operand 
)

Adds a constant value to each SWIFFT hash value element for multiple blocks.

Parameters
[in]nblocksthe number of blocks to operate on.
[in,out]outputthe hash value of SWIFFT to modify, per block.
[in]operandthe constant value to add, per block.

◆ SWIFFT_ConstMul_()

void SWIFFT_ISET_NAME() SWIFFT_ConstMul_ ( BitSequence  output[SWIFFT_OUTPUT_BLOCK_SIZE],
const int16_t  operand 
)

Multiply a constant value into each SWIFFT hash value element.

Parameters
[in,out]outputthe hash value of SWIFFT to modify.
[in]operandthe constant value to multiply by.

◆ SWIFFT_ConstMulMultiple_()

void SWIFFT_ISET_NAME() SWIFFT_ConstMulMultiple_ ( int  nblocks,
BitSequence output,
const int16_t *  operand 
)

Multiply a constant value into each SWIFFT hash value element for multiple blocks.

Parameters
[in]nblocksthe number of blocks to operate on.
[in,out]outputthe hash value of SWIFFT to modify, per block..
[in]operandthe constant value to multiply by, per block.

◆ SWIFFT_ConstSet_()

void SWIFFT_ISET_NAME() SWIFFT_ConstSet_ ( BitSequence  output[SWIFFT_OUTPUT_BLOCK_SIZE],
const int16_t  operand 
)

Sets a constant value at each SWIFFT hash value element.

Parameters
[out]outputthe hash value of SWIFFT to modify.
[in]operandthe constant value to set.

◆ SWIFFT_ConstSetMultiple_()

void SWIFFT_ISET_NAME() SWIFFT_ConstSetMultiple_ ( int  nblocks,
BitSequence output,
const int16_t *  operand 
)

Sets a constant value at each SWIFFT hash value element for multiple blocks.

Parameters
[in]nblocksthe number of blocks to operate on.
[out]outputthe hash value of SWIFFT to modify, per block.
[in]operandthe constant value to set, per block.

◆ SWIFFT_ConstSub_()

void SWIFFT_ISET_NAME() SWIFFT_ConstSub_ ( BitSequence  output[SWIFFT_OUTPUT_BLOCK_SIZE],
const int16_t  operand 
)

Subtracts a constant value from each SWIFFT hash value element.

Parameters
[in,out]outputthe hash value of SWIFFT to modify.
[in]operandthe constant value to subtract.

◆ SWIFFT_ConstSubMultiple_()

void SWIFFT_ISET_NAME() SWIFFT_ConstSubMultiple_ ( int  nblocks,
BitSequence output,
const int16_t *  operand 
)

Subtracts a constant value from each SWIFFT hash value element for multiple blocks.

Parameters
[in]nblocksthe number of blocks to operate on.
[in,out]outputthe hash value of SWIFFT to modify, per block..
[in]operandthe constant value to subtract, per block.

◆ SWIFFT_fft_()

LIBSWIFFT_BEGIN_EXTERN_C void SWIFFT_ISET_NAME() 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.

Parameters
[in]inputthe blocks of input, each of 256 bytes (2048 bits).
[in]signthe blocks of sign bits corresponding to blocks of input of 256 bytes (2048 bits).
[in]mnumber of 8-elements in the input.
[out]fftoutthe blocks of FFT-output elements, totaling SWIFFT_N*m.

◆ SWIFFT_fftMultiple_()

void SWIFFT_ISET_NAME() 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.

Parameters
[in]nblocksthe number of blocks to operate on.
[in]inputthe blocks of input, each of 256 bytes (2048 bits).
[in]signthe blocks of sign bits corresponding to blocks of input of 256 bytes (2048 bits).
[in]mnumber of 8-elements in the input.
[out]fftoutthe blocks of FFT-output elements, totaling nblocks*N*m.

◆ SWIFFT_fftsum_()

void SWIFFT_ISET_NAME() 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.

Parameters
[in]ikeythe SWIFFT key.
[in]ifftoutthe blocks of FFT-output elements, totaling N*m
[in]mnumber of 8-elements in the input.
[out]ioutthe blocks of output elements, each of 64 double-bytes (1024 bits).

◆ SWIFFT_fftsumMultiple_()

void SWIFFT_ISET_NAME() 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.

Parameters
[in]nblocksthe number of blocks to operate on.
[in]ikeythe SWIFFT key.
[in]ifftoutthe blocks of FFT-output elements, totaling N*m
[in]mnumber of 8-elements in the input.
[out]ioutthe blocks of output elements, each of 64 double-bytes (1024 bits).

◆ SWIFFT_Mul_()

void SWIFFT_ISET_NAME() SWIFFT_Mul_ ( BitSequence  output[SWIFFT_OUTPUT_BLOCK_SIZE],
const BitSequence  operand[SWIFFT_OUTPUT_BLOCK_SIZE] 
)

Multiplies a SWIFFT hash value from another, element-wise.

Parameters
[in,out]outputthe hash value of SWIFFT to modify.
[in]operandthe hash value to multiply by.

◆ SWIFFT_MulMultiple_()

void SWIFFT_ISET_NAME() SWIFFT_MulMultiple_ ( int  nblocks,
BitSequence output,
const BitSequence operand 
)

Multiplies a SWIFFT hash value from another, element-wise, for multiple blocks.

Parameters
[in]nblocksthe number of blocks to operate on.
[in,out]outputthe hash value of SWIFFT to modify, per block..
[in]operandthe hash value to multiply by, per block.

◆ SWIFFT_Set_()

void SWIFFT_ISET_NAME() SWIFFT_Set_ ( BitSequence  output[SWIFFT_OUTPUT_BLOCK_SIZE],
const BitSequence  operand[SWIFFT_OUTPUT_BLOCK_SIZE] 
)

Sets a SWIFFT hash value to another, element-wise.

Parameters
[in,out]outputthe hash value of SWIFFT to modify.
[in]operandthe hash value to set to.

◆ SWIFFT_SetMultiple_()

void SWIFFT_ISET_NAME() SWIFFT_SetMultiple_ ( int  nblocks,
BitSequence output,
const BitSequence operand 
)

Sets a SWIFFT hash value to another, element-wise, for multiple blocks.

Parameters
[in]nblocksthe number of blocks to operate on.
[in,out]outputthe hash value of SWIFFT to modify, per block..
[in]operandthe hash value to set to, per block.

◆ SWIFFT_Sub_()

void SWIFFT_ISET_NAME() SWIFFT_Sub_ ( BitSequence  output[SWIFFT_OUTPUT_BLOCK_SIZE],
const BitSequence  operand[SWIFFT_OUTPUT_BLOCK_SIZE] 
)

Subtracts a SWIFFT hash value from another, element-wise.

Parameters
[in,out]outputthe hash value of SWIFFT to modify.
[in]operandthe hash value to subtract.

◆ SWIFFT_SubMultiple_()

void SWIFFT_ISET_NAME() SWIFFT_SubMultiple_ ( int  nblocks,
BitSequence output,
const BitSequence operand 
)

Subtracts a SWIFFT hash value from another, element-wise, for multiple blocks.

Parameters
[in]nblocksthe number of blocks to operate on.
[in,out]outputthe hash value of SWIFFT to modify, per block..
[in]operandthe hash value to subtract, per block.