Botan 3.2.0
Crypto and TLS for C&
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Botan::Whirlpool Class Referencefinal

#include <whirlpool.h>

Inheritance diagram for Botan::Whirlpool:
Botan::HashFunction Botan::Buffered_Computation

Public Types

using digest_type = secure_vector< uint64_t >
 

Public Member Functions

void clear () override
 
HashFunctionclone () const
 
std::unique_ptr< HashFunctioncopy_state () const override
 
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
T final ()
 
void final (std::span< uint8_t > out)
 
template<concepts::resizable_byte_buffer T>
void final (T &out)
 
void final (uint8_t out[])
 
std::vector< uint8_t > final_stdvec ()
 
size_t hash_block_size () const override
 
std::string name () const override
 
std::unique_ptr< HashFunctionnew_object () const override
 
size_t output_length () const override
 
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
T process (const uint8_t in[], size_t length)
 
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
T process (std::span< const uint8_t > in)
 
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
T process (std::string_view in)
 
virtual std::string provider () const
 
void update (const uint8_t in[], size_t length)
 
void update (std::span< const uint8_t > in)
 
void update (std::string_view str)
 
void update (uint8_t in)
 
void update_be (uint16_t val)
 
void update_be (uint32_t val)
 
void update_be (uint64_t val)
 
void update_le (uint16_t val)
 
void update_le (uint32_t val)
 
void update_le (uint64_t val)
 

Static Public Member Functions

static void compress_n (digest_type &digest, std::span< const uint8_t > input, size_t blocks)
 
static std::unique_ptr< HashFunctioncreate (std::string_view algo_spec, std::string_view provider="")
 
static std::unique_ptr< HashFunctioncreate_or_throw (std::string_view algo_spec, std::string_view provider="")
 
static void init (digest_type &digest)
 
static std::vector< std::string > providers (std::string_view algo_spec)
 

Static Public Attributes

static constexpr MD_Endian bit_endianness = MD_Endian::Big
 
static constexpr size_t block_bytes = 64
 
static constexpr MD_Endian byte_endianness = MD_Endian::Big
 
static constexpr size_t ctr_bytes = 32
 
static constexpr size_t output_bytes = 64
 

Detailed Description

Whirlpool

Definition at line 18 of file whirlpool.h.

Member Typedef Documentation

◆ digest_type

Definition at line 20 of file whirlpool.h.

Member Function Documentation

◆ clear()

void Botan::Whirlpool::clear ( )
inlineoverridevirtual

Reset the state.

Implements Botan::HashFunction.

Definition at line 42 of file whirlpool.h.

42{ m_md.clear(); }

◆ clone()

HashFunction * Botan::HashFunction::clone ( ) const
inlineinherited
Returns
new object representing the same algorithm as *this

Definition at line 87 of file hash.h.

87{ return this->new_object().release(); }
virtual std::unique_ptr< HashFunction > new_object() const =0

◆ compress_n()

void Botan::Whirlpool::compress_n ( digest_type digest,
std::span< const uint8_t >  input,
size_t  blocks 
)
static

Definition at line 90 of file whirlpool.cpp.

