Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
ecc_events.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
barretenberg/vm2/common/field.hpp
"
4
#include "
barretenberg/vm2/common/memory_types.hpp
"
5
6
namespace
bb::avm2::simulation
{
7
8
struct
EccException
:
public
std::runtime_error {
9
EccException
(
const
std::string& message)
10
:
std
::runtime_error(
"EccException: "
+ message)
11
{}
12
};
13
14
struct
EccAddEvent
{
15
EmbeddedCurvePoint
p
;
16
EmbeddedCurvePoint
q
;
17
EmbeddedCurvePoint
result
;
18
};
19
20
struct
EccAddMemoryEvent
{
21
uint32_t
execution_clk
;
22
uint32_t
space_id
;
23
EmbeddedCurvePoint
p
;
24
EmbeddedCurvePoint
q
;
25
EmbeddedCurvePoint
result
;
26
MemoryAddress
dst_address
;
27
};
28
29
struct
ScalarMulIntermediateState
{
30
/* Accumulated result on this bit of the scalar */
31
EmbeddedCurvePoint
res
;
32
/* 2**(bit_idx) * point */
33
EmbeddedCurvePoint
temp
;
34
/* current bit of the scalar */
35
bool
bit
;
36
37
bool
operator==
(
const
ScalarMulIntermediateState
& other)
const
=
default
;
38
};
39
40
struct
ScalarMulEvent
{
41
EmbeddedCurvePoint
point
;
42
FF
scalar
;
43
std::vector<ScalarMulIntermediateState>
intermediate_states
;
44
EmbeddedCurvePoint
result
;
45
46
bool
operator==
(
const
ScalarMulEvent
& other)
const
=
default
;
47
};
48
49
}
// namespace bb::avm2::simulation
bb::avm2::StandardAffinePoint< AvmFlavorSettings::EmbeddedCurve::AffineElement >
memory_types.hpp
bb::avm2::simulation
Definition
address_derivation.cpp:8
bb::avm2::MemoryAddress
uint32_t MemoryAddress
Definition
memory_types.hpp:11
bb::avm2::FF
AvmFlavorSettings::FF FF
Definition
field.hpp:10
std
STL namespace.
std::get
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition
tuple.hpp:13
bb::avm2::simulation::EccAddEvent
Definition
ecc_events.hpp:14
bb::avm2::simulation::EccAddEvent::q
EmbeddedCurvePoint q
Definition
ecc_events.hpp:16
bb::avm2::simulation::EccAddEvent::p
EmbeddedCurvePoint p
Definition
ecc_events.hpp:15
bb::avm2::simulation::EccAddEvent::result
EmbeddedCurvePoint result
Definition
ecc_events.hpp:17
bb::avm2::simulation::EccAddMemoryEvent
Definition
ecc_events.hpp:20
bb::avm2::simulation::EccAddMemoryEvent::execution_clk
uint32_t execution_clk
Definition
ecc_events.hpp:21
bb::avm2::simulation::EccAddMemoryEvent::q
EmbeddedCurvePoint q
Definition
ecc_events.hpp:24
bb::avm2::simulation::EccAddMemoryEvent::p
EmbeddedCurvePoint p
Definition
ecc_events.hpp:23
bb::avm2::simulation::EccAddMemoryEvent::result
EmbeddedCurvePoint result
Definition
ecc_events.hpp:25
bb::avm2::simulation::EccAddMemoryEvent::dst_address
MemoryAddress dst_address
Definition
ecc_events.hpp:26
bb::avm2::simulation::EccAddMemoryEvent::space_id
uint32_t space_id
Definition
ecc_events.hpp:22
bb::avm2::simulation::EccException
Definition
ecc_events.hpp:8
bb::avm2::simulation::EccException::EccException
EccException(const std::string &message)
Definition
ecc_events.hpp:9
bb::avm2::simulation::ScalarMulEvent
Definition
ecc_events.hpp:40
bb::avm2::simulation::ScalarMulEvent::result
EmbeddedCurvePoint result
Definition
ecc_events.hpp:44
bb::avm2::simulation::ScalarMulEvent::scalar
FF scalar
Definition
ecc_events.hpp:42
bb::avm2::simulation::ScalarMulEvent::operator==
bool operator==(const ScalarMulEvent &other) const =default
bb::avm2::simulation::ScalarMulEvent::point
EmbeddedCurvePoint point
Definition
ecc_events.hpp:41
bb::avm2::simulation::ScalarMulEvent::intermediate_states
std::vector< ScalarMulIntermediateState > intermediate_states
Definition
ecc_events.hpp:43
bb::avm2::simulation::ScalarMulIntermediateState
Definition
ecc_events.hpp:29
bb::avm2::simulation::ScalarMulIntermediateState::bit
bool bit
Definition
ecc_events.hpp:35
bb::avm2::simulation::ScalarMulIntermediateState::operator==
bool operator==(const ScalarMulIntermediateState &other) const =default
bb::avm2::simulation::ScalarMulIntermediateState::res
EmbeddedCurvePoint res
Definition
ecc_events.hpp:31
bb::avm2::simulation::ScalarMulIntermediateState::temp
EmbeddedCurvePoint temp
Definition
ecc_events.hpp:33
field.hpp
src
barretenberg
vm2
simulation
events
ecc_events.hpp
Generated by
1.9.8