From 4365412733e4be7496b24c1c7bc5540aef0e6993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serhat=20=C5=9Eevki=20Din=C3=A7er?= Date: Wed, 14 Apr 2021 22:05:54 +0300 Subject: [PATCH] remove redundant slice cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Serhat Şevki Dinçer --- idemix/credrequest.go | 4 ++-- idemix/nymsignature.go | 4 ++-- idemix/signature.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/idemix/credrequest.go b/idemix/credrequest.go index ff8472a9530..dfd36b91ee5 100644 --- a/idemix/credrequest.go +++ b/idemix/credrequest.go @@ -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) @@ -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) diff --git a/idemix/nymsignature.go b/idemix/nymsignature.go index bf8b212bfc1..a12a999360f 100644 --- a/idemix/nymsignature.go +++ b/idemix/nymsignature.go @@ -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) @@ -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) diff --git a/idemix/signature.go b/idemix/signature.go index 009b0ae0002..521480e9af1 100644 --- a/idemix/signature.go +++ b/idemix/signature.go @@ -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) @@ -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)