Skip to content

Commit

Permalink
Seed phrases
Browse files Browse the repository at this point in the history
  • Loading branch information
davxy committed Nov 16, 2024
1 parent bb08915 commit 435aa8b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/pedersen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl<S: PedersenSuite> Verifier<S> for Public<S> {
#[cfg(test)]
pub(crate) mod testing {
use super::*;
use crate::testing::{self as common, random_val, TEST_SEED};
use crate::testing::{self as common, random_val, PEDERSEN_BASE_SEED, TEST_SEED};

pub fn prove_verify<S: PedersenSuite>() {
use pedersen::{Prover, Verifier};
Expand All @@ -163,9 +163,10 @@ pub(crate) mod testing {
}

pub fn blinding_base_check<S: PedersenSuite>() {
const BLINDING_BASE_SEED: &[u8] = b"w3f/ring-proof/blinding";
let p = S::data_to_point(BLINDING_BASE_SEED).unwrap();
assert_eq!(S::BLINDING_BASE, p);
assert_eq!(
S::data_to_point(PEDERSEN_BASE_SEED).unwrap(),
S::BLINDING_BASE
);
}

#[macro_export]
Expand Down
7 changes: 4 additions & 3 deletions src/suites/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ impl Suite for TestSuite {

impl PedersenSuite for TestSuite {
const BLINDING_BASE: AffinePoint = {
const X: BaseField =
MontFp!("2842812182132742151291439804105987992770071362848070020835328675429531065386");
const X: BaseField = MontFp!(
"56166678312616788007069565072535608368274441012407488217322349490274061293828"
);
const Y: BaseField = MontFp!(
"51537589290258453714586392305999864217349499404270029291993413345863140891436"
"55452291704810100370049689540036330133850202475722787526070685722371210180696"
);
AffinePoint::new_unchecked(X, Y)
};
Expand Down
12 changes: 12 additions & 0 deletions src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ use ark_std::{vec, vec::Vec};
use crate::*;
use ark_std::{rand::RngCore, UniformRand};

// The basis that hides the hidden light, which eludes the mind and creates darkness for those who see.
pub const PEDERSEN_BASE_SEED: &[u8] =
b"basis caecans lucis occultae, quae mentem fugit et tenebras iis qui vident creat";

// "The substratum of the accumulator, which in the silence of time guards the hidden secret"
pub const ACCUMULATOR_BASE_SEED: &[u8] =
b"substratum accumulatoris, quod in silentio temporis arcanum absconditum custodit";

// "A shadow that fills the void left by lost souls, echoing among the darkness"
pub const PADDING_SEED: &[u8] =
b"umbra quae vacuum implet, ab animabus perditis relictum, inter tenebras resonans";

pub const TEST_SEED: &[u8] = b"seed";

// Zcash SRS file derived from (https://zfnd.org/conclusion-of-the-powers-of-tau-ceremony).
Expand Down

0 comments on commit 435aa8b

Please sign in to comment.