90 {
91 static const uint64_t RC[10] = {0x1823C6E887B8014F,
92 0x36A6D2F5796F9152,
93 0x60BC9B8EA30C7B35,
94 0x1DE0D7C22E4BFE57,
95 0x157737E59FF04ADA,
96 0x58C9290AB1A06B85,
97 0xBD5D10F4CB3E0567,
98 0xE427418BA77D95D8,
99 0xFBEE7C66DD17479E,
100 0xCA2DBF07AD5A8333};
101 BufferSlicer in(input);
102
103 for(size_t i = 0; i != blocks; ++i) {
104 const auto block = in.take(block_bytes);
105
106 uint64_t K[11 * 8] = {0};
107
108 K[0] = digest[0];
109 K[1] = digest[1];
110 K[2] = digest[2];
111 K[3] = digest[3];
112 K[4] = digest[4];
113 K[5] = digest[5];
114 K[6] = digest[6];
115 K[7] = digest[7];
116
117 // Whirlpool key schedule:
118 for(size_t r = 1; r != 11; ++r) {
119 const uint64_t PK0 = K[8 * (r - 1) + 0];
120 const uint64_t PK1 = K[8 * (r - 1) + 1];
121 const uint64_t PK2 = K[8 * (r - 1) + 2];
122 const uint64_t PK3 = K[8 * (r - 1) + 3];
123 const uint64_t PK4 = K[8 * (r - 1) + 4];
124 const uint64_t PK5 = K[8 * (r - 1) + 5];
125 const uint64_t PK6 = K[8 * (r - 1) + 6];
126 const uint64_t PK7 = K[8 * (r - 1) + 7];
127
128 K[8 * r + 0] = whirl(PK0, PK7, PK6, PK5, PK4, PK3, PK2, PK1) ^ RC[r - 1];
129 K[8 * r + 1] = whirl(PK1, PK0, PK7, PK6, PK5, PK4, PK3, PK2);
130 K[8 * r + 2] = whirl(PK2, PK1, PK0, PK7, PK6, PK5, PK4, PK3);
131 K[8 * r + 3] = whirl(PK3, PK2, PK1, PK0, PK7, PK6, PK5, PK4);
132 K[8 * r + 4] = whirl(PK4, PK3, PK2, PK1, PK0, PK7, PK6, PK5);
133 K[8 * r + 5] = whirl(PK5, PK4, PK3, PK2, PK1, PK0, PK7, PK6);
134 K[8 * r + 6] = whirl(PK6, PK5, PK4, PK3, PK2, PK1, PK0, PK7);
135 K[8 * r + 7] = whirl(PK7, PK6, PK5, PK4, PK3, PK2, PK1, PK0);
136 }
137
138 uint64_t M[8] = {0};
139 load_be(M, block.data(), 8);
140
141 // First round (key masking)
142 uint64_t B0 = M[0] ^ K[0];
143 uint64_t B1 = M[1] ^ K[1];
144 uint64_t B2 = M[2] ^ K[2];
145 uint64_t B3 = M[3] ^ K[3];
146 uint64_t B4 = M[4] ^ K[4];
147 uint64_t B5 = M[5] ^ K[5];
148 uint64_t B6 = M[6] ^ K[6];
149 uint64_t B7 = M[7] ^ K[7];
150
151 for(size_t r = 1; r != 11; ++r) {
152 uint64_t T0 = whirl(B0, B7, B6, B5, B4, B3, B2, B1) ^ K[8 * r + 0];
153 uint64_t T1 = whirl(B1, B0, B7, B6, B5, B4, B3, B2) ^ K[8 * r + 1];
154 uint64_t T2 = whirl(B2, B1, B0, B7, B6, B5, B4, B3) ^ K[8 * r + 2];
155 uint64_t T3 = whirl(B3, B2, B1, B0, B7, B6, B5, B4) ^ K[8 * r + 3];
156 uint64_t T4 = whirl(B4, B3, B2, B1, B0, B7, B6, B5) ^ K[8 * r + 4];
157 uint64_t T5 = whirl(B5, B4, B3, B2, B1, B0, B7, B6) ^ K[8 * r + 5];
158 uint64_t T6 = whirl(B6, B5, B4, B3, B2, B1, B0, B7) ^ K[8 * r + 6];
159 uint64_t T7 = whirl(B7, B6, B5, B4, B3, B2, B1, B0) ^ K[8 * r + 7];
160
161 B0 = T0;
162 B1 = T1;
163 B2 = T2;
164 B3 = T3;
165 B4 = T4;
166 B5 = T5;
167 B6 = T6;
168 B7 = T7;
169 }
170
171 digest[0] ^= B0 ^ M[0];
172 digest[1] ^= B1 ^ M[1];
173 digest[2] ^= B2 ^ M[2];
174 digest[3] ^= B3 ^ M[3];
175 digest[4] ^= B4 ^ M[4];
176 digest[5] ^= B5 ^ M[5];
177 digest[6] ^= B6 ^ M[6];
178 digest[7] ^= B7 ^ M[7];
179 }
180}
static constexpr size_t block_bytes
Definition whirlpool.h:24
constexpr T load_be(const uint8_t in[], size_t off)
Definition loadstor.h:92

References block_bytes, Botan::load_be(), and Botan::BufferSlicer::take().

◆ copy_state()

std::unique_ptr< HashFunction > Botan::Whirlpool::copy_state ( ) const
overridevirtual

Return a new hash object with the same state as *this. This allows computing the hash of several messages with a common prefix more efficiently than would otherwise be possible.

This function should be called clone but that was already used for the case of returning an uninitialized object.

Returns
new hash object

Implements Botan::HashFunction.

Definition at line 191 of file whirlpool.cpp.

