Skip to content

Commit

Permalink
anemoi: set constant private members const_a, const_b explicitly as c…
Browse files Browse the repository at this point in the history
…onstants
  • Loading branch information
Vesselin Velichkov committed Sep 5, 2022
1 parent d67e25d commit 18a7e49
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions libsnark/gadgetlib1/gadgets/hashes/anemoi/anemoi_components.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ namespace libsnark
{

#define ANEMOI_BLS12_381_CONST_ALPHA 5
#define ANEMOI_BLS12_381_CONST_BETA 2 // = G1
#define ANEMOI_BLS12_381_CONST_GAMMA 5 // TODO: value by spec is 0
#define ANEMOI_BLS12_381_CONST_DELTA 0 // TODO: value by spec is G1.inv()
// equals to G1
#define ANEMOI_BLS12_381_CONST_BETA 2
// TODO: value by spec is 0
#define ANEMOI_BLS12_381_CONST_GAMMA 5
// TODO: value by spec is G1.inv()
#define ANEMOI_BLS12_381_CONST_DELTA 0

/// Compute y = const_a x^2 + const_b
/// x: input
Expand All @@ -33,8 +36,8 @@ template<typename FieldT> class anemoi_power_two_gadget : public gadget<FieldT>
{
private:
// constants
FieldT const_a;
FieldT const_b;
const FieldT const_a;
const FieldT const_b;

public:
// input/output
Expand Down Expand Up @@ -62,8 +65,8 @@ class anemoi_power_three_gadget : public gadget<FieldT>
/// internal (i.e. intermediate) variable
pb_variable<FieldT> internal;
/// constants
FieldT const_a;
FieldT const_b;
const FieldT const_a;
const FieldT const_b;

public:
/// input/output
Expand Down

0 comments on commit 18a7e49

Please sign in to comment.