Skip to content

Commit b9c5fa7

Browse files
committed
RingSize Sanity Check Fix by Slixe
1 parent 0951e98 commit b9c5fa7

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

config/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ import "github.com/blang/semver/v4"
2020

2121
// right now it has to be manually changed
2222
// do we need to include git commitsha??
23-
var Version = semver.MustParse("3.5.3-117.DEROHE.STARGATE+18032023")
23+
var Version = semver.MustParse("3.5.3-140.DEROHE.STARGATE+13062023")

cryptography/crypto/protocol_structures.go

+13-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616

1717
package crypto
1818

19-
import "bytes"
20-
import "encoding/binary"
21-
import "math/big"
22-
import "github.com/deroproject/derohe/cryptography/bn256"
23-
import "github.com/deroproject/graviton"
19+
import (
20+
"bytes"
21+
"encoding/binary"
22+
"fmt"
23+
"math/big"
24+
25+
"github.com/deroproject/derohe/cryptography/bn256"
26+
"github.com/deroproject/graviton"
27+
)
2428

2529
type Statement struct {
2630
RingSize uint64
@@ -98,6 +102,9 @@ func (s *Statement) Deserialize(r *bytes.Reader) error {
98102
return err
99103
}
100104
s.RingSize = 1 << length
105+
if s.RingSize > 128 {
106+
return fmt.Errorf("ring size is too large")
107+
}
101108

102109
s.Bytes_per_publickey, err = r.ReadByte()
103110
if err != nil {
@@ -223,3 +230,4 @@ type Proof struct {
223230
//ip *InnerProduct
224231
}
225232
*/
233+

0 commit comments

Comments
 (0)