@@ -37,12 +37,11 @@ const NONCE_SIZE: usize = 16;
3737
3838// draft-jimouris-cfrg-mastic:
3939//
40- // ONEHOT_PROOF_INIT = XofTurboShake128(zeros(XofTurboShake128.SEED_SIZE),
41- // dst(b'', USAGE_ONEHOT_PROOF_INIT),
42- // b'').next(PROOF_SIZE)
40+ // ONEHOT_PROOF_INIT = XofTurboShake128(
41+ // b'', dst(b'', USAGE_ONEHOT_PROOF_INIT), b'').next(PROOF_SIZE)
4342pub ( crate ) const ONEHOT_PROOF_INIT : [ u8 ; 32 ] = [
44- 253 , 211 , 45 , 179 , 139 , 135 , 183 , 67 , 202 , 144 , 13 , 205 , 241 , 39 , 165 , 73 , 232 , 54 , 57 , 193 ,
45- 106 , 154 , 133 , 22 , 15 , 194 , 223 , 162 , 79 , 108 , 60 , 133 ,
43+ 97 , 188 , 153 , 213 , 116 , 162 , 25 , 70 , 98 , 231 , 255 , 255 , 1 , 207 , 231 , 225 , 13 , 187 , 182 , 1 , 16 ,
44+ 90 , 161 , 104 , 201 , 152 , 149 , 153 , 35 , 92 , 254 , 149 ,
4645] ;
4746
4847pub ( crate ) const USAGE_PROVE_RAND : u8 = 0 ;
@@ -187,9 +186,7 @@ impl<'a, T: Type> ParameterizedDecode<(&'a Mastic<T>, usize)> for MasticInputSha
187186 if * agg_id > 1 {
188187 return Err ( CodecError :: UnexpectedValue ) ;
189188 }
190- let mut value = [ 0 ; 16 ] ;
191- bytes. read_exact ( & mut value) ?;
192- let vidpf_key = VidpfKey :: from_bytes ( value) ;
189+ let vidpf_key = VidpfKey :: decode ( bytes) ?;
193190 let proof_share = SzkProofShare :: decode_with_param (
194191 & (
195192 * agg_id == 0 ,
@@ -550,8 +547,10 @@ impl<T: Type> Aggregator<32, NONCE_SIZE> for Mastic<T> {
550547
551548 // Onehot and payload checks
552549 let ( payload_check, onehot_proof) = {
553- let mut payload_check_xof =
554- XofTurboShake128 :: init ( & [ 0 ; 32 ] , & [ & dst_usage ( USAGE_PAYLOAD_CHECK ) , & self . id , ctx] ) ;
550+ let mut payload_check_xof = XofTurboShake128 :: from_seed_slice (
551+ & [ ] ,
552+ & [ & dst_usage ( USAGE_PAYLOAD_CHECK ) , & self . id , ctx] ,
553+ ) ;
555554 let mut payload_check_buf = Vec :: with_capacity ( T :: Field :: ENCODED_SIZE ) ;
556555 let mut onehot_proof = ONEHOT_PROOF_INIT ;
557556
@@ -604,8 +603,10 @@ impl<T: Type> Aggregator<32, NONCE_SIZE> for Mastic<T> {
604603 } ;
605604
606605 let eval_proof = {
607- let mut eval_proof_xof =
608- XofTurboShake128 :: init ( & [ 0 ; 32 ] , & [ & dst_usage ( USAGE_EVAL_PROOF ) , & self . id , ctx] ) ;
606+ let mut eval_proof_xof = XofTurboShake128 :: from_seed_slice (
607+ & [ ] ,
608+ & [ & dst_usage ( USAGE_EVAL_PROOF ) , & self . id , ctx] ,
609+ ) ;
609610 eval_proof_xof. update ( & onehot_proof) ;
610611 eval_proof_xof. update ( & counter_check) ;
611612 eval_proof_xof. update ( & payload_check) ;
0 commit comments