Skip to content
Snippets Groups Projects
Commit b7ddf59a authored by capossele's avatar capossele
Browse files

:lock: adds distributed public key check

parent 5b8f1c5c
No related branches found
No related tags found
No related merge requests found
package collectiveBeacon package collectiveBeacon
import ( import (
"bytes"
"crypto/sha512" "crypto/sha512"
"errors" "errors"
...@@ -47,6 +48,10 @@ func VerifyCollectiveBeacon(state *state.State, data *events.CollectiveBeaconEve ...@@ -47,6 +48,10 @@ func VerifyCollectiveBeacon(state *state.State, data *events.CollectiveBeaconEve
return err return err
} }
if !bytes.Equal(data.Dpk, state.Committee().DistributedPK) {
return errors.New("Distributed Public Key does not match")
}
if err := verifySignature(data); err != nil { if err := verifySignature(data); err != nil {
return err return err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment