File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -369,7 +369,13 @@ impl IBEDomainSep {
369
369
match self {
370
370
Self :: HashToMask => "ic-vetkd-bls12-381-ibe-hash-to-mask" . to_owned ( ) ,
371
371
Self :: MaskSeed => "ic-vetkd-bls12-381-ibe-mask-seed" . to_owned ( ) ,
372
- Self :: MaskMsg ( len) => format ! ( "ic-vetkd-bls12-381-ibe-mask-msg-{}" , len) ,
372
+ // Zero prefix the length up to 20 digits, which is sufficient to be fixed
373
+ // length for any 64-bit length. This ensures all of the MaskMsg domain
374
+ // separators are of equal length. With how we use the domain separators, this
375
+ // padding isn't required - we only need uniquness - but having variable
376
+ // length domain separators is generally not considered a good practice and is
377
+ // easily avoidable here.
378
+ Self :: MaskMsg ( len) => format ! ( "ic-vetkd-bls12-381-ibe-mask-msg-{:020}" , len) ,
373
379
}
374
380
}
375
381
}
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ fn protocol_flow_with_fixed_rng_has_expected_outputs() {
143
143
let ctext_bytes = ctext. serialize ( ) ;
144
144
145
145
assert_eq ! ( hex:: encode( & ctext_bytes) ,
146
- "4943204942450001a9937528bda5826cf5c7da77a5f5e46719a9748f4ea0aa491c8fba92081e5d55457ab36ec4f6335954c6d87987d0b28301bd8da166493bb537c842d20396da5a68cc9e9672fadedf1e311e0057fc906dfd37d1077ca027954c45336405e66e5e4b346b0f24bfd358a09de701654c1e0791741e4826396588440eee021df9b2398f143c " ) ;
146
+ "4943204942450001a9937528bda5826cf5c7da77a5f5e46719a9748f4ea0aa491c8fba92081e5d55457ab36ec4f6335954c6d87987d0b28301bd8da166493bb537c842d20396da5a68cc9e9672fadedf1e311e0057fc906dfd37d1077ca027954c45336405e66e5e4b346b0f24bfd358a09de701654c1e0791741e4826396588440eee021df9b2399f7f98 " ) ;
147
147
148
148
assert_eq ! (
149
149
ctext,
You can’t perform that action at this time.
0 commit comments