191 {
192 return std::make_unique<Whirlpool>(*this);
193}

◆ create()

std::unique_ptr< HashFunction > Botan::HashFunction::create ( std::string_view  algo_spec,
std::string_view  provider = "" 
)
staticinherited

Create an instance based on a name, or return null if the algo/provider combination cannot be found. If provider is empty then best available is chosen.

Definition at line 103 of file hash.cpp.

103 {
104#if defined(BOTAN_HAS_COMMONCRYPTO)
105 if(provider.empty() || provider == "commoncrypto") {
106 if(auto hash = make_commoncrypto_hash(algo_spec))
107 return hash;
108
109 if(!provider.empty())
110 return nullptr;
111 }
112#endif
113
114 if(provider.empty() == false && provider != "base") {
115 return nullptr; // unknown provider
116 }
117
118#if defined(BOTAN_HAS_SHA1)
119 if(algo_spec == "SHA-1") {
120 return std::make_unique<SHA_1>();
121 }
122#endif
123
124#if defined(BOTAN_HAS_SHA2_32)
125 if(algo_spec == "SHA-224") {
126 return std::make_unique<SHA_224>();
127 }
128
129 if(algo_spec == "SHA-256") {
130 return std::make_unique<SHA_256>();
131 }
132#endif
133
134#if defined(BOTAN_HAS_SHA2_64)
135 if(algo_spec == "SHA-384") {
136 return std::make_unique<SHA_384>();
137 }
138
139 if(algo_spec == "SHA-512") {
140 return std::make_unique<SHA_512>();
141 }
142
143 if(algo_spec == "SHA-512-256") {
144 return std::make_unique<SHA_512_256>();
145 }
146#endif
147
148#if defined(BOTAN_HAS_RIPEMD_160)
149 if(algo_spec == "RIPEMD-160") {
150 return std::make_unique<RIPEMD_160>();
151 }
152#endif
153
154#if defined(BOTAN_HAS_WHIRLPOOL)
155 if(algo_spec == "Whirlpool") {
156 return std::make_unique<Whirlpool>();
157 }
158#endif
159
160#if defined(BOTAN_HAS_MD5)
161 if(algo_spec == "MD5") {
162 return std::make_unique<MD5>();
163 }
164#endif
165
166#if defined(BOTAN_HAS_MD4)
167 if(algo_spec == "MD4") {
168 return std::make_unique<MD4>();
169 }
170#endif
171
172#if defined(BOTAN_HAS_GOST_34_11)
173 if(algo_spec == "GOST-R-34.11-94" || algo_spec == "GOST-34.11") {
174 return std::make_unique<GOST_34_11>();
175 }
176#endif
177
178#if defined(BOTAN_HAS_ADLER32)
179 if(algo_spec == "Adler32") {
180 return std::make_unique<Adler32>();
181 }
182#endif
183
184#if defined(BOTAN_HAS_CRC24)
185 if(algo_spec == "CRC24") {
186 return std::make_unique<CRC24>();
187 }
188#endif
189
190#if defined(BOTAN_HAS_CRC32)
191 if(algo_spec == "CRC32") {
192 return std::make_unique<CRC32>();
193 }
194#endif
195
196#if defined(BOTAN_HAS_STREEBOG)
197 if(algo_spec == "Streebog-256") {
198 return std::make_unique<Streebog>(256);
199 }
200 if(algo_spec == "Streebog-512") {
201 return std::make_unique<Streebog>(512);
202 }
203#endif
204
205#if defined(BOTAN_HAS_SM3)
206 if(algo_spec == "SM3") {
207 return std::make_unique<SM3>();
208 }
209#endif
210
211 const SCAN_Name req(algo_spec);
212
213#if defined(BOTAN_HAS_SKEIN_512)
214 if(req.algo_name() == "Skein-512") {
215 return std::make_unique<Skein_512>(req.arg_as_integer(0, 512), req.arg(1, ""));
216 }
217#endif
218
219#if defined(BOTAN_HAS_BLAKE2B)
220 if(req.algo_name() == "Blake2b" || req.algo_name() == "BLAKE2b") {
221 return std::make_unique<BLAKE2b>(req.arg_as_integer(0, 512));
222 }
223#endif
224
225#if defined(BOTAN_HAS_KECCAK)
226 if(req.algo_name() == "Keccak-1600") {
227 return std::make_unique<Keccak_1600>(req.arg_as_integer(0, 512));
228 }
229#endif
230
231#if defined(BOTAN_HAS_SHA3)
232 if(req.algo_name() == "SHA-3") {
233 return std::make_unique<SHA_3>(req.arg_as_integer(0, 512));
234 }
235#endif
236
237#if defined(BOTAN_HAS_SHAKE)
238 if(req.algo_name() == "SHAKE-128" && req.arg_count() == 1) {
239 return std::make_unique<SHAKE_128>(req.arg_as_integer(0));
240 }
241 if(req.algo_name() == "SHAKE-256" && req.arg_count() == 1) {
242 return std::make_unique<SHAKE_256>(req.arg_as_integer(0));
243 }
244#endif
245
246#if defined(BOTAN_HAS_PARALLEL_HASH)
247 if(req.algo_name() == "Parallel") {
248 std::vector<std::unique_ptr<HashFunction>> hashes;
249
250 for(size_t i = 0; i != req.arg_count(); ++i) {
251 auto h = HashFunction::create(req.arg(i));
252 if(!h) {
253 return nullptr;
254 }
255 hashes.push_back(std::move(h));
256 }
257
258 return std::make_unique<Parallel>(hashes);
259 }
260#endif
261
262#if defined(BOTAN_HAS_TRUNCATED_HASH)
263 if(req.algo_name() == "Truncated" && req.arg_count() == 2) {
264 auto hash = HashFunction::create(req.arg(0));
265 if(!hash) {
266 return nullptr;
267 }
268
269 return std::make_unique<Truncated_Hash>(std::move(hash), req.arg_as_integer(1));
270 }
271#endif
272
273#if defined(BOTAN_HAS_COMB4P)
274 if(req.algo_name() == "Comb4P" && req.arg_count() == 2) {
275 auto h1 = HashFunction::create(req.arg(0));
276 auto h2 = HashFunction::create(req.arg(1));
277
278 if(h1 && h2) {
279 return std::make_unique<Comb4P>(std::move(h1), std::move(h2));
280 }
281 }
282#endif
283
284 return nullptr;
285}
virtual std::string provider() const
Definition hash.h:49
static std::unique_ptr< HashFunction > create(std::string_view algo_spec, std::string_view provider="")
Definition hash.cpp:103
std::unique_ptr< HashFunction > make_commoncrypto_hash(std::string_view name)

