@@ -8,13 +8,13 @@ package crypto
88
99import (
1010 "crypto/sha256"
11- "encoding/json"
1211 "math/bits"
1312 "strconv"
1413
1514 mathlib "github.com/IBM/mathlib"
1615 "github.com/hyperledger-labs/fabric-smart-client/platform/common/utils/collections"
17- math2 "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/crypto/math"
16+ "github.com/hyperledger-labs/fabric-token-sdk/token/core/common/encoding/json"
17+ "github.com/hyperledger-labs/fabric-token-sdk/token/core/zkatdlog/crypto/math"
1818 "github.com/hyperledger-labs/fabric-token-sdk/token/driver"
1919 pp2 "github.com/hyperledger-labs/fabric-token-sdk/token/driver/protos-go/pp"
2020 "github.com/pkg/errors"
@@ -53,16 +53,16 @@ func (rpp *RangeProofParams) Validate(curveID mathlib.CurveID) error {
5353 if len (rpp .LeftGenerators ) != len (rpp .RightGenerators ) {
5454 return errors .Errorf ("invalid range proof parameters: the size of the left generators does not match the size of the right generators [%d vs, %d]" , len (rpp .LeftGenerators ), len (rpp .RightGenerators ))
5555 }
56- if err := math2 .CheckElement (rpp .Q , curveID ); err != nil {
56+ if err := math .CheckElement (rpp .Q , curveID ); err != nil {
5757 return errors .Wrapf (err , "invalid range proof parameters: generator Q is invalid" )
5858 }
59- if err := math2 .CheckElement (rpp .P , curveID ); err != nil {
59+ if err := math .CheckElement (rpp .P , curveID ); err != nil {
6060 return errors .Wrapf (err , "invalid range proof parameters: generator P is invalid" )
6161 }
62- if err := math2 .CheckElements (rpp .LeftGenerators , curveID , rpp .BitLength ); err != nil {
62+ if err := math .CheckElements (rpp .LeftGenerators , curveID , rpp .BitLength ); err != nil {
6363 return errors .Wrap (err , "invalid range proof parameters, left generators is invalid" )
6464 }
65- if err := math2 .CheckElements (rpp .RightGenerators , curveID , rpp .BitLength ); err != nil {
65+ if err := math .CheckElements (rpp .RightGenerators , curveID , rpp .BitLength ); err != nil {
6666 return errors .Wrap (err , "invalid range proof parameters, right generators is invalid" )
6767 }
6868
@@ -289,7 +289,7 @@ func (pp *PublicParams) Validate() error {
289289 return errors .Errorf ("invalid public parameters: invalid idemix curveID [%d > %d]" , int (pp .Curve ), len (mathlib .Curves )- 1 )
290290 }
291291 }
292- if err := math2 .CheckElements (pp .PedersenGenerators , pp .Curve , 3 ); err != nil {
292+ if err := math .CheckElements (pp .PedersenGenerators , pp .Curve , 3 ); err != nil {
293293 return errors .Wrapf (err , "invalid pedersen generators" )
294294 }
295295 if pp .RangeProofParams == nil {
0 commit comments