#include "./salsa.hpp" /////////////////////////////////////////////////////////////////////////////// std::array util::crypto::salsa20 (const std::array bytes) noexcept { auto x = *reinterpret_cast*> (&bytes); auto y = x; for (auto &t: x) t = util::ltoh (t); for (int i = 0; i < 10; ++i) x = salsa::doubleround (x); for (size_t i = 0; i < std::size (y); ++i) x[i] += y[i]; for (auto &t: x) t = util::htol (t); return *reinterpret_cast*> (&x); }