Skip to content

Commit

Permalink
RingSize Sanity Check Fix by Slixe
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainDero committed Jun 13, 2023
1 parent 0951e98 commit b9c5fa7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ import "github.com/blang/semver/v4"

// right now it has to be manually changed
// do we need to include git commitsha??
var Version = semver.MustParse("3.5.3-117.DEROHE.STARGATE+18032023")
var Version = semver.MustParse("3.5.3-140.DEROHE.STARGATE+13062023")
18 changes: 13 additions & 5 deletions cryptography/crypto/protocol_structures.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@

package crypto

import "bytes"
import "encoding/binary"
import "math/big"
import "github.com/deroproject/derohe/cryptography/bn256"
import "github.com/deroproject/graviton"
import (
"bytes"
"encoding/binary"
"fmt"
"math/big"

"github.com/deroproject/derohe/cryptography/bn256"
"github.com/deroproject/graviton"
)

type Statement struct {
RingSize uint64
Expand Down Expand Up @@ -98,6 +102,9 @@ func (s *Statement) Deserialize(r *bytes.Reader) error {
return err
}
s.RingSize = 1 << length
if s.RingSize > 128 {
return fmt.Errorf("ring size is too large")
}

s.Bytes_per_publickey, err = r.ReadByte()
if err != nil {
Expand Down Expand Up @@ -223,3 +230,4 @@ type Proof struct {
//ip *InnerProduct
}
*/

0 comments on commit b9c5fa7

Please sign in to comment.