Botan 3.9.0
Crypto and TLS for C&
Botan::Streebog Class Referencefinal

#include <streebog.h>

Inheritance diagram for Botan::Streebog:
Botan::HashFunction Botan::Buffered_Computation

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>>
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>>
process (const uint8_t in[], size_t length)
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
process (std::span< const uint8_t > in)
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>>
process (std::string_view in)
virtual std::string provider () const
 Streebog (size_t output_bits)
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 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 std::vector< std::string > providers (std::string_view algo_spec)

Protected Member Functions

void add_data (std::span< const uint8_t > input) override
void compress (const uint8_t input[], bool lastblock=false)
void compress_64 (const uint64_t input[], bool lastblock=false)
void final_result (std::span< uint8_t > out) override

Detailed Description

Streebog (GOST R 34.11-2012) RFC 6986

Definition at line 21 of file streebog.h.

Constructor & Destructor Documentation

◆ Streebog()

Botan::Streebog::Streebog ( size_t output_bits)
explicit

Definition at line 27 of file streebog.cpp.

27 : m_output_bits(output_bits), m_count(0), m_h(8), m_S(8) {
28 if(output_bits != 256 && output_bits != 512) {
29 throw Invalid_Argument(fmt("Streebog: Invalid output length {}", output_bits));
30 }
31
32 clear();
33}
void clear() override
Definition streebog.cpp:42
std::string fmt(std::string_view format, const T &... args)
Definition fmt.h:53

References clear(), and Botan::fmt().

Member Function Documentation

◆ add_data()

void Botan::Streebog::add_data ( std::span< const uint8_t > input)
overrideprotectedvirtual

Add more data to the computation

Parameters
inputis an input buffer

Implements Botan::Buffered_Computation.

Definition at line 54 of file streebog.cpp.

54 {
55 BufferSlicer in(input);
56
57 while(!in.empty()) {
58 if(const auto one_block = m_buffer.handle_unaligned_data(in)) {
59 compress(one_block->data());
60 m_count += 512;
61 }
62
63 if(m_buffer.in_alignment()) {
64 while(const auto aligned_block = m_buffer.next_aligned_block_to_process(in)) {
65 compress(aligned_block->data());
66 m_count += 512;
67 }
68 }
69 }
70}
void compress(const uint8_t input[], bool lastblock=false)
Definition streebog.cpp:123

References compress(), and Botan::BufferSlicer::empty().

◆ clear()

void Botan::Streebog::clear ( )
overridevirtual

Reset the state.

Implements Botan::HashFunction.

Definition at line 42 of file streebog.cpp.

42 {
43 m_count = 0;
44 m_buffer.clear();
45 zeroise(m_S);
46
47 const uint64_t fill = (m_output_bits == 512) ? 0 : 0x0101010101010101;
48 std::fill(m_h.begin(), m_h.end(), fill);
49}
void zeroise(std::vector< T, Alloc > &vec)
Definition secmem.h:125

References Botan::zeroise().

Referenced by final_result(), and Streebog().

◆ clone()

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

Definition at line 85 of file hash.h.

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

References new_object().

◆ compress()

void Botan::Streebog::compress ( const uint8_t input[],
bool lastblock = false )
protected

Definition at line 123 of file streebog.cpp.

123 {
124 uint64_t M[8];
125 std::memcpy(M, input, 64);
126
127 compress_64(M, last_block);
128}
void compress_64(const uint64_t input[], bool lastblock=false)
Definition streebog.cpp:130

References compress_64().

Referenced by add_data(), and final_result().

◆ compress_64()

void Botan::Streebog::compress_64 ( const uint64_t input[],
bool lastblock = false )
protected

Definition at line 130 of file streebog.cpp.

