mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
crypto/bn256/google: align behavior
This commit is contained in:
parent
22a832c6b7
commit
35120930af
1 changed files with 2 additions and 2 deletions
|
|
@ -128,7 +128,7 @@ func (e *G1) Marshal() []byte {
|
|||
func (e *G1) Unmarshal(m []byte) ([]byte, error) {
|
||||
// Each value is a 256-bit number.
|
||||
const numBytes = 256 / 8
|
||||
if len(m) != 2*numBytes {
|
||||
if len(m) < 2*numBytes {
|
||||
return nil, errors.New("bn256: not enough data")
|
||||
}
|
||||
// Unmarshal the points and check their caps
|
||||
|
|
@ -253,7 +253,7 @@ func (n *G2) Marshal() []byte {
|
|||
func (e *G2) Unmarshal(m []byte) ([]byte, error) {
|
||||
// Each value is a 256-bit number.
|
||||
const numBytes = 256 / 8
|
||||
if len(m) != 4*numBytes {
|
||||
if len(m) < 4*numBytes {
|
||||
return nil, errors.New("bn256: not enough data")
|
||||
}
|
||||
// Unmarshal the points and check their caps
|
||||
|
|
|
|||
Loading…
Reference in a new issue