mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 19:36:44 +01:00
mv of babyjub.PublicKey to babyjub.PublicKeyComp
Update usage of `*babyjub.PublicKey` to `babyjub.PublicKeyComp` - when the key is not defined, internally is used `babyjub.EmptyBJJComp`, which is a `[32]byte` of zeroes of type `babyjub.PublicKeyComp` - the API continues returning `nil` when the key is not defined
This commit is contained in:
@@ -27,15 +27,15 @@ func EthAddrToBigInt(a ethCommon.Address) *big.Int {
|
||||
// the Hermez checksum at the last byte, and is encoded in BigEndian) and
|
||||
// returns the corresponding *babyjub.PublicKey. This method is not part of the
|
||||
// spec, is used for importing javascript test vectors data.
|
||||
func BJJFromStringWithChecksum(s string) (*babyjub.PublicKey, error) {
|
||||
func BJJFromStringWithChecksum(s string) (babyjub.PublicKeyComp, error) {
|
||||
b, err := hex.DecodeString(s)
|
||||
if err != nil {
|
||||
return nil, tracerr.Wrap(err)
|
||||
return EmptyBJJComp, tracerr.Wrap(err)
|
||||
}
|
||||
pkBytes := SwapEndianness(b)
|
||||
var pkComp babyjub.PublicKeyComp
|
||||
copy(pkComp[:], pkBytes[:])
|
||||
return pkComp.Decompress()
|
||||
return pkComp, nil
|
||||
}
|
||||
|
||||
// CopyBigInt returns a copy of the big int
|
||||
|
||||
Reference in New Issue
Block a user