8#ifndef BOTAN_GCM_GHASH_H_
9#define BOTAN_GCM_GHASH_H_
11#include <botan/sym_algo.h>
24 void start(std::span<const uint8_t> nonce);
29 void update(std::span<const uint8_t> in);
36 void final(std::span<uint8_t> out);
42 void clear()
override;
46 std::string
name()
const override {
return "GHASH"; }
55#if defined(BOTAN_HAS_GHASH_CLMUL_CPU)
56 static void ghash_precompute_cpu(
const uint8_t H[16], uint64_t H_pow[4 * 2]);
58 static void ghash_multiply_cpu(uint8_t x[16],
const uint64_t H_pow[4 * 2],
const uint8_t input[],
size_t blocks);
61#if defined(BOTAN_HAS_GHASH_CLMUL_VPERM)
62 static void ghash_multiply_vperm(uint8_t x[16],
const uint64_t HM[256],
const uint8_t input[],
size_t blocks);
65 void key_schedule(std::span<const uint8_t> key)
override;
69 static const size_t GCM_BS = 16;
78 size_t m_text_len = 0;
void update_associated_data(std::span< const uint8_t > ad)
std::string provider() const
void nonce_hash(secure_vector< uint8_t > &y0, std::span< const uint8_t > nonce)
void ghash_update(secure_vector< uint8_t > &x, std::span< const uint8_t > input)
std::string name() const override
void add_final_block(secure_vector< uint8_t > &x, size_t ad_len, size_t pt_len)
void start(std::span< const uint8_t > nonce)
Key_Length_Specification key_spec() const override
bool has_keying_material() const override
void set_associated_data(std::span< const uint8_t > ad)
int(* update)(CTX *, const void *, CC_LONG len)
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector