17 const auto key = ConsumeFixedLengthByteVector<std::byte>(fuzzed_data_provider,
Poly1305::KEYLEN);
18 const auto in = ConsumeRandomLengthByteVector<std::byte>(fuzzed_data_provider);
31 Poly1305 poly_full{key}, poly_split{key};
34 std::vector<std::byte> total_input;
38 auto in = ConsumeRandomLengthByteVector<std::byte>(provider);
39 poly_split.Update(in);
41 total_input.insert(total_input.end(), in.begin(), in.end());
45 poly_full.Update(total_input);
48 std::array<std::byte, Poly1305::TAGLEN> tag_split, tag_full;
49 poly_split.Finalize(tag_split);
50 poly_full.Finalize(tag_full);
51 assert(tag_full == tag_split);
std::vector< T > ConsumeBytes(size_t num_bytes)
C++ wrapper with std::byte Span interface around poly1305_donna code.
static constexpr unsigned KEYLEN
Length of the keys expected by the constructor.
Poly1305 & Update(Span< const std::byte > msg) noexcept
Process message bytes.
void Finalize(Span< std::byte > out) noexcept
Write authentication tag to 16-byte out.
static constexpr unsigned TAGLEN
Length of the output produced by Finalize().
FUZZ_TARGET(crypto_poly1305)
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.