Skip to content

Commit

Permalink
Hadar/b const mult (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
HadarIngonyama authored Jan 6, 2025
1 parent 29fe5de commit 33c708f
Show file tree
Hide file tree
Showing 8 changed files with 262 additions and 105 deletions.
8 changes: 8 additions & 0 deletions icicle/include/icicle/curves/params/bls12_377.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ namespace bls12_377 {
static constexpr point_field_t weierstrass_b = {0x00000001, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000};

static constexpr bool is_b_u32 = true;
static constexpr bool is_b_neg = false;
}; // G1

struct G2 {
Expand All @@ -47,6 +50,11 @@ namespace bls12_377 {
0x3c6bf800, 0x129207b6, 0xcd5fd889, 0xdc7b4f91,
0x7460c589, 0x43bd0373, 0xdb0fd6f3, 0x010222f6};

static constexpr bool is_b_u32_g2_re = true;
static constexpr bool is_b_neg_g2_re = false;
static constexpr bool is_b_u32_g2_im = false;
static constexpr bool is_b_neg_g2_im = false;

static constexpr g2_point_field_t gen_x = {g2_gen_x_re, g2_gen_x_im};
static constexpr g2_point_field_t gen_y = {g2_gen_y_re, g2_gen_y_im};
static constexpr g2_point_field_t weierstrass_b = {weierstrass_b_g2_re, weierstrass_b_g2_im};
Expand Down
8 changes: 8 additions & 0 deletions icicle/include/icicle/curves/params/bls12_381.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ namespace bls12_381 {
static constexpr point_field_t weierstrass_b = {0x00000004, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000};

static constexpr bool is_b_u32 = true;
static constexpr bool is_b_neg = false;
};

struct G2 {
Expand All @@ -48,6 +51,11 @@ namespace bls12_381 {
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000};

static constexpr bool is_b_u32_g2_re = true;
static constexpr bool is_b_neg_g2_re = false;
static constexpr bool is_b_u32_g2_im = true;
static constexpr bool is_b_neg_g2_im = false;

static constexpr g2_point_field_t gen_x = {g2_gen_x_re, g2_gen_x_im};
static constexpr g2_point_field_t gen_y = {g2_gen_y_re, g2_gen_y_im};
static constexpr g2_point_field_t weierstrass_b = {weierstrass_b_g2_re, weierstrass_b_g2_im};
Expand Down
8 changes: 8 additions & 0 deletions icicle/include/icicle/curves/params/bn254.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ namespace bn254 {
0x00000000, 0x00000000, 0x00000000, 0x00000000};
static constexpr point_field_t weierstrass_b = {0x00000003, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000};

static constexpr bool is_b_u32 = true;
static constexpr bool is_b_neg = false;
}; // G1

struct G2 {
Expand All @@ -40,6 +43,11 @@ namespace bn254 {
static constexpr point_field_t weierstrass_b_g2_im = {0x85c315d2, 0xe4a2bd06, 0xe52d1852, 0xa74fa084,
0xeed8fdf4, 0xcd2cafad, 0x3af0fed4, 0x009713b0};

static constexpr bool is_b_u32_g2_re = false;
static constexpr bool is_b_neg_g2_re = false;
static constexpr bool is_b_u32_g2_im = false;
static constexpr bool is_b_neg_g2_im = false;

static constexpr g2_point_field_t gen_x = {g2_gen_x_re, g2_gen_x_im};
static constexpr g2_point_field_t gen_y = {g2_gen_y_re, g2_gen_y_im};
static constexpr g2_point_field_t weierstrass_b = {weierstrass_b_g2_re, weierstrass_b_g2_im};
Expand Down
17 changes: 14 additions & 3 deletions icicle/include/icicle/curves/params/bw6_761.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ namespace bw6_761 {
0xb3053253, 0x9f9df141, 0x6fc2cdd4, 0xbe3fb90b, 0x717a4c55, 0xcc685d31,
0x71b5b806, 0xc5b8fa17, 0xaf7e0dba, 0x265909f1, 0xa2e573a3, 0x1a7348d2,
0x884c9ec6, 0x0f952589, 0x45cc2a42, 0xe6fd637b, 0x0a6fc574, 0x0058b84e};
// actual value:
// static constexpr point_field_t weierstrass_b = {
// 0x0000008a, 0xf49d0000, 0x70000082, 0xe6913e68, 0xeaf0a437, 0x160cf8ae, 0x5667a8f8, 0x98a116c2,
// 0x73ebff2e, 0x71dcd3dc, 0x12f9fd90, 0x8689c8ed, 0x25b42304, 0x03cebaff, 0xe584e919, 0x707ba638,
// 0x8087be41, 0x528275ef, 0x81d14688, 0xb926186a, 0x04faff3e, 0xd187c940, 0xfb83ce0a, 0x0122e824};
static constexpr point_field_t weierstrass_b = {
0x0000008a, 0xf49d0000, 0x70000082, 0xe6913e68, 0xeaf0a437, 0x160cf8ae, 0x5667a8f8, 0x98a116c2,
0x73ebff2e, 0x71dcd3dc, 0x12f9fd90, 0x8689c8ed, 0x25b42304, 0x03cebaff, 0xe584e919, 0x707ba638,
0x8087be41, 0x528275ef, 0x81d14688, 0xb926186a, 0x04faff3e, 0xd187c940, 0xfb83ce0a, 0x0122e824};
0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000};

static constexpr bool is_b_u32 = true;
static constexpr bool is_b_neg = true;
};

struct G2 {
Expand All @@ -44,5 +52,8 @@ namespace bw6_761 {
0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000};

static constexpr bool is_b_u32 = true;
static constexpr bool is_b_neg = false;
};
} // namespace bw6_761
10 changes: 8 additions & 2 deletions icicle/include/icicle/curves/params/grumpkin.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ namespace grumpkin {
static constexpr point_field_t gen_y = {0x823f272c, 0x833fc48d, 0xf1181294, 0x2d270d45,
0x6a45d63, 0xcf135e75, 0x00000002, 0x00000000};

static constexpr point_field_t weierstrass_b = {0xeffffff0, 0x43e1f593, 0x79b97091, 0x2833e848,
0x8181585d, 0xb85045b6, 0xe131a029, 0x30644e72};
// actual value:
// static constexpr point_field_t weierstrass_b = {0xeffffff0, 0x43e1f593, 0x79b97091, 0x2833e848,
// 0x8181585d, 0xb85045b6, 0xe131a029, 0x30644e72};
static constexpr point_field_t weierstrass_b = {0x00000011, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000};

static constexpr bool is_b_u32 = true;
static constexpr bool is_b_neg = true;
}; // G1
} // namespace grumpkin
Loading

0 comments on commit 33c708f

Please sign in to comment.