From 549526a4281f1fb878dda6396660deb23d68a9f2 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Tue, 13 Aug 2024 07:49:22 -0700 Subject: [PATCH] Remove an unnecessary loop from hashPointToR --- sign/bdn/bdn.go | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/sign/bdn/bdn.go b/sign/bdn/bdn.go index d722bcd1..b1a8c25e 100644 --- a/sign/bdn/bdn.go +++ b/sign/bdn/bdn.go @@ -32,23 +32,16 @@ var modulus128 = new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 128), big.NewI // We also use the entire roster so that the coefficient will vary for the same // public key used in different roster func hashPointToR(pubs []kyber.Point) ([]kyber.Scalar, error) { - peers := make([][]byte, len(pubs)) - for i, pub := range pubs { - peer, err := pub.MarshalBinary() - if err != nil { - return nil, err - } - - peers[i] = peer - } - h, err := blake2s.NewXOF(blake2s.OutputLengthUnknown, nil) if err != nil { return nil, err } - - for _, peer := range peers { - _, err := h.Write(peer) + for _, pub := range pubs { + peer, err := pub.MarshalBinary() + if err != nil { + return nil, err + } + _, err = h.Write(peer) if err != nil { return nil, err }