Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agreement/cryptoVerifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func makeUnauthenticatedVote(l Ledger, sender basics.Address, selection *crypto.

m, _ := membership(l, rv.Sender, rv.Round, rv.Period, rv.Step)
cred := committee.MakeCredential(&selection.SK, m.Selector)
ephID := basics.OneTimeIDForRound(rv.Round, voting.KeyDilution(config.Consensus[protocol.ConsensusCurrentVersion]))
ephID := basics.OneTimeIDForRound(rv.Round, voting.KeyDilution(config.Consensus[protocol.ConsensusCurrentVersion].DefaultKeyDilution))
sig := voting.Sign(ephID, rv)

return unauthenticatedVote{
Expand Down
2 changes: 1 addition & 1 deletion agreement/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func makeVote(rv rawVote, voting crypto.OneTimeSigner, selection *crypto.VRFSecr
}
}

ephID := basics.OneTimeIDForRound(rv.Round, voting.KeyDilution(proto))
ephID := basics.OneTimeIDForRound(rv.Round, voting.KeyDilution(proto.DefaultKeyDilution))
sig := voting.Sign(ephID, rv)
if (sig == crypto.OneTimeSignature{}) {
return unauthenticatedVote{}, fmt.Errorf("makeVote: got back empty signature for vote")
Expand Down
8 changes: 3 additions & 5 deletions crypto/onetimesig.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ import (
"encoding/binary"
"fmt"

"github.com/algorand/go-deadlock"

"github.com/algorand/go-algorand/config"
"github.com/algorand/go-algorand/logging"
"github.com/algorand/go-algorand/protocol"
"github.com/algorand/go-deadlock"
)

// A OneTimeSignature is a cryptographic signature that is produced a limited
Expand Down Expand Up @@ -432,10 +430,10 @@ type OneTimeSigner struct {
}

// KeyDilution returns the appropriate key dilution value for a OneTimeSigner.
func (ots OneTimeSigner) KeyDilution(params config.ConsensusParams) uint64 {
func (ots OneTimeSigner) KeyDilution(defaultKeyDilution uint64) uint64 {
if ots.OptionalKeyDilution != 0 {
return ots.OptionalKeyDilution
}

return params.DefaultKeyDilution
return defaultKeyDilution
}
2 changes: 1 addition & 1 deletion node/netprio.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (node *AlgorandFullNode) MakePrioResponse(challenge string) []byte {
}

signer := maxPart.VotingSigner()
ephID := basics.OneTimeIDForRound(voteRound, signer.KeyDilution(proto))
ephID := basics.OneTimeIDForRound(voteRound, signer.KeyDilution(proto.DefaultKeyDilution))

rs.Round = voteRound
rs.Sender = maxPart.Address()
Expand Down