fact stringlengths 6 171k | type stringclasses 21
values | library stringclasses 22
values | imports listlengths 0 53 | filename stringlengths 9 65 | symbolic_name stringlengths 1 90 | docstring stringclasses 1
value |
|---|---|---|---|---|---|---|
_t'5: ident := 190%positive. | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | _t'5 | |
_t'6: ident := 191%positive. | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | _t'6 | |
_t'7: ident := 192%positive. | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | _t'7 | |
_t'8: ident := 193%positive. | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | _t'8 | |
_t'9: ident := 194%positive. | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | _t'9 | |
v___stringlit_3:= {|
gvar_info := (tarray tschar 21);
gvar_init := (Init_int8 (Int.repr 32) :: Init_int8 (Int.repr 32) ::
Init_int8 (Int.repr 65) :: Init_int8 (Int.repr 69) ::
Init_int8 (Int.repr 83) :: Init_int8 (Int.repr 45) ::
Init_int8 (Int.repr 69) :: Init_int8 (... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | v___stringlit_3 | |
v___stringlit_1:= {|
gvar_info := (tarray tschar 4);
gvar_init := (Init_int8 (Int.repr 101) :: Init_int8 (Int.repr 110) ::
Init_int8 (Int.repr 99) :: Init_int8 (Int.repr 0) :: nil);
gvar_readonly := true;
gvar_volatile := false
|}. | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | v___stringlit_1 | |
v___stringlit_5:= {|
gvar_info := (tarray tschar 8);
gvar_init := (Init_int8 (Int.repr 112) :: Init_int8 (Int.repr 97) ::
Init_int8 (Int.repr 115) :: Init_int8 (Int.repr 115) ::
Init_int8 (Int.repr 101) :: Init_int8 (Int.repr 100) ::
Init_int8 (Int.repr 10) :: Init_in... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | v___stringlit_5 | |
v___stringlit_6:= {|
gvar_info := (tarray tschar 2);
gvar_init := (Init_int8 (Int.repr 10) :: Init_int8 (Int.repr 0) :: nil);
gvar_readonly := true;
gvar_volatile := false
|}. | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | v___stringlit_6 | |
v___stringlit_2:= {|
gvar_info := (tarray tschar 4);
gvar_init := (Init_int8 (Int.repr 100) :: Init_int8 (Int.repr 101) ::
Init_int8 (Int.repr 99) :: Init_int8 (Int.repr 0) :: nil);
gvar_readonly := true;
gvar_volatile := false
|}. | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | v___stringlit_2 | |
v___stringlit_4:= {|
gvar_info := (tarray tschar 8);
gvar_init := (Init_int8 (Int.repr 102) :: Init_int8 (Int.repr 97) ::
Init_int8 (Int.repr 105) :: Init_int8 (Int.repr 108) ::
Init_int8 (Int.repr 101) :: Init_int8 (Int.repr 100) ::
Init_int8 (Int.repr 10) :: Init_in... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | v___stringlit_4 | |
f_mbedtls_zeroize:= {|
fn_return := tvoid;
fn_callconv := cc_default;
fn_params := ((_v, (tptr tvoid)) :: (_n, tulong) :: nil);
fn_vars := nil;
fn_temps := ((_p, (tptr tuchar)) :: (_t'2, (tptr tuchar)) ::
(_t'1, tulong) :: nil);
fn_body :=
(Ssequence
(Sset _p (Etempvar _v (tptr tvoid)))
(... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | f_mbedtls_zeroize | |
v_tables:= {|
gvar_info := (Tstruct _aes_tables_struct noattr);
gvar_init := (Init_space 8744 :: nil);
gvar_readonly := false;
gvar_volatile := false
|}. | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | v_tables | |
v_aes_init_done:= {|
gvar_info := tint;
gvar_init := (Init_int32 (Int.repr 0) :: nil);
gvar_readonly := false;
gvar_volatile := false
|}. | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | v_aes_init_done | |
f_aes_gen_tables:= {|
fn_return := tvoid;
fn_callconv := cc_default;
fn_params := nil;
fn_vars := ((_pow, (tarray tint 256)) :: (_log, (tarray tint 256)) :: nil);
fn_temps := ((_i, tint) :: (_x, tint) :: (_y, tint) :: (_z, tint) ::
(_rot, tuint) :: (_logi, tint) :: (_prod1, tint) ::
... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | f_aes_gen_tables | |
f_mbedtls_aes_init:= {|
fn_return := tvoid;
fn_callconv := cc_default;
fn_params := ((_ctx, (tptr (Tstruct _mbedtls_aes_context_struct noattr))) ::
nil);
fn_vars := nil;
fn_temps := nil;
fn_body :=
(Scall None
(Evar _memset (Tfunction ((tptr tvoid) :: tint :: tulong :: nil)
... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | f_mbedtls_aes_init | |
f_mbedtls_aes_free:= {|
fn_return := tvoid;
fn_callconv := cc_default;
fn_params := ((_ctx, (tptr (Tstruct _mbedtls_aes_context_struct noattr))) ::
nil);
fn_vars := nil;
fn_temps := nil;
fn_body :=
(Ssequence
(Sifthenelse (Ebinop Oeq
(Etempvar _ctx (tptr (Tstruct _mbedtls_... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | f_mbedtls_aes_free | |
f_mbedtls_aes_setkey_enc:= {|
fn_return := tint;
fn_callconv := cc_default;
fn_params := ((_ctx, (tptr (Tstruct _mbedtls_aes_context_struct noattr))) ::
(_key, (tptr tuchar)) :: (_keybits, tuint) :: nil);
fn_vars := nil;
fn_temps := ((_i, tuint) :: (_key_word, tuint) :: (_RK, (tptr tuint)) ::
... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | f_mbedtls_aes_setkey_enc | |
f_mbedtls_aes_setkey_dec:= {|
fn_return := tint;
fn_callconv := cc_default;
fn_params := ((_ctx, (tptr (Tstruct _mbedtls_aes_context_struct noattr))) ::
(_key, (tptr tuchar)) :: (_keybits, tuint) :: nil);
fn_vars := ((_cty, (Tstruct _mbedtls_aes_context_struct noattr)) :: nil);
fn_temps := ((_... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | f_mbedtls_aes_setkey_dec | |
f_mbedtls_aes_encrypt:= {|
fn_return := tvoid;
fn_callconv := cc_default;
fn_params := ((_ctx, (tptr (Tstruct _mbedtls_aes_context_struct noattr))) ::
(_input, (tptr tuchar)) :: (_output, (tptr tuchar)) :: nil);
fn_vars := nil;
fn_temps := ((_i, tint) :: (_RK, (tptr tuint)) :: (_X0, tuint) ::
... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | f_mbedtls_aes_encrypt | |
f_mbedtls_aes_decrypt:= {|
fn_return := tvoid;
fn_callconv := cc_default;
fn_params := ((_ctx, (tptr (Tstruct _mbedtls_aes_context_struct noattr))) ::
(_input, (tptr tuchar)) :: (_output, (tptr tuchar)) :: nil);
fn_vars := nil;
fn_temps := ((_i, tint) :: (_RK, (tptr tuint)) :: (_X0, tuint) ::
... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | f_mbedtls_aes_decrypt | |
f_mbedtls_aes_crypt_ecb:= {|
fn_return := tint;
fn_callconv := cc_default;
fn_params := ((_ctx, (tptr (Tstruct _mbedtls_aes_context_struct noattr))) ::
(_mode, tint) :: (_input, (tptr tuchar)) ::
(_output, (tptr tuchar)) :: nil);
fn_vars := nil;
fn_temps := nil;
fn_body :=
(S... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | f_mbedtls_aes_crypt_ecb | |
v_aes_test_ecb_dec:= {|
gvar_info := (tarray (tarray tuchar 16) 3);
gvar_init := (Init_int8 (Int.repr 68) :: Init_int8 (Int.repr 65) ::
Init_int8 (Int.repr 106) :: Init_int8 (Int.repr 194) ::
Init_int8 (Int.repr 209) :: Init_int8 (Int.repr 245) ::
Init_int8 (Int.repr ... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | v_aes_test_ecb_dec | |
v_aes_test_ecb_enc:= {|
gvar_info := (tarray (tarray tuchar 16) 3);
gvar_init := (Init_int8 (Int.repr 195) :: Init_int8 (Int.repr 76) ::
Init_int8 (Int.repr 5) :: Init_int8 (Int.repr 44) ::
Init_int8 (Int.repr 192) :: Init_int8 (Int.repr 218) ::
Init_int8 (Int.repr 14... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | v_aes_test_ecb_enc | |
f_mbedtls_aes_self_test:= {|
fn_return := tint;
fn_callconv := cc_default;
fn_params := ((_verbose, tint) :: nil);
fn_vars := ((_key, (tarray tuchar 32)) :: (_buf, (tarray tuchar 64)) ::
(_iv, (tarray tuchar 16)) ::
(_ctx, (Tstruct _mbedtls_aes_context_struct noattr)) :: nil);
fn_t... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | f_mbedtls_aes_self_test | |
composites: list composite_definition :=
(Composite _mbedtls_aes_context_struct Struct
(Member_plain _nr tint :: Member_plain _rk (tptr tuint) ::
Member_plain _buf (tarray tuint 68) :: nil)
noattr ::
Composite _aes_tables_struct Struct
(Member_plain _FSb (tarray tuchar 256) ::
Member_plain _FT0 (tarra... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | composites | |
global_definitions: list (ident * globdef fundef type) :=
((___compcert_va_int32,
Gfun(External (EF_runtime "__compcert_va_int32"
(mksignature (AST.Xptr :: nil) AST.Xint cc_default))
((tptr tvoid) :: nil) tuint cc_default)) ::
(___compcert_va_int64,
Gfun(External (EF_runtime "__compcert_v... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | global_definitions | |
public_idents: list ident :=
(_mbedtls_aes_self_test :: _mbedtls_aes_crypt_ecb :: _mbedtls_aes_decrypt ::
_mbedtls_aes_encrypt :: _mbedtls_aes_setkey_dec ::
_mbedtls_aes_setkey_enc :: _mbedtls_aes_free :: _mbedtls_aes_init ::
_printf :: _memset :: _memcmp :: ___builtin_debug :: ___builtin_fmin ::
___builtin_fmax ::... | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | public_idents | |
prog: Clight.program :=
mkprogram composites global_definitions public_idents _main Logic.I. | Definition | aes | [
"From Coq Require Import String List ZArith",
"From compcert Require Import Coqlib Integers Floats AST Ctypes Cop Clight Clightdefs"
] | aes/aes.v | prog | |
encryption_loop_body:=
(Ssequence (Sset _t'5 (Etempvar _RK (tptr tuint)))
(Ssequence (Sset _RK (Ebinop Oadd (Etempvar _t'5 (tptr tuint)) (Econst_int (Int.repr 1) tint) (tptr tuint)))
(Ssequence (Sset _rk (Ederef (Etempvar _t'5 (tptr tuint)) tuint))
(Ssequence
(Sset _b0__... | Definition | aes | [
"Require Import Clightdefs",
"Require Import aes.aes"
] | aes/aes_encryption_loop_body.v | encryption_loop_body | |
Vprog: varspecs. mk_varspecs prog. Defined. | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | Vprog | |
t_struct_aesctx:= Tstruct _mbedtls_aes_context_struct noattr. | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | t_struct_aesctx | |
t_struct_tables:= Tstruct _aes_tables_struct noattr. | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | t_struct_tables | |
tables_initialized(tables : val) := data_at Ews t_struct_tables
(map Vint FSb, (map Vint FT0, (map Vint FT1, (map Vint FT2, (map Vint FT3,
(map Vint RSb, (map Vint RT0, (map Vint RT1, (map Vint RT2, (map Vint RT3,
(map Vint RCON))))))))))) tables. | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | tables_initialized | |
Vundef256: list val := repeat Vundef 256%nat. | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | Vundef256 | |
tables_uninitializedtables := data_at Ews t_struct_tables (Vundef256,
(Vundef256, (Vundef256, (Vundef256, (Vundef256, (Vundef256,
(Vundef256, (Vundef256, (Vundef256, (Vundef256,
(repeat Vundef 10))))))))))) tables. | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | tables_uninitialized | |
gen_tables_spec:=
DECLARE _aes_gen_tables
WITH gv: globals
PRE [ ]
PROP ()
LOCAL (gvars gv)
SEP (tables_uninitialized (gv _tables))
POST [ tvoid ]
PROP ()
LOCAL ()
SEP (tables_initialized (gv _tables))
. | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | gen_tables_spec | |
word_to_int(w : (int * int * int * int)) : int :=
match w with (b0, b1, b2, b3) =>
(Int.or (Int.or (Int.or
b0
(Int.shl b1 (Int.repr 8)))
(Int.shl b2 (Int.repr 16)))
(Int.shl b3 (Int.repr 24)))
end. | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | word_to_int | |
SubWord(w: int) : int := word_to_int (
(Znth (byte0 w) FSb),
(Znth (byte1 w) FSb),
(Znth (byte2 w) FSb),
(Znth (byte3 w) FSb)
). | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | SubWord | |
RotWord(i: int): int :=
Int.or (Int.and (Int.shl i (Int.repr 8)) (Int.repr (-1))) (Int.shru i (Int.repr 24)).
(* round constant (RCon) array, described in section 5.2 and explicitly written
* out in appendix A.3 (256-bit key expansion example) *) | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | RotWord | |
RCon: list int := map (fun i => Int.shl i (Int.repr 24)) [
(* 0x01000000 *) (Int.repr 1);
(* 0x02000000 *) (Int.repr 2);
(* 0x04000000 *) (Int.repr 4);
(* 0x08000000 *) (Int.repr 8);
(* 0x10000000 *) (Int.repr 16);
(* 0x20000000 *) (Int.repr 32);
(* 0x40000000 *) (Int.repr 64)
]. | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | RCon | |
GrowKeyByOne(w: list int): list int :=
let i := Zlength w in
let temp := (Znth (i-1) w) in
let temp' := if (i mod Nk =? 0) then
Int.xor (SubWord (RotWord temp)) (Znth (i/Nk) RCon)
else if (i mod Nk =? 4) then
SubWord temp
else
temp
in
w ++ [Int.xor (Znth (i-8) w) temp']. | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | GrowKeyByOne | |
pow_fun{T: Type}(f: T -> T)(n: nat)(a: T): T := match n with
| O => a
| S m => f (pow_fun f m a)
end.
(* +2 because 1 is for the initial round which is not counted, and 1 superfluous round key is
created in the last loop iteration, because each iteration creates 2 round keys.
-Nk because the first two round keys... | Fixpoint | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | pow_fun | |
KeyExpansion2: list int -> list int := pow_fun GrowKeyByOne (Z.to_nat (Nb*(Nr+2)-Nk)). | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | KeyExpansion2 | |
get_uint32_le(arr: list Z) (i: Z) : int :=
(Int.or (Int.or (Int.or
(Int.repr (Znth i arr))
(Int.shl (Int.repr (Znth (i+1) arr)) (Int.repr 8)))
(Int.shl (Int.repr (Znth (i+2) arr)) (Int.repr 16)))
(Int.shl (Int.repr (Znth (i+3) arr)) (Int.repr 24))). | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | get_uint32_le | |
key_bytes_to_key_words(key_bytes: list Z): list int :=
fill_list 8 (fun i => get_uint32_le key_bytes (i*4)).
(* Note: clightgen turns global variables of type int to pointers to int, to make them addressable,
so aes_init_done is a pointer to int, not an int! *) | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | key_bytes_to_key_words | |
key_expansion_spec:=
DECLARE _mbedtls_aes_setkey_enc
WITH ctx : val, key : val, ctx_sh : share, key_sh : share, key_chars : list Z,
init_done : Z, ish: share, gv: globals
PRE [ _ctx OF (tptr t_struct_aesctx), _key OF (tptr tuchar), _keybits OF tuint ]
PROP (writable_share ctx_sh; readable_shar... | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | key_expansion_spec | |
encryption_spec_ll:=
DECLARE _mbedtls_aes_encrypt
WITH ctx : val, input : val, output : val, (* arguments *)
ctx_sh : share, in_sh : share, out_sh : share, (* shares *)
plaintext : list Z, (* 16 chars *)
exp_key : list Z, (* expanded key, 4*(Nr+1)=60 32-bit integers *)
gv: globals (* glo... | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | encryption_spec_ll | |
Gprog: funspecs := ltac:(with_library prog [
gen_tables_spec; key_expansion_spec; encryption_spec_ll
]).
(* This is to make sure do_compute_expr (invoked by load_tac and others), which calls hnf on the
expression it's computing, does not unfold field_address.
TODO floyd: Ideally, we'd have "Global Opaque field... | Definition | aes | [
"Require Export VST.floyd.proofauto",
"Require Export VST.floyd.reassoc_seq",
"Require Export aes.aes",
"Require Export aes.GF_ops_LL",
"Require Export aes.tablesLL",
"Require Export aes.spec_utils_LL",
"Require Export aes.list_utils",
"Require Export aes.spec_encryption_LL",
"Require Import VST.flo... | aes/api_specs.v | Gprog | |
byte0_word_to_int: forall b0 b1 b2 b3,
byte0 (word_to_int (b0, b1, b2, b3)) = Int.unsigned b0.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | byte0_word_to_int | |
byte1_word_to_int: forall b0 b1 b2 b3,
byte1 (word_to_int (b0, b1, b2, b3)) = Int.unsigned b1.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | byte1_word_to_int | |
byte2_word_to_int: forall b0 b1 b2 b3,
byte2 (word_to_int (b0, b1, b2, b3)) = Int.unsigned b2.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | byte2_word_to_int | |
byte3_word_to_int: forall b0 b1 b2 b3,
byte3 (word_to_int (b0, b1, b2, b3)) = Int.unsigned b3.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | byte3_word_to_int | |
xor_byte0_with_FSb: forall b0 b1 b2 b3 i,
Int.xor (word_to_int (b0, b1, b2, b3)) (Znth i tablesLL.FSb)
= word_to_int ((Int.xor b0 (Znth i tablesLL.FSb)), b1, b2, b3).
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | xor_byte0_with_FSb | |
xor_byte1_with_FSb: forall b0 b1 b2 b3 i,
Int.xor (word_to_int (b0, b1, b2, b3)) (Int.shl (Znth i tablesLL.FSb) (Int.repr 8))
= word_to_int (b0, (Int.xor b1 (Znth i tablesLL.FSb)), b2, b3).
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | xor_byte1_with_FSb | |
xor_byte2_with_FSb: forall b0 b1 b2 b3 i,
Int.xor (word_to_int (b0, b1, b2, b3)) (Int.shl (Znth i tablesLL.FSb) (Int.repr 16))
= word_to_int (b0, b1, (Int.xor b2 (Znth i tablesLL.FSb)), b3).
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | xor_byte2_with_FSb | |
xor_byte3_with_FSb: forall b0 b1 b2 b3 i,
Int.xor (word_to_int (b0, b1, b2, b3)) (Int.shl (Znth i tablesLL.FSb) (Int.repr 24))
= word_to_int (b0, b1, b2, (Int.xor b3 (Znth i tablesLL.FSb))).
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | xor_byte3_with_FSb | |
equiv_sbox: forall b,
Znth (Int.unsigned b) tablesLL.FSb = look_sbox b.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | equiv_sbox | |
xor_word_to_int: forall a0 a1 a2 a3 b0 b1 b2 b3,
Int.xor (word_to_int (a0, a1, a2, a3)) (word_to_int (b0, b1, b2, b3))
= word_to_int ((Int.xor a0 b0), (Int.xor a1 b1), (Int.xor a2 b2), (Int.xor a3 b3)).
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | xor_word_to_int | |
rot8_word_to_int: forall b0 b1 b2 b3,
rot8 (word_to_int (b0, b1, b2, b3)) = word_to_int (b3, b0, b1, b2).
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | rot8_word_to_int | |
mask_byte_nop: forall i,
0 <= Int.unsigned i < 256 ->
Int.and i (Int.repr 255) = i.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | mask_byte_nop | |
FSb_range: forall i,
0 <= Int.unsigned (Znth i FSb) < 256.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | FSb_range | |
zero_ext_nop: forall i,
0 <= (Int.unsigned i) < 256 ->
Int.zero_ext 8 i = i.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | zero_ext_nop | |
FSb_inj: forall i j,
0 <= i < 256 ->
0 <= j < 256 ->
Znth i FSb = Znth j FSb ->
i = j.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | FSb_inj | |
FSb_RSb_id: forall j,
0 <= j < 256 ->
j = Int.unsigned (Znth (Int.unsigned (Znth j RSb)) FSb).
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | FSb_RSb_id | |
RSb_inj: forall i j,
0 <= i < 256 ->
0 <= j < 256 ->
Znth i RSb = Znth j RSb ->
i = j.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | RSb_inj | |
RSb_range: forall i,
0 <= Int.unsigned (Znth i RSb) < 256.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | RSb_range | |
xor_is_or_4_bytes: forall b0 b1 b2 b3,
(Int.xor (Int.xor (Int.xor b0
(Int.shl b1 (Int.repr 8)))
(Int.shl b2 (Int.repr 16)))
(Int.shl b3 (Int.repr 24))) =
(Int.or (Int.or (Int.or b0
(Int.shl b1 (Int.repr 8)))
(Int... | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | xor_is_or_4_bytes | |
masked_byte_range: forall i,
0 <= Z.land i 255 < 256.
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | masked_byte_range | |
zero_ext_mask: forall i,
Int.zero_ext 8 i = Int.and i (Int.repr 255).
Admitted. | Lemma | aes | [
"Require Export aes.conv_HL_to_LL",
"Require Import VST.floyd.functional_base"
] | aes/bitfiddling.v | zero_ext_mask | |
state_to_list(s : state) : list int :=
match transpose s with
| ((b11, b12, b13, b14), (b21, b22, b23, b24), (b31, b32, b33, b34), (b41, b42, b43, b44)) =>
[ b11; b12; b13; b14 ; b21; b22; b23; b24 ; b31; b32; b33; b34 ; b41; b42; b43; b44 ]
end. | Definition | aes | [
"Require Export aes.spec_AES256_HL",
"Require Export aes.spec_encryption_LL",
"Require Export List. Export ListNotations"
] | aes/conv_HL_to_LL.v | state_to_list | |
list_to_state(l : list int) : state := transpose
match l with
| [ b11; b12; b13; b14 ; b21; b22; b23; b24 ; b31; b32; b33; b34 ; b41; b42; b43; b44 ] =>
((b11, b12, b13, b14), (b21, b22, b23, b24), (b31, b32, b33, b34), (b41, b42, b43, b44))
| _ => let z4 := (Int.zero, Int.zero, Int.zero, Int.zero) in
... | Definition | aes | [
"Require Export aes.spec_AES256_HL",
"Require Export aes.spec_encryption_LL",
"Require Export List. Export ListNotations"
] | aes/conv_HL_to_LL.v | list_to_state | |
word_to_int(w : word) : int :=
match w with (b0, b1, b2, b3) =>
(Int.or (Int.or (Int.or
b0
(Int.shl b1 (Int.repr 8)))
(Int.shl b2 (Int.repr 16)))
(Int.shl b3 (Int.repr 24)))
end.
(* | Definition | aes | [
"Require Export aes.spec_AES256_HL",
"Require Export aes.spec_encryption_LL",
"Require Export List. Export ListNotations"
] | aes/conv_HL_to_LL.v | word_to_int | |
int_to_word(x : int) : word := (
(Int.and x (Int.repr 255)),
(Int.and (Int.shru x (Int.repr 8)) (Int.repr 255)),
(Int.and (Int.shru x (Int.repr 16)) (Int.repr 255)),
(Int.and (Int.shru x (Int.repr 24)) (Int.repr 255))
). | Definition | aes | [
"Require Export aes.spec_AES256_HL",
"Require Export aes.spec_encryption_LL",
"Require Export List. Export ListNotations"
] | aes/conv_HL_to_LL.v | int_to_word | |
four_ints_to_state(s : four_ints) : state := transpose match s with
| (c0, (c1, (c2, c3))) => (int_to_word c0, int_to_word c1, int_to_word c2, int_to_word c3)
end.
*) | Definition | aes | [
"Require Export aes.spec_AES256_HL",
"Require Export aes.spec_encryption_LL",
"Require Export List. Export ListNotations"
] | aes/conv_HL_to_LL.v | four_ints_to_state | |
state_to_four_ints(s : state) : four_ints := match transpose s with
| (c0, c1, c2, c3) => (word_to_int c0, (word_to_int c1, (word_to_int c2, word_to_int c3)))
end. | Definition | aes | [
"Require Export aes.spec_AES256_HL",
"Require Export aes.spec_encryption_LL",
"Require Export List. Export ListNotations"
] | aes/conv_HL_to_LL.v | state_to_four_ints | |
block_to_ints(b : block) : list int :=
match b with (w0, w1, w2, w3) => [word_to_int w0; word_to_int w1; word_to_int w2; word_to_int w3] end. | Definition | aes | [
"Require Export aes.spec_AES256_HL",
"Require Export aes.spec_encryption_LL",
"Require Export List. Export ListNotations"
] | aes/conv_HL_to_LL.v | block_to_ints | |
blocks_to_ints(blocks : list block) : list int := flat_map block_to_ints blocks. | Definition | aes | [
"Require Export aes.spec_AES256_HL",
"Require Export aes.spec_encryption_LL",
"Require Export List. Export ListNotations"
] | aes/conv_HL_to_LL.v | blocks_to_ints | |
blocks_to_Zwords(blocks : list block) : list Z := map Int.unsigned (blocks_to_ints blocks). | Definition | aes | [
"Require Export aes.spec_AES256_HL",
"Require Export aes.spec_encryption_LL",
"Require Export List. Export ListNotations"
] | aes/conv_HL_to_LL.v | blocks_to_Zwords | |
round13eq: forall buf S12 S13,
S13 = mbed_tls_fround S12 buf 52 ->
Int.xor
(Int.xor
(Int.xor
(Int.xor (Int.repr (Znth 52 buf))
(Znth
(Z.land (Int.unsigned (col 0 S12))
(Int.unsigned (Int.repr 255))) FT0))
... | Lemma | aes | [
"Require Import aes.spec_encryption_LL",
"Require Import compcert.common.Values",
"Require Import VST.floyd.functional_base"
] | aes/encryption_LL_round_step_eqs.v | round13eq | |
round14eq: forall buf S13 S14,
S14 = mbed_tls_final_fround S13 buf 56 ->
Int.xor
(Int.xor
(Int.xor
(Int.xor (Int.repr (Znth 56 buf))
(Znth
(Z.land (Int.unsigned (col 0 S13))
(Int.unsigned (Int.repr 255))) FS... | Lemma | aes | [
"Require Import aes.spec_encryption_LL",
"Require Import compcert.common.Values",
"Require Import VST.floyd.functional_base"
] | aes/encryption_LL_round_step_eqs.v | round14eq | |
map_append_eq_4x4:
forall (a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15: int)
(b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15: int),
a0 = b0 -> a1 = b1 -> a2 = b2 -> a3 = b3 ->
a4 = b4 -> a5 = b5 -> a6 = b6 -> a7 = b7 ->
a8 = b8 -> a9 = b9 -> a10 = b10 -> a11 = b11 -... | Lemma | aes | [
"Require Import aes.spec_encryption_LL",
"Require Import compcert.common.Values",
"Require Import VST.floyd.functional_base"
] | aes/encryption_LL_round_step_eqs.v | map_append_eq_4x4 | |
round13_eq_assemble_general: forall i buf plaintext S0 S12 S13,
S0 = mbed_tls_initial_add_round_key plaintext buf ->
S12 = mbed_tls_enc_rounds i S0 buf 4 ->
S13 = mbed_tls_fround S12 buf (4 + 4 * Z.of_nat i) ->
S13 = mbed_tls_enc_rounds (S i) (mbed_tls_initial_add_round_key plaintext buf) buf 4.
Proof.
intros... | Lemma | aes | [
"Require Import aes.spec_encryption_LL",
"Require Import compcert.common.Values",
"Require Import VST.floyd.functional_base"
] | aes/encryption_LL_round_step_eqs.v | round13_eq_assemble_general | |
round13_eq_assemble: forall buf plaintext S0 S12 S13,
S0 = mbed_tls_initial_add_round_key plaintext buf ->
S12 = mbed_tls_enc_rounds 12 S0 buf 4 ->
S13 = mbed_tls_fround S12 buf 52 ->
S13 = mbed_tls_enc_rounds 13 (mbed_tls_initial_add_round_key plaintext buf) buf 4.
Proof.
intros. eapply round13_eq_assemble_g... | Lemma | aes | [
"Require Import aes.spec_encryption_LL",
"Require Import compcert.common.Values",
"Require Import VST.floyd.functional_base"
] | aes/encryption_LL_round_step_eqs.v | round13_eq_assemble | |
final_aes_eq: forall buf plaintext S0 S12 S13,
S0 = mbed_tls_initial_add_round_key plaintext buf ->
S12 = mbed_tls_enc_rounds 12 S0 buf 4 ->
S13 = mbed_tls_fround S12 buf 52 ->
[Vint (Int.and (col 0 (mbed_tls_final_fround S13 buf 56)) (Int.repr 255));
Vint (Int.and (Int.shru (col 0 (... | Lemma | aes | [
"Require Import aes.spec_encryption_LL",
"Require Import compcert.common.Values",
"Require Import VST.floyd.functional_base"
] | aes/encryption_LL_round_step_eqs.v | final_aes_eq | |
split_quad_eq: forall {T : Type} (c0 c1 c2 c3 c0' c1' c2' c3' : T),
c0 = c0' -> c1 = c1' -> c2 = c2' -> c3 = c3' -> (c0, c1, c2, c3) = (c0', c1', c2', c3').
Proof.
intros. congruence.
Qed. | Lemma | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | split_quad_eq | |
split_4eq: forall (T : Type) (c0 c1 c2 c3 c0' c1' c2' c3' : T),
(c0, c1, c2, c3) = (c0', c1', c2', c3') ->
c0 = c0' /\ c1 = c1' /\ c2 = c2' /\ c3 = c3'.
Proof.
intros. inversion H. subst. auto.
Qed. | Lemma | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | split_4eq | |
get_uint32_le_sublist: forall i l,
0 <= i <= Zlength l - 4 ->
get_uint32_le l i = get_uint32_le (sublist i (i+4) l) 0.
Proof.
intros. unfold get_uint32_le.
do 4 rewrite Znth_sublist by lia.
replace (0 + i) with i by lia.
replace (0 + 1 + i) with (i + 1) by lia.
replace (0 + 2 + i) with (i + 2) by lia.
r... | Lemma | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | get_uint32_le_sublist | |
get_uint32_le_word_to_int: forall b0 b1 b2 b3,
get_uint32_le (map Int.unsigned [b0; b1; b2; b3]) 0 = word_to_int (b0, b1, b2, b3).
Proof.
intros. unfold get_uint32_le. unfold word_to_int.
do 4 rewrite Znth_map by (change (Zlength [b0; b1; b2; b3]) with 4; lia).
do 4 rewrite Int.repr_unsigned.
reflexivity.
Qed... | Lemma | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | get_uint32_le_word_to_int | |
initial_round_equiv: forall S K,
(mbed_tls_initial_add_round_key
(map Int.unsigned (state_to_list S))
(map Int.unsigned (block_to_ints K))
) = state_to_four_ints (AddRoundKey S K).
Proof.
intros.
destruct S as [[[w0 w1] w2] w3].
destruct w0 as [[[?p0 ?p0] ?p0] ?p0].
destruct w1 as [[[?p0 ?p0] ?p0] ?... | Lemma | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | initial_round_equiv | |
FT0b0(i: Z): int := GF_ops_LL.times2 (Znth i FSb). | Definition | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | FT0b0 | |
FT0b1(i: Z): int := Znth i FSb. | Definition | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | FT0b1 | |
FT0b2(i: Z): int := Znth i FSb. | Definition | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | FT0b2 | |
FT0b3(i: Z): int := GF_ops_LL.times3 (Znth i FSb).
(* Note: according to calc_FT0, it should FT0b3 is
(Int.and (Int.xor (GF_ops_LL.times2 (Znth i FSb)) (Znth i FSb)) (Int.repr 255))
but we prefer to use an equivalent "medium-level" formulation *) | Definition | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | FT0b3 | |
times3_times2: forall i,
0 <= Int.unsigned i < 256 ->
Int.and (Int.xor (times2 i) i) (Int.repr 255) = times3 i.
Proof.
intros. unfold times2, times3.
rewrite <- (mask_byte_nop _ H) at 3.
repeat rewrite <- (Int.and_commut (Int.repr 255)).
rewrite <- Int.and_xor_distrib.
rewrite <- Int.and_assoc.
rewrite ... | Lemma | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | times3_times2 | |
calc_FT0_expose_bytes: forall i,
0 <= i < 256 ->
calc_FT0 i = word_to_int (FT0b0 i, FT0b1 i, FT0b2 i, FT0b3 i).
Proof.
intros.
Transparent calc_FT0. unfold calc_FT0.
unfold word_to_int.
unfold FT0b0, FT0b1, FT0b2, FT0b3.
rewrite xor_is_or_4_bytes.
f_equal. f_equal. apply times3_times2. apply FSb_range.
... | Lemma | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | calc_FT0_expose_bytes | |
calc_FT1_expose_bytes: forall i,
0 <= i < 256 ->
calc_FT1 i = word_to_int (FT0b3 i, FT0b0 i, FT0b1 i, FT0b2 i).
Proof.
intros.
Transparent calc_FT1. unfold calc_FT1.
rewrite calc_FT0_expose_bytes by assumption.
rewrite rot8_word_to_int.
reflexivity.
Qed. | Lemma | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | calc_FT1_expose_bytes | |
calc_FT2_expose_bytes: forall i,
0 <= i < 256 ->
calc_FT2 i = word_to_int (FT0b2 i, FT0b3 i, FT0b0 i, FT0b1 i).
Proof.
intros.
Transparent calc_FT2. unfold calc_FT2, calc_FT1.
rewrite calc_FT0_expose_bytes by assumption.
do 2 rewrite rot8_word_to_int.
reflexivity.
Qed. | Lemma | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | calc_FT2_expose_bytes | |
calc_FT3_expose_bytes: forall i,
0 <= i < 256 ->
calc_FT3 i = word_to_int (FT0b1 i, FT0b2 i, FT0b3 i, FT0b0 i).
Proof.
intros.
Transparent calc_FT3. unfold calc_FT3, calc_FT2, calc_FT1.
rewrite calc_FT0_expose_bytes by assumption.
do 3 rewrite rot8_word_to_int.
reflexivity.
Qed. | Lemma | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | calc_FT3_expose_bytes | |
split_quad_eq': forall {T : Type} (c0 c1 c2 c3 c0' c1' c2' c3' : T),
c0 = c0' -> c1 = c1' -> c2 = c2' -> c3 = c3' -> (c0, (c1, (c2, c3))) = (c0', (c1', (c2', c3'))).
Proof.
intros. congruence.
Qed. | Lemma | aes | [
"Require Import VST.floyd.functional_base",
"Require Import aes.spec_encryption_LL",
"Require Import aes.spec_AES256_HL",
"Require Import aes.tablesLL",
"Require Import aes.GF_ops_LL",
"Require Import aes.conv_HL_to_LL",
"Require Import aes.bitfiddling",
"Require Import aes.list_lemmas",
"Require Im... | aes/equiv_encryption.v | split_quad_eq' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.