Skip to content

Commit f732500

Browse files
author
Manoranjith
committed
client: Hash the nonce share without encoding
- Nonce share, by itself is a byte array. - Hence, it can be directly hashed without encoding. Signed-off-by: Manoranjith <ponraj.manoranjitha@in.bosch.com>
1 parent 4b80fe3 commit f732500

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

client/proposal.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"perun.network/go-perun/log"
2727
"perun.network/go-perun/wallet"
2828
"perun.network/go-perun/wire"
29-
"perun.network/go-perun/wire/perunio"
3029
pcontext "polycry.pt/poly-go/context"
3130
"polycry.pt/poly-go/sync/atomic"
3231
)
@@ -496,7 +495,7 @@ func nonceShares(proposer, proposee NonceShare) []NonceShare {
496495
func calcNonce(nonceShares []NonceShare) channel.Nonce {
497496
hasher := newHasher()
498497
for i, share := range nonceShares {
499-
if err := perunio.Encode(hasher, share); err != nil {
498+
if _, err := hasher.Write(share[:]); err != nil {
500499
log.Panicf("Failed to encode nonce share %d for hashing", i)
501500
}
502501
}

0 commit comments

Comments
 (0)