| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
y |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#ifndef BOTAN_AES_CRYSTALS_XOF_H_ |
| 10 |
#define BOTAN_AES_CRYSTALS_XOF_H_ |
| 11 |
|
| 12 |
#include <botan/secmem.h> |
| 13 |
#include <botan/xof.h> |
| 14 |
|
| 15 |
namespace Botan { |
| 16 |
|
| 17 |
class StreamCipher; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
class BOTAN_TEST_API AES_256_CTR_XOF final : public XOF { |
| 27 |
public: |
| 28 |
AES_256_CTR_XOF(); |
| 29 |
~AES_256_CTR_XOF() override; |
| 30 |
|
| 31 |
void reset() override; |
| 32 |
|
| 33 |
std::string name() const override { return "CTR-BE(AES-256)"; } |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
bool valid_salt_length(size_t iv_length) const override; |
| 39 |
Key_Length_Specification key_spec() const override; |
| 40 |
|
| 41 |
size_t block_size() const override { return 16; } |
| 42 |
|
| 43 |
std::unique_ptr<XOF> copy_state() const override; |
| 44 |
|
| 45 |
std::unique_ptr<XOF> new_object() const override { return std::make_unique<AES_256_CTR_XOF>(); } |
| 46 |
|
| 47 |
bool accepts_input() const override { return false; } |
| 48 |
|
| 49 |
private: |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
void start_msg(std::span<const uint8_t> iv = {}, std::span<const uint8_t> key = {}) override; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
void add_data(std::span<const uint8_t> input) override; |
| 60 |
|
| 61 |
void generate_bytes(std::span<uint8_t> output) override; |
| 62 |
|
| 63 |
private: |
| 64 |
std::unique_ptr<StreamCipher> m_stream_cipher; |
| 65 |
}; |
| 66 |
|
| 67 |
} |
| 68 |
|
| 69 |
#endif |