parent
bfd424db13
commit
81c8204427
@ -0,0 +1,17 @@ |
|||||||
|
package bn254 |
||||||
|
|
||||||
|
import ( |
||||||
|
"bytes" |
||||||
|
|
||||||
|
"github.com/consensys/gnark-crypto/ecc" |
||||||
|
gnark "github.com/consensys/gnark/backend/groth16" |
||||||
|
) |
||||||
|
|
||||||
|
func FromBytesToVerifyingKey(verifyingKey []byte) (gnark.VerifyingKey, error) { |
||||||
|
vk := gnark.NewVerifyingKey(ecc.BN254) |
||||||
|
_, err := vk.ReadFrom(bytes.NewReader(verifyingKey)) |
||||||
|
if err != nil { |
||||||
|
return nil, err |
||||||
|
} |
||||||
|
return vk, nil |
||||||
|
} |
Loading…
Reference in new issue