mirror of
https://github.com/henrydcase/pqc.git
synced 2024-11-24 00:11:27 +00:00
a655ec8a9d
* Add state destroy to SHA2 API * Include optimized SPHINCS+ implementations I've generated new implementations from the sphincsplus repository. * Don't destroy sha256ctx after finalize * Attempt to shut up MSVC * Make sure to drop errors in rmtree
51 lines
1.7 KiB
C
51 lines
1.7 KiB
C
#ifndef PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_ADDRESS_H
|
|
#define PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_ADDRESS_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#define PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_ADDR_TYPE_WOTS 0
|
|
#define PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_ADDR_TYPE_WOTSPK 1
|
|
#define PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_ADDR_TYPE_HASHTREE 2
|
|
#define PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_ADDR_TYPE_FORSTREE 3
|
|
#define PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_ADDR_TYPE_FORSPK 4
|
|
|
|
void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_addr_to_bytes(
|
|
unsigned char *bytes, const uint32_t addr[8]);
|
|
|
|
void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_set_layer_addr(
|
|
uint32_t addr[8], uint32_t layer);
|
|
|
|
void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_set_tree_addr(
|
|
uint32_t addr[8], uint64_t tree);
|
|
|
|
void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_set_type(
|
|
uint32_t addr[8], uint32_t type);
|
|
|
|
/* Copies the layer and tree part of one address into the other */
|
|
void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_copy_subtree_addr(
|
|
uint32_t out[8], const uint32_t in[8]);
|
|
|
|
/* These functions are used for WOTS and FORS addresses. */
|
|
|
|
void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_set_keypair_addr(
|
|
uint32_t addr[8], uint32_t keypair);
|
|
|
|
void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_set_chain_addr(
|
|
uint32_t addr[8], uint32_t chain);
|
|
|
|
void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_set_hash_addr(
|
|
uint32_t addr[8], uint32_t hash);
|
|
|
|
void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_copy_keypair_addr(
|
|
uint32_t out[8], const uint32_t in[8]);
|
|
|
|
/* These functions are used for all hash tree addresses (including FORS). */
|
|
|
|
void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_set_tree_height(
|
|
uint32_t addr[8], uint32_t tree_height);
|
|
|
|
void PQCLEAN_SPHINCSSHA256256SSIMPLE_AVX2_set_tree_index(
|
|
uint32_t addr[8], uint32_t tree_index);
|
|
|
|
#endif
|