130 {
131 const uint64_t N = last_block ? 0 : force_le(m_count);
132
133 uint64_t hN[8];
134 uint64_t A[8];
135
136 copy_mem(hN, m_h.data(), 8);
137 hN[0] ^= N;
138 lps(hN);
139
140 copy_mem(A, hN, 8);
141
142 for(size_t i = 0; i != 8; ++i) {
143 hN[i] ^= M[i];
144 }
145
146 for(size_t i = 0; i < 12; ++i) { // NOLINT(modernize-loop-convert)
147 for(size_t j = 0; j != 8; ++j) {
148 A[j] ^= force_le(STREEBOG_C[i][j]);
149 }
150 lps(A);
151
152 lps(hN);
153 for(size_t j = 0; j != 8; ++j) {
154 hN[j] ^= A[j];
155 }
156 }
157
158 for(size_t i = 0; i != 8; ++i) {
159 m_h[i] ^= hN[i] ^ M[i];
160 }
161
162 if(!last_block) {
163 uint64_t carry = 0;
164 for(int i = 0; i < 8; i++) {
165 const uint64_t m = force_le(M[i]);
166 const uint64_t hi = force_le(m_S[i]);
167 const uint64_t t = hi + m + carry;
168
169 m_S[i] = force_le(t);
170 if(t != m) {
171 carry = (t < m) ? 1 : 0;
172 }
173 }
174 }
175}
constexpr void copy_mem(T *out, const T *in, size_t n)
Definition mem_ops.h:145
const uint64_t STREEBOG_C[12][8]
void carry(int64_t &h0, int64_t &h1)

References Botan::carry(), Botan::copy_mem(), and Botan::STREEBOG_C.

Referenced by compress(), and final_result().

◆ copy_state()

std::unique_ptr< HashFunction > Botan::Streebog::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 23 of file streebog.cpp.

23 {
24 return std::make_unique<Streebog>(*this);
25}

◆ 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 107 of file hash.cpp.

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

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

◆ 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

References output_length().

◆ final() [2/4]

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

Definition at line 54 of file buf_comp.cpp.

54 {
55 BOTAN_ARG_CHECK(out.size() >= output_length(), "provided output buffer has insufficient capacity");
56 final_result(out);
57}
#define BOTAN_ARG_CHECK(expr, msg)
Definition assert.h:33

References BOTAN_ARG_CHECK, and output_length().

◆ final() [3/4]

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

Definition at line 88 of file buf_comp.h.

88 {
89 out.resize(output_length());
90 final_result(out);
91 }

References output_length().

◆ final() [4/4]

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

Complete the computation and retrieve the final result.

Parameters
outThe byte array to be filled with the result. Must be of length output_length()

Definition at line 69 of file buf_comp.h.

69{ final_result({out, output_length()}); }

References output_length().

Referenced by final_stdvec(), Botan::PseudorandomKeyGeneration::gen(), Botan::TPM2::Verification_Operation::is_valid_signature(), Botan::mgf1_mask(), Botan::KMAC::operator=(), Botan::pbkdf2(), Botan::Sphincs_Hash_Functions_Sha2::PRF_msg(), process(), process(), process(), Botan::TPM2::Signature_Operation::sign(), and Botan::sm2_compute_za().

◆ final_result()

void Botan::Streebog::final_result ( std::span< uint8_t > out)
overrideprotectedvirtual

Write the final output to out

Parameters
outis an output buffer of output_length()

Implements Botan::Buffered_Computation.

Definition at line 75 of file streebog.cpp.

75 {
76 const auto pos = m_buffer.elements_in_buffer();
77
78 const uint8_t padding = 0x01;
79 m_buffer.append({&padding, 1});
80 m_buffer.fill_up_with_zeros();
81
82 compress(m_buffer.consume().data());
83 m_count += pos * 8;
84
85 m_buffer.fill_up_with_zeros();
86 store_le(m_count, m_buffer.directly_modify_first(sizeof(m_count)).data());
87 compress(m_buffer.consume().data(), true);
88
89 compress_64(m_S.data(), true);
90 // FIXME
91 std::memcpy(output.data(), &m_h[8 - output_length() / 8], output_length());
92 clear();
93}
size_t output_length() const override
Definition streebog.h:23
constexpr auto store_le(ParamTs &&... params)
Definition loadstor.h:736

References clear(), compress(), compress_64(), output_length(), and Botan::store_le().

