forked from Consensys/gnark-crypto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgurvy.go
46 lines (39 loc) · 1.07 KB
/
gurvy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Copyright © 2020 ConsenSys
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package gurvy is an elliptic curve (+pairing) library. It currently expose efficient implementations for
// bls381, bls377, bn256 and bw761
package gurvy
// do not modify the order of this enum
const (
UNKNOWN ID = iota
BLS377
BLS381
BN256
BW761
)
// ID represent a unique ID for a curve
type ID uint16
func (id ID) String() string {
switch id {
case BLS377:
return "bls377"
case BLS381:
return "bls381"
case BN256:
return "bn256"
case BW761:
return "bw761"
default:
panic("unimplemented curve ID")
}
}