Crate qrc_opensource_rs

Source

Structs§

QscAesHba256State
QscAesKeyparams
QscAesState
QscHmac256State
QscHmac512State
QscKeccakState
QscPoly1305State

Enums§

QscAesCipherType
QscKeccakRate

Constants§

QRCS_CRYPTO_HASH_SIZE
QSC_AES256_KEY_SIZE
QSC_AES_BLOCK_SIZE
QSC_HBA256_MAC_LENGTH
QSC_HBA_MAXINFO_SIZE
QSC_HMAC_256_MAC
QSC_HMAC_512_MAC
QSC_KECCAK_CSHAKE_DOMAIN_ID
QSC_KECCAK_KMAC_DOMAIN_ID
QSC_KECCAK_PERMUTATION_ROUNDS
QSC_KECCAK_SHA3_DOMAIN_ID
QSC_KECCAK_SHAKE_DOMAIN_ID
QSC_KECCAK_STATE_BYTE_SIZE
QSC_KECCAK_STATE_SIZE
QSC_KYBER_CIPHERTEXT_SIZE
QSC_KYBER_PRIVATEKEY_SIZE
QSC_KYBER_PUBLICKEY_SIZE
QSC_KYBER_SEED_SIZE
QSC_KYBER_SHAREDSECRET_SIZE
QSC_MCELIECE_CIPHERTEXT_SIZE
QSC_MCELIECE_PRIVATEKEY_SIZE
QSC_MCELIECE_PUBLICKEY_SIZE
QSC_MCELIECE_SEED_SIZE
QSC_MCELIECE_SHAREDSECRET_SIZE
QSC_POLY1305_BLOCK_SIZE
QSC_SHA2_256_HASH
QSC_SHA2_256_RATE
QSC_SHA2_512_HASH
QSC_SHA2_512_RATE
QSC_SHA3_256_HASH_SIZE
QSC_SHA3_512_HASH_SIZE
QSC_SPHINCSPLUS_PRIVATEKEY_SIZE
QSC_SPHINCSPLUS_PUBLICKEY_SIZE
QSC_SPHINCSPLUS_SIGNATURE_SIZE

Functions§

