Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
eth_address.cpp
Go to the documentation of this file.
2
5
7using bb::avm2::FF;
8
9namespace {
10
11EthAddress ff_to_eth_address(const FF& field)
12{
13 return EthAddress(static_cast<uint256_t>(field).slice(0, MAX_ETH_ADDRESS_BIT_SIZE));
14}
15
16} // namespace
17
19{
20 return ff_to_eth_address(generate_random_field(rng));
21}
FF generate_random_field(std::mt19937_64 &rng)
Definition field.cpp:25
#define MAX_ETH_ADDRESS_BIT_SIZE
EthAddress generate_random_eth_address(std::mt19937_64 &rng)
AvmFlavorSettings::FF FF
Definition field.hpp:10
C slice(C const &container, size_t start)
Definition container.hpp:9
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13