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
7{
8 uint128_t lo = static_cast<uint128_t>(x & MASK_128);
9 uint128_t hi = static_cast<uint128_t>(x >> 128);
10 return { lo, hi };
11}
12
14{
15 uint64_t lo = static_cast<uint64_t>(x & MASK_64);
16 uint64_t hi = static_cast<uint64_t>(x >> 64);
17 return { lo, hi };
18}
19
20} // namespace bb::avm2::simulation
U256Decomposition decompose_256(const uint256_t &x)
U128Decomposition decompose_128(const uint128_t &x)
constexpr uint128_t MASK_64
Definition constants.hpp:23
constexpr uint256_t MASK_128
Definition constants.hpp:22
unsigned __int128 uint128_t
Definition serialize.hpp:44