Crate xkcp_sys

Source
Expand description

§xkcp-sys

Native bindings to the eXtended Keccak Code Package (XKCP) library.

Re-exports§

pub use self::KCP_Phases as KangarooTwelve_Phases;

Structs§

KMAC_Instance
KangarooTwelve_Instance
KeccakP1600_plain64_state
KeccakWidth1600_DuplexInstanceStruct
KeccakWidth1600_SpongeInstanceStruct
KeccakWidth1600_SpongePRG_InstanceStruct
Keccak_HashInstance
Kravatte_Instance
Kravatte_SANE_Instance
Kravatte_SANSE_Instance
ParallelHash_Instance
TupleElement
TupleHash_Instance
TurboSHAKE_SpongeInstanceStruct
Xoodoo_plain32_state
For the documentation, see SnP-documentation.h.
Xoodyak_CyclistInstanceStruct
cSHAKE_Instance

Enums§

HashReturn
KCP_Phases
Kravatte_Phases

Constants§

Cyclist_ModeHash
Cyclist_ModeKeyed
Cyclist_PhaseDown
Cyclist_PhaseUp
IS_BIG_ENDIAN
IS_LITTLE_ENDIAN
KRAVATTE_FLAG_INIT
KRAVATTE_FLAG_LAST_PART
KRAVATTE_FLAG_NONE
KRAVATTE_FLAG_SHORT
KeccakP1600_implementation
KeccakP1600_implementation_config
KravatteAlignment
KravatteMaxParallellism
Kravatte_RollcOffset
Kravatte_RollcSizeInBytes
Kravatte_RolleOffset
Kravatte_RolleSizeInBytes
Kravatte_SANE_TagLength
Kravatte_SANE_l
Kravatte_SANSE_TagLength
Kravatte_WBCAE_t
Kravatte_WBC_b
Kravatte_WBC_l
MAXROUNDS
NCOLUMS
NLANES
NROWS
PLATFORM_BYTE_ORDER
SnP_widthInBytes
Xoodoo_implementation
Xoodyak_Rhash
Xoodyak_Rkin
Xoodyak_Rkout
Xoodyak_f_bPrime
Xoodyak_lRatchet
_rc1
_rc2
_rc3
_rc4
_rc5
_rc6
_rc7
_rc8
_rc9
_rc10
_rc11
_rc12

Functions§

