Skip to content

Commit dfaa2ad

Browse files
yelhousniivokub
andauthored
feat: add Grumpkin elliptic curve (native 2-cycle with BN254) (#1409)
Co-authored-by: Ivo Kubjas <[email protected]>
1 parent b152af1 commit dfaa2ad

File tree

9 files changed

+2168
-0
lines changed

9 files changed

+2168
-0
lines changed

std/algebra/defaults.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/consensys/gnark/std/algebra/emulated/sw_emulated"
1212
"github.com/consensys/gnark/std/algebra/native/sw_bls12377"
1313
"github.com/consensys/gnark/std/algebra/native/sw_bls24315"
14+
"github.com/consensys/gnark/std/algebra/native/sw_grumpkin"
1415
"github.com/consensys/gnark/std/math/emulated"
1516
"github.com/consensys/gnark/std/math/emulated/emparams"
1617
)
@@ -58,6 +59,12 @@ func GetCurve[FR emulated.FieldParams, G1El G1ElementT](api frontend.API) (Curve
5859
return ret, fmt.Errorf("new curve: %w", err)
5960
}
6061
*s = c
62+
case *Curve[sw_grumpkin.ScalarField, sw_grumpkin.G1Affine]:
63+
c, err := sw_grumpkin.NewCurve(api)
64+
if err != nil {
65+
return ret, fmt.Errorf("new curve: %w", err)
66+
}
67+
*s = c
6168
default:
6269
return ret, errors.New("unknown type parametrisation")
6370
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Package sw_grumpkin implements the the Grumpkin curve in-circuit.
2+
//
3+
// Grumpkin curve forms a 2-cycle over BN254 so the operations can use the
4+
// native field arithmetics. Grumpkin curve is not pairing friendly, so it is
5+
// not suitable for pairing based proof system recursion.
6+
//
7+
// References:
8+
// https://aztecprotocol.github.io/aztec-connect/primitives.html/
9+
package sw_grumpkin

0 commit comments

Comments
 (0)