Skip to content

Commit ecc1330

Browse files
committed
Rename all bacon to beacon.
1 parent 00a927e commit ecc1330

File tree

4 files changed

+38
-38
lines changed

4 files changed

+38
-38
lines changed

storage-proofs/src/bacon_post.rs renamed to storage-proofs/src/beacon_post.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct PublicParams<T: Domain, V: Vdf<T>> {
2626
impl<T: Domain, V: Vdf<T>> ParameterSetIdentifier for PublicParams<T, V> {
2727
fn parameter_set_identifier(&self) -> String {
2828
format!(
29-
"bacon_post::PublicParams{{pub_params_hvh_post: {}, post_periods_count: {}",
29+
"beacon_post::PublicParams{{pub_params_hvh_post: {}, post_periods_count: {}",
3030
self.pub_params_hvh_post.parameter_set_identifier(),
3131
self.post_periods_count
3232
)
@@ -59,7 +59,7 @@ impl<'a, H: 'a + Hasher> PrivateInputs<'a, H> {
5959
}
6060
}
6161

62-
/// Bacon-PoSt
62+
/// Beacon-PoSt
6363
/// This is one construction of a Proof-of-Spacetime.
6464
/// It currently only supports proving over a single sector.
6565
#[derive(Clone, Debug)]
@@ -72,7 +72,7 @@ impl<'a, H: Hasher + 'a, V: Vdf<H::Domain>> Proof<'a, H, V> {
7272
}
7373

7474
#[derive(Clone, Debug, Default)]
75-
pub struct BaconPoSt<H: Hasher, V: Vdf<H::Domain>> {
75+
pub struct BeaconPoSt<H: Hasher, V: Vdf<H::Domain>> {
7676
_t: PhantomData<H>,
7777
_v: PhantomData<V>,
7878
}
@@ -98,7 +98,7 @@ impl Beacon {
9898
}
9999
}
100100