qsc_aes_cbc_decrypt_block
\brief Decrypt one 16-byte block of cipher-text using Cipher Block Chaining mode. \n
qsc_aes_cbc_encrypt_block
\brief Encrypt one 16-byte block of cipher-text using Cipher Block Chaining mode. \n
qsc_aes_ctrbe_transform
\brief Transform a length of data using a Big Endian block cipher Counter mode. \n The CTR mode will encrypt plain-text, and decrypt cipher-text.
qsc_aes_ctrle_transform
\brief Transform a length of data using a Little Endian block cipher Counter mode. \n The CTR mode will encrypt plain-text, and decrypt cipher-text.
qsc_aes_dispose
\brief Erase the round-key array and size
qsc_aes_ecb_decrypt_block
\brief Decrypt one 16-byte block of cipher-text using Electronic CodeBook Mode mode. \n \warning ECB is not a secure mode, and should be used only for testing, or building more complex primitives.
qsc_aes_ecb_encrypt_block
\brief Encrypt one 16-byte block of cipher-text using Electronic CodeBook Mode mode. \n \warning ECB is not a secure mode, and should be used only for testing, or building more complex primitives.
qsc_aes_hba256_initialize
\brief Initialize the cipher and load the keying material. Initializes the cipher state to an AES-256 instance.
qsc_aes_hba256_set_associated
\brief Set the associated data string used in authenticating the message. The associated data may be packet header information, domain specific data, or a secret shared by a group. The associated data must be set after initialization, and before each transformation call. The data is erased after each call to the transform.
qsc_aes_hba256_transform
\brief Transform an array of bytes using an instance of AES-256. In encryption mode, the input plain-text is encrypted and then an authentication MAC code is appended to the cipher-text. In decryption mode, the input cipher-text is authenticated internally and compared to the mac code appended to the cipher-text, if the codes to not match, the cipher-text is not decrypted and the call fails.
qsc_aes_initialize
\brief Initialize the state with the input cipher-key and optional info tweak. The qsc_aes_state round-key array must be initialized and size set before passing the state to this function.
qsc_cshake128_compute
\brief Key a cSHAKE-128 instance and generate pseudo-random output. Short form api: processes the key, name, and custom inputs and generates the pseudo-random output with a single call. Permutes and extracts the state to an output byte array..
qsc_cshake256_compute
\brief Key a cSHAKE-256 instance and generate pseudo-random output. Short form api: processes the key, name, and custom inputs and generates the pseudo-random output with a single call. Permutes and extracts the state to an output byte array.
qsc_cshake512_compute
\brief Key a cSHAKE-512 instance and generate pseudo-random output. Short form api: processes the key, name, and custom inputs and generates the pseudo-random output with a single call. Permutes and extracts the state to an output byte array.
qsc_cshake_initialize
\brief The cSHAKE initialize function. Long form api: must be used in conjunction with the squeezeblocks function. Initialize the name and customization strings into the state.
qsc_cshake_squeezeblocks
\brief The cSHAKE squeeze function. Long form api: must be used in conjunction with the initialize function. Permutes and extracts blocks of state to an output byte array.
qsc_hkdf256_expand
\brief Initialize an instance of HKDF(HMAC(SHA2-256)), and output an array of pseudo-random. Short form api: initializes with the key and user info, and generates the output pseudo-random with a single call.
qsc_hkdf256_extract
\brief Extract a key from a combined key and salt input using HMAC(SHA2-256).
qsc_hkdf512_expand
\brief Initialize an instance of HKDF(HMAC(SHA2-512)), and output an array of pseudo-random. Short form api: initializes with the key and user info, and generates the output pseudo-random with a single call.
qsc_hkdf512_extract
\brief Extract a key from a combined key and salt input using HMAC(SHA2-512).
qsc_hmac256_compute
\brief Process a message with HMAC(SHA2-256) and returns the hash code in the output byte array. Short form api: processes the key and complete message, and generates the MAC code with a single call.
qsc_hmac512_compute
\brief Process a message with SHA2-512 and returns the hash code in the output byte array. Short form api: processes the key and complete message, and generates the MAC code with a single call.
qsc_keccak_dispose
\brief Dispose of the Keccak state.
qsc_kmac128_compute
\brief Key a KMAC-128 instance and generate a MAC code. Short form api: processes the key and custom inputs and generates the MAC code with a single call. Key the MAC generator process a message and output the MAC code.
qsc_kmac256_compute
\brief Key a KMAC-256 instance and generate a MAC code. Short form api: processes the key and custom inputs and generates the MAC code with a single call. Key the MAC generator process a message and output the MAC code.
qsc_kmac512_compute
\brief Key a KMAC-512 instance and generate a MAC code. Short form api: processes the key and custom inputs and generates the MAC code with a single call. Key the MAC generator process a message and output the MAC code.
qsc_kmac_finalize
\brief The KMAC finalize function. Long form api: must be used in conjunction with the initialize and blockupdate functions. Final processing and calculation of the MAC code.
qsc_kmac_initialize
\brief Initialize a KMAC instance. Long form api: must be used in conjunction with the blockupdate and finalize functions. Key the MAC generator and initialize the internal state.
qsc_kmac_update
\brief The KMAC message update function. Long form api: must be used in conjunction with the initialize and finalize functions.
qsc_kyber_decrypt
\brief Decrypts the shared secret for a given cipher-text using a private-key Used in conjunction with the encrypt function.
qsc_kyber_encrypt
\brief Generates cipher-text and encapsulates a shared secret key using a public-key Used in conjunction with the encrypt function.
qsc_kyber_generate_keypair
\brief Generates public and private key for the KYBER key encapsulation mechanism
qsc_mceliece_decrypt
\brief Decrypts the shared secret for a given cipher-text using a private-key Used in conjunction with the encrypt function.
qsc_mceliece_encrypt
\brief Generates cipher-text and encapsulates a shared secret key using a public-key Used in conjunction with the encrypt function.
qsc_mceliece_generate_keypair
\brief Generates public and private key for the McEliece key encapsulation mechanism
qsc_poly1305_compute
\brief Compute the MAC code and return the result in the mac byte array.
qsc_poly1305_finalize
\brief Finalize the message state and returns the MAC code. Absorb the last block of message and create the MAC array. \n
qsc_poly1305_initialize
\brief Initialize the state with the secret key.
qsc_poly1305_update
\brief Update the poly1305 generator with a length of message input. Absorbs the input message into the state.
qsc_sha3_compute256
\brief Process a message with SHA3-256 and return the hash code in the output byte array. Short form api: processes the entire message and computes the hash code with a single call.
qsc_sha3_compute512
\brief Process a message with SHA3-512 and return the hash code in the output byte array. Short form api: processes the entire message and computes the hash code with a single call.
qsc_sha3_finalize
\brief Finalize the message state and returns the hash value in output. Long form api: must be used in conjunction with the initialize and block-update functions. Absorb the last block of message and create the hash value. Produces a 32 byte output code using QSC_KECCAK_256_RATE, 64 bytes with QSC_KECCAK_512_RATE.
qsc_sha3_initialize
\brief Initialize the SHA3 state Long form api: Must be called before the update or finalize functions are called.
qsc_sha3_update
\brief Update SHA3 with message input. Long form api: must be used in conjunction with the initialize and finalize functions. Absorbs the input message into the state.
qsc_sha256_blockupdate
qsc_sha256_finalize
\brief Finalize the message state and returns the hash value in output. Long form api: must be used in conjunction with the initialize and update functions. Produces a 32-byte output code.
qsc_sha256_initialize
\brief Initializes a SHA2-256 state structure, must be called before message processing. Long form api: must be used in conjunction with the update and finalize functions.
qsc_sha512_blockupdate
qsc_sha512_finalize
\brief Finalize the message state and returns the SHA2-512 hash value in output. Long form api: must be used in conjunction with the initialize and update functions. Produces a 64 byte output code.
qsc_sha512_initialize
\brief Initializes a SHA2-512 state structure, must be called before message processing. Long form api: must be used in conjunction with the update and finalize functions.
qsc_shake128_compute
\brief Key a SHAKE-128 instance, and generate an array of pseudo-random bytes. Short form api: processes the key and generates the pseudo-random output with a single call.
qsc_shake256_compute
\brief Key a SHAKE-256 instance, and generate an array of pseudo-random bytes. Short form api: processes the key and generates the pseudo-random output with a single call.
qsc_shake512_compute
\brief Key a SHAKE-512 instance, and generate an array of pseudo-random bytes. Short form api: processes the key and generates the pseudo-random output with a single call.
qsc_shake_initialize
\brief The SHAKE initialize function. Long form api: must be used in conjunction with the squeezeblocks function. Absorb and finalize an input key byte array.
qsc_shake_squeezeblocks
\brief The SHAKE squeeze function. Long form api: must be used in conjunction with the initialize function. Permutes and extracts the state to an output byte array.
qsc_sphincsplus_generate_keypair
\brief Generates a Sphincs+ public/private key-pair.
qsc_sphincsplus_sign
\brief Takes the message as input and returns an array containing the signature followed by the message.
qsc_sphincsplus_verify
\brief Verifies a signature-message pair with the public key.