20#include "pw_bytes/span.h"
21#include "pw_crypto/chacha20_backend.h"
22#include "pw_status/status.h"
32inline constexpr size_t kKeySizeBytes = 32;
33inline constexpr size_t kNonceSizeBytes = 12;
54 if (key.size() != kKeySizeBytes) {
57 if (nonce.size() != kNonceSizeBytes) {
60 if (output.size() < input.size()) {
64 return backend::DoChaCha20Crypt(key, nonce, input, output);
static constexpr Status InvalidArgument()
Definition: status.h:164
Definition: span_impl.h:235
Status Crypt(span< const std::byte > key, span< const std::byte > nonce, span< const std::byte > input, span< std::byte > output)
Definition: chacha20.h:50
Cryptography library.
Definition: chacha20.h:24