◆ 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>>(); }
void final(uint8_t out[])
Definition buf_comp.h:69

References final().

◆ hash_block_size()

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

Reimplemented from Botan::HashFunction.

Definition at line 30 of file streebog.h.

30{ return 64; }

◆ name()

std::string Botan::Streebog::name ( ) const
overridevirtual
Returns
the hash function name

Implements Botan::HashFunction.

Definition at line 35 of file streebog.cpp.

35 {
36 return fmt("Streebog-{}", m_output_bits);
37}

References Botan::fmt().

◆ new_object()

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

Implements Botan::HashFunction.

Definition at line 25 of file streebog.h.

25{ return std::make_unique<Streebog>(m_output_bits); }

◆ output_length()

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

Implements Botan::Buffered_Computation.

Definition at line 23 of file streebog.h.

23{ return m_output_bits / 8; }

Referenced by final_result().

◆ 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 101 of file buf_comp.h.

101 {
102 update(in, length);
103 return final<T>();
104 }
void update(const uint8_t in[], size_t length)
Definition buf_comp.h:34

References final(), and update().

Referenced by Botan::Kyber_Symmetric_Primitives::H(), Botan::Kyber_Symmetric_Primitives::H(), and Botan::Kyber_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 125 of file buf_comp.h.

125 {
126 update(in);
127 return final<T>();
128 }

References final(), and 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 113 of file buf_comp.h.

113 {
114 update(in);
115 return final<T>();
116 }

References final(), and 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_3, Botan::SHA_512, Botan::SHA_512_256, Botan::SHAKE_128, and Botan::SHAKE_256.

Definition at line 49 of file hash.h.

49{ return "base"; }

Referenced by create(), and 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 305 of file hash.cpp.

305 {
306 return probe_providers_of<HashFunction>(algo_spec, {"base", "commoncrypto"});
307}
std::vector< std::string > probe_providers_of(std::string_view algo_spec, const std::vector< std::string > &possible={"base"})
Definition scan_name.h:105

References Botan::probe_providers_of().

◆ update() [1/4]

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

Add new input to process.

Parameters
inthe input to process as a byte array
lengthof param in in bytes

Definition at line 34 of file buf_comp.h.

34{ add_data({in, length}); }

Referenced by Botan::PseudorandomKeyGeneration::gen(), Botan::LMOTS_Public_Key::LMOTS_Public_Key(), Botan::mgf1_mask(), Botan::pbkdf2(), Botan::Sphincs_Hash_Functions_Sha2::PRF_msg(), process(), process(), process(), Botan::TLS::TLS_NULL_HMAC_AEAD_Mode::set_associated_data_n(), and Botan::sm2_compute_za().

◆ 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)
inherited

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 14 of file buf_comp.cpp.

14 {
15 add_data(as_span_of_bytes(str));
16}
std::span< const uint8_t > as_span_of_bytes(const char *s, size_t len)
Definition mem_utils.h:28

References Botan::as_span_of_bytes().

◆ 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 18 of file buf_comp.cpp.

18 {
19 uint8_t inb[sizeof(val)];
20 store_be(val, inb);
21 add_data({inb, sizeof(inb)});
22}
constexpr auto store_be(ParamTs &&... params)
Definition loadstor.h:745

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 24 of file buf_comp.cpp.

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

References Botan::store_be().

◆ update_be() [3/3]

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

Definition at line 30 of file buf_comp.cpp.

30 {
31 uint8_t inb[sizeof(val)];
32 store_be(val, inb);
33 add_data({inb, sizeof(inb)});
34}

References Botan::store_be().

◆ update_le() [1/3]

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

Definition at line 36 of file buf_comp.cpp.

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

References Botan::store_le().

◆ update_le() [2/3]

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

Definition at line 42 of file buf_comp.cpp.

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

References Botan::store_le().

◆ update_le() [3/3]

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

Definition at line 48 of file buf_comp.cpp.

48 {
49 uint8_t inb[sizeof(val)];
50 store_le(val, inb);
51 add_data({inb, sizeof(inb)});
52}

References Botan::store_le().


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