Add domain to all signature funcitons, modify validate_proof_of_possession()

This commit is contained in:
Kirk Baird
2019-02-15 13:58:14 +11:00
parent 88c42bf3fb
commit 977f3edfb6
19 changed files with 98 additions and 65 deletions

View File

@@ -10,6 +10,7 @@ pub use self::traits::{
};
const PHASE_0_CUSTODY_BIT: bool = false;
const DOMAIN_ATTESTATION: u64 = 1;
#[derive(Debug, PartialEq)]
pub enum PollOutcome {
@@ -137,7 +138,7 @@ impl<T: SlotClock, U: BeaconNode, V: DutiesReader, W: Signer> Attester<T, U, V,
self.store_produce(attestation_data);
self.signer
.sign_attestation_message(&attestation_data.signable_message(PHASE_0_CUSTODY_BIT)[..])
.sign_attestation_message(&attestation_data.signable_message(PHASE_0_CUSTODY_BIT)[..], DOMAIN_ATTESTATION)
}
/// Returns `true` if signing some attestation_data is safe (non-slashable).