#pragma once

#include <cstddef>
#include <cstdint>
#include <vector>

namespace rosetta::nativecrypto {

bool xchacha20poly1305_encrypt(
    const uint8_t *plaintext,
    std::size_t plaintext_length,
    const uint8_t *key32,
    const uint8_t *nonce24,
    std::vector<uint8_t> &ciphertext_with_tag
);

bool xchacha20poly1305_decrypt(
    const uint8_t *ciphertext_with_tag,
    std::size_t ciphertext_with_tag_length,
    const uint8_t *key32,
    const uint8_t *nonce24,
    std::vector<uint8_t> &plaintext
);

bool xchacha20_xor(
    const uint8_t *input,
    std::size_t input_length,
    const uint8_t *key32,
    const uint8_t *nonce24,
    std::vector<uint8_t> &output
);

bool hsalsa20_derive(
    const uint8_t *raw_dh32,
    std::vector<uint8_t> &shared_key32
);

} // namespace rosetta::nativecrypto
