barretenberg
Loading...
Searching...
No Matches
bn254.hpp
1#pragma once
2#include "../bigfield/bigfield.hpp"
3#include "../biggroup/biggroup.hpp"
4#include "../field/field.hpp"
5#include "barretenberg/ecc/curves/types.hpp"
6
7namespace proof_system::plonk {
8namespace stdlib {
9
10template <typename CircuitBuilder> struct bn254 {
11 static constexpr proof_system::CurveType type = proof_system::CurveType::BN254;
12 // TODO(#673): This flag is temporary. It is needed in the verifier classes (GeminiVerifier, etc.) while these
13 // classes are instantiated with "native" curve types. Eventually, the verifier classes will be instantiated only
14 // with stdlib types, and "native" verification will be acheived via a simulated builder.
15 static constexpr bool is_stdlib_type = true;
16
17 // Corresponding native types (used exclusively for testing)
20 using GroupNative = curve::BN254::Group;
21
22 // Stdlib types corresponding to those defined in the native description of the curve.
23 // Note: its useful to have these type names match the native analog exactly so that components that digest a Curve
24 // (e.g. Gemini) can be agnostic as to whether they're operating on native or stdlib types.
28 using Element = Group;
29 using AffineElement = Group;
30
31 // Additional types with no analog in the native description of the curve
32 using Builder = CircuitBuilder;
37 using uint32_ct = stdlib::uint32<CircuitBuilder>;
38
41
42}; // namespace bn254
43} // namespace stdlib
44} // namespace proof_system::plonk
Definition: bigfield.hpp:17
Definition: byte_array.hpp:9
Definition: biggroup.hpp:22
Definition: field.hpp:10
Definition: witness.hpp:10
Definition: widget.bench.cpp:13
Definition: bn254.hpp:10