16#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) \
17 || defined(_M_X64) || defined(_M_IX86) || defined(__i486) \
22#if defined(PV_INTEL_ARCH) && defined(__PCLMUL__)
27#define PV_USE_PCLMUL_UNCONDITIONAL
30#elif defined(PV_INTEL_ARCH) && SIZEOF_VOID_P >= 8
34#define PV_USE_PCLMUL_DETECT
37#elif SIZEOF_VOID_P >= 8
42#elif SIZEOF_VOID_P == 4
48#error "sizeof(void*) is implausibly weird."
54#define POLYVAL_USE_EXPANDED_KEYS
61#if defined(PV_USE_PCLMUL_UNCONDITIONAL)
62typedef __m128i pv_u128_;
63#elif defined(PV_USE_PCLMUL_DETECT)
64typedef union pv_u128_ {
71#elif defined(PV_USE_CTMUL64)
72typedef struct pv_u128_ {
76#elif defined(PV_USE_CTMUL)
77typedef struct pv_u128_ {
100#define POLYVAL_KEY_LEN 16
104#define POLYVAL_BLOCK_LEN 16
108#define POLYVAL_TAG_LEN 16
148#ifdef POLYVAL_USE_EXPANDED_KEYS
155#define PV_BLOCK_STRIDE 8
156typedef struct pv_expanded_key_t {
160 __m128i k[PV_BLOCK_STRIDE-1];
162typedef struct polyvalx_t {
164 pv_expanded_key_t expanded;
167void polyvalx_init(polyvalx_t *,
const uint8_t *key);
168void polyvalx_init_from_key(polyvalx_t *,
const polyval_key_t *key);
169void polyvalx_add_block(polyvalx_t *,
const uint8_t *block);
170void polyvalx_add_zpad(polyvalx_t *,
const uint8_t *data,
size_t n);
171void polyvalx_get_tag(
const polyvalx_t *, uint8_t *tag_out);
172void polyvalx_reset(polyvalx_t *);
175#define polyvalx_t polyval_t
176#define polyvalx_key_init polyval_key_init
177#define polyvalx_init polyval_init
178#define polyvalx_init_from_key polyval_init_from_key
179#define polyvalx_add_block polyval_add_block
180#define polyvalx_add_zpad polyval_add_zpad
181#define polyvalx_get_tag polyval_get_tag
182#define polyvalx_reset polyval_reset
void polyval_reset(polyval_t *)
void polyval_init(polyval_t *, const uint8_t *key)
void polyval_add_zpad(polyval_t *, const uint8_t *data, size_t n)
void polyval_add_block(polyval_t *, const uint8_t *block)
void polyval_get_tag(const polyval_t *, uint8_t *tag_out)
void polyval_init_from_key(polyval_t *, const polyval_key_t *key)
void polyval_detect_implementation(void)
void polyval_key_init(polyval_key_t *, const uint8_t *key)
Integer definitions used throughout Tor.