References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg(), Botan::SCAN_Name::arg_as_integer(), Botan::SCAN_Name::arg_count(), Botan::HashFunction::create(), Botan::make_commoncrypto_hash(), and Botan::HashFunction::provider().

Referenced by botan_hash_init(), Botan::EME::create(), Botan::EMSA::create(), Botan::BlockCipher::create(), Botan::HashFunction::create(), Botan::KDF::create(), Botan::MessageAuthenticationCode::create(), Botan::PBKDF::create(), Botan::PasswordHashFamily::create(), Botan::HashFunction::create_or_throw(), Botan::Certificate_Store_In_Memory::find_cert_by_pubkey_sha1(), Botan::Certificate_Store_In_Memory::find_cert_by_raw_subject_dn_sha256(), and Botan::X942_PRF::kdf().

◆ create_or_throw()

std::unique_ptr< HashFunction > Botan::HashFunction::create_or_throw ( std::string_view  algo_spec,
std::string_view  provider = "" 
)
staticinherited

◆ final() [1/4]

template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
T Botan::Buffered_Computation::final ( )
inlineinherited

Complete the computation and retrieve the final result as a container of your choice.

Returns
a contiguous container holding the result

Definition at line 77 of file buf_comp.h.

77 {
78 T output(output_length());
79 final_result(output);
80 return output;
81 }
virtual size_t output_length() const =0
FE_25519 T
Definition ge.cpp:34

References T.

◆ final() [2/4]

void Botan::Buffered_Computation::final ( std::span< uint8_t >  out)
inlineinherited

Definition at line 85 of file buf_comp.h.

85 {
86 BOTAN_ARG_CHECK(out.size() >= output_length(), "provided output buffer has insufficient capacity");
87 final_result(out);
88 }
#define BOTAN_ARG_CHECK(expr, msg)
Definition assert.h:29

References BOTAN_ARG_CHECK.

◆ final() [3/4]

template<concepts::resizable_byte_buffer T>
void Botan::Buffered_Computation::final ( T out)
inlineinherited

Definition at line 91 of file buf_comp.h.

91 {
92 out.resize(output_length());
93 final_result(out);
94 }

