@@ -1296,10 +1296,22 @@ impl<F: FieldWitness> InnerCurve<F> {
1296
1296
let proj: GroupProjective < F :: Parameters > = ark_ff:: UniformRand :: rand ( & mut rng) ;
1297
1297
let proj: F :: Projective = proj. into ( ) ;
1298
1298
1299
+ let proj2 = proj;
1300
+ LATEST_RANDOM . set ( Box :: new ( move || {
1301
+ let this = Self { inner : proj2 } ;
1302
+ format ! ( "{:#?}" , this. to_affine( ) )
1303
+ } ) ) ;
1304
+
1299
1305
Self { inner : proj }
1300
1306
}
1301
1307
}
1302
1308
1309
+ use std:: cell:: RefCell ;
1310
+
1311
+ thread_local ! {
1312
+ static LATEST_RANDOM : RefCell <Box <dyn Fn ( ) -> String >> = RefCell :: new( Box :: new( String :: new) ) ;
1313
+ }
1314
+
1303
1315
impl InnerCurve < Fp > {
1304
1316
// TODO: Remove this
1305
1317
pub fn rand ( ) -> Self {
@@ -4013,6 +4025,7 @@ pub(super) fn create_proof<C: ProofConstants, F: FieldWitness>(
4013
4025
witness_aux_hash,
4014
4026
prev_challenges_hash,
4015
4027
group_map_hash,
4028
+ latest_random : LATEST_RANDOM . with_borrow ( |fun| ( fun) ( ) ) ,
4016
4029
} ;
4017
4030
4018
4031
ProofError :: ProvingErrorWithContext ( context)
@@ -4089,6 +4102,7 @@ pub mod debug {
4089
4102
pub witness_aux_hash : String ,
4090
4103
pub prev_challenges_hash : String ,
4091
4104
pub group_map_hash : String ,
4105
+ pub latest_random : String ,
4092
4106
}
4093
4107
4094
4108
// Manual implementation because String does not implement binprot traits (because unbounded)
@@ -4102,19 +4116,22 @@ pub mod debug {
4102
4116
witness_aux_hash,
4103
4117
prev_challenges_hash,
4104
4118
group_map_hash,
4119
+ latest_random,
4105
4120
} = self ;
4106
4121
let inner_error: & [ u8 ] = inner_error. as_bytes ( ) ;
4107
4122
let witness_primary_hash: & [ u8 ] = witness_primary_hash. as_bytes ( ) ;
4108
4123
let witness_aux_hash: & [ u8 ] = witness_aux_hash. as_bytes ( ) ;
4109
4124
let prev_challenges_hash: & [ u8 ] = prev_challenges_hash. as_bytes ( ) ;
4110
4125
let group_map_hash: & [ u8 ] = group_map_hash. as_bytes ( ) ;
4126
+ let latest_random: & [ u8 ] = latest_random. as_bytes ( ) ;
4111
4127
binprot:: BinProtWrite :: binprot_write ( & inner_error, w) ?;
4112
4128
binprot:: BinProtWrite :: binprot_write ( witness_primary, w) ?;
4113
4129
binprot:: BinProtWrite :: binprot_write ( witness_aux, w) ?;
4114
4130
binprot:: BinProtWrite :: binprot_write ( & witness_primary_hash, w) ?;
4115
4131
binprot:: BinProtWrite :: binprot_write ( & witness_aux_hash, w) ?;
4116
4132
binprot:: BinProtWrite :: binprot_write ( & prev_challenges_hash, w) ?;
4117
4133
binprot:: BinProtWrite :: binprot_write ( & group_map_hash, w) ?;
4134
+ binprot:: BinProtWrite :: binprot_write ( & latest_random, w) ?;
4118
4135
Ok ( ( ) )
4119
4136
}
4120
4137
}
@@ -4132,6 +4149,7 @@ pub mod debug {
4132
4149
let witness_aux_hash: Vec < u8 > = binprot:: BinProtRead :: binprot_read ( r) ?;
4133
4150
let prev_challenges_hash: Vec < u8 > = binprot:: BinProtRead :: binprot_read ( r) ?;
4134
4151
let group_map_hash: Vec < u8 > = binprot:: BinProtRead :: binprot_read ( r) ?;
4152
+ let latest_random: Vec < u8 > = binprot:: BinProtRead :: binprot_read ( r) ?;
4135
4153
Ok ( Self {
4136
4154
inner_error : to_string ( inner_error) ,
4137
4155
witness_primary,
@@ -4140,6 +4158,7 @@ pub mod debug {
4140
4158
witness_aux_hash : to_string ( witness_aux_hash) ,
4141
4159
prev_challenges_hash : to_string ( prev_challenges_hash) ,
4142
4160
group_map_hash : to_string ( group_map_hash) ,
4161
+ latest_random : to_string ( latest_random) ,
4143
4162
} )
4144
4163
}
4145
4164
}
@@ -4162,6 +4181,7 @@ pub mod debug {
4162
4181
witness_aux_hash,
4163
4182
prev_challenges_hash,
4164
4183
group_map_hash,
4184
+ latest_random,
4165
4185
} = self ;
4166
4186
4167
4187
// Print witness lengths, not the whole vectors
@@ -4173,6 +4193,7 @@ pub mod debug {
4173
4193
. field ( "witness_aux_hash" , & witness_aux_hash)
4174
4194
. field ( "prev_challenges_hash" , & prev_challenges_hash)
4175
4195
. field ( "group_map_hash" , & group_map_hash)
4196
+ . field ( "latest_random" , & latest_random)
4176
4197
. finish ( )
4177
4198
}
4178
4199
}
0 commit comments