7#include <botan/sodium.h>
9#include <botan/internal/loadstor.h>
10#include <botan/internal/salsa20.h>
15 uint32_t in32[16] = {0};
17 static const uint32_t SIGMA[] = {0x61707865, 0x3320646e, 0x79622d32, 0x6b206574};
46 uint32_t out32[8] = {0};
48 store_le(std::span<uint8_t, 32>(out, 32), out32);
61 uint8_t out[],
const uint8_t in[],
size_t in_len,
const uint8_t nonce[],
const uint8_t key[]) {
66 uint8_t out[],
const uint8_t in[],
size_t in_len,
const uint8_t nonce[], uint64_t ic,
const uint8_t key[]) {
75 salsa.
cipher(in, out, in_len);
88 uint8_t out[],
const uint8_t in[],
size_t in_len,
const uint8_t nonce[],
const uint8_t key[]) {
93 uint8_t out[],
const uint8_t in[],
size_t in_len,
const uint8_t nonce[], uint64_t ic,
const uint8_t key[]) {
102 salsa.
cipher(in, out, in_len);
void seek(uint64_t offset) override
static void hsalsa20(uint32_t output[8], const uint32_t input[16])
void set_iv(const uint8_t iv[], size_t iv_len)
void write_keystream(uint8_t out[], size_t len)
void cipher(const uint8_t in[], uint8_t out[], size_t len)
void set_key(const SymmetricKey &key)
int crypto_stream_salsa20(uint8_t out[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
int crypto_stream_xsalsa20_xor_ic(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], uint64_t ic, const uint8_t key[])
@ crypto_stream_salsa20_NONCEBYTES
@ crypto_stream_xsalsa20_KEYBYTES
@ crypto_stream_xsalsa20_NONCEBYTES
@ crypto_stream_salsa20_KEYBYTES
int crypto_stream_salsa20_xor(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
int crypto_stream_salsa20_xor_ic(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], uint64_t ic, const uint8_t key[])
int crypto_core_hsalsa20(uint8_t out[], const uint8_t in[], const uint8_t key[], const uint8_t c[])
int crypto_stream_xsalsa20(uint8_t out[], size_t ctext_len, const uint8_t nonce[], const uint8_t key[])
int crypto_stream_xsalsa20_xor(uint8_t out[], const uint8_t ptext[], size_t ptext_len, const uint8_t nonce[], const uint8_t key[])
constexpr auto store_le(ParamTs &&... params)
constexpr auto load_le(ParamTs &&... params)