Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andreistefanescu committed Dec 21, 2023
1 parent 4af70c3 commit 43f9a43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions SAW/proof/Loop.cry
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ aesni_gcm_encrypt_impl_loop_step len in out key ivec ctr Xi
where
//next_prefetch_offset = prefetch_offset + (if prefetch_offset + 192 <= len then 96 else 0)
next_prefetch_offset = prefetch_offset + (if prefetch_offset + 4096 <= len + 3904 then 96 else 0)
//next_prefetch_offset = prefetch_offset + (if prefetch_offset <= len - 192 then 96 else 0)

[in_block0, in_block1, in_block2, in_block3, in_block4, in_block5] = split (join (arrayRangeLookup in (loop_index * 96 + 192)))
(next_T1, [out_block0, out_block1, out_block2, out_block3, out_block4, out_block5]) = aes_encrypt_blocks_6_impl key ctr_least_byte T1 inout0 inout1 inout2 inout3 inout4 inout5 [in_block0, in_block1, in_block2, in_block3, in_block4, in_block5]
Expand All @@ -259,7 +258,6 @@ aesni_gcm_encrypt_impl_loop_step len in out key ivec ctr Xi
enc_block3 = prefetch6 # prefetch7
enc_block4 = prefetch8 # prefetch9
enc_block5 = drop Z3

blocks = [enc_block0, enc_block1, enc_block2, enc_block3, enc_block4, enc_block5]
(next_spill_Z3, next_loop_Xi, next_Z0) = gcm_polyval_pmult4_impl key spill_Z3 (drop loop_Xi) (drop Z0) blocks

Expand Down
6 changes: 3 additions & 3 deletions SAW/proof/loop_test.saw
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
enable_experimental;
disable_debug_intrinsics;

//import "../../../aws-lc-verification/cryptol-specs/Common/ByteArray.cry";
import "../../../aws-lc-verification/cryptol-specs/Primitive/Symmetric/Cipher/Block/AES.cry";
import "../../../aws-lc-verification/cryptol-specs/Primitive/Symmetric/Cipher/Authenticated/AES_256_GCM.cry";
import "../../cryptol-specs/Primitive/Symmetric/Cipher/Block/AES.cry";
import "../../cryptol-specs/Primitive/Symmetric/Cipher/Authenticated/AES_256_GCM.cry";
import "../spec/AES/AES-GCM.cry";
import "../spec/AES/X86.cry";
import "../spec/AES/AES-GCM-implementation.cry";
Expand Down Expand Up @@ -97,6 +96,7 @@ include "AES/goal-rewrites.saw";
include "AES/AES.saw";
include "AES/GHASH.saw";
//include "AES/AESNI-GCM.saw";
let do_prove = true;

let fresh_aes_key_st = do {
crucible_fresh_var "key" (llvm_array aes_key_len (llvm_int 8));
Expand Down

0 comments on commit 43f9a43

Please sign in to comment.