8#include <botan/internal/shake.h>
10#include <botan/exceptn.h>
11#include <botan/internal/fmt.h>
16 if(output_bits % 8 != 0) {
22 return fmt(
"SHAKE-128({})", m_output_bits);
26 return std::make_unique<SHAKE_128>(m_output_bits);
30 return std::make_unique<SHAKE_128>(*
this);
33void SHAKE_128::add_data(std::span<const uint8_t> input) {
37void SHAKE_128::final_result(std::span<uint8_t> output) {
44 if(output_bits % 8 != 0) {
50 return fmt(
"SHAKE-256({})", m_output_bits);
54 return std::make_unique<SHAKE_256>(m_output_bits);
58 return std::make_unique<SHAKE_256>(*
this);
61void SHAKE_256::add_data(std::span<const uint8_t> input) {
65void SHAKE_256::final_result(std::span<uint8_t> output) {
void squeeze(std::span< uint8_t > output)
Expand output data from the current Keccak state.
void absorb(std::span< const uint8_t > input)
Absorb input data into the Keccak sponge.
void finish()
Add final padding (as provided in the constructor) and permute.
std::unique_ptr< HashFunction > new_object() const override
SHAKE_128(size_t output_bits)
std::string name() const override
std::unique_ptr< HashFunction > copy_state() const override
std::unique_ptr< HashFunction > new_object() const override
SHAKE_256(size_t output_bits)
std::string name() const override
std::unique_ptr< HashFunction > copy_state() const override
std::string fmt(std::string_view format, const T &... args)