Skip to content

Commit

Permalink
Fix verifying ind-cpa
Browse files Browse the repository at this point in the history
  • Loading branch information
mamonet committed Jan 20, 2025
1 parent 61e0b9c commit c31f3a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ let decrypt
secret_key_unpacked
ciphertext

#push-options "--z3rlimit 800 --ext context_pruning --z3refresh"
#push-options "--z3rlimit 1500 --ext context_pruning --z3refresh"

let compress_then_serialize_u
(v_K v_OUT_LEN v_COMPRESSION_FACTOR v_BLOCK_LEN: usize)
Expand Down Expand Up @@ -866,7 +866,7 @@ let compress_then_serialize_u

#pop-options

#push-options "--z3rlimit 200"
#push-options "--z3rlimit 800 --ext context_pruning --z3refresh"

let encrypt_unpacked
(v_K v_CIPHERTEXT_SIZE v_T_AS_NTT_ENCODED_SIZE v_C1_LEN v_C2_LEN v_U_COMPRESSION_FACTOR v_V_COMPRESSION_FACTOR v_BLOCK_LEN v_ETA1 v_ETA1_RANDOMNESS_SIZE v_ETA2 v_ETA2_RANDOMNESS_SIZE:
Expand Down
4 changes: 2 additions & 2 deletions libcrux-ml-kem/src/ind_cpa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ pub(crate) fn serialize_unpacked_secret_key<
}

/// Call [`compress_then_serialize_ring_element_u`] on each ring element.
#[hax_lib::fstar::options("--z3rlimit 800 --ext context_pruning --z3refresh")]
#[hax_lib::fstar::options("--z3rlimit 1500 --ext context_pruning --z3refresh")]
#[hax_lib::requires(fstar!(r#"Spec.MLKEM.is_rank $K /\
$OUT_LEN == Spec.MLKEM.v_C1_SIZE $K /\
$COMPRESSION_FACTOR == Spec.MLKEM.v_VECTOR_U_COMPRESSION_FACTOR $K /\
Expand Down Expand Up @@ -725,7 +725,7 @@ fn compress_then_serialize_u<
/// The NIST FIPS 203 standard can be found at
/// <https://csrc.nist.gov/pubs/fips/203/ipd>.
#[allow(non_snake_case)]
#[hax_lib::fstar::options("--z3rlimit 200")]
#[hax_lib::fstar::options("--z3rlimit 800 --ext context_pruning --z3refresh")]
#[hax_lib::requires(fstar!(r#"Spec.MLKEM.is_rank $K /\
$ETA1 == Spec.MLKEM.v_ETA1 $K /\
$ETA1_RANDOMNESS_SIZE == Spec.MLKEM.v_ETA1_RANDOMNESS_SIZE $K /\
Expand Down

0 comments on commit c31f3a9

Please sign in to comment.