Skip to content

Commit

Permalink
remove redundant slice cast
Browse files Browse the repository at this point in the history
Signed-off-by: Serhat Şevki Dinçer <jfcgauss@gmail.com>
  • Loading branch information
jfcg authored and ale-linux committed Apr 14, 2021
1 parent 5d500ee commit 4365412
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions idemix/credrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewCredRequest(sk *FP256BN.BIG, IssuerNonce []byte, ipk *IssuerPublicKey, r
// 3 elements of G1 each taking 2*FieldBytes+1 bytes
// hash of the issuer public key of length FieldBytes
// issuer nonce of length FieldBytes
proofData := make([]byte, len([]byte(credRequestLabel))+3*(2*FieldBytes+1)+2*FieldBytes)
proofData := make([]byte, len(credRequestLabel)+3*(2*FieldBytes+1)+2*FieldBytes)
index := 0
index = appendBytesString(proofData, index, credRequestLabel)
index = appendBytesG1(proofData, index, t)
Expand Down Expand Up @@ -93,7 +93,7 @@ func (m *CredRequest) Check(ipk *IssuerPublicKey) error {
t.Sub(Nym.Mul(ProofC)) // t = h_{sk}^s / Nym^C

// Recompute challenge
proofData := make([]byte, len([]byte(credRequestLabel))+3*(2*FieldBytes+1)+2*FieldBytes)
proofData := make([]byte, len(credRequestLabel)+3*(2*FieldBytes+1)+2*FieldBytes)
index := 0
index = appendBytesString(proofData, index, credRequestLabel)
index = appendBytesG1(proofData, index, t)
Expand Down
4 changes: 2 additions & 2 deletions idemix/nymsignature.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewNymSignature(sk *FP256BN.BIG, Nym *FP256BN.ECP, RNym *FP256BN.BIG, ipk *
// - one bigint (hash of the issuer public key) of length FieldBytes
// - disclosed attributes
// - message being signed
proofData := make([]byte, len([]byte(signLabel))+2*(2*FieldBytes+1)+FieldBytes+len(msg))
proofData := make([]byte, len(signLabel)+2*(2*FieldBytes+1)+FieldBytes+len(msg))
index := 0
index = appendBytesString(proofData, index, signLabel)
index = appendBytesG1(proofData, index, t)
Expand Down Expand Up @@ -88,7 +88,7 @@ func (sig *NymSignature) Ver(nym *FP256BN.ECP, ipk *IssuerPublicKey, msg []byte)
t.Sub(nym.Mul(ProofC)) // t = h_{sk}^{s_{sk} \ cdot h_r^{s_{RNym}

// Recompute challenge
proofData := make([]byte, len([]byte(signLabel))+2*(2*FieldBytes+1)+FieldBytes+len(msg))
proofData := make([]byte, len(signLabel)+2*(2*FieldBytes+1)+FieldBytes+len(msg))
index := 0
index = appendBytesString(proofData, index, signLabel)
index = appendBytesG1(proofData, index, t)
Expand Down
4 changes: 2 additions & 2 deletions idemix/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func NewSignature(cred *Credential, sk *FP256BN.BIG, Nym *FP256BN.ECP, RNym *FP2
// disclosed attributes
// message being signed
// the amount of bytes needed for the nonrevocation proof
proofData := make([]byte, len([]byte(signLabel))+7*(2*FieldBytes+1)+FieldBytes+len(Disclosure)+len(msg)+ProofBytes[RevocationAlgorithm(cri.RevocationAlg)])
proofData := make([]byte, len(signLabel)+7*(2*FieldBytes+1)+FieldBytes+len(Disclosure)+len(msg)+ProofBytes[RevocationAlgorithm(cri.RevocationAlg)])
index := 0
index = appendBytesString(proofData, index, signLabel)
index = appendBytesG1(proofData, index, t1)
Expand Down Expand Up @@ -349,7 +349,7 @@ func (sig *Signature) Ver(Disclosure []byte, ipk *IssuerPublicKey, msg []byte, a
// one bigint (hash of the issuer public key) of length FieldBytes
// disclosed attributes
// message that was signed
proofData := make([]byte, len([]byte(signLabel))+7*(2*FieldBytes+1)+FieldBytes+len(Disclosure)+len(msg)+ProofBytes[RevocationAlgorithm(sig.NonRevocationProof.RevocationAlg)])
proofData := make([]byte, len(signLabel)+7*(2*FieldBytes+1)+FieldBytes+len(Disclosure)+len(msg)+ProofBytes[RevocationAlgorithm(sig.NonRevocationProof.RevocationAlg)])
index := 0
index = appendBytesString(proofData, index, signLabel)
index = appendBytesG1(proofData, index, t1)
Expand Down

0 comments on commit 4365412

Please sign in to comment.