Skip to content

Commit

Permalink
Merge pull request #11 from Zeeve-App/fix_sign_sequence_comparison
Browse files Browse the repository at this point in the history
Fix comparison while creating signatures
  • Loading branch information
christophercampbell authored Aug 21, 2023
2 parents 0812ae5 + 57ff461 commit 8365568
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sequence/sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"crypto/ecdsa"
"errors"
"math/big"
"strings"

"github.com/0xPolygon/supernets2-data-availability/batch"
"github.com/0xPolygon/supernets2-data-availability/offchaindata"
Expand Down Expand Up @@ -61,7 +62,7 @@ func (s *Sequence) Sign(privateKey *ecdsa.PrivateKey) (*SignedSequence, error) {
sBytes := sig[32:64]
vByte := sig[64]

if common.Bytes2Hex(sBytes) > "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0" {
if strings.ToUpper(common.Bytes2Hex(sBytes)) > "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0" {
magicNumber := common.Hex2Bytes("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141")
sBig := big.NewInt(0).SetBytes(sBytes)
magicBig := big.NewInt(0).SetBytes(magicNumber)
Expand Down

0 comments on commit 8365568

Please sign in to comment.