KMAC128
KMAC128 function, as defined in NIST’s Special Publication 800-185, published December 2016. @param key Pointer to the key (K). @param keyBitLen The length of the key in bits. @param input Pointer to the input message (X). @param inputBitLen The length of the input message in bits. Only full bytes are supported, length must be a multiple of 8. @param output Pointer to the output buffer. @param outputBitLen The desired number of output bits (L). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
KMAC256
KMAC256 function, as defined in NIST’s Special Publication 800-185, published December 2016. @param key Pointer to the key (K). @param keyBitLen The length of the key in bits. @param input Pointer to the input message (X). @param inputBitLen The length of the input message in bits. Only full bytes are supported, length must be a multiple of 8. @param output Pointer to the output buffer. @param outputBitLen The desired number of output bits (L). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
KMAC128_Final
Function to call after all input data have been input and to get output bits if the length was specified when calling KMAC128_Initialize(). @param kmInstance Pointer to the instance initialized by KMAC128_Initialize(). If @a outputBitLen was not 0 in the call to KMAC128_Initialize(), the number of output bits is equal to @a outputBitLen. If @a outputBitLen was 0 in the call to KMAC128_Initialize(), the output bits must be extracted using the KMAC128_Squeeze() function. @param output Pointer to the buffer where to store the output data. @return 0 if successful, 1 otherwise.
KMAC128_Initialize
Function to initialize the KMAC128 instance used in sequential MACing mode. @param kmInstance Pointer to the instance to be initialized. @param key Pointer to the key (K). @param keyBitLen The length of the key in bits. @param outputBitLen The desired number of output bits (L). or 0 for an arbitrarily-long output (XOF). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
KMAC128_Squeeze
Function to squeeze output data. @param kmInstance Pointer to the instance initialized by KMAC128_Initialize(). @param output Pointer to the buffer where to store the output data. @param outputBitLen The number of output bits desired. Only the last squeeze call can output a partial byte, other calls must have a length multiple of 8. @pre KMAC128_Final() must have been already called. @return 0 if successful, 1 otherwise.
KMAC128_Update
Function to give input data to be MACed. @param kmInstance Pointer to the instance initialized by KMAC128_Initialize(). @param input Pointer to the input data. @param inputBitLen The number of input bits provided in the input data. Only full bytes are supported, length must be a multiple of 8. @return 0 if successful, 1 otherwise.
KMAC256_Final
Function to call after all input data have been input and to get output bits if the length was specified when calling KMAC256_Initialize(). @param kmInstance Pointer to the instance initialized by KMAC256_Initialize(). If @a outputBitLen was not 0 in the call to KMAC256_Initialize(), the number of output bits is equal to @a outputBitLen. If @a outputBitLen was 0 in the call to KMAC256_Initialize(), the output bits must be extracted using the KMAC256_Squeeze() function. @param output Pointer to the buffer where to store the output data. @return 0 if successful, 1 otherwise.
KMAC256_Initialize
Function to initialize the KMAC256 instance used in sequential MACing mode. @param kmInstance Pointer to the instance to be initialized. @param key Pointer to the key (K). @param keyBitLen The length of the key in bits. @param outputBitLen The desired number of output bits (L). or 0 for an arbitrarily-long output (XOF). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
KMAC256_Squeeze
Function to squeeze output data. @param kmInstance Pointer to the instance initialized by KMAC256_Initialize(). @param output Pointer to the buffer where to store the output data. @param outputBitLen The number of output bits desired. Only the last squeeze call can output a partial byte, other calls must have a length multiple of 8. @pre KMAC256_Final() must have been already called. @return 0 if successful, 1 otherwise.
KMAC256_Update
Function to give input data to be MACed. @param kmInstance Pointer to the instance initialized by KMAC256_Initialize(). @param input Pointer to the input data. @param inputBitLen The number of input bits provided in the input data. Only full bytes are supported, length must be a multiple of 8. @return 0 if successful, 1 otherwise.
KT128
Wrapper around KangarooTwelve to use the 128-bit security level.
KT256
Wrapper around KangarooTwelve to use the 256-bit security level.
KangarooTwelve
Extendable ouput function KangarooTwelve. @param securityLevel 128 for KT128 or 256 for KT256 @param input Pointer to the input message (M). @param inputByteLen The length of the input message in bytes. @param output Pointer to the output buffer. @param outputByteLen The desired number of output bytes. @param customization Pointer to the customization string (C). @param customByteLen The length of the customization string in bytes. @return 0 if successful, 1 otherwise.
KangarooTwelve_Final
Function to call after all the input message has been input, and to get output bytes if the length was specified when calling KangarooTwelve_Initialize(). @param ktInstance Pointer to the hash instance initialized by KangarooTwelve_Initialize(). If @a outputByteLen was not 0 in the call to KangarooTwelve_Initialize(), the number of output bytes is equal to @a outputByteLen. If @a outputByteLen was 0 in the call to KangarooTwelve_Initialize(), the output bytes must be extracted using the KangarooTwelve_Squeeze() function. @param output Pointer to the buffer where to store the output data. @param customization Pointer to the customization string (C). @param customByteLen The length of the customization string in bytes. @return 0 if successful, 1 otherwise.
KangarooTwelve_Initialize
Function to initialize a KangarooTwelve instance. @param ktInstance Pointer to the instance to be initialized. @param securityLevel 128 for KT128 or 256 for KT256 @param outputByteLen The desired number of output bytes, or 0 for an arbitrarily-long output. @return 0 if successful, 1 otherwise.
KangarooTwelve_Squeeze
Function to squeeze output data. @param ktInstance Pointer to the hash instance initialized by KangarooTwelve_Initialize(). @param data Pointer to the buffer where to store the output data. @param outputByteLen The number of output bytes desired. @pre KangarooTwelve_Final() must have been already called. @return 0 if successful, 1 otherwise.
KangarooTwelve_Update
Function to give input data to be absorbed. @param ktInstance Pointer to the instance initialized by KangarooTwelve_Initialize(). @param input Pointer to the input message data (M). @param inputByteLen The number of bytes provided in the input message data. @return 0 if successful, 1 otherwise.
KeccakF1600_FastLoop_Absorb
KeccakP1600_12rounds_FastLoop_Absorb
KeccakP1600_AddBytes
KeccakP1600_ExtractAndAddBytes
KeccakP1600_ExtractBytes
KeccakP1600_Initialize
KeccakP1600_OverwriteBytes
KeccakP1600_OverwriteWithZeroes
KeccakP1600_Permute_12rounds
KeccakP1600_Permute_24rounds
KeccakP1600_Permute_Nrounds
KeccakWidth1600_DuplexInitialize
KeccakWidth1600_Duplexing
KeccakWidth1600_DuplexingFeedPartialInput
KeccakWidth1600_DuplexingFeedZeroes
KeccakWidth1600_DuplexingGetFurtherOutput
KeccakWidth1600_DuplexingGetFurtherOutputAndAdd
KeccakWidth1600_DuplexingOverwritePartialInput
KeccakWidth1600_DuplexingOverwriteWithZeroes
KeccakWidth1600_Sponge
KeccakWidth1600_SpongeAbsorb
KeccakWidth1600_SpongeAbsorbLastFewBits
KeccakWidth1600_SpongeInitialize
KeccakWidth1600_SpongePRG_Feed
KeccakWidth1600_SpongePRG_Fetch
KeccakWidth1600_SpongePRG_Forget
KeccakWidth1600_SpongePRG_Initialize
KeccakWidth1600_SpongeSqueeze
Keccak_HashFinal
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.
Keccak_HashInitialize
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.
Keccak_HashSqueeze
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.
Keccak_HashUpdate
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.
Kra
Function to give input data to be compressed. @param kvInstance Pointer to the instance initialized by Kravatte_MaskDerivation(). @param input Pointer to the input message data (M). @param inputBitLen The number of bits provided in the input message data. This must be a multiple of 8 if KRAVATTE_FLAG_LAST_PART flag not set. @param flags Bitwise or combination of KRAVATTE_FLAG_NONE, KRAVATTE_FLAG_INIT, KRAVATTE_FLAG_LAST_PART. @return 0 if successful, 1 otherwise.
Kravatte
Function to compress input data and expand output data. @param kvInstance Pointer to the instance initialized by Kravatte_MaskDerivation(). @param input Pointer to the input message (M). @param inputBitLen The number of bits provided in the input message data. @param output Pointer to the output buffer. @param outputBitLen The number of output bits desired. @param flags Bitwise or combination of KRAVATTE_FLAG_NONE, KRAVATTE_FLAG_INIT, KRAVATTE_FLAG_SHORT, KRAVATTE_FLAG_LAST_PART. KRAVATTE_FLAG_LAST_PART is internally forced to true for input and output. @return 0 if successful, 1 otherwise.
Kravatte_MaskDerivation
Function to initialize a Kravatte instance with given key. @param kvInstance Pointer to the instance to be initialized. @param Key Pointer to the key (K). @param KeyBitLen The length of the key in bits. @return 0 if successful, 1 otherwise.
Kravatte_SANE_Initialize
Function to initialize a Kravatte SANE instance with given key and nonce. @param kvInstance Pointer to the instance to be initialized. @param Key Pointer to the key (K). @param KeyBitLen The length of the key in bits. @param Nonce Pointer to the nonce (N). @param NonceBitLen The length of the nonce in bits. @param tag The buffer where to store the tag. This buffer must be minimum Kravatte_SANE_TagLength bytes long. @return 0 if successful, 1 otherwise.
Kravatte_SANE_Unwrap
Function to unwrap ciphertext into plaintext. @param kvInstance Pointer to the instance initialized by Kravatte_SANE_Initialize(). @param ciphertext Pointer to ciphertext data to unwrap. @param plaintext Pointer to buffer where the full unwrapped data will be stored. The plaintext buffer must not overlap ciphertext. @param dataBitLen The size of the ciphertext/plaintext data. @param AD Pointer to the Associated Data. @param ADBitLen The number of bytes provided in the Associated Data. @param tag The buffer where to read the tag to check (when lastFlag is set). This buffer must be minimum Kravatte_SANE_TagLength bytes long. @return 0 if successful, 1 otherwise.
Kravatte_SANE_Wrap
Function to wrap plaintext into ciphertext. @param kvInstance Pointer to the instance initialized by Kravatte_SANE_Initialize(). @param plaintext Pointer to plaintext data to wrap. @param ciphertext Pointer to buffer where the full wrapped data will be stored. The ciphertext buffer must not overlap plaintext. @param dataBitLen The size of the plaintext/ciphertext data. @param AD Pointer to the Associated Data. @param ADBitLen The number of bytes provided in the Associated Data. @param tag The buffer where to store the tag. This buffer must be minimum Kravatte_SANE_TagLength bytes long. @return 0 if successful, 1 otherwise.
Kravatte_SANSE_Initialize
Function to initialize a Kravatte SANSE instance with given key and nonce. @param kvInstance Pointer to the instance to be initialized. @param Key Pointer to the key (K). @param KeyBitLen The length of the key in bits. @return 0 if successful, 1 otherwise.
Kravatte_SANSE_Unwrap
Function to unwrap ciphertext into plaintext. @param kvInstance Pointer to the instance initialized by Kravatte_SANSE_Initialize(). @param ciphertext Pointer to ciphertext data to unwrap. @param plaintext Pointer to buffer where the full unwrapped data will be stored. The plaintext buffer must not overlap ciphertext. @param dataBitLen The size of the ciphertext/plaintext data. @param AD Pointer to the Associated Data. @param ADBitLen The number of bytes provided in the Associated Data. @param tag The buffer where to read the tag to check (when lastFlag is set). This buffer must be minimum Kravatte_SANSE_TagLength bytes long. @return 0 if successful, 1 otherwise.
Kravatte_SANSE_Wrap
Function to wrap plaintext into ciphertext. @param kvInstance Pointer to the instance initialized by Kravatte_SANSE_Initialize(). @param plaintext Pointer to plaintext data to wrap. @param ciphertext Pointer to buffer where the full wrapped data will be stored. The ciphertext buffer must not overlap plaintext. @param dataBitLen The size of the plaintext/ciphertext data. @param AD Pointer to the Associated Data. @param ADBitLen The number of bytes provided in the Associated Data. @param tag The buffer where to store the tag. This buffer must be minimum Kravatte_SANSE_TagLength bytes long. @return 0 if successful, 1 otherwise.
Kravatte_WBCAE_Decipher
Function to decipher ciphertext into plaintext. @param kvInstance Pointer to the instance initialized by Kravatte_WBC_Initialize(). @param ciphertext Pointer to ciphertext data to decipher. Ciphertext is ::Kravatte_WBCAE_t bits longer than plaintext. @param plaintext Pointer to buffer where the deciphered data will be stored. The plaintext buffer must not overlap ciphertext. @param dataBitLen The size in bits of the plaintext data. Ciphertext and plaintext buffers must be ::Kravatte_WBCAE_t bits longer than dataBitLen. @param AD Pointer to the metadata AD. @param ADBitLen The number of bits provided in the metadata. @return 0 if successful, 1 otherwise.
Kravatte_WBCAE_Encipher
Function to encipher plaintext into ciphertext. @param kvInstance Pointer to the instance initialized by Kravatte_WBC_Initialize(). @param plaintext Pointer to plaintext data to encipher. The last ::Kravatte_WBCAE_t bits of the buffer will be overwritten with zeros. @param ciphertext Pointer to buffer where the enciphered data will be stored. The ciphertext buffer must not overlap plaintext. Ciphertext will be ::Kravatte_WBCAE_t bits longer than plaintext. @param dataBitLen The size in bits of the plaintext data. Plaintext and ciphertext buffers must be ::Kravatte_WBCAE_t bits longer than dataBitLen. @param AD Pointer to the metadata AD. @param ADBitLen The number of bits provided in the metadata. @return 0 if successful, 1 otherwise.
Kravatte_WBC_Decipher
Function to decipher ciphertext into plaintext. @param kvInstance Pointer to the instance initialized by Kravatte_WBC_Initialize(). @param ciphertext Pointer to ciphertext data to decipher. @param plaintext Pointer to buffer where the deciphered data will be stored. The plaintext buffer must not overlap ciphertext. @param dataBitLen The size in bits of the plaintext/ciphertext data. @param W Pointer to the tweak W. @param WBitLen The number of bits provided in the tweak. @return 0 if successful, 1 otherwise.
Kravatte_WBC_Encipher
Function to encipher plaintext into ciphertext. @param kvInstance Pointer to the instance initialized by Kravatte_WBC_Initialize(). @param plaintext Pointer to plaintext data to encipher. @param ciphertext Pointer to buffer where the enciphered data will be stored. The ciphertext buffer must not overlap plaintext. @param dataBitLen The size in bits of the plaintext/ciphertext data. @param W Pointer to the tweak W. @param WBitLen The number of bits provided in the tweak. @return 0 if successful, 1 otherwise.
ParallelHash128
Parallel hash function ParallelHash128, as defined in NIST’s Special Publication 800-185, published December 2016. @param input Pointer to the input message (X). @param inputBitLen The number of input bits provided in the input data. Only full bytes are supported, length must be a multiple of 8. @param blockByteLen Block size (B) in bytes, must be a power of 2. The minimum value is 8 in this implementation. @param output Pointer to the output buffer. @param outputBitLen The desired number of output bits (L). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
ParallelHash256
Parallel hash function ParallelHash256, as defined in NIST’s Special Publication 800-185, published December 2016. @param input Pointer to the input message (X). @param inputBitLen The number of input bits provided in the input data. Only full bytes are supported, length must be a multiple of 8. @param blockByteLen Block size (B) in bytes, must be a power of 2. The minimum value is 8 in this implementation. @param output Pointer to the output buffer. @param outputBitLen The desired number of output bits (L). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
ParallelHash128_Final
Function to call after all input blocks have been input and to get output bits if the length was specified when calling ParallelHash128_Initialize(). @param ParallelHashInstance Pointer to the hash instance initialized by ParallelHash128_Initialize(). If @a outputBitLen was not 0 in the call to ParallelHash128_Initialize(), the number of output bits is equal to @a outputBitLen. If @a outputBitLen was 0 in the call to ParallelHash128_Initialize(), the output bits must be extracted using the ParallelHash128_Squeeze() function. @param output Pointer to the buffer where to store the output data. @return 0 if successful, 1 otherwise.
ParallelHash128_Initialize
Function to initialize the parallel hash function ParallelHash128 instance used in sequential hashing mode. @param ParallelHashInstance Pointer to the hash instance to be initialized. @param blockByteLen Block size (B) in bytes, must be a power of 2. The minimum value is 8 in this implementation. @param outputBitLen The desired number of output bits (L). or 0 for an arbitrarily-long output (XOF). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
ParallelHash128_Squeeze
Function to squeeze output data. @param ParallelHashInstance Pointer to the hash instance initialized by ParallelHash128_Initialize(). @param output Pointer to the buffer where to store the output data. @param outputBitLen The number of output bits desired. Only the last squeeze call can output a partial byte, other calls must have a length multiple of 8. @pre ParallelHash128_Final() must have been already called. @return 0 if successful, 1 otherwise.
ParallelHash128_Update
Function to give input data to be absorbed. @param ParallelHashInstance Pointer to the hash instance initialized by ParallelHash128_Initialize(). @param input Pointer to the input data (X). @param inputBitLen The number of input bits provided in the input data. Only full bytes are supported, length must be a multiple of 8. @return 0 if successful, 1 otherwise.
ParallelHash256_Final
Function to call after all input blocks have been input and to get output bits if the length was specified when calling ParallelHash256_Initialize(). @param ParallelHashInstance Pointer to the hash instance initialized by ParallelHash256_Initialize(). If @a outputBitLen was not 0 in the call to ParallelHash256_Initialize(), the number of output bits is equal to @a outputBitLen. If @a outputBitLen was 0 in the call to ParallelHash256_Initialize(), the output bits must be extracted using the ParallelHash256_Squeeze() function. @param output Pointer to the buffer where to store the output data. @return 0 if successful, 1 otherwise.
ParallelHash256_Initialize
Function to initialize the parallel hash function ParallelHash256 instance used in sequential hashing mode. @param ParallelHashInstance Pointer to the hash instance to be initialized. @param blockByteLen Block size (B) in bytes, must be a power of 2. The minimum value is 8 in this implementation. @param outputBitLen The desired number of output bits (L). or 0 for an arbitrarily-long output (XOF). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
ParallelHash256_Squeeze
Function to squeeze output data. @param ParallelHashInstance Pointer to the hash instance initialized by ParallelHash256_Initialize(). @param output Pointer to the buffer where to store the output data. @param outputBitLen The number of output bits desired. Only the last squeeze call can output a partial byte, other calls must have a length multiple of 8. @pre ParallelHash256_Final() must have been already called. @return 0 if successful, 1 otherwise.
ParallelHash256_Update
Function to give input data to be absorbed. @param ParallelHashInstance Pointer to the hash instance initialized by ParallelHash256_Initialize(). @param input Pointer to the input data (X). @param inputBitLen The number of input bits provided in the input data. Only full bytes are supported, length must be a multiple of 8. @return 0 if successful, 1 otherwise.
SHA3_224
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.
SHA3_256
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.
SHA3_384
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.
SHA3_512
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.
SHAKE128
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.
SHAKE256
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.
TupleHash128
Tuple hash function TupleHash128, as defined in NIST’s Special Publication 800-185, published December 2016. @param tuple Pointer to an array of tuple elements (X). @param numberOfElements The number of tuple elements provided in the input data. @param output Pointer to the output buffer. @param outputBitLen The desired number of output bits (L). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
TupleHash256
Tuple hash function TupleHash256, as defined in NIST’s Special Publication 800-185, published December 2016. @param tuple Pointer to an array of tuple elements (X). @param numberOfElements The number of tuple elements provided in the input data. @param output Pointer to the output buffer. @param outputBitLen The desired number of output bits (L). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
TupleHash128_Final
Function to call after all input blocks have been input and to get output bits if the length was specified when calling TupleHash128_Initialize(). @param TupleHashInstance Pointer to the hash instance initialized by TupleHash128_Initialize(). If @a outputBitLen was not 0 in the call to TupleHash128_Initialize(), the number of output bits is equal to @a outputBitLen. If @a outputBitLen was 0 in the call to TupleHash128_Initialize(), the output bits must be extracted using the TupleHash128_Squeeze() function. @param output Pointer to the buffer where to store the output data. @return 0 if successful, 1 otherwise.
TupleHash128_Initialize
Function to initialize the Tuple hash function TupleHash128 instance used in sequential hashing mode. @param TupleHashInstance Pointer to the hash instance to be initialized. @param outputBitLen The desired number of output bits (L). or 0 for an arbitrarily-long output (XOF). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
TupleHash128_Squeeze
Function to squeeze output data. @param TupleHashInstance Pointer to the hash instance initialized by TupleHash128_Initialize(). @param output Pointer to the buffer where to store the output data. @param outputBitLen The number of output bits desired. Only the last squeeze call can output a partial byte, other calls must have a length multiple of 8. @pre TupleHash128_Final() must have been already called. @return 0 if successful, 1 otherwise.
TupleHash128_Update
Function to give input data to be absorbed. @param TupleHashInstance Pointer to the hash instance initialized by TupleHash128_Initialize(). @param tuple Pointer to an array of tuple elements (X). @param numberOfElements The number of tuple elements provided in the input data. @return 0 if successful, 1 otherwise.
TupleHash256_Final
Function to call after all input blocks have been input and to get output bits if the length was specified when calling TupleHash256_Initialize(). @param TupleHashInstance Pointer to the hash instance initialized by TupleHash256_Initialize(). If @a outputBitLen was not 0 in the call to TupleHash256_Initialize(), the number of output bits is equal to @a outputBitLen. If @a outputBitLen was 0 in the call to TupleHash256_Initialize(), the output bits must be extracted using the TupleHash256_Squeeze() function. @param output Pointer to the buffer where to store the output data. @return 0 if successful, 1 otherwise.
TupleHash256_Initialize
Function to initialize the Tuple hash function TupleHash256 instance used in sequential hashing mode. @param TupleHashInstance Pointer to the hash instance to be initialized. @param outputBitLen The desired number of output bits (L). or 0 for an arbitrarily-long output (XOF). @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
TupleHash256_Squeeze
Function to squeeze output data. @param TupleHashInstance Pointer to the hash instance initialized by TupleHash256_Initialize(). @param output Pointer to the buffer where to store the output data. @param outputBitLen The number of output bits desired. Only the last squeeze call can output a partial byte, other calls must have a length multiple of 8. @pre TupleHash256_Final() must have been already called. @return 0 if successful, 1 otherwise.
TupleHash256_Update
Function to give input data to be absorbed. @param TupleHashInstance Pointer to the hash instance initialized by TupleHash256_Initialize(). @param tuple Pointer to an array of tuple elements (X). @param numberOfElements The number of tuple elements provided in the input data. @return 0 if successful, 1 otherwise.
TurboSHAKE
TurboSHAKE_Absorb
TurboSHAKE_AbsorbDomainSeparationByte
TurboSHAKE_Initialize
TurboSHAKE_Squeeze
Vatte
Function to expand output data. @param kvInstance Pointer to the hash instance initialized by Kravatte_MaskDerivation(). @param output Pointer to the buffer where to store the output data. @param outputBitLen The number of output bits desired. This must be a multiple of 8 if KRAVATTE_FLAG_LAST_PART flag not set. @param flags Bitwise or combination of KRAVATTE_FLAG_NONE, KRAVATTE_FLAG_SHORT, KRAVATTE_FLAG_LAST_PART. @return 0 if successful, 1 otherwise.
Xoodoo_AddBytes
Xoodoo_ExtractAndAddBytes
Xoodoo_ExtractBytes
Xoodoo_Initialize
Xoodoo_OverwriteBytes
Xoodoo_OverwriteWithZeroes
Xoodoo_Permute_6rounds
Xoodoo_Permute_12rounds
Xoodoo_Permute_Nrounds
Xoodyak_Absorb
Xoodyak_AbsorbHashFullBlocks
Xoodyak_AbsorbKeyedFullBlocks
Xoodyak_Decrypt
Xoodyak_DecryptFullBlocks
Xoodyak_Encrypt
Xoodyak_EncryptFullBlocks
Xoodyak_Initialize
Xoodyak_Ratchet
Xoodyak_Squeeze
Xoodyak_SqueezeHashFullBlocks
Xoodyak_SqueezeKey
Xoodyak_SqueezeKeyedFullBlocks
cSHAKE128
cSHAKE128 function, as defined in NIST’s Special Publication 800-185, published December 2016. @param input Pointer to the input message (X). @param inputBitLen The length of the input message in bits. @param output Pointer to the output buffer. @param outputBitLen The desired number of output bits (L). @param name Pointer to the function name string (N). @param nameBitLen The length of the function name in bits. Only full bytes are supported, length must be a multiple of 8. @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
cSHAKE256
cSHAKE256 function, as defined in NIST’s Special Publication 800-185, published December 2016. @param input Pointer to the input message (X). @param inputBitLen The length of the input message in bits. @param output Pointer to the output buffer. @param outputBitLen The desired number of output bits (L). @param name Pointer to the function name string (N). @param nameBitLen The length of the function name in bits. Only full bytes are supported, length must be a multiple of 8. @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
cSHAKE128_Final
Function to call after all input blocks have been input and to get output bits if the length was specified when calling cSHAKE128_Initialize(). @param cskInstance Pointer to the hash instance initialized by cSHAKE128_Initialize(). If @a outputBitLen was not 0 in the call to cSHAKE128_Initialize(), the number of output bits is equal to @a outputBitLen. If @a outputBitLen was 0 in the call to cSHAKE128_Initialize(), the output bits must be extracted using the cSHAKE128_Squeeze() function. @param output Pointer to the buffer where to store the output data. @return 0 if successful, 1 otherwise.
cSHAKE128_Initialize
Function to initialize the cSHAKE128 instance used in sequential hashing mode. @param cskInstance Pointer to the hash instance to be initialized. @param outputBitLen The desired number of output bits (L). or 0 for an arbitrarily-long output (XOF). @param name Pointer to the function name string (N). @param nameBitLen The length of the function name in bits. Only full bytes are supported, length must be a multiple of 8. @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
cSHAKE128_Squeeze
Function to squeeze output data. @param cskInstance Pointer to the hash instance initialized by cSHAKE128_Initialize(). @param output Pointer to the buffer where to store the output data. @param outputBitLen The number of output bits desired. Only the last squeeze call can output a partial byte, other calls must have a length multiple of 8. @pre cSHAKE128_Final() must have been already called. @return 0 if successful, 1 otherwise.
cSHAKE128_Update
Function to give input data to be absorbed. @param cskInstance Pointer to the hash instance initialized by cSHAKE128_Initialize(). @param input Pointer to the input data. @param inputBitLen The number of input bits provided in the input data. Only the last update call can input a partial byte, other calls must have a length multiple of 8. @return 0 if successful, 1 otherwise.
cSHAKE256_Final
Function to call after all input blocks have been input and to get output bits if the length was specified when calling cSHAKE256_Initialize(). @param cskInstance Pointer to the hash instance initialized by cSHAKE256_Initialize(). If @a outputBitLen was not 0 in the call to cSHAKE256_Initialize(), the number of output bits is equal to @a outputBitLen. If @a outputBitLen was 0 in the call to cSHAKE256_Initialize(), the output bits must be extracted using the cSHAKE256_Squeeze() function. @param output Pointer to the buffer where to store the output data. @return 0 if successful, 1 otherwise.
cSHAKE256_Initialize
Function to initialize the cSHAKE256 instance used in sequential hashing mode. @param cskInstance Pointer to the hash instance to be initialized. @param outputBitLen The desired number of output bits (L). or 0 for an arbitrarily-long output (XOF). @param name Pointer to the function name string (N). @param nameBitLen The length of the function name in bits. Only full bytes are supported, length must be a multiple of 8. @param customization Pointer to the customization string (S). @param customBitLen The length of the customization string in bits. @return 0 if successful, 1 otherwise.
cSHAKE256_Squeeze
Function to squeeze output data. @param cskInstance Pointer to the hash instance initialized by cSHAKE256_Initialize(). @param output Pointer to the buffer where to store the output data. @param outputBitLen The number of output bits desired. Only the last squeeze call can output a partial byte, other calls must have a length multiple of 8. @pre cSHAKE256_Final() must have been already called. @return 0 if successful, 1 otherwise.
cSHAKE256_Update
Function to give input data to be absorbed. @param cskInstance Pointer to the hash instance initialized by cSHAKE256_Initialize(). @param input Pointer to the input data. @param inputBitLen The number of input bits provided in the input data. Only the last update call can input a partial byte, other calls must have a length multiple of 8. @return 0 if successful, 1 otherwise.

Type Aliases§

BitLength
BitSequence
KeccakP1600_state
KeccakWidth1600_DuplexInstance
KeccakWidth1600_SpongeInstance
KeccakWidth1600_SpongePRG_Instance
TurboSHAKE_Instance
TurboSHAKE_SpongeInstance
Xoodoo_state
For the documentation, see SnP-documentation.h.
Xoodyak_Instance
tXoodooLane