Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
g1.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Planned, auditors: [], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
8
9#include "../../groups/group.hpp"
10#include "./fq.hpp"
11#include "./fr.hpp"
12
13namespace bb {
15 static constexpr bool USE_ENDOMORPHISM = true;
16 static constexpr bool can_hash_to_curve = true;
17 static constexpr bool small_elements = true;
18 static constexpr bool has_a = false;
19
20 // Generator = (1, sqrt(4)) = (1, 2)
21 static constexpr fq one_x = fq::one();
22#if defined(__SIZEOF_INT128__) && !defined(__wasm__)
23 static constexpr fq one_y{ 0xa6ba871b8b1e1b3aUL, 0x14f1d651eb8e167bUL, 0xccdd46def0f28c58UL, 0x1c14ef83340fbe5eUL };
24#else
25 static constexpr fq one_y{ 0x9d0709d62af99842UL, 0xf7214c0419c29186UL, 0xa603f5090339546dUL, 0x1b906c52ac7a88eaUL };
26#endif
27 static constexpr fq a{ 0UL, 0UL, 0UL, 0UL };
28#if defined(__SIZEOF_INT128__) && !defined(__wasm__)
29 static constexpr fq b{ 0x7a17caa950ad28d7UL, 0x1f6ac17ae15521b9UL, 0x334bea4e696bd284UL, 0x2a1f6744ce179d8eUL };
30#else
31 static constexpr fq b{ 0xeb8a8ec140766463UL, 0xf2b1f20626a3da49UL, 0xf905ef8d84d5fea4UL, 0x2958a27c02b7cd5fUL };
32#endif
33};
34
36
37// specialize the name in msgpack schema generation
38// consumed by the typescript schema compiler, helps disambiguate templates
39inline std::string msgpack_schema_name(g1::affine_element const& /*unused*/)
40{
41 return "Bn254G1Point";
42}
43
44} // namespace bb
group class. Represents an elliptic curve group element. Group is parametrised by Fq and Fr
Definition group.hpp:36
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
std::string msgpack_schema_name(g1::affine_element const &)
Definition g1.hpp:39
static constexpr fq b
Definition g1.hpp:31
static constexpr bool small_elements
Definition g1.hpp:17
static constexpr bool USE_ENDOMORPHISM
Definition g1.hpp:15
static constexpr fq one_x
Definition g1.hpp:21
static constexpr bool can_hash_to_curve
Definition g1.hpp:16
static constexpr fq a
Definition g1.hpp:27
static constexpr bool has_a
Definition g1.hpp:18
static constexpr fq one_y
Definition g1.hpp:25
static constexpr field one()