Consensys / gnark

gnark is a fast zk-SNARK library that offers a high-level API to design circuits. The library is open source and developed under the Apache 2.0 license

Home Page:https://hackmd.io/@gnark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set bls12_381 G1Affine from [48]frontend.Variable?

readygo67 opened this issue · comments

commented

Bls12-381 public key is usually represented by 48 bytes array. In a my case, a [48]frontend.variable is used to store the publickey bytes, and I need to rebuild the G1Affine(gnark/std/alegra/emulated/sw_bls12381.go).
Is there any method to achieve this goal?

the 48-byte arrays represents points on the curve. Wouldn't it make most sense to convert between the raw bytes with this and convert to gnark-compatible type with this?

the 48-byte arrays represents points on the curve. Wouldn't it make most sense to convert between the raw bytes with this and convert to gnark-compatible type with this?

Indeed I would recommend the same approach.