Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
rotate.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
8#include <cstddef>
9#include <cstdint>
10
11namespace bb::numeric {
12
13constexpr inline uint64_t rotate64(const uint64_t value, const uint64_t rotation)
14{
15 return rotation != 0U ? (value >> rotation) + (value << (64 - rotation)) : value;
16}
17
18constexpr inline uint32_t rotate32(const uint32_t value, const uint32_t rotation)
19{
20 return rotation != 0U ? (value >> rotation) + (value << (32 - rotation)) : value;
21}
22} // namespace bb::numeric
constexpr uint64_t rotate64(const uint64_t value, const uint64_t rotation)
Definition rotate.hpp:13
constexpr uint32_t rotate32(const uint32_t value, const uint32_t rotation)
Definition rotate.hpp:18