Changeset View
Changeset View
Standalone View
Standalone View
src/crypto/chacha20.cpp
// Copyright (c) 2017 The Bitcoin Core developers | // Copyright (c) 2017 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
// Based on the public domain implementation 'merged' by D. J. Bernstein | // Based on the public domain implementation 'merged' by D. J. Bernstein | ||||
// See https://cr.yp.to/chacha.html. | // See https://cr.yp.to/chacha.html. | ||||
#include "crypto/chacha20.h" | #include <crypto/chacha20.h> | ||||
#include "crypto/common.h" | #include <crypto/common.h> | ||||
#include <cstring> | #include <cstring> | ||||
constexpr static inline uint32_t rotl32(uint32_t v, int c) { | constexpr static inline uint32_t rotl32(uint32_t v, int c) { | ||||
return (v << c) | (v >> (32 - c)); | return (v << c) | (v >> (32 - c)); | ||||
} | } | ||||
#define QUARTERROUND(a, b, c, d) \ | #define QUARTERROUND(a, b, c, d) \ | ||||
▲ Show 20 Lines • Show All 173 Lines • Show Last 20 Lines |