101-
impl<'a, H: Hasher, V: Vdf<H::Domain>> ProofScheme<'a> for BaconPoSt<H, V>
101+
impl<'a, H: Hasher, V: Vdf<H::Domain>> ProofScheme<'a> for BeaconPoSt<H, V>
102102
where
103103
H: 'a,
104104
{
@@ -138,7 +138,7 @@ where
138138

139139
// First (t = 0)
140140
{
141-
// Run Bacon
141+
// Run Beacon
142142
let r = beacon.get::<H::Domain>(0);
143143

144144
// Generate challenges
@@ -162,7 +162,7 @@ where
162162

163163
// The rest (t = 1..post_periods_count)
164164
for t in 1..post_periods_count {
165-
// Run Bacon
165+
// Run Beacon
166166
let r = beacon.get::<H::Domain>(t);
167167
let x = extract_post_input::<H, V>(&proofs_hvh_post[t - 1]);
168168

@@ -289,7 +289,7 @@ mod tests {
289289
use crate::vdf_sloth;
290290

291291
#[test]
292-
fn test_bacon_post_basics() {
292+
fn test_beacon_post_basics() {
293293
let rng = &mut XorShiftRng::from_seed([0x3dbe6259, 0x8d313d76, 0x3237db17, 0xe5bc0654]);
294294

295295
let sp = SetupParams::<PedersenDomain, vdf_sloth::Sloth> {
@@ -306,7 +306,7 @@ mod tests {
306306
post_periods_count: 3,
307307
};
308308

309-
let pub_params = BaconPoSt::<PedersenHasher, vdf_sloth::Sloth>::setup(&sp).unwrap();
309+
let pub_params = BeaconPoSt::<PedersenHasher, vdf_sloth::Sloth>::setup(&sp).unwrap();
310310

311311
let data0: Vec<u8> = (0..1024)
312312
.flat_map(|_| fr_into_bytes::<Bls12>(&rng.gen()))
@@ -330,8 +330,8 @@ mod tests {
330330
_h: PhantomData,
331331
};
332332

333-
let proof = BaconPoSt::prove(&pub_params, &pub_inputs, &priv_inputs).unwrap();
333+
let proof = BeaconPoSt::prove(&pub_params, &pub_inputs, &priv_inputs).unwrap();
334334

335-
assert!(BaconPoSt::verify(&pub_params, &pub_inputs, &proof).unwrap());
335+
assert!(BeaconPoSt::verify(&pub_params, &pub_inputs, &proof).unwrap());
336336
}
337337
}

storage-proofs/src/circuit/bacon_post.rs renamed to storage-proofs/src/circuit/beacon_post.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ use bellman::{Circuit, ConstraintSystem, SynthesisError};
44
use pairing::bls12_381::{Bls12, Fr};
55
use sapling_crypto::jubjub::JubjubEngine;
66

7-
use crate::bacon_post::BaconPoSt;
7+
use crate::beacon_post::BeaconPoSt;
88
use crate::circuit::hvh_post;
99
use crate::compound_proof::{CircuitComponent, CompoundProof};
1010
use crate::hasher::Hasher;
1111
use crate::parameter_cache::{CacheableParameters, ParameterSetIdentifier};
1212
use crate::proof::ProofScheme;
1313
use crate::vdf::Vdf;
1414

15-
/// This is the `BACON-PoSt` circuit.
16-
pub struct BaconPoStCircuit<'a, E: JubjubEngine, H: Hasher, V: Vdf<H::Domain>> {
15+
/// This is the `Beacon-PoSt` circuit.
16+
pub struct BeaconPoStCircuit<'a, E: JubjubEngine, H: Hasher, V: Vdf<H::Domain>> {
1717
/// Parameters for the engine.
1818
pub params: &'a E::Params,
1919

@@ -34,48 +34,48 @@ pub struct BaconPoStCircuit<'a, E: JubjubEngine, H: Hasher, V: Vdf<H::Domain>> {
3434
_v: PhantomData<V>,
3535
}
3636

37-
pub struct BaconPoStCompound {}
37+
pub struct BeaconPoStCompound {}
3838

3939
#[derive(Clone, Default)]
4040
pub struct ComponentPrivateInputs {}
4141

4242
impl<'a, E: JubjubEngine, H: Hasher, V: Vdf<H::Domain>> CircuitComponent
43-
for BaconPoStCircuit<'a, E, H, V>
43+
for BeaconPoStCircuit<'a, E, H, V>
4444
{
4545
type ComponentPrivateInputs = ComponentPrivateInputs;
4646
}
4747

4848
impl<'a, H: Hasher, V: Vdf<H::Domain>>
49-
CompoundProof<'a, Bls12, BaconPoSt<H, V>, BaconPoStCircuit<'a, Bls12, H, V>>
50-
for BaconPoStCompound
49+
CompoundProof<'a, Bls12, BeaconPoSt<H, V>, BeaconPoStCircuit<'a, Bls12, H, V>>
50+
for BeaconPoStCompound
5151
where
5252
<V as Vdf<H::Domain>>::PublicParams: Send + Sync,
5353
<V as Vdf<H::Domain>>::Proof: Send + Sync,
5454
H: 'a,
5555
{
5656
fn generate_public_inputs(
57-
_pub_in: &<BaconPoSt<H, V> as ProofScheme<'a>>::PublicInputs,
58-
_pub_params: &<BaconPoSt<H, V> as ProofScheme<'a>>::PublicParams,
57+
_pub_in: &<BeaconPoSt<H, V> as ProofScheme<'a>>::PublicInputs,
58+
_pub_params: &<BeaconPoSt<H, V> as ProofScheme<'a>>::PublicParams,
5959
_partition_k: Option<usize>,
6060
) -> Vec<Fr> {
6161
unimplemented!();
6262
}
6363
fn circuit(
64-
_pub_in: &<BaconPoSt<H, V> as ProofScheme<'a>>::PublicInputs,
65-
_component_private_inputs:<BaconPoStCircuit<'a, Bls12,H,V> as CircuitComponent>::ComponentPrivateInputs,
66-
_vanilla_proof: &<BaconPoSt<H, V> as ProofScheme<'a>>::Proof,
67-
_pub_params: &<BaconPoSt<H, V> as ProofScheme<'a>>::PublicParams,
64+
_pub_in: &<BeaconPoSt<H, V> as ProofScheme<'a>>::PublicInputs,
65+
_component_private_inputs:<BeaconPoStCircuit<'a, Bls12,H,V> as CircuitComponent>::ComponentPrivateInputs,
66+
_vanilla_proof: &<BeaconPoSt<H, V> as ProofScheme<'a>>::Proof,
67+
_pub_params: &<BeaconPoSt<H, V> as ProofScheme<'a>>::PublicParams,
6868
_engine_params: &'a <Bls12 as JubjubEngine>::Params,
69-
) -> BaconPoStCircuit<'a, Bls12, H, V> {
69+
) -> BeaconPoStCircuit<'a, Bls12, H, V> {
7070
unimplemented!()
7171
}
7272
}
7373

7474
impl<E: JubjubEngine, C: Circuit<E>, P: ParameterSetIdentifier> CacheableParameters<E, C, P>
75-
for BaconPoStCompound
75+
for BeaconPoStCompound
7676
{
7777
fn cache_prefix() -> String {
78-
String::from("bacon-post")
78+
String::from("beacon-post")
7979
}
8080
}
8181

@@ -122,7 +122,7 @@ impl<E: JubjubEngine, C: Circuit<E>, P: ParameterSetIdentifier> CacheableParamet
122122
// }
123123

124124
impl<'a, E: JubjubEngine, H: Hasher, V: Vdf<H::Domain>> Circuit<E>
125-
for BaconPoStCircuit<'a, E, H, V>
125+
for BeaconPoStCircuit<'a, E, H, V>
126126
{
127127
fn synthesize<CS: ConstraintSystem<E>>(self, cs: &mut CS) -> Result<(), SynthesisError> {
128128
let post_periods_count = self.vdf_ys_vec.len();
@@ -223,7 +223,7 @@ mod tests {
223223
use rand::{Rng, SeedableRng, XorShiftRng};
224224
use sapling_crypto::jubjub::JubjubBls12;
225225

226-
use crate::bacon_post;
226+
use crate::beacon_post;
227227
use crate::circuit::test::*;
228228
use crate::drgraph::{new_seed, BucketGraph, Graph};
229229
use crate::fr32::fr_into_bytes;
@@ -233,13 +233,13 @@ mod tests {
233233
use crate::vdf_sloth;
234234

235235
#[test]
236-
fn test_bacon_post_circuit_with_bls12_381() {
236+
fn test_beacon_post_circuit_with_bls12_381() {
237237
let params = &JubjubBls12::new();
238238
let rng = &mut XorShiftRng::from_seed([0x3dbe6259, 0x8d313d76, 0x3237db17, 0xe5bc0654]);
239239

240240
let lambda = 32;
241241

242-
let sp = bacon_post::SetupParams::<PedersenDomain, vdf_sloth::Sloth> {
242+
let sp = beacon_post::SetupParams::<PedersenDomain, vdf_sloth::Sloth> {
243243
setup_params_hvh_post: hvh_post::SetupParams::<PedersenDomain, vdf_sloth::Sloth> {
244244
challenge_count: 4,
245245
sector_size: 256 * lambda,
@@ -254,7 +254,7 @@ mod tests {
254254
};
255255

256256
let pub_params =
257-
bacon_post::BaconPoSt::<PedersenHasher, vdf_sloth::Sloth>::setup(&sp).unwrap();
257+
beacon_post::BeaconPoSt::<PedersenHasher, vdf_sloth::Sloth>::setup(&sp).unwrap();
258258

259259
let data0: Vec<u8> = (0..256)
260260
.flat_map(|_| fr_into_bytes::<Bls12>(&rng.gen()))
@@ -268,16 +268,16 @@ mod tests {
268268
let graph1 = BucketGraph::<PedersenHasher>::new(256, 5, 0, new_seed());
269269
let tree1 = graph1.merkle_tree(data1.as_slice()).unwrap();
270270

271-
let pub_inputs = bacon_post::PublicInputs {
271+
let pub_inputs = beacon_post::PublicInputs {
272272
commitments: vec![tree0.root(), tree1.root()],
273273
};
274274
let replicas = [&data0[..], &data1[..]];
275275
let trees = [&tree0, &tree1];
276-
let priv_inputs = bacon_post::PrivateInputs::new(&replicas[..], &trees[..]);
276+
let priv_inputs = beacon_post::PrivateInputs::new(&replicas[..], &trees[..]);
277277

278-
let proof = BaconPoSt::prove(&pub_params, &pub_inputs, &priv_inputs).unwrap();
278+
let proof = BeaconPoSt::prove(&pub_params, &pub_inputs, &priv_inputs).unwrap();
279279

280-
assert!(BaconPoSt::verify(&pub_params, &pub_inputs, &proof).unwrap());
280+
assert!(BeaconPoSt::verify(&pub_params, &pub_inputs, &proof).unwrap());
281281

282282
// actual circuit test
283283

@@ -354,7 +354,7 @@ mod tests {
354354

355355
let mut cs = TestConstraintSystem::<Bls12>::new();
356356

357-
let instance = BaconPoStCircuit::<Bls12, PedersenHasher, vdf_sloth::Sloth> {
357+
let instance = BeaconPoStCircuit::<Bls12, PedersenHasher, vdf_sloth::Sloth> {
358358
params,
359359
// beacon_randomness_vec,
360360
// challenges_vec,

storage-proofs/src/circuit/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mod constraint;
22

33
pub mod por;
44

5-
pub mod bacon_post;
5+
pub mod beacon_post;
66
pub mod drgporep;
77
pub mod hvh_post;
88
pub mod kdf;

storage-proofs/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ pub mod test_helper;
4747

4848
pub mod example_helper;
4949

50-
pub mod bacon_post;
5150
pub mod batchpost;
51+
pub mod beacon_post;
5252
pub mod challenge_derivation;
5353
pub mod circuit;
5454
pub mod compound_proof;

0 commit comments

Comments
 (0)