Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
uint_decomposition.cpp
Go to the documentation of this file.
3
4namespace bb::avm2::simulation {
5
6const uint256_t TWO_POW_128 = uint256_t(1) << 128;
7const uint128_t TWO_POW_64 = static_cast<uint128_t>(1) << 64;
8
10{
11 uint128_t lo = static_cast<uint128_t>(x % TWO_POW_128);
12 uint128_t hi = static_cast<uint128_t>(x >> 128);
13 return { lo, hi };
14}
15
17{
18 uint64_t lo = static_cast<uint64_t>(x % TWO_POW_64);
19 uint64_t hi = static_cast<uint64_t>(x >> 64);
20 return { lo, hi };
21}
22
23} // namespace bb::avm2::simulation
U256Decomposition decompose(const uint256_t &x)
const uint256_t TWO_POW_128
unsigned __int128 uint128_t
Definition serialize.hpp:44