barretenberg
Loading...
Searching...
No Matches
grumpkin.hpp
1#pragma once
2
3#include "../../groups/group.hpp"
4#include "../bn254/fq.hpp"
5#include "../bn254/fr.hpp"
6
7namespace grumpkin {
8
9constexpr size_t MAX_NO_WRAP_INTEGER_BIT_LENGTH = 252;
10
11using fq = barretenberg::fr;
12using fr = barretenberg::fq;
13
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 // have checked in grumpkin.test_b that b is Montgomery form of -17
20 static constexpr barretenberg::fr b{
21 0xdd7056026000005a, 0x223fa97acb319311, 0xcc388229877910c0, 0x34394632b724eaa
22 };
23 static constexpr barretenberg::fr a{ 0UL, 0UL, 0UL, 0UL };
24
25 // generator point = (x, y) = (1, sqrt(-16)), sqrt(-16) = 4i
26 static constexpr barretenberg::fr one_x = barretenberg::fr::one();
27 static constexpr barretenberg::fr one_y{
28 0x11b2dff1448c41d8UL, 0x23d3446f21c77dc3UL, 0xaa7b8cf435dfafbbUL, 0x14b34cf69dc25d68UL
29 };
30};
32
33}; // namespace grumpkin
34
35namespace curve {
36class Grumpkin {
37 public:
40 using Group = typename grumpkin::g1;
41 using Element = typename Group::element;
42 using AffineElement = typename Group::affine_element;
43
44 // TODO(#673): This flag is temporary. It is needed in the verifier classes (GeminiVerifier, etc.) while these
45 // classes are instantiated with "native" curve types. Eventually, the verifier classes will be instantiated only
46 // with stdlib types, and "native" verification will be acheived via a simulated builder.
47 static constexpr bool is_stdlib_type = false;
48};
49} // namespace curve
group class. Represents an elliptic curve group element. Group is parametrised by coordinate_field an...
Definition: group.hpp:29
Definition: grumpkin.hpp:36
Definition: grumpkin.hpp:14