Skip to content

Commit

Permalink
Add more curves to idemixgen
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Sorniotti <[email protected]>
  • Loading branch information
ale-linux committed Oct 16, 2023
1 parent 31eab86 commit d8e84ea
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tools/idemixgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,25 @@ const (
BLS12_377_GURVY = "BLS12_377_GURVY"
BLS12_381_GURVY = "BLS12_381_GURVY"
BLS12_381 = "BLS12_381"
BLS12_381_BBS = "BLS12_381_BBS"
BLS12_381_BBS_GURVY = "BLS12_381_BBS_GURVY"
)

// command line flags
var (
app = kingpin.New("idemixgen", "Utility for generating key material to be used with the Identity Mixer MSP in Hyperledger Fabric")

outputDir = app.Flag("output", "The output directory in which to place artifacts").Default("idemix-config").String()
curveID = app.Flag("curve", "The curve to use to generate the crypto material").Short('c').Default(FP256BN_AMCL).Enum(FP256BN_AMCL, BN254, FP256BN_AMCL_MIRACL, BLS12_377_GURVY, BLS12_381_GURVY, BLS12_381)
useAries = app.Flag("aries", "Use the aries-backed implementation").Bool()
curveID = app.Flag("curve", "The curve to use to generate the crypto material").Short('c').Default(FP256BN_AMCL).
Enum(FP256BN_AMCL,
BN254,
FP256BN_AMCL_MIRACL,
BLS12_377_GURVY,
BLS12_381_GURVY,
BLS12_381,
BLS12_381_BBS,
BLS12_381_BBS_GURVY)
useAries = app.Flag("aries", "Use the aries-backed implementation").Bool()

genIssuerKey = app.Command("ca-keygen", "Generate CA key material")
genSignerConfig = app.Command("signerconfig", "Generate a default signer for this Idemix MSP")
Expand Down Expand Up @@ -98,6 +108,12 @@ func main() {
case BLS12_381:
curve = math.Curves[math.BLS12_381]
tr = &amcl.Gurvy{C: curve}
case BLS12_381_BBS:
curve = math.Curves[math.BLS12_381_BBS]
tr = &amcl.Gurvy{C: curve}
case BLS12_381_BBS_GURVY:
curve = math.Curves[math.BLS12_381_BBS_GURVY]
tr = &amcl.Gurvy{C: curve}
default:
handleError(fmt.Errorf("invalid curve [%s]", *curveID))
}
Expand Down

0 comments on commit d8e84ea

Please sign in to comment.