Skip to content

Commit

Permalink
use a constant for the file name used for the serialized verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
flihp committed Oct 10, 2024
1 parent 144f859 commit 436c552
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const SEED_LEN: usize = 32;
const KEY_LEN: usize = 32;
const SHARE_LEN: usize = KEY_LEN + 1;
const LABEL: &str = "backup";
const VERIFIER_FILE = "verifier.json";

const SHARES: usize = 5;
const THRESHOLD: usize = 3;
Expand Down Expand Up @@ -234,7 +235,7 @@ impl Hsm {
>(*nzs.as_ref(), None, &mut rng)
.map_err(|e| HsmError::SplitKeyFailed { e })?;

let verifier_path = self.out_dir.join("verifier.json");
let verifier_path = self.out_dir.join(VERIFIER_FILE);
debug!(
"Serializing verifier as json to: {}",
verifier_path.display()
Expand Down Expand Up @@ -430,7 +431,7 @@ impl Hsm {
// deserialize verifier:
// verifier was serialized to output/verifier.json in the provisioning ceremony
// it must be included in and deserialized from the ceremony inputs
let verifier = self.out_dir.join("verifier.json");
let verifier = self.out_dir.join(VERIFIER_FILE);
let verifier = fs::read_to_string(verifier)?;
let verifier: FeldmanVerifier<
Scalar,
Expand Down

0 comments on commit 436c552

Please sign in to comment.