@@ -4,16 +4,16 @@ use bellman::{Circuit, ConstraintSystem, SynthesisError};
44use pairing:: bls12_381:: { Bls12 , Fr } ;
55use sapling_crypto:: jubjub:: JubjubEngine ;
66
7- use crate :: bacon_post :: BaconPoSt ;
7+ use crate :: beacon_post :: BeaconPoSt ;
88use crate :: circuit:: hvh_post;
99use crate :: compound_proof:: { CircuitComponent , CompoundProof } ;
1010use crate :: hasher:: Hasher ;
1111use crate :: parameter_cache:: { CacheableParameters , ParameterSetIdentifier } ;
1212use crate :: proof:: ProofScheme ;
1313use 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 ) ]
4040pub struct ComponentPrivateInputs { }
4141
4242impl < ' 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
4848impl < ' 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
5151where
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
7474impl < 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
124124impl < ' 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,
0 commit comments