|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <ecc.hpp>
Public Member Functions | |
| Ecc (ExecutionIdManagerInterface &execution_id_manager, GreaterThanInterface >, ToRadixInterface &to_radix, EventEmitterInterface< EccAddEvent > &ecadd_event_emitter, EventEmitterInterface< ScalarMulEvent > &scalar_mul_event_emitter, EventEmitterInterface< EccAddMemoryEvent > &add_memory_event_emitter) | |
| EmbeddedCurvePoint | add (const EmbeddedCurvePoint &p, const EmbeddedCurvePoint &q) override |
| Adds Grumpkin curve points P and Q and emits an EccAddEvent. Corresponds to the non-memory aware subtrace ecc.pil. | |
| EmbeddedCurvePoint | scalar_mul (const EmbeddedCurvePoint &point, const FF &scalar) override |
| Performs scalar multiplication of an FF value with a Grumpkin curve point using the double and add algorithm, and emits a ScalarMulEvent. Corresponds to the non-memory aware subtrace scalar_mul.pil. | |
| void | add (MemoryInterface &memory, const EmbeddedCurvePoint &p, const EmbeddedCurvePoint &q, MemoryAddress dst_address) override |
| Adds Grumpkin curve points P and Q and emits an EccAddMemoryEvent. Corresponds to the memory aware subtrace ecc_mem.pil (namespace ecc_add_mem). | |
Public Member Functions inherited from bb::avm2::simulation::EccInterface | |
| virtual | ~EccInterface ()=default |
|
inline |
|
overridevirtual |
Adds Grumpkin curve points P and Q and emits an EccAddEvent. Corresponds to the non-memory aware subtrace ecc.pil.
| Unexpected | exception if points are not on the curve or not normalized. Note: This function assumes that the points p and q are on the curve. You should only use this function internally if you can guarantee this. Otherwise it is called via the opcode ECADD, see the overloaded function Ecc::add (which performs the curve check). |
| p | The point P. |
| q | The point Q. |
Implements bb::avm2::simulation::EccInterface.
|
overridevirtual |
Adds Grumpkin curve points P and Q and emits an EccAddMemoryEvent. Corresponds to the memory aware subtrace ecc_mem.pil (namespace ecc_add_mem).
| InternalEccException | if
|
| memory | The memory interface. |
| p | The point P. |
| q | The point Q. |
| dst_address | The memory address to write the result of P + Q to. |
Implements bb::avm2::simulation::EccInterface.
|
overridevirtual |
Performs scalar multiplication of an FF value with a Grumpkin curve point using the double and add algorithm, and emits a ScalarMulEvent. Corresponds to the non-memory aware subtrace scalar_mul.pil.
| Unexpected | exception if the input point is not on the curve. Note: This function assumes that the point is on the curve. As this should only be used internally, it is treated as a catastrophic failure if the point is not on the curve. Note: Though Grumpkin scalars are in Fq, not Fr (= our FF), our use cases require FF values. This is safe because |Fr| < |Fq|, so we cannot multiply by invalid scalars. |
| point | The point P. |
| scalar | The FF scalar. |
Implements bb::avm2::simulation::EccInterface.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |