File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,8 @@ add (point1 point2 : Point) : Point :=
8484 in mkPoint r_x r_y;
8585
8686--- Subtracts point2 from point1 on the EC.
87- sub (point1 point2 : Point) : Point := add point1 point2@Point{y := 0 - y};
87+ sub (point1 point2 : Point) : Point :=
88+ add point1 point2@Point{y := 0 - Point.y point2};
8889
8990--- Computes point1 + alpha * point2 on the elliptic curve.
9091--- Because the EC operation builtin cannot handle inputs where additions of points with the same x
Original file line number Diff line number Diff line change @@ -32,8 +32,19 @@ poseidonHash2 (x y : Field) : Field :=
3232poseidonHashList (list : List Field) : Field :=
3333 let
3434 go (acc : PoseidonState) : List Field -> PoseidonState
35- | [] := poseidonHash acc@PoseidonState{s0 := s0 + 1}
36- | [x] := poseidonHash acc@PoseidonState{s0 := s0 + x; s1 := s1 + 1}
35+ | [] := poseidonHash acc@PoseidonState{s0 := PoseidonState.s0 acc + 1}
36+ | [x] :=
37+ poseidonHash
38+ acc@PoseidonState{
39+ s0 := PoseidonState.s0 acc + x;
40+ s1 := PoseidonState.s1 acc + 1;
41+ }
3742 | (x1 :: x2 :: xs) :=
38- go (poseidonHash acc@PoseidonState{s0 := s0 + x1; s1 := s1 + x2}) xs;
43+ go
44+ (poseidonHash
45+ acc@PoseidonState{
46+ s0 := PoseidonState.s0 acc + x1;
47+ s1 := PoseidonState.s1 acc + x2;
48+ })
49+ xs;
3950 in PoseidonState.s0 (go (mkPoseidonState 0 0 0) list);
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ package : Package :=
1111 github
1212 "anoma"
1313 "juvix-quickcheck"
14- "4242b864714f98947753544ea1b2cb435f6473d3 ";
14+ "b28c74aeb181712e6a20a4371b09f3e9bea49702 ";
1515 github "anoma" "juvix-test" "85811914324b082549cb1f500323884442fc793c";
1616 ];
1717 };
You can’t perform that action at this time.
0 commit comments