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

Enums

Constants

Functions

  • 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.
  • 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.
  • 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.
  • 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.
  • 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 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • Extendable ouput function KangarooTwelve. @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.
  • 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.
  • Function to initialize a KangarooTwelve instance. @param ktInstance Pointer to the instance to be initialized. @param outputByteLen The desired number of output bytes, or 0 for an arbitrarily-long output. @return 0 if successful, 1 otherwise.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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 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.
  • 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.
  • 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.
  • 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.
  • 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