◆ final() [4/4]

void Botan::Buffered_Computation::final ( uint8_t  out[])
inlineinherited

◆ final_stdvec()

std::vector< uint8_t > Botan::Buffered_Computation::final_stdvec ( )
inlineinherited

Definition at line 83 of file buf_comp.h.

83{ return final<std::vector<uint8_t>>(); }

◆ hash_block_size()

size_t Botan::Whirlpool::hash_block_size ( ) const
inlineoverridevirtual
Returns
hash block size as defined for this algorithm

Reimplemented from Botan::HashFunction.

Definition at line 36 of file whirlpool.h.

36{ return block_bytes; }

References block_bytes.

◆ init()

void Botan::Whirlpool::init ( digest_type digest)
static

Definition at line 182 of file whirlpool.cpp.

182 {
183 digest.resize(8);
184 zeroise(digest);
185}
void zeroise(std::vector< T, Alloc > &vec)
Definition secmem.h:108

References Botan::zeroise().

◆ name()

std::string Botan::Whirlpool::name ( ) const
inlineoverridevirtual
Returns
the hash function name

Implements Botan::HashFunction.

Definition at line 32 of file whirlpool.h.

32{ return "Whirlpool"; }

◆ new_object()

std::unique_ptr< HashFunction > Botan::Whirlpool::new_object ( ) const
overridevirtual
Returns
new object representing the same algorithm as *this

Implements Botan::HashFunction.

Definition at line 187 of file whirlpool.cpp.

187 {
188 return std::make_unique<Whirlpool>();
189}

◆ output_length()

size_t Botan::Whirlpool::output_length ( ) const
inlineoverridevirtual
Returns
length of the output of this function in bytes

Implements Botan::Buffered_Computation.

Definition at line 34 of file whirlpool.h.

34{ return output_bytes; }
static constexpr size_t output_bytes
Definition whirlpool.h:25

References output_bytes.

◆ process() [1/3]

template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
T Botan::Buffered_Computation::process ( const uint8_t  in[],
size_t  length 
)
inlineinherited

Update and finalize computation. Does the same as calling update() and final() consecutively.

Parameters
inthe input to process as a byte array
lengththe length of the byte array
Returns
the result of the call to final()

Definition at line 104 of file buf_comp.h.

104 {
105 update(in, length);
106 return final<T>();
107 }
int(* update)(CTX *, const void *, CC_LONG len)

References update.

Referenced by Botan::Dilithium_Symmetric_Primitives::CRH(), and Botan::Dilithium_Symmetric_Primitives::H().

◆ process() [2/3]

template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
T Botan::Buffered_Computation::process ( std::span< const uint8_t >  in)
inlineinherited

Update and finalize computation. Does the same as calling update() and final() consecutively.

Parameters
inthe input to process as a contiguous container
Returns
the result of the call to final()

Definition at line 128 of file buf_comp.h.

128 {
129 update(in);
130 return final<T>();
131 }

References update.

◆ process() [3/3]

template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
T Botan::Buffered_Computation::process ( std::string_view  in)
inlineinherited

Update and finalize computation. Does the same as calling update() and final() consecutively.

Parameters
inthe input to process as a string
Returns
the result of the call to final()

Definition at line 116 of file buf_comp.h.

116 {
117 update(in);
118 return final<T>();
119 }

References update.

◆ provider()

virtual std::string Botan::HashFunction::provider ( ) const
inlinevirtualinherited
Returns
provider information about this implementation. Default is "base", might also return "sse2", "avx2", "openssl", or some other arbitrary string.

Reimplemented in Botan::Keccak_1600, Botan::SHA_1, Botan::SHA_224, Botan::SHA_256, Botan::SHA_384, Botan::SHA_512, Botan::SHA_512_256, Botan::SHA_3, Botan::SHAKE_128, and Botan::SHAKE_256.

Definition at line 49 of file hash.h.

49{ return "base"; }

Referenced by Botan::HashFunction::create(), and Botan::HashFunction::create_or_throw().

◆ providers()

std::vector< std::string > Botan::HashFunction::providers ( std::string_view  algo_spec)
staticinherited
Returns
list of available providers for this algorithm, empty if not available
Parameters
algo_specalgorithm name

Definition at line 295 of file hash.cpp.

295 {
296 return probe_providers_of<HashFunction>(algo_spec, {"base", "commoncrypto"});
297}

◆ update() [1/4]

void Botan::Buffered_Computation::update ( const uint8_t  in[],
size_t  length 
)
inlineinherited

◆ update() [2/4]

void Botan::Buffered_Computation::update ( std::span< const uint8_t >  in)
inlineinherited

Add new input to process.

Parameters
inthe input to process as a contiguous data range

Definition at line 40 of file buf_comp.h.

40{ add_data(in); }

◆ update() [3/4]

void Botan::Buffered_Computation::update ( std::string_view  str)
inlineinherited

Add new input to process.

Parameters
strthe input to process as a std::string_view. Will be interpreted as a byte array based on the strings encoding.

Definition at line 55 of file buf_comp.h.

55{ add_data({cast_char_ptr_to_uint8(str.data()), str.size()}); }
const uint8_t * cast_char_ptr_to_uint8(const char *s)
Definition mem_ops.h:177

References Botan::cast_char_ptr_to_uint8().

◆ update() [4/4]

void Botan::Buffered_Computation::update ( uint8_t  in)
inlineinherited

Process a single byte.

Parameters
inthe byte to process

Definition at line 61 of file buf_comp.h.

61{ add_data({&in, 1}); }

◆ update_be() [1/3]

void Botan::Buffered_Computation::update_be ( uint16_t  val)
inherited

Definition at line 13 of file buf_comp.cpp.

13 {
14 uint8_t inb[sizeof(val)];
15 store_be(val, inb);
16 add_data({inb, sizeof(inb)});
17}
constexpr void store_be(uint16_t in, uint8_t out[2])
Definition loadstor.h:389

References Botan::store_be().

Referenced by Botan::mgf1_mask(), and Botan::pbkdf2().

◆ update_be() [2/3]

void Botan::Buffered_Computation::update_be ( uint32_t  val)
inherited

Definition at line 19 of file buf_comp.cpp.

19 {
20 uint8_t inb[sizeof(val)];
21 store_be(val, inb);
22 add_data({inb, sizeof(inb)});
23}

References Botan::store_be().

◆ update_be() [3/3]

void Botan::Buffered_Computation::update_be ( uint64_t  val)
inherited

Definition at line 25 of file buf_comp.cpp.

25 {
26 uint8_t inb[sizeof(val)];
27 store_be(val, inb);
28 add_data({inb, sizeof(inb)});
29}

References Botan::store_be().

◆ update_le() [1/3]

void Botan::Buffered_Computation::update_le ( uint16_t  val)
inherited

Definition at line 31 of file buf_comp.cpp.

31 {
32 uint8_t inb[sizeof(val)];
33 store_le(val, inb);
34 add_data({inb, sizeof(inb)});
35}
constexpr void store_le(uint16_t in, uint8_t out[2])
Definition loadstor.h:405

References Botan::store_le().

◆ update_le() [2/3]

void Botan::Buffered_Computation::update_le ( uint32_t  val)
inherited

Definition at line 37 of file buf_comp.cpp.

37 {
38 uint8_t inb[sizeof(val)];
39 store_le(val, inb);
40 add_data({inb, sizeof(inb)});
41}

References Botan::store_le().

◆ update_le() [3/3]

void Botan::Buffered_Computation::update_le ( uint64_t  val)
inherited

Definition at line 43 of file buf_comp.cpp.

43 {
44 uint8_t inb[sizeof(val)];
45 store_le(val, inb);
46 add_data({inb, sizeof(inb)});
47}

References Botan::store_le().

Member Data Documentation

◆ bit_endianness

constexpr MD_Endian Botan::Whirlpool::bit_endianness = MD_Endian::Big
staticconstexpr

Definition at line 23 of file whirlpool.h.

◆ block_bytes

constexpr size_t Botan::Whirlpool::block_bytes = 64
staticconstexpr

Definition at line 24 of file whirlpool.h.

Referenced by compress_n(), and hash_block_size().

◆ byte_endianness

constexpr MD_Endian Botan::Whirlpool::byte_endianness = MD_Endian::Big
staticconstexpr

Definition at line 22 of file whirlpool.h.

◆ ctr_bytes

constexpr size_t Botan::Whirlpool::ctr_bytes = 32
staticconstexpr

Definition at line 26 of file whirlpool.h.

◆ output_bytes

constexpr size_t Botan::Whirlpool::output_bytes = 64
staticconstexpr

Definition at line 25 of file whirlpool.h.

Referenced by output_length().


The documentation for this class was generated from the following files: