file_name
stringlengths 5
52
| name
stringlengths 4
95
| original_source_type
stringlengths 0
23k
| source_type
stringlengths 9
23k
| source_definition
stringlengths 9
57.9k
| source
dict | source_range
dict | file_context
stringlengths 0
721k
| dependencies
dict | opens_and_abbrevs
listlengths 2
94
| vconfig
dict | interleaved
bool 1
class | verbose_type
stringlengths 1
7.42k
| effect
stringclasses 118
values | effect_flags
sequencelengths 0
2
| mutual_with
sequencelengths 0
11
| ideal_premises
sequencelengths 0
236
| proof_features
sequencelengths 0
1
| is_simple_lemma
bool 2
classes | is_div
bool 2
classes | is_proof
bool 2
classes | is_simply_typed
bool 2
classes | is_type
bool 2
classes | partial_definition
stringlengths 5
3.99k
| completed_definiton
stringlengths 1
1.63M
| isa_cross_project_example
bool 1
class |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Hacl.Spec.SHA2.Vec.fst | Hacl.Spec.SHA2.Vec.load_last_blocks | val load_last_blocks
(#a: sha2_alg)
(totlen_seq: lseq uint8 (len_length a))
(fin: nat{fin == block_length a \/ fin == 2 * block_length a})
(len: nat{len <= block_length a})
(b: lseq uint8 len)
: lseq uint8 (block_length a) & lseq uint8 (block_length a) | val load_last_blocks
(#a: sha2_alg)
(totlen_seq: lseq uint8 (len_length a))
(fin: nat{fin == block_length a \/ fin == 2 * block_length a})
(len: nat{len <= block_length a})
(b: lseq uint8 len)
: lseq uint8 (block_length a) & lseq uint8 (block_length a) | let load_last_blocks (#a:sha2_alg)
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a})
(b:lseq uint8 len) :
lseq uint8 (block_length a) & lseq uint8 (block_length a) =
let last = create (2 * block_length a) (u8 0) in
let last = update_sub last 0 len b in
let last = last.[len] <- u8 0x80 in
let last = update_sub last (fin - len_length a) (len_length a) totlen_seq in
let l0 : lseq uint8 (block_length a) = sub last 0 (block_length a) in
let l1 : lseq uint8 (block_length a) = sub last (block_length a) (block_length a) in
(l0, l1) | {
"file_name": "code/sha2-mb/Hacl.Spec.SHA2.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 12,
"end_line": 301,
"start_col": 0,
"start_line": 289
} | module Hacl.Spec.SHA2.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.NTuple
open Lib.Sequence
open Lib.IntVector
open Lib.LoopCombinators
open Spec.Hash.Definitions
module Constants = Spec.SHA2.Constants
module Spec = Hacl.Spec.SHA2
module LSeq = Lib.Sequence
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
noextract
type m_spec =
| M32
| M128
| M256
inline_for_extraction
let lanes_t = n:nat{n == 1 \/ n == 2 \/ n == 4 \/ n == 8}
inline_for_extraction
let lanes (a:sha2_alg) (m:m_spec) : lanes_t =
match a,m with
| SHA2_224,M128
| SHA2_256,M128 -> 4
| SHA2_224,M256
| SHA2_256,M256 -> 8
| SHA2_384,M128
| SHA2_512,M128 -> 2
| SHA2_384,M256
| SHA2_512,M256 -> 4
| _ -> 1
noextract
let is_supported (a:sha2_alg) (m:m_spec) =
lanes a m = 1 \/ lanes a m = 4 \/ lanes a m = 8
inline_for_extraction
let element_t (a:sha2_alg) (m:m_spec) = vec_t (word_t a) (lanes a m)
inline_for_extraction
val zero_element: a:sha2_alg -> m:m_spec -> element_t a m
let zero_element a m = vec_zero (word_t a) (lanes a m)
//TODO: remove when Spec.Hash.Definitions.word is fixed
inline_for_extraction
let word (a:hash_alg) = uint_t (word_t a) SEC
//TODO: remove when Spec.Hash.Definitions.word is fixed
inline_for_extraction
let words_state' a = m:Seq.seq (word a) {Seq.length m = state_word_length a}
inline_for_extraction
val load_element: a:sha2_alg -> m:m_spec -> word a -> element_t a m
let load_element a m x = vec_load x (lanes a m)
inline_for_extraction
let ( +| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( +| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( +| ) #U64 #(lanes a m)
inline_for_extraction
let ( ^| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( ^| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( ^| ) #U64 #(lanes a m)
inline_for_extraction
let ( &| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( &| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( &| ) #U64 #(lanes a m)
inline_for_extraction
let ( ~| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( ~| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( ~| ) #U64 #(lanes a m)
inline_for_extraction
let ( >>>| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> rotval (word_t a) -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( >>>| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( >>>| ) #U64 #(lanes a m)
inline_for_extraction
let ( >>| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> shiftval (word_t a) -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( >>| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( >>| ) #U64 #(lanes a m)
inline_for_extraction
val _Ch: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m -> element_t a m -> element_t a m
let _Ch #a #m x y z = (x &| y) ^| (~| x &| z) //Alternative: Ch(e,f,g)=((f^g)&e)^g - does not appear to make a perf diff
inline_for_extraction
val _Maj: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m -> element_t a m -> element_t a m
let _Maj #a #m x y z = (x &| y) ^| ((x &| z) ^| (y &| z)) // Alternative: Maj(a,b,c) = Ch(a^b,c,b) - does not appear to make a perf diff
inline_for_extraction
val _Sigma0: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _Sigma0 #a #m x = Spec.((x >>>| (op0 a).c0) ^| (x >>>| (op0 a).c1) ^| (x >>>| (op0 a).c2))
inline_for_extraction
val _Sigma1: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _Sigma1 #a #m x = Spec.((x >>>| (op0 a).c3) ^| (x >>>| (op0 a).c4) ^| (x >>>| (op0 a).c5))
inline_for_extraction
val _sigma0: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _sigma0 #a #m x = Spec.((x >>>| (op0 a).e0) ^| (x >>>| (op0 a).e1) ^| (x >>| (op0 a).e2))
inline_for_extraction
val _sigma1: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _sigma1 #a #m x = Spec.((x >>>| (op0 a).e3) ^| (x >>>| (op0 a).e4) ^| (x >>| (op0 a).e5))
noextract
let state_spec (a:sha2_alg) (m:m_spec) = lseq (element_t a m) 8
noextract
let ws_spec (a:sha2_alg) (m:m_spec) = lseq (element_t a m) 16
noextract
let state_spec_v (#a:sha2_alg) (#m:m_spec) (st:state_spec a m) : lseq (words_state' a) (lanes a m) =
createi #(words_state' a) (lanes a m) (fun i ->
create8
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i])
noextract
let ws_spec_v (#a:sha2_alg) (#m:m_spec) (st:ws_spec a m) : lseq (lseq (word a) 16) (lanes a m) =
createi #(lseq (word a) 16) (lanes a m) (fun i ->
create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i])
noextract
val shuffle_core_spec: #a: sha2_alg -> #m:m_spec ->
k_t: word a ->
ws_t: element_t a m ->
st: state_spec a m ->
state_spec a m
let shuffle_core_spec #a #m k_t ws_t st =
let a0 = st.[0] in
let b0 = st.[1] in
let c0 = st.[2] in
let d0 = st.[3] in
let e0 = st.[4] in
let f0 = st.[5] in
let g0 = st.[6] in
let h0 = st.[7] in
let k_e_t = load_element a m k_t in
let t1 = h0 +| (_Sigma1 e0) +| (_Ch e0 f0 g0) +| k_e_t +| ws_t in
let t2 = (_Sigma0 a0) +| (_Maj a0 b0 c0) in
let a1 = t1 +| t2 in
let b1 = a0 in
let c1 = b0 in
let d1 = c0 in
let e1 = d0 +| t1 in
let f1 = e0 in
let g1 = f0 in
let h1 = g0 in
create8 a1 b1 c1 d1 e1 f1 g1 h1
inline_for_extraction
let num_rounds16 (a:sha2_alg) : n:size_t{v n > 0 /\ 16 * v n == Spec.size_k_w a} =
match a with
| SHA2_224 | SHA2_256 -> 4ul
| SHA2_384 | SHA2_512 -> 5ul
noextract
let multiseq (lanes:lanes_t) (len:nat) =
ntuple (Seq.lseq uint8 len) lanes
unfold let multiblock_spec (a:sha2_alg) (m:m_spec) =
multiseq (lanes a m) (block_length a)
noextract
let load_elementi (#a:sha2_alg) (#m:m_spec) (b:lseq uint8 (block_length a)) (bi:nat{bi < 16 / lanes a m}) : element_t a m =
let l = lanes a m in
vec_from_bytes_be (word_t a) l (sub b (bi * l * word_length a) (l * word_length a))
noextract
let get_wsi (#a:sha2_alg) (#m:m_spec) (b:multiblock_spec a m) (i:nat{i < 16}) : element_t a m =
let l = lanes a m in
let idx_i = i % l in
let idx_j = i / l in
load_elementi #a #m b.(|idx_i|) idx_j
noextract
let load_blocks (#a:sha2_alg) (#m:m_spec) (b:multiblock_spec a m) : ws_spec a m =
createi 16 (get_wsi #a #m b)
noextract
let transpose_ws1 (#a:sha2_alg) (#m:m_spec{lanes a m == 1}) (ws:ws_spec a m) : ws_spec a m = ws
noextract
let transpose_ws4 (#a:sha2_alg) (#m:m_spec{lanes a m == 4}) (ws:ws_spec a m) : ws_spec a m =
let (ws0,ws1,ws2,ws3) = VecTranspose.transpose4x4 (ws.[0], ws.[1], ws.[2], ws.[3]) in
let (ws4,ws5,ws6,ws7) = VecTranspose.transpose4x4 (ws.[4], ws.[5], ws.[6], ws.[7]) in
let (ws8,ws9,ws10,ws11) = VecTranspose.transpose4x4 (ws.[8], ws.[9], ws.[10], ws.[11]) in
let (ws12,ws13,ws14,ws15) = VecTranspose.transpose4x4 (ws.[12], ws.[13], ws.[14], ws.[15]) in
create16 ws0 ws1 ws2 ws3 ws4 ws5 ws6 ws7 ws8 ws9 ws10 ws11 ws12 ws13 ws14 ws15
noextract
let transpose_ws8 (#a:sha2_alg) (#m:m_spec{lanes a m == 8}) (ws:ws_spec a m) : ws_spec a m =
let (ws0,ws1,ws2,ws3,ws4,ws5,ws6,ws7) = VecTranspose.transpose8x8 (ws.[0], ws.[1], ws.[2], ws.[3], ws.[4], ws.[5], ws.[6], ws.[7]) in
let (ws8,ws9,ws10,ws11,ws12,ws13,ws14,ws15) = VecTranspose.transpose8x8 (ws.[8], ws.[9], ws.[10], ws.[11], ws.[12], ws.[13], ws.[14], ws.[15]) in
create16 ws0 ws1 ws2 ws3 ws4 ws5 ws6 ws7 ws8 ws9 ws10 ws11 ws12 ws13 ws14 ws15
noextract
let transpose_ws (#a:sha2_alg) (#m:m_spec{is_supported a m}) (ws:ws_spec a m) : ws_spec a m =
match lanes a m with
| 1 -> transpose_ws1 #a #m ws
| 4 -> transpose_ws4 #a #m ws
| 8 -> transpose_ws8 #a #m ws
noextract
let load_ws (#a:sha2_alg) (#m:m_spec{is_supported a m}) (b:multiblock_spec a m) : ws_spec a m =
let ws = load_blocks #a #m b in
transpose_ws #a #m ws
noextract
let ws_next_inner (#a:sha2_alg) (#m:m_spec)
(i:nat{i < 16})
(ws:ws_spec a m) : ws_spec a m =
let t16 = ws.[i] in
let t15 = ws.[(i+1) % 16] in
let t7 = ws.[(i+9) % 16] in
let t2 = ws.[(i+14) % 16] in
let s1 = _sigma1 t2 in
let s0 = _sigma0 t15 in
ws.[i] <- (s1 +| t7 +| s0 +| t16)
noextract
let ws_next (#a:sha2_alg) (#m:m_spec)
(ws:ws_spec a m) : ws_spec a m =
repeati 16 (ws_next_inner #a #m) ws
noextract
let shuffle_inner (#a:sha2_alg) (#m:m_spec) (ws:ws_spec a m) (i:nat{i < v (num_rounds16 a)}) (j:nat{j < 16}) (st:state_spec a m) : state_spec a m =
let k_t = Seq.index (Spec.k0 a) (16 * i + j) in
let ws_t = ws.[j] in
shuffle_core_spec k_t ws_t st
noextract
let shuffle_inner_loop (#a:sha2_alg) (#m:m_spec) (i:nat{i < v (num_rounds16 a)})
(ws_st:ws_spec a m & state_spec a m) : ws_spec a m & state_spec a m =
let (ws,st) = ws_st in
let st' = repeati 16 (shuffle_inner ws i) st in
let ws' = if i < v (num_rounds16 a) - 1 then ws_next ws else ws in
(ws',st')
noextract
let shuffle (#a:sha2_alg) (#m:m_spec) (ws:ws_spec a m) (st:state_spec a m) : state_spec a m =
let (ws,st) = repeati (v(num_rounds16 a)) (shuffle_inner_loop #a #m) (ws,st) in
st
noextract
let init (a:sha2_alg) (m:m_spec) : state_spec a m =
createi 8 (fun i -> load_element a m (Seq.index (Spec.h0 a) i))
[@"opaque_to_smt"]
noextract
let update (#a:sha2_alg) (#m:m_spec{is_supported a m}) (b:multiblock_spec a m) (st:state_spec a m): state_spec a m =
let st_old = st in
let ws = load_ws b in
let st_new = shuffle ws st_old in
map2 (+|) st_new st_old
noextract
let padded_blocks (a:sha2_alg) (len:nat{len <= block_length a}) : n:nat{n <= 2} =
if (len + len_length a + 1 <= block_length a) then 1 else 2 | {
"checked_file": "/",
"dependencies": [
"Spec.SHA2.Constants.fst.checked",
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NTuple.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.Serialize.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Hacl.Spec.SHA2.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.SHA2.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.SHA2",
"short_module": "Spec"
},
{
"abbrev": true,
"full_module": "Spec.SHA2.Constants",
"short_module": "Constants"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.NTuple",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.SHA2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.SHA2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
totlen_seq: Lib.Sequence.lseq Lib.IntTypes.uint8 (Spec.Hash.Definitions.len_length a) ->
fin:
Prims.nat
{ fin == Spec.Hash.Definitions.block_length a \/
fin == 2 * Spec.Hash.Definitions.block_length a } ->
len: Prims.nat{len <= Spec.Hash.Definitions.block_length a} ->
b: Lib.Sequence.lseq Lib.IntTypes.uint8 len
-> Lib.Sequence.lseq Lib.IntTypes.uint8 (Spec.Hash.Definitions.block_length a) *
Lib.Sequence.lseq Lib.IntTypes.uint8 (Spec.Hash.Definitions.block_length a) | Prims.Tot | [
"total"
] | [] | [
"Spec.Hash.Definitions.sha2_alg",
"Lib.Sequence.lseq",
"Lib.IntTypes.uint8",
"Spec.Hash.Definitions.len_length",
"Prims.nat",
"Prims.l_or",
"Prims.eq2",
"Prims.int",
"Prims.b2t",
"Prims.op_GreaterThanOrEqual",
"Prims.op_disEquality",
"Spec.Hash.Definitions.block_length",
"FStar.Mul.op_Star",
"Prims.op_LessThanOrEqual",
"FStar.Pervasives.Native.Mktuple2",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Lib.Sequence.sub",
"Prims.op_Multiply",
"Prims.l_and",
"Prims.op_Subtraction",
"Prims.l_Forall",
"Prims.op_LessThan",
"Prims.op_Addition",
"FStar.Seq.Base.index",
"Lib.Sequence.to_seq",
"Lib.Sequence.index",
"Lib.Sequence.update_sub",
"FStar.Seq.Base.seq",
"FStar.Seq.Base.upd",
"Lib.IntTypes.mk_int",
"Prims.pow2",
"Prims.l_imp",
"Lib.Sequence.op_String_Assignment",
"Lib.IntTypes.u8",
"FStar.Seq.Base.create",
"Lib.Sequence.create",
"FStar.Pervasives.Native.tuple2"
] | [] | false | false | false | false | false | let load_last_blocks
(#a: sha2_alg)
(totlen_seq: lseq uint8 (len_length a))
(fin: nat{fin == block_length a \/ fin == 2 * block_length a})
(len: nat{len <= block_length a})
(b: lseq uint8 len)
: lseq uint8 (block_length a) & lseq uint8 (block_length a) =
| let last = create (2 * block_length a) (u8 0) in
let last = update_sub last 0 len b in
let last = last.[ len ] <- u8 0x80 in
let last = update_sub last (fin - len_length a) (len_length a) totlen_seq in
let l0:lseq uint8 (block_length a) = sub last 0 (block_length a) in
let l1:lseq uint8 (block_length a) = sub last (block_length a) (block_length a) in
(l0, l1) | false |
Hacl.Spec.SHA2.Vec.fst | Hacl.Spec.SHA2.Vec.get_multiblock_spec | val get_multiblock_spec
(#a: sha2_alg)
(#m: m_spec)
(len: Spec.len_lt_max_a_t a)
(b: multiseq (lanes a m) len)
(i: nat{i < len / block_length a})
: multiseq (lanes a m) (block_length a) | val get_multiblock_spec
(#a: sha2_alg)
(#m: m_spec)
(len: Spec.len_lt_max_a_t a)
(b: multiseq (lanes a m) len)
(i: nat{i < len / block_length a})
: multiseq (lanes a m) (block_length a) | let get_multiblock_spec (#a:sha2_alg) (#m:m_spec)
(len:Spec.len_lt_max_a_t a) (b:multiseq (lanes a m) len)
(i:nat{i < len / block_length a})
: multiseq (lanes a m) (block_length a) =
Lib.NTuple.createi #(Seq.lseq uint8 (block_length a)) (lanes a m)
(fun j -> Seq.slice b.(|j|) (i * block_length a) (i * block_length a + block_length a)) | {
"file_name": "code/sha2-mb/Hacl.Spec.SHA2.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 93,
"end_line": 442,
"start_col": 0,
"start_line": 436
} | module Hacl.Spec.SHA2.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.NTuple
open Lib.Sequence
open Lib.IntVector
open Lib.LoopCombinators
open Spec.Hash.Definitions
module Constants = Spec.SHA2.Constants
module Spec = Hacl.Spec.SHA2
module LSeq = Lib.Sequence
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
noextract
type m_spec =
| M32
| M128
| M256
inline_for_extraction
let lanes_t = n:nat{n == 1 \/ n == 2 \/ n == 4 \/ n == 8}
inline_for_extraction
let lanes (a:sha2_alg) (m:m_spec) : lanes_t =
match a,m with
| SHA2_224,M128
| SHA2_256,M128 -> 4
| SHA2_224,M256
| SHA2_256,M256 -> 8
| SHA2_384,M128
| SHA2_512,M128 -> 2
| SHA2_384,M256
| SHA2_512,M256 -> 4
| _ -> 1
noextract
let is_supported (a:sha2_alg) (m:m_spec) =
lanes a m = 1 \/ lanes a m = 4 \/ lanes a m = 8
inline_for_extraction
let element_t (a:sha2_alg) (m:m_spec) = vec_t (word_t a) (lanes a m)
inline_for_extraction
val zero_element: a:sha2_alg -> m:m_spec -> element_t a m
let zero_element a m = vec_zero (word_t a) (lanes a m)
//TODO: remove when Spec.Hash.Definitions.word is fixed
inline_for_extraction
let word (a:hash_alg) = uint_t (word_t a) SEC
//TODO: remove when Spec.Hash.Definitions.word is fixed
inline_for_extraction
let words_state' a = m:Seq.seq (word a) {Seq.length m = state_word_length a}
inline_for_extraction
val load_element: a:sha2_alg -> m:m_spec -> word a -> element_t a m
let load_element a m x = vec_load x (lanes a m)
inline_for_extraction
let ( +| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( +| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( +| ) #U64 #(lanes a m)
inline_for_extraction
let ( ^| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( ^| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( ^| ) #U64 #(lanes a m)
inline_for_extraction
let ( &| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( &| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( &| ) #U64 #(lanes a m)
inline_for_extraction
let ( ~| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( ~| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( ~| ) #U64 #(lanes a m)
inline_for_extraction
let ( >>>| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> rotval (word_t a) -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( >>>| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( >>>| ) #U64 #(lanes a m)
inline_for_extraction
let ( >>| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> shiftval (word_t a) -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( >>| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( >>| ) #U64 #(lanes a m)
inline_for_extraction
val _Ch: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m -> element_t a m -> element_t a m
let _Ch #a #m x y z = (x &| y) ^| (~| x &| z) //Alternative: Ch(e,f,g)=((f^g)&e)^g - does not appear to make a perf diff
inline_for_extraction
val _Maj: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m -> element_t a m -> element_t a m
let _Maj #a #m x y z = (x &| y) ^| ((x &| z) ^| (y &| z)) // Alternative: Maj(a,b,c) = Ch(a^b,c,b) - does not appear to make a perf diff
inline_for_extraction
val _Sigma0: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _Sigma0 #a #m x = Spec.((x >>>| (op0 a).c0) ^| (x >>>| (op0 a).c1) ^| (x >>>| (op0 a).c2))
inline_for_extraction
val _Sigma1: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _Sigma1 #a #m x = Spec.((x >>>| (op0 a).c3) ^| (x >>>| (op0 a).c4) ^| (x >>>| (op0 a).c5))
inline_for_extraction
val _sigma0: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _sigma0 #a #m x = Spec.((x >>>| (op0 a).e0) ^| (x >>>| (op0 a).e1) ^| (x >>| (op0 a).e2))
inline_for_extraction
val _sigma1: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _sigma1 #a #m x = Spec.((x >>>| (op0 a).e3) ^| (x >>>| (op0 a).e4) ^| (x >>| (op0 a).e5))
noextract
let state_spec (a:sha2_alg) (m:m_spec) = lseq (element_t a m) 8
noextract
let ws_spec (a:sha2_alg) (m:m_spec) = lseq (element_t a m) 16
noextract
let state_spec_v (#a:sha2_alg) (#m:m_spec) (st:state_spec a m) : lseq (words_state' a) (lanes a m) =
createi #(words_state' a) (lanes a m) (fun i ->
create8
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i])
noextract
let ws_spec_v (#a:sha2_alg) (#m:m_spec) (st:ws_spec a m) : lseq (lseq (word a) 16) (lanes a m) =
createi #(lseq (word a) 16) (lanes a m) (fun i ->
create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i])
noextract
val shuffle_core_spec: #a: sha2_alg -> #m:m_spec ->
k_t: word a ->
ws_t: element_t a m ->
st: state_spec a m ->
state_spec a m
let shuffle_core_spec #a #m k_t ws_t st =
let a0 = st.[0] in
let b0 = st.[1] in
let c0 = st.[2] in
let d0 = st.[3] in
let e0 = st.[4] in
let f0 = st.[5] in
let g0 = st.[6] in
let h0 = st.[7] in
let k_e_t = load_element a m k_t in
let t1 = h0 +| (_Sigma1 e0) +| (_Ch e0 f0 g0) +| k_e_t +| ws_t in
let t2 = (_Sigma0 a0) +| (_Maj a0 b0 c0) in
let a1 = t1 +| t2 in
let b1 = a0 in
let c1 = b0 in
let d1 = c0 in
let e1 = d0 +| t1 in
let f1 = e0 in
let g1 = f0 in
let h1 = g0 in
create8 a1 b1 c1 d1 e1 f1 g1 h1
inline_for_extraction
let num_rounds16 (a:sha2_alg) : n:size_t{v n > 0 /\ 16 * v n == Spec.size_k_w a} =
match a with
| SHA2_224 | SHA2_256 -> 4ul
| SHA2_384 | SHA2_512 -> 5ul
noextract
let multiseq (lanes:lanes_t) (len:nat) =
ntuple (Seq.lseq uint8 len) lanes
unfold let multiblock_spec (a:sha2_alg) (m:m_spec) =
multiseq (lanes a m) (block_length a)
noextract
let load_elementi (#a:sha2_alg) (#m:m_spec) (b:lseq uint8 (block_length a)) (bi:nat{bi < 16 / lanes a m}) : element_t a m =
let l = lanes a m in
vec_from_bytes_be (word_t a) l (sub b (bi * l * word_length a) (l * word_length a))
noextract
let get_wsi (#a:sha2_alg) (#m:m_spec) (b:multiblock_spec a m) (i:nat{i < 16}) : element_t a m =
let l = lanes a m in
let idx_i = i % l in
let idx_j = i / l in
load_elementi #a #m b.(|idx_i|) idx_j
noextract
let load_blocks (#a:sha2_alg) (#m:m_spec) (b:multiblock_spec a m) : ws_spec a m =
createi 16 (get_wsi #a #m b)
noextract
let transpose_ws1 (#a:sha2_alg) (#m:m_spec{lanes a m == 1}) (ws:ws_spec a m) : ws_spec a m = ws
noextract
let transpose_ws4 (#a:sha2_alg) (#m:m_spec{lanes a m == 4}) (ws:ws_spec a m) : ws_spec a m =
let (ws0,ws1,ws2,ws3) = VecTranspose.transpose4x4 (ws.[0], ws.[1], ws.[2], ws.[3]) in
let (ws4,ws5,ws6,ws7) = VecTranspose.transpose4x4 (ws.[4], ws.[5], ws.[6], ws.[7]) in
let (ws8,ws9,ws10,ws11) = VecTranspose.transpose4x4 (ws.[8], ws.[9], ws.[10], ws.[11]) in
let (ws12,ws13,ws14,ws15) = VecTranspose.transpose4x4 (ws.[12], ws.[13], ws.[14], ws.[15]) in
create16 ws0 ws1 ws2 ws3 ws4 ws5 ws6 ws7 ws8 ws9 ws10 ws11 ws12 ws13 ws14 ws15
noextract
let transpose_ws8 (#a:sha2_alg) (#m:m_spec{lanes a m == 8}) (ws:ws_spec a m) : ws_spec a m =
let (ws0,ws1,ws2,ws3,ws4,ws5,ws6,ws7) = VecTranspose.transpose8x8 (ws.[0], ws.[1], ws.[2], ws.[3], ws.[4], ws.[5], ws.[6], ws.[7]) in
let (ws8,ws9,ws10,ws11,ws12,ws13,ws14,ws15) = VecTranspose.transpose8x8 (ws.[8], ws.[9], ws.[10], ws.[11], ws.[12], ws.[13], ws.[14], ws.[15]) in
create16 ws0 ws1 ws2 ws3 ws4 ws5 ws6 ws7 ws8 ws9 ws10 ws11 ws12 ws13 ws14 ws15
noextract
let transpose_ws (#a:sha2_alg) (#m:m_spec{is_supported a m}) (ws:ws_spec a m) : ws_spec a m =
match lanes a m with
| 1 -> transpose_ws1 #a #m ws
| 4 -> transpose_ws4 #a #m ws
| 8 -> transpose_ws8 #a #m ws
noextract
let load_ws (#a:sha2_alg) (#m:m_spec{is_supported a m}) (b:multiblock_spec a m) : ws_spec a m =
let ws = load_blocks #a #m b in
transpose_ws #a #m ws
noextract
let ws_next_inner (#a:sha2_alg) (#m:m_spec)
(i:nat{i < 16})
(ws:ws_spec a m) : ws_spec a m =
let t16 = ws.[i] in
let t15 = ws.[(i+1) % 16] in
let t7 = ws.[(i+9) % 16] in
let t2 = ws.[(i+14) % 16] in
let s1 = _sigma1 t2 in
let s0 = _sigma0 t15 in
ws.[i] <- (s1 +| t7 +| s0 +| t16)
noextract
let ws_next (#a:sha2_alg) (#m:m_spec)
(ws:ws_spec a m) : ws_spec a m =
repeati 16 (ws_next_inner #a #m) ws
noextract
let shuffle_inner (#a:sha2_alg) (#m:m_spec) (ws:ws_spec a m) (i:nat{i < v (num_rounds16 a)}) (j:nat{j < 16}) (st:state_spec a m) : state_spec a m =
let k_t = Seq.index (Spec.k0 a) (16 * i + j) in
let ws_t = ws.[j] in
shuffle_core_spec k_t ws_t st
noextract
let shuffle_inner_loop (#a:sha2_alg) (#m:m_spec) (i:nat{i < v (num_rounds16 a)})
(ws_st:ws_spec a m & state_spec a m) : ws_spec a m & state_spec a m =
let (ws,st) = ws_st in
let st' = repeati 16 (shuffle_inner ws i) st in
let ws' = if i < v (num_rounds16 a) - 1 then ws_next ws else ws in
(ws',st')
noextract
let shuffle (#a:sha2_alg) (#m:m_spec) (ws:ws_spec a m) (st:state_spec a m) : state_spec a m =
let (ws,st) = repeati (v(num_rounds16 a)) (shuffle_inner_loop #a #m) (ws,st) in
st
noextract
let init (a:sha2_alg) (m:m_spec) : state_spec a m =
createi 8 (fun i -> load_element a m (Seq.index (Spec.h0 a) i))
[@"opaque_to_smt"]
noextract
let update (#a:sha2_alg) (#m:m_spec{is_supported a m}) (b:multiblock_spec a m) (st:state_spec a m): state_spec a m =
let st_old = st in
let ws = load_ws b in
let st_new = shuffle ws st_old in
map2 (+|) st_new st_old
noextract
let padded_blocks (a:sha2_alg) (len:nat{len <= block_length a}) : n:nat{n <= 2} =
if (len + len_length a + 1 <= block_length a) then 1 else 2
noextract
let load_last_blocks (#a:sha2_alg)
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a})
(b:lseq uint8 len) :
lseq uint8 (block_length a) & lseq uint8 (block_length a) =
let last = create (2 * block_length a) (u8 0) in
let last = update_sub last 0 len b in
let last = last.[len] <- u8 0x80 in
let last = update_sub last (fin - len_length a) (len_length a) totlen_seq in
let l0 : lseq uint8 (block_length a) = sub last 0 (block_length a) in
let l1 : lseq uint8 (block_length a) = sub last (block_length a) (block_length a) in
(l0, l1)
noextract
let load_last1 (#a:sha2_alg) (#m:m_spec{lanes a m == 1})
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a}) (b:multiseq (lanes a m) len) :
multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
let b = b.(|0|) in
let (l0,l1) = load_last_blocks #a totlen_seq fin len b in
let lb0 : multiseq (lanes a m) (block_length a) = ntup1 l0 in
let lb1 : multiseq (lanes a m) (block_length a) = ntup1 l1 in
(lb0, lb1)
#push-options "--z3rlimit 100"
noextract
let load_last4 (#a:sha2_alg) (#m:m_spec{lanes a m == 4})
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a}) (b:multiseq (lanes a m) len) :
multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
let b0 = b.(|0|) in
let b1 = b.(|1|) in
let b2 = b.(|2|) in
let b3 = b.(|3|) in
let (l00,l01) = load_last_blocks #a totlen_seq fin len b0 in
let (l10,l11) = load_last_blocks #a totlen_seq fin len b1 in
let (l20,l21) = load_last_blocks #a totlen_seq fin len b2 in
let (l30,l31) = load_last_blocks #a totlen_seq fin len b3 in
let mb0 = ntup4 (l00, (l10, (l20, l30))) in
let mb1 = ntup4 (l01, (l11, (l21, l31))) in
(mb0, mb1)
noextract
let load_last8 (#a:sha2_alg) (#m:m_spec{lanes a m == 8})
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a}) (b:multiseq (lanes a m) len) :
multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
let b0 = b.(|0|) in
let b1 = b.(|1|) in
let b2 = b.(|2|) in
let b3 = b.(|3|) in
let b4 = b.(|4|) in
let b5 = b.(|5|) in
let b6 = b.(|6|) in
let b7 = b.(|7|) in
let (l00,l01) = load_last_blocks #a totlen_seq fin len b0 in
let (l10,l11) = load_last_blocks #a totlen_seq fin len b1 in
let (l20,l21) = load_last_blocks #a totlen_seq fin len b2 in
let (l30,l31) = load_last_blocks #a totlen_seq fin len b3 in
let (l40,l41) = load_last_blocks #a totlen_seq fin len b4 in
let (l50,l51) = load_last_blocks #a totlen_seq fin len b5 in
let (l60,l61) = load_last_blocks #a totlen_seq fin len b6 in
let (l70,l71) = load_last_blocks #a totlen_seq fin len b7 in
let mb0 = ntup8 (l00, (l10, (l20, (l30, (l40, (l50, (l60, l70))))))) in
let mb1 = ntup8 (l01, (l11, (l21, (l31, (l41, (l51, (l61, l71))))))) in
(mb0, mb1)
#pop-options
[@"opaque_to_smt"]
noextract
let load_last (#a:sha2_alg) (#m:m_spec{is_supported a m}) (totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a}) (b:multiseq (lanes a m) len) :
multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
match lanes a m with
| 1 -> load_last1 #a #m totlen_seq fin len b
| 4 -> load_last4 #a #m totlen_seq fin len b
| 8 -> load_last8 #a #m totlen_seq fin len b
noextract
let update_last (#a:sha2_alg) (#m:m_spec{is_supported a m}) (totlen:len_t a)
(len:nat{len <= block_length a})
(b:multiseq (lanes a m) len) (st:state_spec a m): state_spec a m =
let blocks = padded_blocks a len in
let fin : nat = blocks * block_length a in
let total_len_bits = secret (shift_left #(len_int_type a) totlen 3ul) in
let totlen_seq = Lib.ByteSequence.uint_to_bytes_be #(len_int_type a) total_len_bits in
let (b0,b1) = load_last #a #m totlen_seq fin len b in
let st = update b0 st in
if blocks > 1 then
update b1 st
else st
noextract
let transpose_state4 (#a:sha2_alg) (#m:m_spec{lanes a m == 4})
(st:state_spec a m) : state_spec a m =
let st0 = st.[0] in
let st1 = st.[1] in
let st2 = st.[2] in
let st3 = st.[3] in
let st4 = st.[4] in
let st5 = st.[5] in
let st6 = st.[6] in
let st7 = st.[7] in
let (st0,st1,st2,st3) = VecTranspose.transpose4x4 (st0,st1,st2,st3) in
let (st4,st5,st6,st7) = VecTranspose.transpose4x4 (st4,st5,st6,st7) in
create8 st0 st4 st1 st5 st2 st6 st3 st7
noextract
let transpose_state8 (#a:sha2_alg) (#m:m_spec{lanes a m == 8})
(st:state_spec a m) : state_spec a m =
let st0 = st.[0] in
let st1 = st.[1] in
let st2 = st.[2] in
let st3 = st.[3] in
let st4 = st.[4] in
let st5 = st.[5] in
let st6 = st.[6] in
let st7 = st.[7] in
let (st0,st1,st2,st3,st4,st5,st6,st7) = VecTranspose.transpose8x8 (st0,st1,st2,st3,st4,st5,st6,st7) in
create8 st0 st1 st2 st3 st4 st5 st6 st7
noextract
let transpose_state (#a:sha2_alg) (#m:m_spec{is_supported a m}) (st:state_spec a m) : state_spec a m =
match lanes a m with
| 1 -> st
| 4 -> transpose_state4 #a #m st
| 8 -> transpose_state8 #a #m st
noextract
let store_state (#a:sha2_alg) (#m:m_spec{is_supported a m}) (st:state_spec a m) :
lseq uint8 (lanes a m * 8 * word_length a) =
let st = transpose_state st in
Lib.IntVector.Serialize.vecs_to_bytes_be st
noextract
let emit (#a:sha2_alg) (#m:m_spec)
(hseq:lseq uint8 (lanes a m * 8 * word_length a)):
multiseq (lanes a m) (hash_length a) =
Lib.NTuple.createi #(Seq.lseq uint8 (hash_length a)) (lanes a m)
(fun i -> sub hseq (i * 8 * word_length a) (hash_length a)) | {
"checked_file": "/",
"dependencies": [
"Spec.SHA2.Constants.fst.checked",
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NTuple.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.Serialize.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Hacl.Spec.SHA2.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.SHA2.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.SHA2",
"short_module": "Spec"
},
{
"abbrev": true,
"full_module": "Spec.SHA2.Constants",
"short_module": "Constants"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.NTuple",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.SHA2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.SHA2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
len: Hacl.Spec.SHA2.len_lt_max_a_t a ->
b: Hacl.Spec.SHA2.Vec.multiseq (Hacl.Spec.SHA2.Vec.lanes a m) len ->
i: Prims.nat{i < len / Spec.Hash.Definitions.block_length a}
-> Hacl.Spec.SHA2.Vec.multiseq (Hacl.Spec.SHA2.Vec.lanes a m)
(Spec.Hash.Definitions.block_length a) | Prims.Tot | [
"total"
] | [] | [
"Spec.Hash.Definitions.sha2_alg",
"Hacl.Spec.SHA2.Vec.m_spec",
"Hacl.Spec.SHA2.len_lt_max_a_t",
"Hacl.Spec.SHA2.Vec.multiseq",
"Hacl.Spec.SHA2.Vec.lanes",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.op_Division",
"Spec.Hash.Definitions.block_length",
"Lib.NTuple.createi",
"FStar.Seq.Properties.lseq",
"Lib.IntTypes.uint8",
"FStar.Seq.Base.slice",
"Lib.NTuple.op_Lens_Access",
"FStar.Mul.op_Star",
"Prims.op_Addition"
] | [] | false | false | false | false | false | let get_multiblock_spec
(#a: sha2_alg)
(#m: m_spec)
(len: Spec.len_lt_max_a_t a)
(b: multiseq (lanes a m) len)
(i: nat{i < len / block_length a})
: multiseq (lanes a m) (block_length a) =
| Lib.NTuple.createi #(Seq.lseq uint8 (block_length a))
(lanes a m)
(fun j -> Seq.slice b.(| j |) (i * block_length a) (i * block_length a + block_length a)) | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.vale_full_heap | val vale_full_heap : Type | let vale_full_heap = vale_full_heap | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 42,
"end_line": 10,
"start_col": 7,
"start_line": 10
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapImpl.vale_full_heap"
] | [] | false | false | false | true | true | let vale_full_heap =
| vale_full_heap | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.vale_full_heap_equal | val vale_full_heap_equal : h1: Vale.PPC64LE.Memory.vale_full_heap -> h2: Vale.PPC64LE.Memory.vale_full_heap -> Prims.logical | let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 43,
"end_line": 23,
"start_col": 0,
"start_line": 20
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh} | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h1: Vale.PPC64LE.Memory.vale_full_heap -> h2: Vale.PPC64LE.Memory.vale_full_heap -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Memory.vale_full_heap",
"Prims.l_and",
"Prims.eq2",
"Vale.Arch.HeapImpl.vale_heap_layout",
"Vale.Arch.HeapImpl.__proj__Mkvale_full_heap__item__vf_layout",
"Vale.Arch.HeapImpl.vale_heap",
"Vale.Arch.HeapImpl.__proj__Mkvale_full_heap__item__vf_heap",
"Vale.Lib.Map16.equal",
"Vale.Arch.HeapImpl.__proj__Mkvale_full_heap__item__vf_heaplets",
"Prims.logical"
] | [] | false | false | false | true | true | let vale_full_heap_equal (h1 h2: vale_full_heap) =
| h1.vf_layout == h2.vf_layout /\ h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.nat16 | val nat16 : Type0 | let nat16 = Vale.Def.Words_s.nat16 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 41,
"end_line": 28,
"start_col": 7,
"start_line": 28
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.Def.Words_s.nat16"
] | [] | false | false | false | true | true | let nat16 =
| Vale.Def.Words_s.nat16 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.heaplet_id | val heaplet_id : Type0 | let heaplet_id = heaplet_id | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 34,
"end_line": 11,
"start_col": 7,
"start_line": 11
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapImpl.heaplet_id"
] | [] | false | false | false | true | true | let heaplet_id =
| heaplet_id | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.vale_heap | val vale_heap : Type | let vale_heap = vale_heap | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 32,
"end_line": 9,
"start_col": 7,
"start_line": 9
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapImpl.vale_heap"
] | [] | false | false | false | true | true | let vale_heap =
| vale_heap | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.set_vale_heap | val set_vale_heap (vfh: vale_full_heap) (vh: vale_heap) : vale_full_heap | val set_vale_heap (vfh: vale_full_heap) (vh: vale_heap) : vale_full_heap | let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh} | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 25,
"end_line": 18,
"start_col": 0,
"start_line": 17
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | vfh: Vale.PPC64LE.Memory.vale_full_heap -> vh: Vale.PPC64LE.Memory.vale_heap
-> Vale.PPC64LE.Memory.vale_full_heap | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Memory.vale_full_heap",
"Vale.PPC64LE.Memory.vale_heap",
"Vale.Arch.HeapImpl.Mkvale_full_heap",
"Vale.Arch.HeapImpl.__proj__Mkvale_full_heap__item__vf_layout",
"Vale.Arch.HeapImpl.__proj__Mkvale_full_heap__item__vf_heaplets"
] | [] | false | false | false | true | false | let set_vale_heap (vfh: vale_full_heap) (vh: vale_heap) : vale_full_heap =
| { vfh with vf_heap = vh } | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.nat64 | val nat64 : Type0 | let nat64 = Vale.Def.Words_s.nat64 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 41,
"end_line": 30,
"start_col": 7,
"start_line": 30
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.Def.Words_s.nat64"
] | [] | false | false | false | true | true | let nat64 =
| Vale.Def.Words_s.nat64 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.get_vale_heap | val get_vale_heap (vhi: vale_full_heap) : vale_heap | val get_vale_heap (vhi: vale_full_heap) : vale_heap | let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 64,
"end_line": 14,
"start_col": 0,
"start_line": 14
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | vhi: Vale.PPC64LE.Memory.vale_full_heap -> Vale.PPC64LE.Memory.vale_heap | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Memory.vale_full_heap",
"Vale.Arch.HeapImpl.__proj__Mkvale_full_heap__item__vf_heap",
"Vale.PPC64LE.Memory.vale_heap"
] | [] | false | false | false | true | false | let get_vale_heap (vhi: vale_full_heap) : vale_heap =
| vhi.vf_heap | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.nat8 | val nat8 : Type0 | let nat8 = Vale.Def.Words_s.nat8 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 39,
"end_line": 27,
"start_col": 7,
"start_line": 27
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.Def.Words_s.nat8"
] | [] | false | false | false | true | true | let nat8 =
| Vale.Def.Words_s.nat8 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.nat32 | val nat32 : Type0 | let nat32 = Vale.Def.Words_s.nat32 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 41,
"end_line": 29,
"start_col": 7,
"start_line": 29
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.Def.Words_s.nat32"
] | [] | false | false | false | true | true | let nat32 =
| Vale.Def.Words_s.nat32 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.quad32 | val quad32 : Prims.eqtype | let quad32 = Vale.Def.Types_s.quad32 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 43,
"end_line": 31,
"start_col": 7,
"start_line": 31
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.eqtype | Prims.Tot | [
"total"
] | [] | [
"Vale.Def.Types_s.quad32"
] | [] | false | false | false | true | false | let quad32 =
| Vale.Def.Types_s.quad32 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.scale8 | val scale8 (index: int) : int | val scale8 (index: int) : int | let scale8 (index:int) : int = scale_by 8 index | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 54,
"end_line": 44,
"start_col": 7,
"start_line": 44
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | index: Prims.int -> Prims.int | Prims.Tot | [
"total"
] | [] | [
"Prims.int",
"Vale.PPC64LE.Memory.scale_by"
] | [] | false | false | false | true | false | let scale8 (index: int) : int =
| scale_by 8 index | false |
Hacl.Spec.SHA2.Vec.fst | Hacl.Spec.SHA2.Vec.load_last8 | val load_last8
(#a: sha2_alg)
(#m: m_spec{lanes a m == 8})
(totlen_seq: lseq uint8 (len_length a))
(fin: nat{fin == block_length a \/ fin == 2 * block_length a})
(len: nat{len <= block_length a})
(b: multiseq (lanes a m) len)
: multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) | val load_last8
(#a: sha2_alg)
(#m: m_spec{lanes a m == 8})
(totlen_seq: lseq uint8 (len_length a))
(fin: nat{fin == block_length a \/ fin == 2 * block_length a})
(len: nat{len <= block_length a})
(b: multiseq (lanes a m) len)
: multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) | let load_last8 (#a:sha2_alg) (#m:m_spec{lanes a m == 8})
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a}) (b:multiseq (lanes a m) len) :
multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
let b0 = b.(|0|) in
let b1 = b.(|1|) in
let b2 = b.(|2|) in
let b3 = b.(|3|) in
let b4 = b.(|4|) in
let b5 = b.(|5|) in
let b6 = b.(|6|) in
let b7 = b.(|7|) in
let (l00,l01) = load_last_blocks #a totlen_seq fin len b0 in
let (l10,l11) = load_last_blocks #a totlen_seq fin len b1 in
let (l20,l21) = load_last_blocks #a totlen_seq fin len b2 in
let (l30,l31) = load_last_blocks #a totlen_seq fin len b3 in
let (l40,l41) = load_last_blocks #a totlen_seq fin len b4 in
let (l50,l51) = load_last_blocks #a totlen_seq fin len b5 in
let (l60,l61) = load_last_blocks #a totlen_seq fin len b6 in
let (l70,l71) = load_last_blocks #a totlen_seq fin len b7 in
let mb0 = ntup8 (l00, (l10, (l20, (l30, (l40, (l50, (l60, l70))))))) in
let mb1 = ntup8 (l01, (l11, (l21, (l31, (l41, (l51, (l61, l71))))))) in
(mb0, mb1) | {
"file_name": "code/sha2-mb/Hacl.Spec.SHA2.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 14,
"end_line": 358,
"start_col": 0,
"start_line": 335
} | module Hacl.Spec.SHA2.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.NTuple
open Lib.Sequence
open Lib.IntVector
open Lib.LoopCombinators
open Spec.Hash.Definitions
module Constants = Spec.SHA2.Constants
module Spec = Hacl.Spec.SHA2
module LSeq = Lib.Sequence
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
noextract
type m_spec =
| M32
| M128
| M256
inline_for_extraction
let lanes_t = n:nat{n == 1 \/ n == 2 \/ n == 4 \/ n == 8}
inline_for_extraction
let lanes (a:sha2_alg) (m:m_spec) : lanes_t =
match a,m with
| SHA2_224,M128
| SHA2_256,M128 -> 4
| SHA2_224,M256
| SHA2_256,M256 -> 8
| SHA2_384,M128
| SHA2_512,M128 -> 2
| SHA2_384,M256
| SHA2_512,M256 -> 4
| _ -> 1
noextract
let is_supported (a:sha2_alg) (m:m_spec) =
lanes a m = 1 \/ lanes a m = 4 \/ lanes a m = 8
inline_for_extraction
let element_t (a:sha2_alg) (m:m_spec) = vec_t (word_t a) (lanes a m)
inline_for_extraction
val zero_element: a:sha2_alg -> m:m_spec -> element_t a m
let zero_element a m = vec_zero (word_t a) (lanes a m)
//TODO: remove when Spec.Hash.Definitions.word is fixed
inline_for_extraction
let word (a:hash_alg) = uint_t (word_t a) SEC
//TODO: remove when Spec.Hash.Definitions.word is fixed
inline_for_extraction
let words_state' a = m:Seq.seq (word a) {Seq.length m = state_word_length a}
inline_for_extraction
val load_element: a:sha2_alg -> m:m_spec -> word a -> element_t a m
let load_element a m x = vec_load x (lanes a m)
inline_for_extraction
let ( +| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( +| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( +| ) #U64 #(lanes a m)
inline_for_extraction
let ( ^| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( ^| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( ^| ) #U64 #(lanes a m)
inline_for_extraction
let ( &| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( &| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( &| ) #U64 #(lanes a m)
inline_for_extraction
let ( ~| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( ~| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( ~| ) #U64 #(lanes a m)
inline_for_extraction
let ( >>>| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> rotval (word_t a) -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( >>>| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( >>>| ) #U64 #(lanes a m)
inline_for_extraction
let ( >>| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> shiftval (word_t a) -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( >>| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( >>| ) #U64 #(lanes a m)
inline_for_extraction
val _Ch: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m -> element_t a m -> element_t a m
let _Ch #a #m x y z = (x &| y) ^| (~| x &| z) //Alternative: Ch(e,f,g)=((f^g)&e)^g - does not appear to make a perf diff
inline_for_extraction
val _Maj: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m -> element_t a m -> element_t a m
let _Maj #a #m x y z = (x &| y) ^| ((x &| z) ^| (y &| z)) // Alternative: Maj(a,b,c) = Ch(a^b,c,b) - does not appear to make a perf diff
inline_for_extraction
val _Sigma0: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _Sigma0 #a #m x = Spec.((x >>>| (op0 a).c0) ^| (x >>>| (op0 a).c1) ^| (x >>>| (op0 a).c2))
inline_for_extraction
val _Sigma1: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _Sigma1 #a #m x = Spec.((x >>>| (op0 a).c3) ^| (x >>>| (op0 a).c4) ^| (x >>>| (op0 a).c5))
inline_for_extraction
val _sigma0: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _sigma0 #a #m x = Spec.((x >>>| (op0 a).e0) ^| (x >>>| (op0 a).e1) ^| (x >>| (op0 a).e2))
inline_for_extraction
val _sigma1: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _sigma1 #a #m x = Spec.((x >>>| (op0 a).e3) ^| (x >>>| (op0 a).e4) ^| (x >>| (op0 a).e5))
noextract
let state_spec (a:sha2_alg) (m:m_spec) = lseq (element_t a m) 8
noextract
let ws_spec (a:sha2_alg) (m:m_spec) = lseq (element_t a m) 16
noextract
let state_spec_v (#a:sha2_alg) (#m:m_spec) (st:state_spec a m) : lseq (words_state' a) (lanes a m) =
createi #(words_state' a) (lanes a m) (fun i ->
create8
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i])
noextract
let ws_spec_v (#a:sha2_alg) (#m:m_spec) (st:ws_spec a m) : lseq (lseq (word a) 16) (lanes a m) =
createi #(lseq (word a) 16) (lanes a m) (fun i ->
create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i])
noextract
val shuffle_core_spec: #a: sha2_alg -> #m:m_spec ->
k_t: word a ->
ws_t: element_t a m ->
st: state_spec a m ->
state_spec a m
let shuffle_core_spec #a #m k_t ws_t st =
let a0 = st.[0] in
let b0 = st.[1] in
let c0 = st.[2] in
let d0 = st.[3] in
let e0 = st.[4] in
let f0 = st.[5] in
let g0 = st.[6] in
let h0 = st.[7] in
let k_e_t = load_element a m k_t in
let t1 = h0 +| (_Sigma1 e0) +| (_Ch e0 f0 g0) +| k_e_t +| ws_t in
let t2 = (_Sigma0 a0) +| (_Maj a0 b0 c0) in
let a1 = t1 +| t2 in
let b1 = a0 in
let c1 = b0 in
let d1 = c0 in
let e1 = d0 +| t1 in
let f1 = e0 in
let g1 = f0 in
let h1 = g0 in
create8 a1 b1 c1 d1 e1 f1 g1 h1
inline_for_extraction
let num_rounds16 (a:sha2_alg) : n:size_t{v n > 0 /\ 16 * v n == Spec.size_k_w a} =
match a with
| SHA2_224 | SHA2_256 -> 4ul
| SHA2_384 | SHA2_512 -> 5ul
noextract
let multiseq (lanes:lanes_t) (len:nat) =
ntuple (Seq.lseq uint8 len) lanes
unfold let multiblock_spec (a:sha2_alg) (m:m_spec) =
multiseq (lanes a m) (block_length a)
noextract
let load_elementi (#a:sha2_alg) (#m:m_spec) (b:lseq uint8 (block_length a)) (bi:nat{bi < 16 / lanes a m}) : element_t a m =
let l = lanes a m in
vec_from_bytes_be (word_t a) l (sub b (bi * l * word_length a) (l * word_length a))
noextract
let get_wsi (#a:sha2_alg) (#m:m_spec) (b:multiblock_spec a m) (i:nat{i < 16}) : element_t a m =
let l = lanes a m in
let idx_i = i % l in
let idx_j = i / l in
load_elementi #a #m b.(|idx_i|) idx_j
noextract
let load_blocks (#a:sha2_alg) (#m:m_spec) (b:multiblock_spec a m) : ws_spec a m =
createi 16 (get_wsi #a #m b)
noextract
let transpose_ws1 (#a:sha2_alg) (#m:m_spec{lanes a m == 1}) (ws:ws_spec a m) : ws_spec a m = ws
noextract
let transpose_ws4 (#a:sha2_alg) (#m:m_spec{lanes a m == 4}) (ws:ws_spec a m) : ws_spec a m =
let (ws0,ws1,ws2,ws3) = VecTranspose.transpose4x4 (ws.[0], ws.[1], ws.[2], ws.[3]) in
let (ws4,ws5,ws6,ws7) = VecTranspose.transpose4x4 (ws.[4], ws.[5], ws.[6], ws.[7]) in
let (ws8,ws9,ws10,ws11) = VecTranspose.transpose4x4 (ws.[8], ws.[9], ws.[10], ws.[11]) in
let (ws12,ws13,ws14,ws15) = VecTranspose.transpose4x4 (ws.[12], ws.[13], ws.[14], ws.[15]) in
create16 ws0 ws1 ws2 ws3 ws4 ws5 ws6 ws7 ws8 ws9 ws10 ws11 ws12 ws13 ws14 ws15
noextract
let transpose_ws8 (#a:sha2_alg) (#m:m_spec{lanes a m == 8}) (ws:ws_spec a m) : ws_spec a m =
let (ws0,ws1,ws2,ws3,ws4,ws5,ws6,ws7) = VecTranspose.transpose8x8 (ws.[0], ws.[1], ws.[2], ws.[3], ws.[4], ws.[5], ws.[6], ws.[7]) in
let (ws8,ws9,ws10,ws11,ws12,ws13,ws14,ws15) = VecTranspose.transpose8x8 (ws.[8], ws.[9], ws.[10], ws.[11], ws.[12], ws.[13], ws.[14], ws.[15]) in
create16 ws0 ws1 ws2 ws3 ws4 ws5 ws6 ws7 ws8 ws9 ws10 ws11 ws12 ws13 ws14 ws15
noextract
let transpose_ws (#a:sha2_alg) (#m:m_spec{is_supported a m}) (ws:ws_spec a m) : ws_spec a m =
match lanes a m with
| 1 -> transpose_ws1 #a #m ws
| 4 -> transpose_ws4 #a #m ws
| 8 -> transpose_ws8 #a #m ws
noextract
let load_ws (#a:sha2_alg) (#m:m_spec{is_supported a m}) (b:multiblock_spec a m) : ws_spec a m =
let ws = load_blocks #a #m b in
transpose_ws #a #m ws
noextract
let ws_next_inner (#a:sha2_alg) (#m:m_spec)
(i:nat{i < 16})
(ws:ws_spec a m) : ws_spec a m =
let t16 = ws.[i] in
let t15 = ws.[(i+1) % 16] in
let t7 = ws.[(i+9) % 16] in
let t2 = ws.[(i+14) % 16] in
let s1 = _sigma1 t2 in
let s0 = _sigma0 t15 in
ws.[i] <- (s1 +| t7 +| s0 +| t16)
noextract
let ws_next (#a:sha2_alg) (#m:m_spec)
(ws:ws_spec a m) : ws_spec a m =
repeati 16 (ws_next_inner #a #m) ws
noextract
let shuffle_inner (#a:sha2_alg) (#m:m_spec) (ws:ws_spec a m) (i:nat{i < v (num_rounds16 a)}) (j:nat{j < 16}) (st:state_spec a m) : state_spec a m =
let k_t = Seq.index (Spec.k0 a) (16 * i + j) in
let ws_t = ws.[j] in
shuffle_core_spec k_t ws_t st
noextract
let shuffle_inner_loop (#a:sha2_alg) (#m:m_spec) (i:nat{i < v (num_rounds16 a)})
(ws_st:ws_spec a m & state_spec a m) : ws_spec a m & state_spec a m =
let (ws,st) = ws_st in
let st' = repeati 16 (shuffle_inner ws i) st in
let ws' = if i < v (num_rounds16 a) - 1 then ws_next ws else ws in
(ws',st')
noextract
let shuffle (#a:sha2_alg) (#m:m_spec) (ws:ws_spec a m) (st:state_spec a m) : state_spec a m =
let (ws,st) = repeati (v(num_rounds16 a)) (shuffle_inner_loop #a #m) (ws,st) in
st
noextract
let init (a:sha2_alg) (m:m_spec) : state_spec a m =
createi 8 (fun i -> load_element a m (Seq.index (Spec.h0 a) i))
[@"opaque_to_smt"]
noextract
let update (#a:sha2_alg) (#m:m_spec{is_supported a m}) (b:multiblock_spec a m) (st:state_spec a m): state_spec a m =
let st_old = st in
let ws = load_ws b in
let st_new = shuffle ws st_old in
map2 (+|) st_new st_old
noextract
let padded_blocks (a:sha2_alg) (len:nat{len <= block_length a}) : n:nat{n <= 2} =
if (len + len_length a + 1 <= block_length a) then 1 else 2
noextract
let load_last_blocks (#a:sha2_alg)
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a})
(b:lseq uint8 len) :
lseq uint8 (block_length a) & lseq uint8 (block_length a) =
let last = create (2 * block_length a) (u8 0) in
let last = update_sub last 0 len b in
let last = last.[len] <- u8 0x80 in
let last = update_sub last (fin - len_length a) (len_length a) totlen_seq in
let l0 : lseq uint8 (block_length a) = sub last 0 (block_length a) in
let l1 : lseq uint8 (block_length a) = sub last (block_length a) (block_length a) in
(l0, l1)
noextract
let load_last1 (#a:sha2_alg) (#m:m_spec{lanes a m == 1})
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a}) (b:multiseq (lanes a m) len) :
multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
let b = b.(|0|) in
let (l0,l1) = load_last_blocks #a totlen_seq fin len b in
let lb0 : multiseq (lanes a m) (block_length a) = ntup1 l0 in
let lb1 : multiseq (lanes a m) (block_length a) = ntup1 l1 in
(lb0, lb1)
#push-options "--z3rlimit 100"
noextract
let load_last4 (#a:sha2_alg) (#m:m_spec{lanes a m == 4})
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a}) (b:multiseq (lanes a m) len) :
multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
let b0 = b.(|0|) in
let b1 = b.(|1|) in
let b2 = b.(|2|) in
let b3 = b.(|3|) in
let (l00,l01) = load_last_blocks #a totlen_seq fin len b0 in
let (l10,l11) = load_last_blocks #a totlen_seq fin len b1 in
let (l20,l21) = load_last_blocks #a totlen_seq fin len b2 in
let (l30,l31) = load_last_blocks #a totlen_seq fin len b3 in
let mb0 = ntup4 (l00, (l10, (l20, l30))) in
let mb1 = ntup4 (l01, (l11, (l21, l31))) in
(mb0, mb1) | {
"checked_file": "/",
"dependencies": [
"Spec.SHA2.Constants.fst.checked",
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NTuple.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.Serialize.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Hacl.Spec.SHA2.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.SHA2.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.SHA2",
"short_module": "Spec"
},
{
"abbrev": true,
"full_module": "Spec.SHA2.Constants",
"short_module": "Constants"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.NTuple",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.SHA2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.SHA2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
totlen_seq: Lib.Sequence.lseq Lib.IntTypes.uint8 (Spec.Hash.Definitions.len_length a) ->
fin:
Prims.nat
{ fin == Spec.Hash.Definitions.block_length a \/
fin == 2 * Spec.Hash.Definitions.block_length a } ->
len: Prims.nat{len <= Spec.Hash.Definitions.block_length a} ->
b: Hacl.Spec.SHA2.Vec.multiseq (Hacl.Spec.SHA2.Vec.lanes a m) len
-> Hacl.Spec.SHA2.Vec.multiseq (Hacl.Spec.SHA2.Vec.lanes a m)
(Spec.Hash.Definitions.block_length a) *
Hacl.Spec.SHA2.Vec.multiseq (Hacl.Spec.SHA2.Vec.lanes a m)
(Spec.Hash.Definitions.block_length a) | Prims.Tot | [
"total"
] | [] | [
"Spec.Hash.Definitions.sha2_alg",
"Hacl.Spec.SHA2.Vec.m_spec",
"Prims.eq2",
"Prims.int",
"Hacl.Spec.SHA2.Vec.lanes",
"Lib.Sequence.lseq",
"Lib.IntTypes.uint8",
"Spec.Hash.Definitions.len_length",
"Prims.nat",
"Prims.l_or",
"Prims.b2t",
"Prims.op_GreaterThanOrEqual",
"Prims.op_disEquality",
"Spec.Hash.Definitions.block_length",
"FStar.Mul.op_Star",
"Prims.op_LessThanOrEqual",
"Hacl.Spec.SHA2.Vec.multiseq",
"FStar.Pervasives.Native.Mktuple2",
"Lib.NTuple.ntuple",
"FStar.Seq.Properties.lseq",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Lib.NTuple.ntup8",
"FStar.Pervasives.Native.tuple2",
"Hacl.Spec.SHA2.Vec.load_last_blocks",
"Lib.NTuple.op_Lens_Access"
] | [] | false | false | false | false | false | let load_last8
(#a: sha2_alg)
(#m: m_spec{lanes a m == 8})
(totlen_seq: lseq uint8 (len_length a))
(fin: nat{fin == block_length a \/ fin == 2 * block_length a})
(len: nat{len <= block_length a})
(b: multiseq (lanes a m) len)
: multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
| let b0 = b.(| 0 |) in
let b1 = b.(| 1 |) in
let b2 = b.(| 2 |) in
let b3 = b.(| 3 |) in
let b4 = b.(| 4 |) in
let b5 = b.(| 5 |) in
let b6 = b.(| 6 |) in
let b7 = b.(| 7 |) in
let l00, l01 = load_last_blocks #a totlen_seq fin len b0 in
let l10, l11 = load_last_blocks #a totlen_seq fin len b1 in
let l20, l21 = load_last_blocks #a totlen_seq fin len b2 in
let l30, l31 = load_last_blocks #a totlen_seq fin len b3 in
let l40, l41 = load_last_blocks #a totlen_seq fin len b4 in
let l50, l51 = load_last_blocks #a totlen_seq fin len b5 in
let l60, l61 = load_last_blocks #a totlen_seq fin len b6 in
let l70, l71 = load_last_blocks #a totlen_seq fin len b7 in
let mb0 = ntup8 (l00, (l10, (l20, (l30, (l40, (l50, (l60, l70))))))) in
let mb1 = ntup8 (l01, (l11, (l21, (l31, (l41, (l51, (l61, l71))))))) in
(mb0, mb1) | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.scale_by | val scale_by (scale index: int) : int | val scale_by (scale index: int) : int | let scale_by (scale index:int) : int = scale * index | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 52,
"end_line": 41,
"start_col": 0,
"start_line": 41
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | scale: Prims.int -> index: Prims.int -> Prims.int | Prims.Tot | [
"total"
] | [] | [
"Prims.int",
"FStar.Mul.op_Star"
] | [] | false | false | false | true | false | let scale_by (scale index: int) : int =
| scale * index | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.scale4 | val scale4 (index: int) : int | val scale4 (index: int) : int | let scale4 (index:int) : int = scale_by 4 index | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 54,
"end_line": 43,
"start_col": 7,
"start_line": 43
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | index: Prims.int -> Prims.int | Prims.Tot | [
"total"
] | [] | [
"Prims.int",
"Vale.PPC64LE.Memory.scale_by"
] | [] | false | false | false | true | false | let scale4 (index: int) : int =
| scale_by 4 index | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.scale16 | val scale16 (index: int) : int | val scale16 (index: int) : int | let scale16 (index:int) : int = scale_by 16 index | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 56,
"end_line": 45,
"start_col": 7,
"start_line": 45
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | index: Prims.int -> Prims.int | Prims.Tot | [
"total"
] | [] | [
"Prims.int",
"Vale.PPC64LE.Memory.scale_by"
] | [] | false | false | false | true | false | let scale16 (index: int) : int =
| scale_by 16 index | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.scale2 | val scale2 (index: int) : int | val scale2 (index: int) : int | let scale2 (index:int) : int = scale_by 2 index | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 54,
"end_line": 42,
"start_col": 7,
"start_line": 42
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | index: Prims.int -> Prims.int | Prims.Tot | [
"total"
] | [] | [
"Prims.int",
"Vale.PPC64LE.Memory.scale_by"
] | [] | false | false | false | true | false | let scale2 (index: int) : int =
| scale_by 2 index | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.buffer | val buffer (t: base_typ) : Type0 | val buffer (t: base_typ) : Type0 | let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 68,
"end_line": 47,
"start_col": 7,
"start_line": 47
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t: Vale.Arch.HeapTypes_s.base_typ -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapTypes_s.base_typ",
"Vale.Arch.HeapImpl.buffer"
] | [] | false | false | false | true | true | let buffer (t: base_typ) : Type0 =
| Vale.Arch.HeapImpl.buffer t | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.vuint8 | val vuint8 : Vale.Arch.HeapTypes_s.base_typ | let vuint8 = TUInt8 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 26,
"end_line": 67,
"start_col": 7,
"start_line": 67
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.Arch.HeapTypes_s.base_typ | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapTypes_s.TUInt8"
] | [] | false | false | false | true | false | let vuint8 =
| TUInt8 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.vuint16 | val vuint16 : Vale.Arch.HeapTypes_s.base_typ | let vuint16 = TUInt16 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 28,
"end_line": 68,
"start_col": 7,
"start_line": 68
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system: | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.Arch.HeapTypes_s.base_typ | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapTypes_s.TUInt16"
] | [] | false | false | false | true | false | let vuint16 =
| TUInt16 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.valid_buffer_write | val valid_buffer_write (#t: base_typ) (h: vale_heap) (b: buffer t) (i: int) : prop0 | val valid_buffer_write (#t: base_typ) (h: vale_heap) (b: buffer t) (i: int) : prop0 | let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 47,
"end_line": 64,
"start_col": 0,
"start_line": 63
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: Vale.PPC64LE.Memory.vale_heap -> b: Vale.PPC64LE.Memory.buffer t -> i: Prims.int
-> Vale.Def.Prop_s.prop0 | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapTypes_s.base_typ",
"Vale.PPC64LE.Memory.vale_heap",
"Vale.PPC64LE.Memory.buffer",
"Prims.int",
"Prims.l_and",
"Vale.PPC64LE.Memory.valid_buffer_read",
"Vale.PPC64LE.Memory.buffer_writeable",
"Vale.Def.Prop_s.prop0"
] | [] | false | false | false | false | false | let valid_buffer_write (#t: base_typ) (h: vale_heap) (b: buffer t) (i: int) : prop0 =
| valid_buffer_read h b i /\ buffer_writeable b | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.valid_buffer_read | val valid_buffer_read (#t: base_typ) (h: vale_heap) (b: buffer t) (i: int) : prop0 | val valid_buffer_read (#t: base_typ) (h: vale_heap) (b: buffer t) (i: int) : prop0 | let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 54,
"end_line": 61,
"start_col": 0,
"start_line": 60
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: Vale.PPC64LE.Memory.vale_heap -> b: Vale.PPC64LE.Memory.buffer t -> i: Prims.int
-> Vale.Def.Prop_s.prop0 | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapTypes_s.base_typ",
"Vale.PPC64LE.Memory.vale_heap",
"Vale.PPC64LE.Memory.buffer",
"Prims.int",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"Vale.PPC64LE.Memory.buffer_length",
"Vale.PPC64LE.Memory.buffer_readable",
"Vale.Def.Prop_s.prop0"
] | [] | false | false | false | false | false | let valid_buffer_read (#t: base_typ) (h: vale_heap) (b: buffer t) (i: int) : prop0 =
| 0 <= i /\ i < buffer_length b /\ buffer_readable h b | false |
FStar.Int8.fst | FStar.Int8.v | val v (x:t) : Tot (int_t n) | val v (x:t) : Tot (int_t n) | let v x = x.v | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 13,
"end_line": 32,
"start_col": 0,
"start_line": 32
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: FStar.Int8.t -> FStar.Int.int_t FStar.Int8.n | Prims.Tot | [
"total"
] | [] | [
"FStar.Int8.t",
"FStar.Int8.__proj__Mk__item__v",
"FStar.Int.int_t",
"FStar.Int8.n"
] | [] | false | false | false | true | false | let v x =
| x.v | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.vuint64 | val vuint64 : Vale.Arch.HeapTypes_s.base_typ | let vuint64 = TUInt64 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 28,
"end_line": 70,
"start_col": 7,
"start_line": 70
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.Arch.HeapTypes_s.base_typ | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapTypes_s.TUInt64"
] | [] | false | false | false | true | false | let vuint64 =
| TUInt64 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.vuint32 | val vuint32 : Vale.Arch.HeapTypes_s.base_typ | let vuint32 = TUInt32 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 28,
"end_line": 69,
"start_col": 7,
"start_line": 69
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.Arch.HeapTypes_s.base_typ | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapTypes_s.TUInt32"
] | [] | false | false | false | true | false | let vuint32 =
| TUInt32 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.vuint128 | val vuint128 : Vale.Arch.HeapTypes_s.base_typ | let vuint128 = TUInt128 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 30,
"end_line": 71,
"start_col": 7,
"start_line": 71
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.Arch.HeapTypes_s.base_typ | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapTypes_s.TUInt128"
] | [] | false | false | false | true | false | let vuint128 =
| TUInt128 | false |
|
Hacl.Spec.SHA2.Vec.fst | Hacl.Spec.SHA2.Vec.emit | val emit (#a: sha2_alg) (#m: m_spec) (hseq: lseq uint8 (lanes a m * 8 * word_length a))
: multiseq (lanes a m) (hash_length a) | val emit (#a: sha2_alg) (#m: m_spec) (hseq: lseq uint8 (lanes a m * 8 * word_length a))
: multiseq (lanes a m) (hash_length a) | let emit (#a:sha2_alg) (#m:m_spec)
(hseq:lseq uint8 (lanes a m * 8 * word_length a)):
multiseq (lanes a m) (hash_length a) =
Lib.NTuple.createi #(Seq.lseq uint8 (hash_length a)) (lanes a m)
(fun i -> sub hseq (i * 8 * word_length a) (hash_length a)) | {
"file_name": "code/sha2-mb/Hacl.Spec.SHA2.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 65,
"end_line": 433,
"start_col": 0,
"start_line": 429
} | module Hacl.Spec.SHA2.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.NTuple
open Lib.Sequence
open Lib.IntVector
open Lib.LoopCombinators
open Spec.Hash.Definitions
module Constants = Spec.SHA2.Constants
module Spec = Hacl.Spec.SHA2
module LSeq = Lib.Sequence
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
noextract
type m_spec =
| M32
| M128
| M256
inline_for_extraction
let lanes_t = n:nat{n == 1 \/ n == 2 \/ n == 4 \/ n == 8}
inline_for_extraction
let lanes (a:sha2_alg) (m:m_spec) : lanes_t =
match a,m with
| SHA2_224,M128
| SHA2_256,M128 -> 4
| SHA2_224,M256
| SHA2_256,M256 -> 8
| SHA2_384,M128
| SHA2_512,M128 -> 2
| SHA2_384,M256
| SHA2_512,M256 -> 4
| _ -> 1
noextract
let is_supported (a:sha2_alg) (m:m_spec) =
lanes a m = 1 \/ lanes a m = 4 \/ lanes a m = 8
inline_for_extraction
let element_t (a:sha2_alg) (m:m_spec) = vec_t (word_t a) (lanes a m)
inline_for_extraction
val zero_element: a:sha2_alg -> m:m_spec -> element_t a m
let zero_element a m = vec_zero (word_t a) (lanes a m)
//TODO: remove when Spec.Hash.Definitions.word is fixed
inline_for_extraction
let word (a:hash_alg) = uint_t (word_t a) SEC
//TODO: remove when Spec.Hash.Definitions.word is fixed
inline_for_extraction
let words_state' a = m:Seq.seq (word a) {Seq.length m = state_word_length a}
inline_for_extraction
val load_element: a:sha2_alg -> m:m_spec -> word a -> element_t a m
let load_element a m x = vec_load x (lanes a m)
inline_for_extraction
let ( +| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( +| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( +| ) #U64 #(lanes a m)
inline_for_extraction
let ( ^| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( ^| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( ^| ) #U64 #(lanes a m)
inline_for_extraction
let ( &| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( &| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( &| ) #U64 #(lanes a m)
inline_for_extraction
let ( ~| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( ~| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( ~| ) #U64 #(lanes a m)
inline_for_extraction
let ( >>>| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> rotval (word_t a) -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( >>>| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( >>>| ) #U64 #(lanes a m)
inline_for_extraction
let ( >>| ) (#a:sha2_alg) (#m:m_spec): element_t a m -> shiftval (word_t a) -> element_t a m =
match a with
| SHA2_224 | SHA2_256 -> ( >>| ) #U32 #(lanes a m)
| SHA2_384 | SHA2_512 -> ( >>| ) #U64 #(lanes a m)
inline_for_extraction
val _Ch: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m -> element_t a m -> element_t a m
let _Ch #a #m x y z = (x &| y) ^| (~| x &| z) //Alternative: Ch(e,f,g)=((f^g)&e)^g - does not appear to make a perf diff
inline_for_extraction
val _Maj: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m -> element_t a m -> element_t a m
let _Maj #a #m x y z = (x &| y) ^| ((x &| z) ^| (y &| z)) // Alternative: Maj(a,b,c) = Ch(a^b,c,b) - does not appear to make a perf diff
inline_for_extraction
val _Sigma0: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _Sigma0 #a #m x = Spec.((x >>>| (op0 a).c0) ^| (x >>>| (op0 a).c1) ^| (x >>>| (op0 a).c2))
inline_for_extraction
val _Sigma1: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _Sigma1 #a #m x = Spec.((x >>>| (op0 a).c3) ^| (x >>>| (op0 a).c4) ^| (x >>>| (op0 a).c5))
inline_for_extraction
val _sigma0: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _sigma0 #a #m x = Spec.((x >>>| (op0 a).e0) ^| (x >>>| (op0 a).e1) ^| (x >>| (op0 a).e2))
inline_for_extraction
val _sigma1: #a:sha2_alg -> #m:m_spec -> element_t a m -> element_t a m
let _sigma1 #a #m x = Spec.((x >>>| (op0 a).e3) ^| (x >>>| (op0 a).e4) ^| (x >>| (op0 a).e5))
noextract
let state_spec (a:sha2_alg) (m:m_spec) = lseq (element_t a m) 8
noextract
let ws_spec (a:sha2_alg) (m:m_spec) = lseq (element_t a m) 16
noextract
let state_spec_v (#a:sha2_alg) (#m:m_spec) (st:state_spec a m) : lseq (words_state' a) (lanes a m) =
createi #(words_state' a) (lanes a m) (fun i ->
create8
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i])
noextract
let ws_spec_v (#a:sha2_alg) (#m:m_spec) (st:ws_spec a m) : lseq (lseq (word a) 16) (lanes a m) =
createi #(lseq (word a) 16) (lanes a m) (fun i ->
create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i])
noextract
val shuffle_core_spec: #a: sha2_alg -> #m:m_spec ->
k_t: word a ->
ws_t: element_t a m ->
st: state_spec a m ->
state_spec a m
let shuffle_core_spec #a #m k_t ws_t st =
let a0 = st.[0] in
let b0 = st.[1] in
let c0 = st.[2] in
let d0 = st.[3] in
let e0 = st.[4] in
let f0 = st.[5] in
let g0 = st.[6] in
let h0 = st.[7] in
let k_e_t = load_element a m k_t in
let t1 = h0 +| (_Sigma1 e0) +| (_Ch e0 f0 g0) +| k_e_t +| ws_t in
let t2 = (_Sigma0 a0) +| (_Maj a0 b0 c0) in
let a1 = t1 +| t2 in
let b1 = a0 in
let c1 = b0 in
let d1 = c0 in
let e1 = d0 +| t1 in
let f1 = e0 in
let g1 = f0 in
let h1 = g0 in
create8 a1 b1 c1 d1 e1 f1 g1 h1
inline_for_extraction
let num_rounds16 (a:sha2_alg) : n:size_t{v n > 0 /\ 16 * v n == Spec.size_k_w a} =
match a with
| SHA2_224 | SHA2_256 -> 4ul
| SHA2_384 | SHA2_512 -> 5ul
noextract
let multiseq (lanes:lanes_t) (len:nat) =
ntuple (Seq.lseq uint8 len) lanes
unfold let multiblock_spec (a:sha2_alg) (m:m_spec) =
multiseq (lanes a m) (block_length a)
noextract
let load_elementi (#a:sha2_alg) (#m:m_spec) (b:lseq uint8 (block_length a)) (bi:nat{bi < 16 / lanes a m}) : element_t a m =
let l = lanes a m in
vec_from_bytes_be (word_t a) l (sub b (bi * l * word_length a) (l * word_length a))
noextract
let get_wsi (#a:sha2_alg) (#m:m_spec) (b:multiblock_spec a m) (i:nat{i < 16}) : element_t a m =
let l = lanes a m in
let idx_i = i % l in
let idx_j = i / l in
load_elementi #a #m b.(|idx_i|) idx_j
noextract
let load_blocks (#a:sha2_alg) (#m:m_spec) (b:multiblock_spec a m) : ws_spec a m =
createi 16 (get_wsi #a #m b)
noextract
let transpose_ws1 (#a:sha2_alg) (#m:m_spec{lanes a m == 1}) (ws:ws_spec a m) : ws_spec a m = ws
noextract
let transpose_ws4 (#a:sha2_alg) (#m:m_spec{lanes a m == 4}) (ws:ws_spec a m) : ws_spec a m =
let (ws0,ws1,ws2,ws3) = VecTranspose.transpose4x4 (ws.[0], ws.[1], ws.[2], ws.[3]) in
let (ws4,ws5,ws6,ws7) = VecTranspose.transpose4x4 (ws.[4], ws.[5], ws.[6], ws.[7]) in
let (ws8,ws9,ws10,ws11) = VecTranspose.transpose4x4 (ws.[8], ws.[9], ws.[10], ws.[11]) in
let (ws12,ws13,ws14,ws15) = VecTranspose.transpose4x4 (ws.[12], ws.[13], ws.[14], ws.[15]) in
create16 ws0 ws1 ws2 ws3 ws4 ws5 ws6 ws7 ws8 ws9 ws10 ws11 ws12 ws13 ws14 ws15
noextract
let transpose_ws8 (#a:sha2_alg) (#m:m_spec{lanes a m == 8}) (ws:ws_spec a m) : ws_spec a m =
let (ws0,ws1,ws2,ws3,ws4,ws5,ws6,ws7) = VecTranspose.transpose8x8 (ws.[0], ws.[1], ws.[2], ws.[3], ws.[4], ws.[5], ws.[6], ws.[7]) in
let (ws8,ws9,ws10,ws11,ws12,ws13,ws14,ws15) = VecTranspose.transpose8x8 (ws.[8], ws.[9], ws.[10], ws.[11], ws.[12], ws.[13], ws.[14], ws.[15]) in
create16 ws0 ws1 ws2 ws3 ws4 ws5 ws6 ws7 ws8 ws9 ws10 ws11 ws12 ws13 ws14 ws15
noextract
let transpose_ws (#a:sha2_alg) (#m:m_spec{is_supported a m}) (ws:ws_spec a m) : ws_spec a m =
match lanes a m with
| 1 -> transpose_ws1 #a #m ws
| 4 -> transpose_ws4 #a #m ws
| 8 -> transpose_ws8 #a #m ws
noextract
let load_ws (#a:sha2_alg) (#m:m_spec{is_supported a m}) (b:multiblock_spec a m) : ws_spec a m =
let ws = load_blocks #a #m b in
transpose_ws #a #m ws
noextract
let ws_next_inner (#a:sha2_alg) (#m:m_spec)
(i:nat{i < 16})
(ws:ws_spec a m) : ws_spec a m =
let t16 = ws.[i] in
let t15 = ws.[(i+1) % 16] in
let t7 = ws.[(i+9) % 16] in
let t2 = ws.[(i+14) % 16] in
let s1 = _sigma1 t2 in
let s0 = _sigma0 t15 in
ws.[i] <- (s1 +| t7 +| s0 +| t16)
noextract
let ws_next (#a:sha2_alg) (#m:m_spec)
(ws:ws_spec a m) : ws_spec a m =
repeati 16 (ws_next_inner #a #m) ws
noextract
let shuffle_inner (#a:sha2_alg) (#m:m_spec) (ws:ws_spec a m) (i:nat{i < v (num_rounds16 a)}) (j:nat{j < 16}) (st:state_spec a m) : state_spec a m =
let k_t = Seq.index (Spec.k0 a) (16 * i + j) in
let ws_t = ws.[j] in
shuffle_core_spec k_t ws_t st
noextract
let shuffle_inner_loop (#a:sha2_alg) (#m:m_spec) (i:nat{i < v (num_rounds16 a)})
(ws_st:ws_spec a m & state_spec a m) : ws_spec a m & state_spec a m =
let (ws,st) = ws_st in
let st' = repeati 16 (shuffle_inner ws i) st in
let ws' = if i < v (num_rounds16 a) - 1 then ws_next ws else ws in
(ws',st')
noextract
let shuffle (#a:sha2_alg) (#m:m_spec) (ws:ws_spec a m) (st:state_spec a m) : state_spec a m =
let (ws,st) = repeati (v(num_rounds16 a)) (shuffle_inner_loop #a #m) (ws,st) in
st
noextract
let init (a:sha2_alg) (m:m_spec) : state_spec a m =
createi 8 (fun i -> load_element a m (Seq.index (Spec.h0 a) i))
[@"opaque_to_smt"]
noextract
let update (#a:sha2_alg) (#m:m_spec{is_supported a m}) (b:multiblock_spec a m) (st:state_spec a m): state_spec a m =
let st_old = st in
let ws = load_ws b in
let st_new = shuffle ws st_old in
map2 (+|) st_new st_old
noextract
let padded_blocks (a:sha2_alg) (len:nat{len <= block_length a}) : n:nat{n <= 2} =
if (len + len_length a + 1 <= block_length a) then 1 else 2
noextract
let load_last_blocks (#a:sha2_alg)
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a})
(b:lseq uint8 len) :
lseq uint8 (block_length a) & lseq uint8 (block_length a) =
let last = create (2 * block_length a) (u8 0) in
let last = update_sub last 0 len b in
let last = last.[len] <- u8 0x80 in
let last = update_sub last (fin - len_length a) (len_length a) totlen_seq in
let l0 : lseq uint8 (block_length a) = sub last 0 (block_length a) in
let l1 : lseq uint8 (block_length a) = sub last (block_length a) (block_length a) in
(l0, l1)
noextract
let load_last1 (#a:sha2_alg) (#m:m_spec{lanes a m == 1})
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a}) (b:multiseq (lanes a m) len) :
multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
let b = b.(|0|) in
let (l0,l1) = load_last_blocks #a totlen_seq fin len b in
let lb0 : multiseq (lanes a m) (block_length a) = ntup1 l0 in
let lb1 : multiseq (lanes a m) (block_length a) = ntup1 l1 in
(lb0, lb1)
#push-options "--z3rlimit 100"
noextract
let load_last4 (#a:sha2_alg) (#m:m_spec{lanes a m == 4})
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a}) (b:multiseq (lanes a m) len) :
multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
let b0 = b.(|0|) in
let b1 = b.(|1|) in
let b2 = b.(|2|) in
let b3 = b.(|3|) in
let (l00,l01) = load_last_blocks #a totlen_seq fin len b0 in
let (l10,l11) = load_last_blocks #a totlen_seq fin len b1 in
let (l20,l21) = load_last_blocks #a totlen_seq fin len b2 in
let (l30,l31) = load_last_blocks #a totlen_seq fin len b3 in
let mb0 = ntup4 (l00, (l10, (l20, l30))) in
let mb1 = ntup4 (l01, (l11, (l21, l31))) in
(mb0, mb1)
noextract
let load_last8 (#a:sha2_alg) (#m:m_spec{lanes a m == 8})
(totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a}) (b:multiseq (lanes a m) len) :
multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
let b0 = b.(|0|) in
let b1 = b.(|1|) in
let b2 = b.(|2|) in
let b3 = b.(|3|) in
let b4 = b.(|4|) in
let b5 = b.(|5|) in
let b6 = b.(|6|) in
let b7 = b.(|7|) in
let (l00,l01) = load_last_blocks #a totlen_seq fin len b0 in
let (l10,l11) = load_last_blocks #a totlen_seq fin len b1 in
let (l20,l21) = load_last_blocks #a totlen_seq fin len b2 in
let (l30,l31) = load_last_blocks #a totlen_seq fin len b3 in
let (l40,l41) = load_last_blocks #a totlen_seq fin len b4 in
let (l50,l51) = load_last_blocks #a totlen_seq fin len b5 in
let (l60,l61) = load_last_blocks #a totlen_seq fin len b6 in
let (l70,l71) = load_last_blocks #a totlen_seq fin len b7 in
let mb0 = ntup8 (l00, (l10, (l20, (l30, (l40, (l50, (l60, l70))))))) in
let mb1 = ntup8 (l01, (l11, (l21, (l31, (l41, (l51, (l61, l71))))))) in
(mb0, mb1)
#pop-options
[@"opaque_to_smt"]
noextract
let load_last (#a:sha2_alg) (#m:m_spec{is_supported a m}) (totlen_seq:lseq uint8 (len_length a))
(fin:nat{fin == block_length a \/ fin == 2 * block_length a})
(len:nat{len <= block_length a}) (b:multiseq (lanes a m) len) :
multiseq (lanes a m) (block_length a) & multiseq (lanes a m) (block_length a) =
match lanes a m with
| 1 -> load_last1 #a #m totlen_seq fin len b
| 4 -> load_last4 #a #m totlen_seq fin len b
| 8 -> load_last8 #a #m totlen_seq fin len b
noextract
let update_last (#a:sha2_alg) (#m:m_spec{is_supported a m}) (totlen:len_t a)
(len:nat{len <= block_length a})
(b:multiseq (lanes a m) len) (st:state_spec a m): state_spec a m =
let blocks = padded_blocks a len in
let fin : nat = blocks * block_length a in
let total_len_bits = secret (shift_left #(len_int_type a) totlen 3ul) in
let totlen_seq = Lib.ByteSequence.uint_to_bytes_be #(len_int_type a) total_len_bits in
let (b0,b1) = load_last #a #m totlen_seq fin len b in
let st = update b0 st in
if blocks > 1 then
update b1 st
else st
noextract
let transpose_state4 (#a:sha2_alg) (#m:m_spec{lanes a m == 4})
(st:state_spec a m) : state_spec a m =
let st0 = st.[0] in
let st1 = st.[1] in
let st2 = st.[2] in
let st3 = st.[3] in
let st4 = st.[4] in
let st5 = st.[5] in
let st6 = st.[6] in
let st7 = st.[7] in
let (st0,st1,st2,st3) = VecTranspose.transpose4x4 (st0,st1,st2,st3) in
let (st4,st5,st6,st7) = VecTranspose.transpose4x4 (st4,st5,st6,st7) in
create8 st0 st4 st1 st5 st2 st6 st3 st7
noextract
let transpose_state8 (#a:sha2_alg) (#m:m_spec{lanes a m == 8})
(st:state_spec a m) : state_spec a m =
let st0 = st.[0] in
let st1 = st.[1] in
let st2 = st.[2] in
let st3 = st.[3] in
let st4 = st.[4] in
let st5 = st.[5] in
let st6 = st.[6] in
let st7 = st.[7] in
let (st0,st1,st2,st3,st4,st5,st6,st7) = VecTranspose.transpose8x8 (st0,st1,st2,st3,st4,st5,st6,st7) in
create8 st0 st1 st2 st3 st4 st5 st6 st7
noextract
let transpose_state (#a:sha2_alg) (#m:m_spec{is_supported a m}) (st:state_spec a m) : state_spec a m =
match lanes a m with
| 1 -> st
| 4 -> transpose_state4 #a #m st
| 8 -> transpose_state8 #a #m st
noextract
let store_state (#a:sha2_alg) (#m:m_spec{is_supported a m}) (st:state_spec a m) :
lseq uint8 (lanes a m * 8 * word_length a) =
let st = transpose_state st in
Lib.IntVector.Serialize.vecs_to_bytes_be st | {
"checked_file": "/",
"dependencies": [
"Spec.SHA2.Constants.fst.checked",
"Spec.Hash.Definitions.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.NTuple.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.Serialize.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Hacl.Spec.SHA2.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.SHA2.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.SHA2",
"short_module": "Spec"
},
{
"abbrev": true,
"full_module": "Spec.SHA2.Constants",
"short_module": "Constants"
},
{
"abbrev": false,
"full_module": "Spec.Hash.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.NTuple",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.SHA2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.SHA2",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 0,
"initial_ifuel": 0,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
hseq:
Lib.Sequence.lseq Lib.IntTypes.uint8
((Hacl.Spec.SHA2.Vec.lanes a m * 8) * Spec.Hash.Definitions.word_length a)
-> Hacl.Spec.SHA2.Vec.multiseq (Hacl.Spec.SHA2.Vec.lanes a m)
(Spec.Hash.Definitions.hash_length a) | Prims.Tot | [
"total"
] | [] | [
"Spec.Hash.Definitions.sha2_alg",
"Hacl.Spec.SHA2.Vec.m_spec",
"Lib.Sequence.lseq",
"Lib.IntTypes.uint8",
"FStar.Mul.op_Star",
"Hacl.Spec.SHA2.Vec.lanes",
"Spec.Hash.Definitions.word_length",
"Lib.NTuple.createi",
"FStar.Seq.Properties.lseq",
"Spec.Hash.Definitions.hash_length",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Lib.Sequence.sub",
"Hacl.Spec.SHA2.Vec.multiseq"
] | [] | false | false | false | false | false | let emit (#a: sha2_alg) (#m: m_spec) (hseq: lseq uint8 (lanes a m * 8 * word_length a))
: multiseq (lanes a m) (hash_length a) =
| Lib.NTuple.createi #(Seq.lseq uint8 (hash_length a))
(lanes a m)
(fun i -> sub hseq ((i * 8) * word_length a) (hash_length a)) | false |
Hacl.Poly1305_256.fst | Hacl.Poly1305_256.poly1305_update | val poly1305_update: poly1305_update_st M256 | val poly1305_update: poly1305_update_st M256 | let poly1305_update = poly1305_update #M256 | {
"file_name": "code/poly1305/Hacl.Poly1305_256.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 43,
"end_line": 19,
"start_col": 0,
"start_line": 19
} | module Hacl.Poly1305_256
open FStar.HyperStack
open FStar.HyperStack.All
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.Poly1305.Fields
open Hacl.Impl.Poly1305
open Hacl.Meta.Poly1305
friend Hacl.Meta.Poly1305
let poly1305_init = poly1305_init #M256
let poly1305_update1 = poly1305_update1 #M256 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Meta.Poly1305.fst.checked",
"Hacl.Meta.Poly1305.fst.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Poly1305_256.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Meta.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Impl.Poly1305.poly1305_update_st Hacl.Impl.Poly1305.Fields.M256 | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Poly1305.poly1305_update",
"Hacl.Impl.Poly1305.Fields.M256"
] | [] | false | false | false | true | false | let poly1305_update =
| poly1305_update #M256 | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.buffer8 | val buffer8 : Type0 | let buffer8 = buffer vuint8 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 27,
"end_line": 73,
"start_col": 0,
"start_line": 73
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Memory.buffer",
"Vale.PPC64LE.Memory.vuint8"
] | [] | false | false | false | true | true | let buffer8 =
| buffer vuint8 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.buffer64 | val buffer64 : Type0 | let buffer64 = buffer vuint64 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 29,
"end_line": 76,
"start_col": 0,
"start_line": 76
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128
let buffer8 = buffer vuint8
let buffer16 = buffer vuint16 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Memory.buffer",
"Vale.PPC64LE.Memory.vuint64"
] | [] | false | false | false | true | true | let buffer64 =
| buffer vuint64 | false |
|
Hacl.Poly1305_256.fst | Hacl.Poly1305_256.poly1305_init | val poly1305_init: poly1305_init_st M256 | val poly1305_init: poly1305_init_st M256 | let poly1305_init = poly1305_init #M256 | {
"file_name": "code/poly1305/Hacl.Poly1305_256.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 39,
"end_line": 15,
"start_col": 0,
"start_line": 15
} | module Hacl.Poly1305_256
open FStar.HyperStack
open FStar.HyperStack.All
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.Poly1305.Fields
open Hacl.Impl.Poly1305
open Hacl.Meta.Poly1305
friend Hacl.Meta.Poly1305 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Meta.Poly1305.fst.checked",
"Hacl.Meta.Poly1305.fst.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Poly1305_256.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Meta.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Impl.Poly1305.poly1305_init_st Hacl.Impl.Poly1305.Fields.M256 | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Poly1305.poly1305_init",
"Hacl.Impl.Poly1305.Fields.M256"
] | [] | false | false | false | true | false | let poly1305_init =
| poly1305_init #M256 | false |
Hacl.Poly1305_256.fst | Hacl.Poly1305_256.poly1305_finish | val poly1305_finish: poly1305_finish_st M256 | val poly1305_finish: poly1305_finish_st M256 | let poly1305_finish = poly1305_finish #M256 | {
"file_name": "code/poly1305/Hacl.Poly1305_256.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 43,
"end_line": 21,
"start_col": 0,
"start_line": 21
} | module Hacl.Poly1305_256
open FStar.HyperStack
open FStar.HyperStack.All
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.Poly1305.Fields
open Hacl.Impl.Poly1305
open Hacl.Meta.Poly1305
friend Hacl.Meta.Poly1305
let poly1305_init = poly1305_init #M256
let poly1305_update1 = poly1305_update1 #M256
let poly1305_update = poly1305_update #M256 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Meta.Poly1305.fst.checked",
"Hacl.Meta.Poly1305.fst.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Poly1305_256.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Meta.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Impl.Poly1305.poly1305_finish_st Hacl.Impl.Poly1305.Fields.M256 | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Poly1305.poly1305_finish",
"Hacl.Impl.Poly1305.Fields.M256"
] | [] | false | false | false | true | false | let poly1305_finish =
| poly1305_finish #M256 | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.buffer128 | val buffer128 : Type0 | let buffer128 = buffer vuint128 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 31,
"end_line": 77,
"start_col": 0,
"start_line": 77
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128
let buffer8 = buffer vuint8
let buffer16 = buffer vuint16
let buffer32 = buffer vuint32 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Memory.buffer",
"Vale.PPC64LE.Memory.vuint128"
] | [] | false | false | false | true | true | let buffer128 =
| buffer vuint128 | false |
|
Hacl.Poly1305_256.fst | Hacl.Poly1305_256.poly1305_update1 | val poly1305_update1: poly1305_update1_st M256 | val poly1305_update1: poly1305_update1_st M256 | let poly1305_update1 = poly1305_update1 #M256 | {
"file_name": "code/poly1305/Hacl.Poly1305_256.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 45,
"end_line": 17,
"start_col": 0,
"start_line": 17
} | module Hacl.Poly1305_256
open FStar.HyperStack
open FStar.HyperStack.All
open Lib.IntTypes
open Lib.Buffer
open Hacl.Impl.Poly1305.Fields
open Hacl.Impl.Poly1305
open Hacl.Meta.Poly1305
friend Hacl.Meta.Poly1305
let poly1305_init = poly1305_init #M256 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Meta.Poly1305.fst.checked",
"Hacl.Meta.Poly1305.fst.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Poly1305_256.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Meta.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Impl.Poly1305.poly1305_update1_st Hacl.Impl.Poly1305.Fields.M256 | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Poly1305.poly1305_update1",
"Hacl.Impl.Poly1305.Fields.M256"
] | [] | false | false | false | true | false | let poly1305_update1 =
| poly1305_update1 #M256 | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.buffer32 | val buffer32 : Type0 | let buffer32 = buffer vuint32 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 29,
"end_line": 75,
"start_col": 0,
"start_line": 75
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128
let buffer8 = buffer vuint8 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Memory.buffer",
"Vale.PPC64LE.Memory.vuint32"
] | [] | false | false | false | true | true | let buffer32 =
| buffer vuint32 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.buffer16 | val buffer16 : Type0 | let buffer16 = buffer vuint16 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 29,
"end_line": 74,
"start_col": 0,
"start_line": 74
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Memory.buffer",
"Vale.PPC64LE.Memory.vuint16"
] | [] | false | false | false | true | true | let buffer16 =
| buffer vuint16 | false |
|
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.valid_taint_buf64 | val valid_taint_buf64 (b: buffer64) (h: vale_heap) (mt: memtaint) (tn: taint) : GTot prop0 | val valid_taint_buf64 (b: buffer64) (h: vale_heap) (mt: memtaint) (tn: taint) : GTot prop0 | let valid_taint_buf64 (b:buffer64) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 27,
"end_line": 311,
"start_col": 0,
"start_line": 310
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128
let buffer8 = buffer vuint8
let buffer16 = buffer vuint16
let buffer32 = buffer vuint32
let buffer64 = buffer vuint64
let buffer128 = buffer vuint128
val buffer_addr (#t:base_typ) (b:buffer t) (h:vale_heap) : GTot int
unfold
let locs_disjoint (ls:list loc) : prop0 =
BigOps.normal (BigOps.pairwise_and' (fun x y -> loc_disjoint x y /\ loc_disjoint y x) ls)
// equivalent to modifies; used to prove modifies clauses via modifies_goal_directed_trans
val modifies_goal_directed (s:loc) (h1 h2:vale_heap) : GTot prop0
val lemma_modifies_goal_directed (s:loc) (h1 h2:vale_heap) : Lemma
(modifies s h1 h2 == modifies_goal_directed s h1 h2)
val buffer_length_buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : Lemma
(requires True)
(ensures (Seq.length (buffer_as_seq h b) == buffer_length b))
[SMTPat (Seq.length (buffer_as_seq h b))]
val modifies_buffer_elim (#t1:base_typ) (b:buffer t1) (p:loc) (h h':vale_heap) : Lemma
(requires
loc_disjoint (loc_buffer b) p /\
buffer_readable h b /\
modifies p h h'
)
(ensures
buffer_readable h b /\
buffer_readable h' b /\
buffer_as_seq h b == buffer_as_seq h' b
)
[SMTPatOr [
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)];
[SMTPat (modifies p h h'); SMTPat (buffer_as_seq h' b)];
]]
val modifies_buffer_addr (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h'
)
(ensures buffer_addr b h == buffer_addr b h')
[SMTPat (modifies p h h'); SMTPat (buffer_addr b h')]
val modifies_buffer_readable (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h' /\
buffer_readable h b
)
(ensures buffer_readable h' b)
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)]
val loc_disjoint_none_r (s:loc) : Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r (s s1 s2:loc) : Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_includes_refl (s:loc) : Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans (s1 s2 s3:loc) : Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r (s s1 s2:loc) : Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l (s1 s2 s:loc) : Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
// for efficiency, no SMT pattern
val loc_includes_union_l_buffer (#t:base_typ) (s1 s2:loc) (b:buffer t) : Lemma
(requires (loc_includes s1 (loc_buffer b) \/ loc_includes s2 (loc_buffer b)))
(ensures (loc_includes (loc_union s1 s2) (loc_buffer b)))
[SMTPat (loc_includes (loc_union s1 s2) (loc_buffer b))]
val loc_includes_none (s:loc) : Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val modifies_refl (s:loc) (h:vale_heap) : Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_goal_directed_refl (s:loc) (h:vale_heap) : Lemma
(modifies_goal_directed s h h)
[SMTPat (modifies_goal_directed s h h)]
val modifies_loc_includes (s1:loc) (h h':vale_heap) (s2:loc) : Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
// for efficiency, no SMT pattern
val modifies_trans (s12:loc) (h1 h2:vale_heap) (s23:loc) (h3:vale_heap) : Lemma
(requires (modifies s12 h1 h2 /\ modifies s23 h2 h3))
(ensures (modifies (loc_union s12 s23) h1 h3))
// for efficiency, no SMT pattern
// Prove (modifies s13 h1 h3).
// To avoid unnecessary matches, don't introduce any other modifies terms.
// Introduce modifies_goal_directed instead.
val modifies_goal_directed_trans (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies s13 h1 h3)]
val modifies_goal_directed_trans2 (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies_goal_directed s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies_goal_directed s13 h1 h3)]
val buffer_read (#t:base_typ) (b:buffer t) (i:int) (h:vale_heap) : Ghost (base_typ_as_vale_type t)
(requires True)
(ensures (fun v ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
v == Seq.index (buffer_as_seq h b) i
))
val buffer_write (#t:base_typ) (b:buffer t) (i:int) (v:base_typ_as_vale_type t) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures (fun h' ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
modifies (loc_buffer b) h h' /\
get_heaplet_id h' == get_heaplet_id h /\
buffer_readable h' b /\
buffer_as_seq h' b == Seq.upd (buffer_as_seq h b) i v
))
val valid_mem64 (ptr:int) (h:vale_heap) : GTot bool // is there a 64-bit word at address ptr?
val writeable_mem64 (ptr:int) (h:vale_heap) : GTot bool // can we write a 64-bit word at address ptr?
val load_mem64 (ptr:int) (h:vale_heap) : GTot nat64 // the 64-bit word at ptr (if valid_mem64 holds)
val store_mem64 (ptr:int) (v:nat64) (h:vale_heap) : GTot vale_heap
val valid_mem128 (ptr:int) (h:vale_heap) : GTot bool
val writeable_mem128 (ptr:int) (h:vale_heap) : GTot bool
val load_mem128 (ptr:int) (h:vale_heap) : GTot quad32
val store_mem128 (ptr:int) (v:quad32) (h:vale_heap) : GTot vale_heap
val lemma_valid_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_writeable_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_load_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem64 (buffer_addr b h + scale8 i) h == buffer_read b i h
)
val lemma_store_mem64 (b:buffer64) (i:nat) (v:nat64) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem64 (buffer_addr b h + scale8 i) v h == buffer_write b i v h
)
val lemma_valid_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_writeable_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_load_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem128 (buffer_addr b h + scale16 i) h == buffer_read b i h
)
val lemma_store_mem128 (b:buffer128) (i:nat) (v:quad32) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem128 (buffer_addr b h + scale16 i) v h == buffer_write b i v h
)
//Memtaint related functions
type memtaint = memTaint_t | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Seq_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
b: Vale.PPC64LE.Memory.buffer64 ->
h: Vale.PPC64LE.Memory.vale_heap ->
mt: Vale.PPC64LE.Memory.memtaint ->
tn: Vale.Arch.HeapTypes_s.taint
-> Prims.GTot Vale.Def.Prop_s.prop0 | Prims.GTot | [
"sometrivial"
] | [] | [
"Vale.PPC64LE.Memory.buffer64",
"Vale.PPC64LE.Memory.vale_heap",
"Vale.PPC64LE.Memory.memtaint",
"Vale.Arch.HeapTypes_s.taint",
"Vale.PPC64LE.Memory.valid_taint_buf",
"Vale.PPC64LE.Memory.vuint64",
"Vale.Def.Prop_s.prop0"
] | [] | false | false | false | false | false | let valid_taint_buf64 (b: buffer64) (h: vale_heap) (mt: memtaint) (tn: taint) : GTot prop0 =
| valid_taint_buf b h mt tn | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.valid_taint_buf128 | val valid_taint_buf128 (b: buffer128) (h: vale_heap) (mt: memtaint) (tn: taint) : GTot prop0 | val valid_taint_buf128 (b: buffer128) (h: vale_heap) (mt: memtaint) (tn: taint) : GTot prop0 | let valid_taint_buf128 (b:buffer128) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 27,
"end_line": 313,
"start_col": 0,
"start_line": 312
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128
let buffer8 = buffer vuint8
let buffer16 = buffer vuint16
let buffer32 = buffer vuint32
let buffer64 = buffer vuint64
let buffer128 = buffer vuint128
val buffer_addr (#t:base_typ) (b:buffer t) (h:vale_heap) : GTot int
unfold
let locs_disjoint (ls:list loc) : prop0 =
BigOps.normal (BigOps.pairwise_and' (fun x y -> loc_disjoint x y /\ loc_disjoint y x) ls)
// equivalent to modifies; used to prove modifies clauses via modifies_goal_directed_trans
val modifies_goal_directed (s:loc) (h1 h2:vale_heap) : GTot prop0
val lemma_modifies_goal_directed (s:loc) (h1 h2:vale_heap) : Lemma
(modifies s h1 h2 == modifies_goal_directed s h1 h2)
val buffer_length_buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : Lemma
(requires True)
(ensures (Seq.length (buffer_as_seq h b) == buffer_length b))
[SMTPat (Seq.length (buffer_as_seq h b))]
val modifies_buffer_elim (#t1:base_typ) (b:buffer t1) (p:loc) (h h':vale_heap) : Lemma
(requires
loc_disjoint (loc_buffer b) p /\
buffer_readable h b /\
modifies p h h'
)
(ensures
buffer_readable h b /\
buffer_readable h' b /\
buffer_as_seq h b == buffer_as_seq h' b
)
[SMTPatOr [
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)];
[SMTPat (modifies p h h'); SMTPat (buffer_as_seq h' b)];
]]
val modifies_buffer_addr (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h'
)
(ensures buffer_addr b h == buffer_addr b h')
[SMTPat (modifies p h h'); SMTPat (buffer_addr b h')]
val modifies_buffer_readable (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h' /\
buffer_readable h b
)
(ensures buffer_readable h' b)
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)]
val loc_disjoint_none_r (s:loc) : Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r (s s1 s2:loc) : Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_includes_refl (s:loc) : Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans (s1 s2 s3:loc) : Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r (s s1 s2:loc) : Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l (s1 s2 s:loc) : Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
// for efficiency, no SMT pattern
val loc_includes_union_l_buffer (#t:base_typ) (s1 s2:loc) (b:buffer t) : Lemma
(requires (loc_includes s1 (loc_buffer b) \/ loc_includes s2 (loc_buffer b)))
(ensures (loc_includes (loc_union s1 s2) (loc_buffer b)))
[SMTPat (loc_includes (loc_union s1 s2) (loc_buffer b))]
val loc_includes_none (s:loc) : Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val modifies_refl (s:loc) (h:vale_heap) : Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_goal_directed_refl (s:loc) (h:vale_heap) : Lemma
(modifies_goal_directed s h h)
[SMTPat (modifies_goal_directed s h h)]
val modifies_loc_includes (s1:loc) (h h':vale_heap) (s2:loc) : Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
// for efficiency, no SMT pattern
val modifies_trans (s12:loc) (h1 h2:vale_heap) (s23:loc) (h3:vale_heap) : Lemma
(requires (modifies s12 h1 h2 /\ modifies s23 h2 h3))
(ensures (modifies (loc_union s12 s23) h1 h3))
// for efficiency, no SMT pattern
// Prove (modifies s13 h1 h3).
// To avoid unnecessary matches, don't introduce any other modifies terms.
// Introduce modifies_goal_directed instead.
val modifies_goal_directed_trans (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies s13 h1 h3)]
val modifies_goal_directed_trans2 (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies_goal_directed s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies_goal_directed s13 h1 h3)]
val buffer_read (#t:base_typ) (b:buffer t) (i:int) (h:vale_heap) : Ghost (base_typ_as_vale_type t)
(requires True)
(ensures (fun v ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
v == Seq.index (buffer_as_seq h b) i
))
val buffer_write (#t:base_typ) (b:buffer t) (i:int) (v:base_typ_as_vale_type t) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures (fun h' ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
modifies (loc_buffer b) h h' /\
get_heaplet_id h' == get_heaplet_id h /\
buffer_readable h' b /\
buffer_as_seq h' b == Seq.upd (buffer_as_seq h b) i v
))
val valid_mem64 (ptr:int) (h:vale_heap) : GTot bool // is there a 64-bit word at address ptr?
val writeable_mem64 (ptr:int) (h:vale_heap) : GTot bool // can we write a 64-bit word at address ptr?
val load_mem64 (ptr:int) (h:vale_heap) : GTot nat64 // the 64-bit word at ptr (if valid_mem64 holds)
val store_mem64 (ptr:int) (v:nat64) (h:vale_heap) : GTot vale_heap
val valid_mem128 (ptr:int) (h:vale_heap) : GTot bool
val writeable_mem128 (ptr:int) (h:vale_heap) : GTot bool
val load_mem128 (ptr:int) (h:vale_heap) : GTot quad32
val store_mem128 (ptr:int) (v:quad32) (h:vale_heap) : GTot vale_heap
val lemma_valid_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_writeable_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_load_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem64 (buffer_addr b h + scale8 i) h == buffer_read b i h
)
val lemma_store_mem64 (b:buffer64) (i:nat) (v:nat64) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem64 (buffer_addr b h + scale8 i) v h == buffer_write b i v h
)
val lemma_valid_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_writeable_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_load_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem128 (buffer_addr b h + scale16 i) h == buffer_read b i h
)
val lemma_store_mem128 (b:buffer128) (i:nat) (v:quad32) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem128 (buffer_addr b h + scale16 i) v h == buffer_write b i v h
)
//Memtaint related functions
type memtaint = memTaint_t
val valid_taint_buf (#t:base_typ) (b:buffer t) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0
let valid_taint_buf64 (b:buffer64) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 = | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Seq_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
b: Vale.PPC64LE.Memory.buffer128 ->
h: Vale.PPC64LE.Memory.vale_heap ->
mt: Vale.PPC64LE.Memory.memtaint ->
tn: Vale.Arch.HeapTypes_s.taint
-> Prims.GTot Vale.Def.Prop_s.prop0 | Prims.GTot | [
"sometrivial"
] | [] | [
"Vale.PPC64LE.Memory.buffer128",
"Vale.PPC64LE.Memory.vale_heap",
"Vale.PPC64LE.Memory.memtaint",
"Vale.Arch.HeapTypes_s.taint",
"Vale.PPC64LE.Memory.valid_taint_buf",
"Vale.PPC64LE.Memory.vuint128",
"Vale.Def.Prop_s.prop0"
] | [] | false | false | false | false | false | let valid_taint_buf128 (b: buffer128) (h: vale_heap) (mt: memtaint) (tn: taint) : GTot prop0 =
| valid_taint_buf b h mt tn | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.locs_disjoint | val locs_disjoint (ls: list loc) : prop0 | val locs_disjoint (ls: list loc) : prop0 | let locs_disjoint (ls:list loc) : prop0 =
BigOps.normal (BigOps.pairwise_and' (fun x y -> loc_disjoint x y /\ loc_disjoint y x) ls) | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 91,
"end_line": 83,
"start_col": 0,
"start_line": 82
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128
let buffer8 = buffer vuint8
let buffer16 = buffer vuint16
let buffer32 = buffer vuint32
let buffer64 = buffer vuint64
let buffer128 = buffer vuint128
val buffer_addr (#t:base_typ) (b:buffer t) (h:vale_heap) : GTot int | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | ls: Prims.list Vale.PPC64LE.Memory.loc -> Vale.Def.Prop_s.prop0 | Prims.Tot | [
"total"
] | [] | [
"Prims.list",
"Vale.PPC64LE.Memory.loc",
"FStar.BigOps.normal",
"FStar.BigOps.pairwise_and'",
"Prims.l_and",
"Vale.PPC64LE.Memory.loc_disjoint",
"Vale.Def.Prop_s.prop0"
] | [] | false | false | false | true | false | let locs_disjoint (ls: list loc) : prop0 =
| BigOps.normal (BigOps.pairwise_and' (fun x y -> loc_disjoint x y /\ loc_disjoint y x) ls) | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.buffer_info_disjoint | val buffer_info_disjoint : bi1: Vale.Arch.HeapImpl.buffer_info -> bi2: Vale.Arch.HeapImpl.buffer_info -> Prims.logical | let buffer_info_disjoint (bi1 bi2:buffer_info) =
bi1.bi_typ =!= bi2.bi_typ \/ bi1.bi_heaplet =!= bi2.bi_heaplet ==>
loc_disjoint (loc_buffer bi1.bi_buffer) (loc_buffer bi2.bi_buffer) | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 68,
"end_line": 374,
"start_col": 0,
"start_line": 372
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128
let buffer8 = buffer vuint8
let buffer16 = buffer vuint16
let buffer32 = buffer vuint32
let buffer64 = buffer vuint64
let buffer128 = buffer vuint128
val buffer_addr (#t:base_typ) (b:buffer t) (h:vale_heap) : GTot int
unfold
let locs_disjoint (ls:list loc) : prop0 =
BigOps.normal (BigOps.pairwise_and' (fun x y -> loc_disjoint x y /\ loc_disjoint y x) ls)
// equivalent to modifies; used to prove modifies clauses via modifies_goal_directed_trans
val modifies_goal_directed (s:loc) (h1 h2:vale_heap) : GTot prop0
val lemma_modifies_goal_directed (s:loc) (h1 h2:vale_heap) : Lemma
(modifies s h1 h2 == modifies_goal_directed s h1 h2)
val buffer_length_buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : Lemma
(requires True)
(ensures (Seq.length (buffer_as_seq h b) == buffer_length b))
[SMTPat (Seq.length (buffer_as_seq h b))]
val modifies_buffer_elim (#t1:base_typ) (b:buffer t1) (p:loc) (h h':vale_heap) : Lemma
(requires
loc_disjoint (loc_buffer b) p /\
buffer_readable h b /\
modifies p h h'
)
(ensures
buffer_readable h b /\
buffer_readable h' b /\
buffer_as_seq h b == buffer_as_seq h' b
)
[SMTPatOr [
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)];
[SMTPat (modifies p h h'); SMTPat (buffer_as_seq h' b)];
]]
val modifies_buffer_addr (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h'
)
(ensures buffer_addr b h == buffer_addr b h')
[SMTPat (modifies p h h'); SMTPat (buffer_addr b h')]
val modifies_buffer_readable (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h' /\
buffer_readable h b
)
(ensures buffer_readable h' b)
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)]
val loc_disjoint_none_r (s:loc) : Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r (s s1 s2:loc) : Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_includes_refl (s:loc) : Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans (s1 s2 s3:loc) : Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r (s s1 s2:loc) : Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l (s1 s2 s:loc) : Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
// for efficiency, no SMT pattern
val loc_includes_union_l_buffer (#t:base_typ) (s1 s2:loc) (b:buffer t) : Lemma
(requires (loc_includes s1 (loc_buffer b) \/ loc_includes s2 (loc_buffer b)))
(ensures (loc_includes (loc_union s1 s2) (loc_buffer b)))
[SMTPat (loc_includes (loc_union s1 s2) (loc_buffer b))]
val loc_includes_none (s:loc) : Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val modifies_refl (s:loc) (h:vale_heap) : Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_goal_directed_refl (s:loc) (h:vale_heap) : Lemma
(modifies_goal_directed s h h)
[SMTPat (modifies_goal_directed s h h)]
val modifies_loc_includes (s1:loc) (h h':vale_heap) (s2:loc) : Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
// for efficiency, no SMT pattern
val modifies_trans (s12:loc) (h1 h2:vale_heap) (s23:loc) (h3:vale_heap) : Lemma
(requires (modifies s12 h1 h2 /\ modifies s23 h2 h3))
(ensures (modifies (loc_union s12 s23) h1 h3))
// for efficiency, no SMT pattern
// Prove (modifies s13 h1 h3).
// To avoid unnecessary matches, don't introduce any other modifies terms.
// Introduce modifies_goal_directed instead.
val modifies_goal_directed_trans (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies s13 h1 h3)]
val modifies_goal_directed_trans2 (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies_goal_directed s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies_goal_directed s13 h1 h3)]
val buffer_read (#t:base_typ) (b:buffer t) (i:int) (h:vale_heap) : Ghost (base_typ_as_vale_type t)
(requires True)
(ensures (fun v ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
v == Seq.index (buffer_as_seq h b) i
))
val buffer_write (#t:base_typ) (b:buffer t) (i:int) (v:base_typ_as_vale_type t) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures (fun h' ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
modifies (loc_buffer b) h h' /\
get_heaplet_id h' == get_heaplet_id h /\
buffer_readable h' b /\
buffer_as_seq h' b == Seq.upd (buffer_as_seq h b) i v
))
val valid_mem64 (ptr:int) (h:vale_heap) : GTot bool // is there a 64-bit word at address ptr?
val writeable_mem64 (ptr:int) (h:vale_heap) : GTot bool // can we write a 64-bit word at address ptr?
val load_mem64 (ptr:int) (h:vale_heap) : GTot nat64 // the 64-bit word at ptr (if valid_mem64 holds)
val store_mem64 (ptr:int) (v:nat64) (h:vale_heap) : GTot vale_heap
val valid_mem128 (ptr:int) (h:vale_heap) : GTot bool
val writeable_mem128 (ptr:int) (h:vale_heap) : GTot bool
val load_mem128 (ptr:int) (h:vale_heap) : GTot quad32
val store_mem128 (ptr:int) (v:quad32) (h:vale_heap) : GTot vale_heap
val lemma_valid_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_writeable_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_load_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem64 (buffer_addr b h + scale8 i) h == buffer_read b i h
)
val lemma_store_mem64 (b:buffer64) (i:nat) (v:nat64) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem64 (buffer_addr b h + scale8 i) v h == buffer_write b i v h
)
val lemma_valid_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_writeable_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_load_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem128 (buffer_addr b h + scale16 i) h == buffer_read b i h
)
val lemma_store_mem128 (b:buffer128) (i:nat) (v:quad32) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem128 (buffer_addr b h + scale16 i) v h == buffer_write b i v h
)
//Memtaint related functions
type memtaint = memTaint_t
val valid_taint_buf (#t:base_typ) (b:buffer t) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0
let valid_taint_buf64 (b:buffer64) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn
let valid_taint_buf128 (b:buffer128) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn
val lemma_valid_taint64
(b:buffer64)
(memTaint:memtaint)
(vale_heap:vale_heap)
(i:nat{i < buffer_length b})
(t:taint)
: Lemma
(requires valid_taint_buf64 b vale_heap memTaint t /\ buffer_readable vale_heap b)
(ensures (
let ptr = buffer_addr b vale_heap + scale8 i in
forall i'.{:pattern Map.sel memTaint i'} i' >= ptr /\ i' < ptr + 8 ==> Map.sel memTaint i' == t))
val lemma_valid_taint128
(b:buffer128)
(memTaint:memtaint)
(vale_heap:vale_heap)
(i:nat{i < buffer_length b})
(t:taint)
: Lemma
(requires valid_taint_buf128 b vale_heap memTaint t /\ buffer_readable vale_heap b)
(ensures (
let ptr = buffer_addr b vale_heap + scale16 i in
forall i'.{:pattern Map.sel memTaint i'} i' >= ptr /\ i' < ptr + 16 ==> Map.sel memTaint i' == t))
val same_memTaint64
(b:buffer64)
(mem0:vale_heap)
(mem1:vale_heap)
(memtaint0:memtaint)
(memtaint1:memtaint)
: Lemma
(requires (modifies (loc_buffer b) mem0 mem1 /\
(forall p.{:pattern Map.sel memtaint0 p \/ Map.sel memtaint1 p} Map.sel memtaint0 p == Map.sel memtaint1 p)))
(ensures memtaint0 == memtaint1)
val same_memTaint128
(b:buffer128)
(mem0:vale_heap)
(mem1:vale_heap)
(memtaint0:memtaint)
(memtaint1:memtaint)
: Lemma
(requires (modifies (loc_buffer b) mem0 mem1 /\
(forall p.{:pattern Map.sel memtaint0 p \/ Map.sel memtaint1 p} Map.sel memtaint0 p == Map.sel memtaint1 p)))
(ensures memtaint0 == memtaint1)
val modifies_valid_taint (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) (mt:memtaint) (tn:taint) : Lemma
(requires modifies p h h')
(ensures valid_taint_buf b h mt tn <==> valid_taint_buf b h' mt tn)
[SMTPat (modifies p h h'); SMTPat (valid_taint_buf b h' mt tn)]
val modifies_same_heaplet_id (l:loc) (h1 h2:vale_heap) : Lemma
(requires modifies l h1 h2)
(ensures get_heaplet_id h1 == get_heaplet_id h2)
[SMTPat (modifies l h1 h2); SMTPat (get_heaplet_id h2)] | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Seq_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | bi1: Vale.Arch.HeapImpl.buffer_info -> bi2: Vale.Arch.HeapImpl.buffer_info -> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapImpl.buffer_info",
"Prims.l_imp",
"Prims.l_or",
"Prims.l_not",
"Prims.eq2",
"Vale.Arch.HeapTypes_s.base_typ",
"Vale.Arch.HeapImpl.__proj__Mkbuffer_info__item__bi_typ",
"Vale.Arch.HeapImpl.heaplet_id",
"Vale.Arch.HeapImpl.__proj__Mkbuffer_info__item__bi_heaplet",
"Vale.PPC64LE.Memory.loc_disjoint",
"Vale.PPC64LE.Memory.loc_buffer",
"Vale.Arch.HeapImpl.__proj__Mkbuffer_info__item__bi_buffer",
"Prims.logical"
] | [] | false | false | false | true | true | let buffer_info_disjoint (bi1 bi2: buffer_info) =
| bi1.bi_typ =!= bi2.bi_typ \/ bi1.bi_heaplet =!= bi2.bi_heaplet ==>
loc_disjoint (loc_buffer bi1.bi_buffer) (loc_buffer bi2.bi_buffer) | false |
|
FStar.Int8.fst | FStar.Int8.sub | val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c)) | val sub (a:t) (b:t) : Pure t
(requires (size (v a - v b) n))
(ensures (fun c -> v a - v b = v c)) | let sub a b = Mk (sub (v a) (v b)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 34,
"end_line": 51,
"start_col": 0,
"start_line": 51
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1
let add a b = Mk (add (v a) (v b)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: FStar.Int8.t -> b: FStar.Int8.t -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"FStar.Int8.Mk",
"FStar.Int.sub",
"FStar.Int8.n",
"FStar.Int8.v"
] | [] | false | false | false | false | false | let sub a b =
| Mk (sub (v a) (v b)) | false |
FStar.Int8.fst | FStar.Int8.mul | val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c)) | val mul (a:t) (b:t) : Pure t
(requires (size (v a * v b) n))
(ensures (fun c -> v a * v b = v c)) | let mul a b = Mk (mul (v a) (v b)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 34,
"end_line": 53,
"start_col": 0,
"start_line": 53
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1
let add a b = Mk (add (v a) (v b))
let sub a b = Mk (sub (v a) (v b)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: FStar.Int8.t -> b: FStar.Int8.t -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"FStar.Int8.Mk",
"FStar.Int.mul",
"FStar.Int8.n",
"FStar.Int8.v"
] | [] | false | false | false | false | false | let mul a b =
| Mk (mul (v a) (v b)) | false |
FStar.Int8.fst | FStar.Int8.one | val one : x:t{v x = 1} | val one : x:t{v x = 1} | let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1 | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 12,
"end_line": 47,
"start_col": 0,
"start_line": 45
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: FStar.Int8.t{FStar.Int8.v x = 1} | Prims.Tot | [
"total"
] | [] | [
"FStar.Int8.int_to_t",
"Prims.unit",
"FStar.Math.Lemmas.pow2_lt_compat",
"Prims.op_Subtraction",
"FStar.Int8.n"
] | [] | false | false | false | false | false | let one =
| FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1 | false |
FStar.Int8.fst | FStar.Int8.add | val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c)) | val add (a:t) (b:t) : Pure t
(requires (size (v a + v b) n))
(ensures (fun c -> v a + v b = v c)) | let add a b = Mk (add (v a) (v b)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 34,
"end_line": 49,
"start_col": 0,
"start_line": 49
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: FStar.Int8.t -> b: FStar.Int8.t -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"FStar.Int8.Mk",
"FStar.Int.add",
"FStar.Int8.n",
"FStar.Int8.v"
] | [] | false | false | false | false | false | let add a b =
| Mk (add (v a) (v b)) | false |
FStar.Int8.fst | FStar.Int8.lognot | val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z)) | val lognot (x:t) : Pure t
(requires True)
(ensures (fun z -> lognot (v x) == v z)) | let lognot x = Mk (lognot (v x)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 32,
"end_line": 65,
"start_col": 0,
"start_line": 65
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1
let add a b = Mk (add (v a) (v b))
let sub a b = Mk (sub (v a) (v b))
let mul a b = Mk (mul (v a) (v b))
let div a b = Mk (div (v a) (v b))
let rem a b = Mk (mod (v a) (v b))
let logand x y = Mk (logand (v x) (v y))
let logxor x y = Mk (logxor (v x) (v y))
let logor x y = Mk (logor (v x) (v y)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: FStar.Int8.t -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"FStar.Int8.Mk",
"FStar.Int.lognot",
"FStar.Int8.n",
"FStar.Int8.v"
] | [] | false | false | false | false | false | let lognot x =
| Mk (lognot (v x)) | false |
FStar.Int8.fst | FStar.Int8.int_to_t | val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x)) | val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x)) | let int_to_t x = Mk x | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 21,
"end_line": 35,
"start_col": 0,
"start_line": 35
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: FStar.Int.int_t FStar.Int8.n -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int.int_t",
"FStar.Int8.n",
"FStar.Int8.Mk",
"FStar.Int8.t"
] | [] | false | false | false | false | false | let int_to_t x =
| Mk x | false |
FStar.Int8.fst | FStar.Int8.zero | val zero : x:t{v x = 0} | val zero : x:t{v x = 0} | let zero = int_to_t 0 | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 21,
"end_line": 43,
"start_col": 0,
"start_line": 43
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: FStar.Int8.t{FStar.Int8.v x = 0} | Prims.Tot | [
"total"
] | [] | [
"FStar.Int8.int_to_t"
] | [] | false | false | false | false | false | let zero =
| int_to_t 0 | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.buffer_info_has_id | val buffer_info_has_id : bs: FStar.Seq.Base.seq Vale.Arch.HeapImpl.buffer_info ->
i: Prims.nat ->
id: Vale.PPC64LE.Memory.heaplet_id
-> Prims.logical | let buffer_info_has_id (bs:Seq.seq buffer_info) (i:nat) (id:heaplet_id) =
i < Seq.length bs /\ (Seq.index bs i).bi_heaplet == id | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 56,
"end_line": 410,
"start_col": 0,
"start_line": 409
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128
let buffer8 = buffer vuint8
let buffer16 = buffer vuint16
let buffer32 = buffer vuint32
let buffer64 = buffer vuint64
let buffer128 = buffer vuint128
val buffer_addr (#t:base_typ) (b:buffer t) (h:vale_heap) : GTot int
unfold
let locs_disjoint (ls:list loc) : prop0 =
BigOps.normal (BigOps.pairwise_and' (fun x y -> loc_disjoint x y /\ loc_disjoint y x) ls)
// equivalent to modifies; used to prove modifies clauses via modifies_goal_directed_trans
val modifies_goal_directed (s:loc) (h1 h2:vale_heap) : GTot prop0
val lemma_modifies_goal_directed (s:loc) (h1 h2:vale_heap) : Lemma
(modifies s h1 h2 == modifies_goal_directed s h1 h2)
val buffer_length_buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : Lemma
(requires True)
(ensures (Seq.length (buffer_as_seq h b) == buffer_length b))
[SMTPat (Seq.length (buffer_as_seq h b))]
val modifies_buffer_elim (#t1:base_typ) (b:buffer t1) (p:loc) (h h':vale_heap) : Lemma
(requires
loc_disjoint (loc_buffer b) p /\
buffer_readable h b /\
modifies p h h'
)
(ensures
buffer_readable h b /\
buffer_readable h' b /\
buffer_as_seq h b == buffer_as_seq h' b
)
[SMTPatOr [
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)];
[SMTPat (modifies p h h'); SMTPat (buffer_as_seq h' b)];
]]
val modifies_buffer_addr (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h'
)
(ensures buffer_addr b h == buffer_addr b h')
[SMTPat (modifies p h h'); SMTPat (buffer_addr b h')]
val modifies_buffer_readable (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h' /\
buffer_readable h b
)
(ensures buffer_readable h' b)
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)]
val loc_disjoint_none_r (s:loc) : Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r (s s1 s2:loc) : Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_includes_refl (s:loc) : Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans (s1 s2 s3:loc) : Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r (s s1 s2:loc) : Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l (s1 s2 s:loc) : Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
// for efficiency, no SMT pattern
val loc_includes_union_l_buffer (#t:base_typ) (s1 s2:loc) (b:buffer t) : Lemma
(requires (loc_includes s1 (loc_buffer b) \/ loc_includes s2 (loc_buffer b)))
(ensures (loc_includes (loc_union s1 s2) (loc_buffer b)))
[SMTPat (loc_includes (loc_union s1 s2) (loc_buffer b))]
val loc_includes_none (s:loc) : Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val modifies_refl (s:loc) (h:vale_heap) : Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_goal_directed_refl (s:loc) (h:vale_heap) : Lemma
(modifies_goal_directed s h h)
[SMTPat (modifies_goal_directed s h h)]
val modifies_loc_includes (s1:loc) (h h':vale_heap) (s2:loc) : Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
// for efficiency, no SMT pattern
val modifies_trans (s12:loc) (h1 h2:vale_heap) (s23:loc) (h3:vale_heap) : Lemma
(requires (modifies s12 h1 h2 /\ modifies s23 h2 h3))
(ensures (modifies (loc_union s12 s23) h1 h3))
// for efficiency, no SMT pattern
// Prove (modifies s13 h1 h3).
// To avoid unnecessary matches, don't introduce any other modifies terms.
// Introduce modifies_goal_directed instead.
val modifies_goal_directed_trans (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies s13 h1 h3)]
val modifies_goal_directed_trans2 (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies_goal_directed s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies_goal_directed s13 h1 h3)]
val buffer_read (#t:base_typ) (b:buffer t) (i:int) (h:vale_heap) : Ghost (base_typ_as_vale_type t)
(requires True)
(ensures (fun v ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
v == Seq.index (buffer_as_seq h b) i
))
val buffer_write (#t:base_typ) (b:buffer t) (i:int) (v:base_typ_as_vale_type t) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures (fun h' ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
modifies (loc_buffer b) h h' /\
get_heaplet_id h' == get_heaplet_id h /\
buffer_readable h' b /\
buffer_as_seq h' b == Seq.upd (buffer_as_seq h b) i v
))
val valid_mem64 (ptr:int) (h:vale_heap) : GTot bool // is there a 64-bit word at address ptr?
val writeable_mem64 (ptr:int) (h:vale_heap) : GTot bool // can we write a 64-bit word at address ptr?
val load_mem64 (ptr:int) (h:vale_heap) : GTot nat64 // the 64-bit word at ptr (if valid_mem64 holds)
val store_mem64 (ptr:int) (v:nat64) (h:vale_heap) : GTot vale_heap
val valid_mem128 (ptr:int) (h:vale_heap) : GTot bool
val writeable_mem128 (ptr:int) (h:vale_heap) : GTot bool
val load_mem128 (ptr:int) (h:vale_heap) : GTot quad32
val store_mem128 (ptr:int) (v:quad32) (h:vale_heap) : GTot vale_heap
val lemma_valid_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_writeable_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_load_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem64 (buffer_addr b h + scale8 i) h == buffer_read b i h
)
val lemma_store_mem64 (b:buffer64) (i:nat) (v:nat64) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem64 (buffer_addr b h + scale8 i) v h == buffer_write b i v h
)
val lemma_valid_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_writeable_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_load_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem128 (buffer_addr b h + scale16 i) h == buffer_read b i h
)
val lemma_store_mem128 (b:buffer128) (i:nat) (v:quad32) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem128 (buffer_addr b h + scale16 i) v h == buffer_write b i v h
)
//Memtaint related functions
type memtaint = memTaint_t
val valid_taint_buf (#t:base_typ) (b:buffer t) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0
let valid_taint_buf64 (b:buffer64) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn
let valid_taint_buf128 (b:buffer128) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn
val lemma_valid_taint64
(b:buffer64)
(memTaint:memtaint)
(vale_heap:vale_heap)
(i:nat{i < buffer_length b})
(t:taint)
: Lemma
(requires valid_taint_buf64 b vale_heap memTaint t /\ buffer_readable vale_heap b)
(ensures (
let ptr = buffer_addr b vale_heap + scale8 i in
forall i'.{:pattern Map.sel memTaint i'} i' >= ptr /\ i' < ptr + 8 ==> Map.sel memTaint i' == t))
val lemma_valid_taint128
(b:buffer128)
(memTaint:memtaint)
(vale_heap:vale_heap)
(i:nat{i < buffer_length b})
(t:taint)
: Lemma
(requires valid_taint_buf128 b vale_heap memTaint t /\ buffer_readable vale_heap b)
(ensures (
let ptr = buffer_addr b vale_heap + scale16 i in
forall i'.{:pattern Map.sel memTaint i'} i' >= ptr /\ i' < ptr + 16 ==> Map.sel memTaint i' == t))
val same_memTaint64
(b:buffer64)
(mem0:vale_heap)
(mem1:vale_heap)
(memtaint0:memtaint)
(memtaint1:memtaint)
: Lemma
(requires (modifies (loc_buffer b) mem0 mem1 /\
(forall p.{:pattern Map.sel memtaint0 p \/ Map.sel memtaint1 p} Map.sel memtaint0 p == Map.sel memtaint1 p)))
(ensures memtaint0 == memtaint1)
val same_memTaint128
(b:buffer128)
(mem0:vale_heap)
(mem1:vale_heap)
(memtaint0:memtaint)
(memtaint1:memtaint)
: Lemma
(requires (modifies (loc_buffer b) mem0 mem1 /\
(forall p.{:pattern Map.sel memtaint0 p \/ Map.sel memtaint1 p} Map.sel memtaint0 p == Map.sel memtaint1 p)))
(ensures memtaint0 == memtaint1)
val modifies_valid_taint (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) (mt:memtaint) (tn:taint) : Lemma
(requires modifies p h h')
(ensures valid_taint_buf b h mt tn <==> valid_taint_buf b h' mt tn)
[SMTPat (modifies p h h'); SMTPat (valid_taint_buf b h' mt tn)]
val modifies_same_heaplet_id (l:loc) (h1 h2:vale_heap) : Lemma
(requires modifies l h1 h2)
(ensures get_heaplet_id h1 == get_heaplet_id h2)
[SMTPat (modifies l h1 h2); SMTPat (get_heaplet_id h2)]
// Buffers in different heaplets are disjoint
let buffer_info_disjoint (bi1 bi2:buffer_info) =
bi1.bi_typ =!= bi2.bi_typ \/ bi1.bi_heaplet =!= bi2.bi_heaplet ==>
loc_disjoint (loc_buffer bi1.bi_buffer) (loc_buffer bi2.bi_buffer)
// Requirements for enabling heaplets
let init_heaplets_req (h:vale_heap) (bs:Seq.seq buffer_info) =
(forall (i:nat).{:pattern (Seq.index bs i)} i < Seq.length bs ==>
buffer_readable h (Seq.index bs i).bi_buffer) /\
(forall (i1 i2:nat).{:pattern (Seq.index bs i1); (Seq.index bs i2)}
i1 < Seq.length bs /\ i2 < Seq.length bs ==> buffer_info_disjoint (Seq.index bs i1) (Seq.index bs i2))
// Location containing all mutable buffers
let rec loc_mutable_buffers (buffers:list buffer_info) : GTot loc =
match buffers with
| [] -> loc_none
| [{bi_mutable = Mutable; bi_buffer = b}] -> loc_buffer b
| ({bi_mutable = Immutable})::t -> loc_mutable_buffers t
| ({bi_mutable = Mutable; bi_buffer = b})::t -> loc_union (loc_buffer b) (loc_mutable_buffers t)
// Buffer b belongs to heaplet h
val valid_layout_buffer_id (t:base_typ) (b:buffer t) (layout:vale_heap_layout) (h_id:option heaplet_id) (write:bool) : prop0
let valid_layout_buffer (#t:base_typ) (b:buffer t) (layout:vale_heap_layout) (h:vale_heap) (write:bool) =
valid_layout_buffer_id t b layout (get_heaplet_id h) false /\
valid_layout_buffer_id t b layout (get_heaplet_id h) write
// Initial memory state
val is_initial_heap (layout:vale_heap_layout) (h:vale_heap) : prop0
// Invariant that is always true in Vale procedures
val mem_inv (h:vale_full_heap) : prop0
// Layout data
val layout_heaplets_initialized (layout:vale_heap_layout_inner) : bool
val layout_old_heap (layout:vale_heap_layout_inner) : vale_heap
val layout_modifies_loc (layout:vale_heap_layout_inner) : loc
val layout_buffers (layout:vale_heap_layout_inner) : Seq.seq buffer_info | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Seq_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
bs: FStar.Seq.Base.seq Vale.Arch.HeapImpl.buffer_info ->
i: Prims.nat ->
id: Vale.PPC64LE.Memory.heaplet_id
-> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"FStar.Seq.Base.seq",
"Vale.Arch.HeapImpl.buffer_info",
"Prims.nat",
"Vale.PPC64LE.Memory.heaplet_id",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.Seq.Base.length",
"Prims.eq2",
"Vale.Arch.HeapImpl.heaplet_id",
"Vale.Arch.HeapImpl.__proj__Mkbuffer_info__item__bi_heaplet",
"FStar.Seq.Base.index",
"Prims.logical"
] | [] | false | false | false | true | true | let buffer_info_has_id (bs: Seq.seq buffer_info) (i: nat) (id: heaplet_id) =
| i < Seq.length bs /\ (Seq.index bs i).bi_heaplet == id | false |
|
FStar.Int8.fst | FStar.Int8.logxor | val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z)) | val logxor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logxor` v y == v z)) | let logxor x y = Mk (logxor (v x) (v y)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 40,
"end_line": 61,
"start_col": 0,
"start_line": 61
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1
let add a b = Mk (add (v a) (v b))
let sub a b = Mk (sub (v a) (v b))
let mul a b = Mk (mul (v a) (v b))
let div a b = Mk (div (v a) (v b))
let rem a b = Mk (mod (v a) (v b))
let logand x y = Mk (logand (v x) (v y)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: FStar.Int8.t -> y: FStar.Int8.t -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"FStar.Int8.Mk",
"FStar.Int.logxor",
"FStar.Int8.n",
"FStar.Int8.v"
] | [] | false | false | false | false | false | let logxor x y =
| Mk (logxor (v x) (v y)) | false |
FStar.Int8.fst | FStar.Int8.shift_arithmetic_right | val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c)) | val shift_arithmetic_right (a:t) (s:UInt32.t) : Pure t
(requires (UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_arithmetic_right (v a) (UInt32.v s) = v c)) | let shift_arithmetic_right a s = Mk (shift_arithmetic_right (v a) (UInt32.v s)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 79,
"end_line": 71,
"start_col": 0,
"start_line": 71
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1
let add a b = Mk (add (v a) (v b))
let sub a b = Mk (sub (v a) (v b))
let mul a b = Mk (mul (v a) (v b))
let div a b = Mk (div (v a) (v b))
let rem a b = Mk (mod (v a) (v b))
let logand x y = Mk (logand (v x) (v y))
let logxor x y = Mk (logxor (v x) (v y))
let logor x y = Mk (logor (v x) (v y))
let lognot x = Mk (lognot (v x))
let shift_right a s = Mk (shift_right (v a) (UInt32.v s))
let shift_left a s = Mk (shift_left (v a) (UInt32.v s)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: FStar.Int8.t -> s: FStar.UInt32.t -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"FStar.UInt32.t",
"FStar.Int8.Mk",
"FStar.Int.shift_arithmetic_right",
"FStar.Int8.n",
"FStar.Int8.v",
"FStar.UInt32.v"
] | [] | false | false | false | false | false | let shift_arithmetic_right a s =
| Mk (shift_arithmetic_right (v a) (UInt32.v s)) | false |
FStar.Int8.fst | FStar.Int8.logor | val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z)) | val logor (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logor` v y == v z)) | let logor x y = Mk (logor (v x) (v y)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 38,
"end_line": 63,
"start_col": 0,
"start_line": 63
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1
let add a b = Mk (add (v a) (v b))
let sub a b = Mk (sub (v a) (v b))
let mul a b = Mk (mul (v a) (v b))
let div a b = Mk (div (v a) (v b))
let rem a b = Mk (mod (v a) (v b))
let logand x y = Mk (logand (v x) (v y))
let logxor x y = Mk (logxor (v x) (v y)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: FStar.Int8.t -> y: FStar.Int8.t -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"FStar.Int8.Mk",
"FStar.Int.logor",
"FStar.Int8.n",
"FStar.Int8.v"
] | [] | false | false | false | false | false | let logor x y =
| Mk (logor (v x) (v y)) | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.valid_layout_buffer | val valid_layout_buffer : b: Vale.PPC64LE.Memory.buffer t ->
layout: Vale.Arch.HeapImpl.vale_heap_layout ->
h: Vale.PPC64LE.Memory.vale_heap ->
write: Prims.bool
-> Prims.logical | let valid_layout_buffer (#t:base_typ) (b:buffer t) (layout:vale_heap_layout) (h:vale_heap) (write:bool) =
valid_layout_buffer_id t b layout (get_heaplet_id h) false /\
valid_layout_buffer_id t b layout (get_heaplet_id h) write | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 60,
"end_line": 395,
"start_col": 0,
"start_line": 393
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128
let buffer8 = buffer vuint8
let buffer16 = buffer vuint16
let buffer32 = buffer vuint32
let buffer64 = buffer vuint64
let buffer128 = buffer vuint128
val buffer_addr (#t:base_typ) (b:buffer t) (h:vale_heap) : GTot int
unfold
let locs_disjoint (ls:list loc) : prop0 =
BigOps.normal (BigOps.pairwise_and' (fun x y -> loc_disjoint x y /\ loc_disjoint y x) ls)
// equivalent to modifies; used to prove modifies clauses via modifies_goal_directed_trans
val modifies_goal_directed (s:loc) (h1 h2:vale_heap) : GTot prop0
val lemma_modifies_goal_directed (s:loc) (h1 h2:vale_heap) : Lemma
(modifies s h1 h2 == modifies_goal_directed s h1 h2)
val buffer_length_buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : Lemma
(requires True)
(ensures (Seq.length (buffer_as_seq h b) == buffer_length b))
[SMTPat (Seq.length (buffer_as_seq h b))]
val modifies_buffer_elim (#t1:base_typ) (b:buffer t1) (p:loc) (h h':vale_heap) : Lemma
(requires
loc_disjoint (loc_buffer b) p /\
buffer_readable h b /\
modifies p h h'
)
(ensures
buffer_readable h b /\
buffer_readable h' b /\
buffer_as_seq h b == buffer_as_seq h' b
)
[SMTPatOr [
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)];
[SMTPat (modifies p h h'); SMTPat (buffer_as_seq h' b)];
]]
val modifies_buffer_addr (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h'
)
(ensures buffer_addr b h == buffer_addr b h')
[SMTPat (modifies p h h'); SMTPat (buffer_addr b h')]
val modifies_buffer_readable (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h' /\
buffer_readable h b
)
(ensures buffer_readable h' b)
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)]
val loc_disjoint_none_r (s:loc) : Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r (s s1 s2:loc) : Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_includes_refl (s:loc) : Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans (s1 s2 s3:loc) : Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r (s s1 s2:loc) : Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l (s1 s2 s:loc) : Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
// for efficiency, no SMT pattern
val loc_includes_union_l_buffer (#t:base_typ) (s1 s2:loc) (b:buffer t) : Lemma
(requires (loc_includes s1 (loc_buffer b) \/ loc_includes s2 (loc_buffer b)))
(ensures (loc_includes (loc_union s1 s2) (loc_buffer b)))
[SMTPat (loc_includes (loc_union s1 s2) (loc_buffer b))]
val loc_includes_none (s:loc) : Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val modifies_refl (s:loc) (h:vale_heap) : Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_goal_directed_refl (s:loc) (h:vale_heap) : Lemma
(modifies_goal_directed s h h)
[SMTPat (modifies_goal_directed s h h)]
val modifies_loc_includes (s1:loc) (h h':vale_heap) (s2:loc) : Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
// for efficiency, no SMT pattern
val modifies_trans (s12:loc) (h1 h2:vale_heap) (s23:loc) (h3:vale_heap) : Lemma
(requires (modifies s12 h1 h2 /\ modifies s23 h2 h3))
(ensures (modifies (loc_union s12 s23) h1 h3))
// for efficiency, no SMT pattern
// Prove (modifies s13 h1 h3).
// To avoid unnecessary matches, don't introduce any other modifies terms.
// Introduce modifies_goal_directed instead.
val modifies_goal_directed_trans (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies s13 h1 h3)]
val modifies_goal_directed_trans2 (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies_goal_directed s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies_goal_directed s13 h1 h3)]
val buffer_read (#t:base_typ) (b:buffer t) (i:int) (h:vale_heap) : Ghost (base_typ_as_vale_type t)
(requires True)
(ensures (fun v ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
v == Seq.index (buffer_as_seq h b) i
))
val buffer_write (#t:base_typ) (b:buffer t) (i:int) (v:base_typ_as_vale_type t) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures (fun h' ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
modifies (loc_buffer b) h h' /\
get_heaplet_id h' == get_heaplet_id h /\
buffer_readable h' b /\
buffer_as_seq h' b == Seq.upd (buffer_as_seq h b) i v
))
val valid_mem64 (ptr:int) (h:vale_heap) : GTot bool // is there a 64-bit word at address ptr?
val writeable_mem64 (ptr:int) (h:vale_heap) : GTot bool // can we write a 64-bit word at address ptr?
val load_mem64 (ptr:int) (h:vale_heap) : GTot nat64 // the 64-bit word at ptr (if valid_mem64 holds)
val store_mem64 (ptr:int) (v:nat64) (h:vale_heap) : GTot vale_heap
val valid_mem128 (ptr:int) (h:vale_heap) : GTot bool
val writeable_mem128 (ptr:int) (h:vale_heap) : GTot bool
val load_mem128 (ptr:int) (h:vale_heap) : GTot quad32
val store_mem128 (ptr:int) (v:quad32) (h:vale_heap) : GTot vale_heap
val lemma_valid_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_writeable_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_load_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem64 (buffer_addr b h + scale8 i) h == buffer_read b i h
)
val lemma_store_mem64 (b:buffer64) (i:nat) (v:nat64) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem64 (buffer_addr b h + scale8 i) v h == buffer_write b i v h
)
val lemma_valid_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_writeable_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_load_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem128 (buffer_addr b h + scale16 i) h == buffer_read b i h
)
val lemma_store_mem128 (b:buffer128) (i:nat) (v:quad32) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem128 (buffer_addr b h + scale16 i) v h == buffer_write b i v h
)
//Memtaint related functions
type memtaint = memTaint_t
val valid_taint_buf (#t:base_typ) (b:buffer t) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0
let valid_taint_buf64 (b:buffer64) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn
let valid_taint_buf128 (b:buffer128) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn
val lemma_valid_taint64
(b:buffer64)
(memTaint:memtaint)
(vale_heap:vale_heap)
(i:nat{i < buffer_length b})
(t:taint)
: Lemma
(requires valid_taint_buf64 b vale_heap memTaint t /\ buffer_readable vale_heap b)
(ensures (
let ptr = buffer_addr b vale_heap + scale8 i in
forall i'.{:pattern Map.sel memTaint i'} i' >= ptr /\ i' < ptr + 8 ==> Map.sel memTaint i' == t))
val lemma_valid_taint128
(b:buffer128)
(memTaint:memtaint)
(vale_heap:vale_heap)
(i:nat{i < buffer_length b})
(t:taint)
: Lemma
(requires valid_taint_buf128 b vale_heap memTaint t /\ buffer_readable vale_heap b)
(ensures (
let ptr = buffer_addr b vale_heap + scale16 i in
forall i'.{:pattern Map.sel memTaint i'} i' >= ptr /\ i' < ptr + 16 ==> Map.sel memTaint i' == t))
val same_memTaint64
(b:buffer64)
(mem0:vale_heap)
(mem1:vale_heap)
(memtaint0:memtaint)
(memtaint1:memtaint)
: Lemma
(requires (modifies (loc_buffer b) mem0 mem1 /\
(forall p.{:pattern Map.sel memtaint0 p \/ Map.sel memtaint1 p} Map.sel memtaint0 p == Map.sel memtaint1 p)))
(ensures memtaint0 == memtaint1)
val same_memTaint128
(b:buffer128)
(mem0:vale_heap)
(mem1:vale_heap)
(memtaint0:memtaint)
(memtaint1:memtaint)
: Lemma
(requires (modifies (loc_buffer b) mem0 mem1 /\
(forall p.{:pattern Map.sel memtaint0 p \/ Map.sel memtaint1 p} Map.sel memtaint0 p == Map.sel memtaint1 p)))
(ensures memtaint0 == memtaint1)
val modifies_valid_taint (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) (mt:memtaint) (tn:taint) : Lemma
(requires modifies p h h')
(ensures valid_taint_buf b h mt tn <==> valid_taint_buf b h' mt tn)
[SMTPat (modifies p h h'); SMTPat (valid_taint_buf b h' mt tn)]
val modifies_same_heaplet_id (l:loc) (h1 h2:vale_heap) : Lemma
(requires modifies l h1 h2)
(ensures get_heaplet_id h1 == get_heaplet_id h2)
[SMTPat (modifies l h1 h2); SMTPat (get_heaplet_id h2)]
// Buffers in different heaplets are disjoint
let buffer_info_disjoint (bi1 bi2:buffer_info) =
bi1.bi_typ =!= bi2.bi_typ \/ bi1.bi_heaplet =!= bi2.bi_heaplet ==>
loc_disjoint (loc_buffer bi1.bi_buffer) (loc_buffer bi2.bi_buffer)
// Requirements for enabling heaplets
let init_heaplets_req (h:vale_heap) (bs:Seq.seq buffer_info) =
(forall (i:nat).{:pattern (Seq.index bs i)} i < Seq.length bs ==>
buffer_readable h (Seq.index bs i).bi_buffer) /\
(forall (i1 i2:nat).{:pattern (Seq.index bs i1); (Seq.index bs i2)}
i1 < Seq.length bs /\ i2 < Seq.length bs ==> buffer_info_disjoint (Seq.index bs i1) (Seq.index bs i2))
// Location containing all mutable buffers
let rec loc_mutable_buffers (buffers:list buffer_info) : GTot loc =
match buffers with
| [] -> loc_none
| [{bi_mutable = Mutable; bi_buffer = b}] -> loc_buffer b
| ({bi_mutable = Immutable})::t -> loc_mutable_buffers t
| ({bi_mutable = Mutable; bi_buffer = b})::t -> loc_union (loc_buffer b) (loc_mutable_buffers t)
// Buffer b belongs to heaplet h | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Seq_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
b: Vale.PPC64LE.Memory.buffer t ->
layout: Vale.Arch.HeapImpl.vale_heap_layout ->
h: Vale.PPC64LE.Memory.vale_heap ->
write: Prims.bool
-> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapTypes_s.base_typ",
"Vale.PPC64LE.Memory.buffer",
"Vale.Arch.HeapImpl.vale_heap_layout",
"Vale.PPC64LE.Memory.vale_heap",
"Prims.bool",
"Prims.l_and",
"Vale.PPC64LE.Memory.valid_layout_buffer_id",
"Vale.PPC64LE.Memory.get_heaplet_id",
"Prims.logical"
] | [] | false | false | false | false | true | let valid_layout_buffer
(#t: base_typ)
(b: buffer t)
(layout: vale_heap_layout)
(h: vale_heap)
(write: bool)
=
| valid_layout_buffer_id t b layout (get_heaplet_id h) false /\
valid_layout_buffer_id t b layout (get_heaplet_id h) write | false |
|
FStar.Int8.fst | FStar.Int8.logand | val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z)) | val logand (x:t) (y:t) : Pure t
(requires True)
(ensures (fun z -> v x `logand` v y = v z)) | let logand x y = Mk (logand (v x) (v y)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 40,
"end_line": 59,
"start_col": 0,
"start_line": 59
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1
let add a b = Mk (add (v a) (v b))
let sub a b = Mk (sub (v a) (v b))
let mul a b = Mk (mul (v a) (v b))
let div a b = Mk (div (v a) (v b))
let rem a b = Mk (mod (v a) (v b)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: FStar.Int8.t -> y: FStar.Int8.t -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"FStar.Int8.Mk",
"FStar.Int.logand",
"FStar.Int8.n",
"FStar.Int8.v"
] | [] | false | false | false | false | false | let logand x y =
| Mk (logand (v x) (v y)) | false |
FStar.Int8.fst | FStar.Int8.rem | val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c)) | val rem (a:t) (b:t{v b <> 0}) : Pure t
(requires (size (v a / v b) n))
(ensures (fun c -> FStar.Int.mod (v a) (v b) = v c)) | let rem a b = Mk (mod (v a) (v b)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 34,
"end_line": 57,
"start_col": 0,
"start_line": 57
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1
let add a b = Mk (add (v a) (v b))
let sub a b = Mk (sub (v a) (v b))
let mul a b = Mk (mul (v a) (v b))
let div a b = Mk (div (v a) (v b)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: FStar.Int8.t -> b: FStar.Int8.t{FStar.Int8.v b <> 0} -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"Prims.b2t",
"Prims.op_disEquality",
"Prims.int",
"FStar.Int8.v",
"FStar.Int8.Mk",
"FStar.Int.mod",
"FStar.Int8.n"
] | [] | false | false | false | false | false | let rem a b =
| Mk (mod (v a) (v b)) | false |
FStar.Int8.fst | FStar.Int8.shift_right | val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c)) | val shift_right (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_right (v a) (UInt32.v s) = v c)) | let shift_right a s = Mk (shift_right (v a) (UInt32.v s)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 57,
"end_line": 67,
"start_col": 0,
"start_line": 67
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1
let add a b = Mk (add (v a) (v b))
let sub a b = Mk (sub (v a) (v b))
let mul a b = Mk (mul (v a) (v b))
let div a b = Mk (div (v a) (v b))
let rem a b = Mk (mod (v a) (v b))
let logand x y = Mk (logand (v x) (v y))
let logxor x y = Mk (logxor (v x) (v y))
let logor x y = Mk (logor (v x) (v y))
let lognot x = Mk (lognot (v x)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: FStar.Int8.t -> s: FStar.UInt32.t -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"FStar.UInt32.t",
"FStar.Int8.Mk",
"FStar.Int.shift_right",
"FStar.Int8.n",
"FStar.Int8.v",
"FStar.UInt32.v"
] | [] | false | false | false | false | false | let shift_right a s =
| Mk (shift_right (v a) (UInt32.v s)) | false |
FStar.Int8.fst | FStar.Int8.div | val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c)) | val div (a:t) (b:t{v b <> 0}) : Pure t
// division overflows on INT_MIN / -1
(requires (size (v a / v b) n))
(ensures (fun c -> v a / v b = v c)) | let div a b = Mk (div (v a) (v b)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 34,
"end_line": 55,
"start_col": 0,
"start_line": 55
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1
let add a b = Mk (add (v a) (v b))
let sub a b = Mk (sub (v a) (v b))
let mul a b = Mk (mul (v a) (v b)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: FStar.Int8.t -> b: FStar.Int8.t{FStar.Int8.v b <> 0} -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"Prims.b2t",
"Prims.op_disEquality",
"Prims.int",
"FStar.Int8.v",
"FStar.Int8.Mk",
"FStar.Int.div",
"FStar.Int8.n"
] | [] | false | false | false | false | false | let div a b =
| Mk (div (v a) (v b)) | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.base_typ_as_vale_type | val base_typ_as_vale_type (t: base_typ) : Tot eqtype | val base_typ_as_vale_type (t: base_typ) : Tot eqtype | let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32 | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 39,
"start_col": 0,
"start_line": 33
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32 | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t: Vale.Arch.HeapTypes_s.base_typ -> Prims.eqtype | Prims.Tot | [
"total"
] | [] | [
"Vale.Arch.HeapTypes_s.base_typ",
"Vale.PPC64LE.Memory.nat8",
"Vale.PPC64LE.Memory.nat16",
"Vale.PPC64LE.Memory.nat32",
"Vale.PPC64LE.Memory.nat64",
"Vale.PPC64LE.Memory.quad32",
"Prims.eqtype"
] | [] | false | false | false | true | false | let base_typ_as_vale_type (t: base_typ) : Tot eqtype =
| match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32 | false |
FStar.Int8.fst | FStar.Int8.shift_left | val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c)) | val shift_left (a:t) (s:UInt32.t) : Pure t
(requires (0 <= v a /\ v a * pow2 (UInt32.v s) <= max_int n /\ UInt32.v s < n))
(ensures (fun c -> FStar.Int.shift_left (v a) (UInt32.v s) = v c)) | let shift_left a s = Mk (shift_left (v a) (UInt32.v s)) | {
"file_name": "ulib/FStar.Int8.fst",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 55,
"end_line": 69,
"start_col": 0,
"start_line": 69
} | (*
Copyright 2008-2019 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Int8
(**** THIS MODULE IS GENERATED AUTOMATICALLY USING [mk_int.sh], DO NOT EDIT DIRECTLY ****)
open FStar.Int
open FStar.Mul
#set-options "--max_fuel 0 --max_ifuel 0"
(* NOTE: anything that you fix/update here should be reflected in [FStar.UIntN.fstp], which is mostly
* a copy-paste of this module. *)
type t : eqtype =
| Mk: v:int_t n -> t
let v x = x.v
irreducible
let int_to_t x = Mk x
let uv_inv _ = ()
let vu_inv _ = ()
let v_inj _ _ = ()
let zero = int_to_t 0
let one =
FStar.Math.Lemmas.pow2_lt_compat (n - 1) 1;
int_to_t 1
let add a b = Mk (add (v a) (v b))
let sub a b = Mk (sub (v a) (v b))
let mul a b = Mk (mul (v a) (v b))
let div a b = Mk (div (v a) (v b))
let rem a b = Mk (mod (v a) (v b))
let logand x y = Mk (logand (v x) (v y))
let logxor x y = Mk (logxor (v x) (v y))
let logor x y = Mk (logor (v x) (v y))
let lognot x = Mk (lognot (v x))
let shift_right a s = Mk (shift_right (v a) (UInt32.v s)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Int.fsti.checked"
],
"interface_file": true,
"source_file": "FStar.Int8.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | a: FStar.Int8.t -> s: FStar.UInt32.t -> Prims.Pure FStar.Int8.t | Prims.Pure | [] | [] | [
"FStar.Int8.t",
"FStar.UInt32.t",
"FStar.Int8.Mk",
"FStar.Int.shift_left",
"FStar.Int8.n",
"FStar.Int8.v",
"FStar.UInt32.v"
] | [] | false | false | false | false | false | let shift_left a s =
| Mk (shift_left (v a) (UInt32.v s)) | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.loc_mutable_buffers | val loc_mutable_buffers (buffers: list buffer_info) : GTot loc | val loc_mutable_buffers (buffers: list buffer_info) : GTot loc | let rec loc_mutable_buffers (buffers:list buffer_info) : GTot loc =
match buffers with
| [] -> loc_none
| [{bi_mutable = Mutable; bi_buffer = b}] -> loc_buffer b
| ({bi_mutable = Immutable})::t -> loc_mutable_buffers t
| ({bi_mutable = Mutable; bi_buffer = b})::t -> loc_union (loc_buffer b) (loc_mutable_buffers t) | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 98,
"end_line": 389,
"start_col": 0,
"start_line": 384
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128
let buffer8 = buffer vuint8
let buffer16 = buffer vuint16
let buffer32 = buffer vuint32
let buffer64 = buffer vuint64
let buffer128 = buffer vuint128
val buffer_addr (#t:base_typ) (b:buffer t) (h:vale_heap) : GTot int
unfold
let locs_disjoint (ls:list loc) : prop0 =
BigOps.normal (BigOps.pairwise_and' (fun x y -> loc_disjoint x y /\ loc_disjoint y x) ls)
// equivalent to modifies; used to prove modifies clauses via modifies_goal_directed_trans
val modifies_goal_directed (s:loc) (h1 h2:vale_heap) : GTot prop0
val lemma_modifies_goal_directed (s:loc) (h1 h2:vale_heap) : Lemma
(modifies s h1 h2 == modifies_goal_directed s h1 h2)
val buffer_length_buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : Lemma
(requires True)
(ensures (Seq.length (buffer_as_seq h b) == buffer_length b))
[SMTPat (Seq.length (buffer_as_seq h b))]
val modifies_buffer_elim (#t1:base_typ) (b:buffer t1) (p:loc) (h h':vale_heap) : Lemma
(requires
loc_disjoint (loc_buffer b) p /\
buffer_readable h b /\
modifies p h h'
)
(ensures
buffer_readable h b /\
buffer_readable h' b /\
buffer_as_seq h b == buffer_as_seq h' b
)
[SMTPatOr [
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)];
[SMTPat (modifies p h h'); SMTPat (buffer_as_seq h' b)];
]]
val modifies_buffer_addr (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h'
)
(ensures buffer_addr b h == buffer_addr b h')
[SMTPat (modifies p h h'); SMTPat (buffer_addr b h')]
val modifies_buffer_readable (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h' /\
buffer_readable h b
)
(ensures buffer_readable h' b)
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)]
val loc_disjoint_none_r (s:loc) : Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r (s s1 s2:loc) : Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_includes_refl (s:loc) : Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans (s1 s2 s3:loc) : Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r (s s1 s2:loc) : Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l (s1 s2 s:loc) : Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
// for efficiency, no SMT pattern
val loc_includes_union_l_buffer (#t:base_typ) (s1 s2:loc) (b:buffer t) : Lemma
(requires (loc_includes s1 (loc_buffer b) \/ loc_includes s2 (loc_buffer b)))
(ensures (loc_includes (loc_union s1 s2) (loc_buffer b)))
[SMTPat (loc_includes (loc_union s1 s2) (loc_buffer b))]
val loc_includes_none (s:loc) : Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val modifies_refl (s:loc) (h:vale_heap) : Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_goal_directed_refl (s:loc) (h:vale_heap) : Lemma
(modifies_goal_directed s h h)
[SMTPat (modifies_goal_directed s h h)]
val modifies_loc_includes (s1:loc) (h h':vale_heap) (s2:loc) : Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
// for efficiency, no SMT pattern
val modifies_trans (s12:loc) (h1 h2:vale_heap) (s23:loc) (h3:vale_heap) : Lemma
(requires (modifies s12 h1 h2 /\ modifies s23 h2 h3))
(ensures (modifies (loc_union s12 s23) h1 h3))
// for efficiency, no SMT pattern
// Prove (modifies s13 h1 h3).
// To avoid unnecessary matches, don't introduce any other modifies terms.
// Introduce modifies_goal_directed instead.
val modifies_goal_directed_trans (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies s13 h1 h3)]
val modifies_goal_directed_trans2 (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies_goal_directed s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies_goal_directed s13 h1 h3)]
val buffer_read (#t:base_typ) (b:buffer t) (i:int) (h:vale_heap) : Ghost (base_typ_as_vale_type t)
(requires True)
(ensures (fun v ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
v == Seq.index (buffer_as_seq h b) i
))
val buffer_write (#t:base_typ) (b:buffer t) (i:int) (v:base_typ_as_vale_type t) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures (fun h' ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
modifies (loc_buffer b) h h' /\
get_heaplet_id h' == get_heaplet_id h /\
buffer_readable h' b /\
buffer_as_seq h' b == Seq.upd (buffer_as_seq h b) i v
))
val valid_mem64 (ptr:int) (h:vale_heap) : GTot bool // is there a 64-bit word at address ptr?
val writeable_mem64 (ptr:int) (h:vale_heap) : GTot bool // can we write a 64-bit word at address ptr?
val load_mem64 (ptr:int) (h:vale_heap) : GTot nat64 // the 64-bit word at ptr (if valid_mem64 holds)
val store_mem64 (ptr:int) (v:nat64) (h:vale_heap) : GTot vale_heap
val valid_mem128 (ptr:int) (h:vale_heap) : GTot bool
val writeable_mem128 (ptr:int) (h:vale_heap) : GTot bool
val load_mem128 (ptr:int) (h:vale_heap) : GTot quad32
val store_mem128 (ptr:int) (v:quad32) (h:vale_heap) : GTot vale_heap
val lemma_valid_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_writeable_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_load_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem64 (buffer_addr b h + scale8 i) h == buffer_read b i h
)
val lemma_store_mem64 (b:buffer64) (i:nat) (v:nat64) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem64 (buffer_addr b h + scale8 i) v h == buffer_write b i v h
)
val lemma_valid_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_writeable_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_load_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem128 (buffer_addr b h + scale16 i) h == buffer_read b i h
)
val lemma_store_mem128 (b:buffer128) (i:nat) (v:quad32) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem128 (buffer_addr b h + scale16 i) v h == buffer_write b i v h
)
//Memtaint related functions
type memtaint = memTaint_t
val valid_taint_buf (#t:base_typ) (b:buffer t) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0
let valid_taint_buf64 (b:buffer64) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn
let valid_taint_buf128 (b:buffer128) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn
val lemma_valid_taint64
(b:buffer64)
(memTaint:memtaint)
(vale_heap:vale_heap)
(i:nat{i < buffer_length b})
(t:taint)
: Lemma
(requires valid_taint_buf64 b vale_heap memTaint t /\ buffer_readable vale_heap b)
(ensures (
let ptr = buffer_addr b vale_heap + scale8 i in
forall i'.{:pattern Map.sel memTaint i'} i' >= ptr /\ i' < ptr + 8 ==> Map.sel memTaint i' == t))
val lemma_valid_taint128
(b:buffer128)
(memTaint:memtaint)
(vale_heap:vale_heap)
(i:nat{i < buffer_length b})
(t:taint)
: Lemma
(requires valid_taint_buf128 b vale_heap memTaint t /\ buffer_readable vale_heap b)
(ensures (
let ptr = buffer_addr b vale_heap + scale16 i in
forall i'.{:pattern Map.sel memTaint i'} i' >= ptr /\ i' < ptr + 16 ==> Map.sel memTaint i' == t))
val same_memTaint64
(b:buffer64)
(mem0:vale_heap)
(mem1:vale_heap)
(memtaint0:memtaint)
(memtaint1:memtaint)
: Lemma
(requires (modifies (loc_buffer b) mem0 mem1 /\
(forall p.{:pattern Map.sel memtaint0 p \/ Map.sel memtaint1 p} Map.sel memtaint0 p == Map.sel memtaint1 p)))
(ensures memtaint0 == memtaint1)
val same_memTaint128
(b:buffer128)
(mem0:vale_heap)
(mem1:vale_heap)
(memtaint0:memtaint)
(memtaint1:memtaint)
: Lemma
(requires (modifies (loc_buffer b) mem0 mem1 /\
(forall p.{:pattern Map.sel memtaint0 p \/ Map.sel memtaint1 p} Map.sel memtaint0 p == Map.sel memtaint1 p)))
(ensures memtaint0 == memtaint1)
val modifies_valid_taint (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) (mt:memtaint) (tn:taint) : Lemma
(requires modifies p h h')
(ensures valid_taint_buf b h mt tn <==> valid_taint_buf b h' mt tn)
[SMTPat (modifies p h h'); SMTPat (valid_taint_buf b h' mt tn)]
val modifies_same_heaplet_id (l:loc) (h1 h2:vale_heap) : Lemma
(requires modifies l h1 h2)
(ensures get_heaplet_id h1 == get_heaplet_id h2)
[SMTPat (modifies l h1 h2); SMTPat (get_heaplet_id h2)]
// Buffers in different heaplets are disjoint
let buffer_info_disjoint (bi1 bi2:buffer_info) =
bi1.bi_typ =!= bi2.bi_typ \/ bi1.bi_heaplet =!= bi2.bi_heaplet ==>
loc_disjoint (loc_buffer bi1.bi_buffer) (loc_buffer bi2.bi_buffer)
// Requirements for enabling heaplets
let init_heaplets_req (h:vale_heap) (bs:Seq.seq buffer_info) =
(forall (i:nat).{:pattern (Seq.index bs i)} i < Seq.length bs ==>
buffer_readable h (Seq.index bs i).bi_buffer) /\
(forall (i1 i2:nat).{:pattern (Seq.index bs i1); (Seq.index bs i2)}
i1 < Seq.length bs /\ i2 < Seq.length bs ==> buffer_info_disjoint (Seq.index bs i1) (Seq.index bs i2)) | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Seq_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | buffers: Prims.list Vale.Arch.HeapImpl.buffer_info -> Prims.GTot Vale.PPC64LE.Memory.loc | Prims.GTot | [
"sometrivial"
] | [] | [
"Prims.list",
"Vale.Arch.HeapImpl.buffer_info",
"Vale.PPC64LE.Memory.loc_none",
"Vale.Arch.HeapTypes_s.base_typ",
"Vale.Arch.HeapImpl.buffer",
"Vale.Arch.HeapImpl.heaplet_id",
"Vale.Arch.HeapTypes_s.taint",
"Vale.PPC64LE.Memory.loc_buffer",
"Vale.PPC64LE.Memory.loc_mutable_buffers",
"Vale.PPC64LE.Memory.loc_union",
"Vale.PPC64LE.Memory.loc"
] | [
"recursion"
] | false | false | false | false | false | let rec loc_mutable_buffers (buffers: list buffer_info) : GTot loc =
| match buffers with
| [] -> loc_none
| [{ bi_mutable = Mutable ; bi_buffer = b }] -> loc_buffer b
| { bi_mutable = Immutable } :: t -> loc_mutable_buffers t
| { bi_mutable = Mutable ; bi_buffer = b } :: t -> loc_union (loc_buffer b) (loc_mutable_buffers t) | false |
Vale.PPC64LE.Memory.fsti | Vale.PPC64LE.Memory.init_heaplets_req | val init_heaplets_req : h: Vale.PPC64LE.Memory.vale_heap -> bs: FStar.Seq.Base.seq Vale.Arch.HeapImpl.buffer_info
-> Prims.logical | let init_heaplets_req (h:vale_heap) (bs:Seq.seq buffer_info) =
(forall (i:nat).{:pattern (Seq.index bs i)} i < Seq.length bs ==>
buffer_readable h (Seq.index bs i).bi_buffer) /\
(forall (i1 i2:nat).{:pattern (Seq.index bs i1); (Seq.index bs i2)}
i1 < Seq.length bs /\ i2 < Seq.length bs ==> buffer_info_disjoint (Seq.index bs i1) (Seq.index bs i2)) | {
"file_name": "vale/code/arch/ppc64le/Vale.PPC64LE.Memory.fsti",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 106,
"end_line": 381,
"start_col": 0,
"start_line": 377
} | module Vale.PPC64LE.Memory
include Vale.Arch.HeapTypes_s
open FStar.Mul
open Vale.Def.Prop_s
open Vale.PPC64LE.Machine_s
open Vale.Arch.HeapImpl
module Map16 = Vale.Lib.Map16
unfold let vale_heap = vale_heap
unfold let vale_full_heap = vale_full_heap
unfold let heaplet_id = heaplet_id
[@va_qattr]
let get_vale_heap (vhi:vale_full_heap) : vale_heap = vhi.vf_heap
[@va_qattr]
let set_vale_heap (vfh:vale_full_heap) (vh:vale_heap) : vale_full_heap =
{vfh with vf_heap = vh}
let vale_full_heap_equal (h1 h2:vale_full_heap) =
h1.vf_layout == h2.vf_layout /\
h1.vf_heap == h2.vf_heap /\
Map16.equal h1.vf_heaplets h2.vf_heaplets
val get_heaplet_id (h:vale_heap) : option heaplet_id
unfold let nat8 = Vale.Def.Words_s.nat8
unfold let nat16 = Vale.Def.Words_s.nat16
unfold let nat32 = Vale.Def.Words_s.nat32
unfold let nat64 = Vale.Def.Words_s.nat64
unfold let quad32 = Vale.Def.Types_s.quad32
let base_typ_as_vale_type (t:base_typ) : Tot eqtype =
match t with
| TUInt8 -> nat8
| TUInt16 -> nat16
| TUInt32 -> nat32
| TUInt64 -> nat64
| TUInt128 -> quad32
let scale_by (scale index:int) : int = scale * index
unfold let scale2 (index:int) : int = scale_by 2 index
unfold let scale4 (index:int) : int = scale_by 4 index
unfold let scale8 (index:int) : int = scale_by 8 index
unfold let scale16 (index:int) : int = scale_by 16 index
unfold let buffer (t:base_typ) : Type0 = Vale.Arch.HeapImpl.buffer t
val buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot (Seq.seq (base_typ_as_vale_type t))
val buffer_readable (#t:base_typ) (h:vale_heap) (b:buffer t) : GTot prop0
val buffer_writeable (#t:base_typ) (b:buffer t) : GTot prop0
val buffer_length (#t:base_typ) (b:buffer t) : GTot nat
val loc : Type u#0
val loc_none : loc
val loc_union (s1 s2:loc) : GTot loc
val loc_buffer (#t:base_typ) (b:buffer t) : GTot loc
val loc_disjoint (s1 s2:loc) : GTot prop0
val loc_includes (s1 s2:loc) : GTot prop0
val modifies (s:loc) (h1 h2:vale_heap) : GTot prop0
let valid_buffer_read (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
0 <= i /\ i < buffer_length b /\ buffer_readable h b
let valid_buffer_write (#t:base_typ) (h:vale_heap) (b:buffer t) (i:int) : prop0 =
valid_buffer_read h b i /\ buffer_writeable b
// Named abbreviations for Vale type system:
unfold let vuint8 = TUInt8
unfold let vuint16 = TUInt16
unfold let vuint32 = TUInt32
unfold let vuint64 = TUInt64
unfold let vuint128 = TUInt128
let buffer8 = buffer vuint8
let buffer16 = buffer vuint16
let buffer32 = buffer vuint32
let buffer64 = buffer vuint64
let buffer128 = buffer vuint128
val buffer_addr (#t:base_typ) (b:buffer t) (h:vale_heap) : GTot int
unfold
let locs_disjoint (ls:list loc) : prop0 =
BigOps.normal (BigOps.pairwise_and' (fun x y -> loc_disjoint x y /\ loc_disjoint y x) ls)
// equivalent to modifies; used to prove modifies clauses via modifies_goal_directed_trans
val modifies_goal_directed (s:loc) (h1 h2:vale_heap) : GTot prop0
val lemma_modifies_goal_directed (s:loc) (h1 h2:vale_heap) : Lemma
(modifies s h1 h2 == modifies_goal_directed s h1 h2)
val buffer_length_buffer_as_seq (#t:base_typ) (h:vale_heap) (b:buffer t) : Lemma
(requires True)
(ensures (Seq.length (buffer_as_seq h b) == buffer_length b))
[SMTPat (Seq.length (buffer_as_seq h b))]
val modifies_buffer_elim (#t1:base_typ) (b:buffer t1) (p:loc) (h h':vale_heap) : Lemma
(requires
loc_disjoint (loc_buffer b) p /\
buffer_readable h b /\
modifies p h h'
)
(ensures
buffer_readable h b /\
buffer_readable h' b /\
buffer_as_seq h b == buffer_as_seq h' b
)
[SMTPatOr [
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)];
[SMTPat (modifies p h h'); SMTPat (buffer_as_seq h' b)];
]]
val modifies_buffer_addr (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h'
)
(ensures buffer_addr b h == buffer_addr b h')
[SMTPat (modifies p h h'); SMTPat (buffer_addr b h')]
val modifies_buffer_readable (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) : Lemma
(requires
modifies p h h' /\
buffer_readable h b
)
(ensures buffer_readable h' b)
[SMTPat (modifies p h h'); SMTPat (buffer_readable h' b)]
val loc_disjoint_none_r (s:loc) : Lemma
(ensures (loc_disjoint s loc_none))
[SMTPat (loc_disjoint s loc_none)]
val loc_disjoint_union_r (s s1 s2:loc) : Lemma
(requires (loc_disjoint s s1 /\ loc_disjoint s s2))
(ensures (loc_disjoint s (loc_union s1 s2)))
[SMTPat (loc_disjoint s (loc_union s1 s2))]
val loc_includes_refl (s:loc) : Lemma
(loc_includes s s)
[SMTPat (loc_includes s s)]
val loc_includes_trans (s1 s2 s3:loc) : Lemma
(requires (loc_includes s1 s2 /\ loc_includes s2 s3))
(ensures (loc_includes s1 s3))
val loc_includes_union_r (s s1 s2:loc) : Lemma
(requires (loc_includes s s1 /\ loc_includes s s2))
(ensures (loc_includes s (loc_union s1 s2)))
[SMTPat (loc_includes s (loc_union s1 s2))]
val loc_includes_union_l (s1 s2 s:loc) : Lemma
(requires (loc_includes s1 s \/ loc_includes s2 s))
(ensures (loc_includes (loc_union s1 s2) s))
// for efficiency, no SMT pattern
val loc_includes_union_l_buffer (#t:base_typ) (s1 s2:loc) (b:buffer t) : Lemma
(requires (loc_includes s1 (loc_buffer b) \/ loc_includes s2 (loc_buffer b)))
(ensures (loc_includes (loc_union s1 s2) (loc_buffer b)))
[SMTPat (loc_includes (loc_union s1 s2) (loc_buffer b))]
val loc_includes_none (s:loc) : Lemma
(loc_includes s loc_none)
[SMTPat (loc_includes s loc_none)]
val modifies_refl (s:loc) (h:vale_heap) : Lemma
(modifies s h h)
[SMTPat (modifies s h h)]
val modifies_goal_directed_refl (s:loc) (h:vale_heap) : Lemma
(modifies_goal_directed s h h)
[SMTPat (modifies_goal_directed s h h)]
val modifies_loc_includes (s1:loc) (h h':vale_heap) (s2:loc) : Lemma
(requires (modifies s2 h h' /\ loc_includes s1 s2))
(ensures (modifies s1 h h'))
// for efficiency, no SMT pattern
val modifies_trans (s12:loc) (h1 h2:vale_heap) (s23:loc) (h3:vale_heap) : Lemma
(requires (modifies s12 h1 h2 /\ modifies s23 h2 h3))
(ensures (modifies (loc_union s12 s23) h1 h3))
// for efficiency, no SMT pattern
// Prove (modifies s13 h1 h3).
// To avoid unnecessary matches, don't introduce any other modifies terms.
// Introduce modifies_goal_directed instead.
val modifies_goal_directed_trans (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies s13 h1 h3)]
val modifies_goal_directed_trans2 (s12:loc) (h1 h2:vale_heap) (s13:loc) (h3:vale_heap) : Lemma
(requires
modifies s12 h1 h2 /\
modifies_goal_directed s13 h2 h3 /\
loc_includes s13 s12
)
(ensures (modifies_goal_directed s13 h1 h3))
[SMTPat (modifies s12 h1 h2); SMTPat (modifies_goal_directed s13 h1 h3)]
val buffer_read (#t:base_typ) (b:buffer t) (i:int) (h:vale_heap) : Ghost (base_typ_as_vale_type t)
(requires True)
(ensures (fun v ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
v == Seq.index (buffer_as_seq h b) i
))
val buffer_write (#t:base_typ) (b:buffer t) (i:int) (v:base_typ_as_vale_type t) (h:vale_heap) : Ghost vale_heap
(requires buffer_readable h b /\ buffer_writeable b)
(ensures (fun h' ->
0 <= i /\ i < buffer_length b /\ buffer_readable h b ==>
modifies (loc_buffer b) h h' /\
get_heaplet_id h' == get_heaplet_id h /\
buffer_readable h' b /\
buffer_as_seq h' b == Seq.upd (buffer_as_seq h b) i v
))
val valid_mem64 (ptr:int) (h:vale_heap) : GTot bool // is there a 64-bit word at address ptr?
val writeable_mem64 (ptr:int) (h:vale_heap) : GTot bool // can we write a 64-bit word at address ptr?
val load_mem64 (ptr:int) (h:vale_heap) : GTot nat64 // the 64-bit word at ptr (if valid_mem64 holds)
val store_mem64 (ptr:int) (v:nat64) (h:vale_heap) : GTot vale_heap
val valid_mem128 (ptr:int) (h:vale_heap) : GTot bool
val writeable_mem128 (ptr:int) (h:vale_heap) : GTot bool
val load_mem128 (ptr:int) (h:vale_heap) : GTot quad32
val store_mem128 (ptr:int) (v:quad32) (h:vale_heap) : GTot vale_heap
val lemma_valid_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_writeable_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem64 (buffer_addr b h + scale8 i) h
)
val lemma_load_mem64 (b:buffer64) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem64 (buffer_addr b h + scale8 i) h == buffer_read b i h
)
val lemma_store_mem64 (b:buffer64) (i:nat) (v:nat64) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem64 (buffer_addr b h + scale8 i) v h == buffer_write b i v h
)
val lemma_valid_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
valid_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_writeable_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
writeable_mem128 (buffer_addr b h + scale16 i) h
)
val lemma_load_mem128 (b:buffer128) (i:nat) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b
)
(ensures
load_mem128 (buffer_addr b h + scale16 i) h == buffer_read b i h
)
val lemma_store_mem128 (b:buffer128) (i:nat) (v:quad32) (h:vale_heap) : Lemma
(requires
i < Seq.length (buffer_as_seq h b) /\
buffer_readable h b /\
buffer_writeable b
)
(ensures
store_mem128 (buffer_addr b h + scale16 i) v h == buffer_write b i v h
)
//Memtaint related functions
type memtaint = memTaint_t
val valid_taint_buf (#t:base_typ) (b:buffer t) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0
let valid_taint_buf64 (b:buffer64) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn
let valid_taint_buf128 (b:buffer128) (h:vale_heap) (mt:memtaint) (tn:taint) : GTot prop0 =
valid_taint_buf b h mt tn
val lemma_valid_taint64
(b:buffer64)
(memTaint:memtaint)
(vale_heap:vale_heap)
(i:nat{i < buffer_length b})
(t:taint)
: Lemma
(requires valid_taint_buf64 b vale_heap memTaint t /\ buffer_readable vale_heap b)
(ensures (
let ptr = buffer_addr b vale_heap + scale8 i in
forall i'.{:pattern Map.sel memTaint i'} i' >= ptr /\ i' < ptr + 8 ==> Map.sel memTaint i' == t))
val lemma_valid_taint128
(b:buffer128)
(memTaint:memtaint)
(vale_heap:vale_heap)
(i:nat{i < buffer_length b})
(t:taint)
: Lemma
(requires valid_taint_buf128 b vale_heap memTaint t /\ buffer_readable vale_heap b)
(ensures (
let ptr = buffer_addr b vale_heap + scale16 i in
forall i'.{:pattern Map.sel memTaint i'} i' >= ptr /\ i' < ptr + 16 ==> Map.sel memTaint i' == t))
val same_memTaint64
(b:buffer64)
(mem0:vale_heap)
(mem1:vale_heap)
(memtaint0:memtaint)
(memtaint1:memtaint)
: Lemma
(requires (modifies (loc_buffer b) mem0 mem1 /\
(forall p.{:pattern Map.sel memtaint0 p \/ Map.sel memtaint1 p} Map.sel memtaint0 p == Map.sel memtaint1 p)))
(ensures memtaint0 == memtaint1)
val same_memTaint128
(b:buffer128)
(mem0:vale_heap)
(mem1:vale_heap)
(memtaint0:memtaint)
(memtaint1:memtaint)
: Lemma
(requires (modifies (loc_buffer b) mem0 mem1 /\
(forall p.{:pattern Map.sel memtaint0 p \/ Map.sel memtaint1 p} Map.sel memtaint0 p == Map.sel memtaint1 p)))
(ensures memtaint0 == memtaint1)
val modifies_valid_taint (#t:base_typ) (b:buffer t) (p:loc) (h h':vale_heap) (mt:memtaint) (tn:taint) : Lemma
(requires modifies p h h')
(ensures valid_taint_buf b h mt tn <==> valid_taint_buf b h' mt tn)
[SMTPat (modifies p h h'); SMTPat (valid_taint_buf b h' mt tn)]
val modifies_same_heaplet_id (l:loc) (h1 h2:vale_heap) : Lemma
(requires modifies l h1 h2)
(ensures get_heaplet_id h1 == get_heaplet_id h2)
[SMTPat (modifies l h1 h2); SMTPat (get_heaplet_id h2)]
// Buffers in different heaplets are disjoint
let buffer_info_disjoint (bi1 bi2:buffer_info) =
bi1.bi_typ =!= bi2.bi_typ \/ bi1.bi_heaplet =!= bi2.bi_heaplet ==>
loc_disjoint (loc_buffer bi1.bi_buffer) (loc_buffer bi2.bi_buffer) | {
"checked_file": "/",
"dependencies": [
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.Lib.Map16.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"Vale.Arch.HeapImpl.fsti.checked",
"prims.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked",
"FStar.BigOps.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.PPC64LE.Memory.fsti"
} | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Seqs_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Four_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words.Seq_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Arch.MachineHeap_s",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Heap",
"short_module": "H"
},
{
"abbrev": false,
"full_module": "Vale.Lib.BufferViewHelpers",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Down",
"short_module": "DV"
},
{
"abbrev": true,
"full_module": "LowStar.BufferView.Up",
"short_module": "UV"
},
{
"abbrev": false,
"full_module": "LowStar.ModifiesPat",
"short_module": null
},
{
"abbrev": true,
"full_module": "LowStar.Modifies",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "LowStar.Monotonic.Buffer",
"short_module": "MB"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "HST"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": true,
"full_module": "Vale.Interop",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Vale.Interop.Base",
"short_module": "IB"
},
{
"abbrev": false,
"full_module": "Vale.Interop.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Interop.Types",
"short_module": null
},
{
"abbrev": true,
"full_module": "Vale.Lib.Map16",
"short_module": "Map16"
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapImpl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | h: Vale.PPC64LE.Memory.vale_heap -> bs: FStar.Seq.Base.seq Vale.Arch.HeapImpl.buffer_info
-> Prims.logical | Prims.Tot | [
"total"
] | [] | [
"Vale.PPC64LE.Memory.vale_heap",
"FStar.Seq.Base.seq",
"Vale.Arch.HeapImpl.buffer_info",
"Prims.l_and",
"Prims.l_Forall",
"Prims.nat",
"Prims.l_imp",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.Seq.Base.length",
"Vale.PPC64LE.Memory.buffer_readable",
"Vale.Arch.HeapImpl.__proj__Mkbuffer_info__item__bi_typ",
"FStar.Seq.Base.index",
"Vale.Arch.HeapImpl.__proj__Mkbuffer_info__item__bi_buffer",
"Vale.PPC64LE.Memory.buffer_info_disjoint",
"Prims.logical"
] | [] | false | false | false | true | true | let init_heaplets_req (h: vale_heap) (bs: Seq.seq buffer_info) =
| (forall (i: nat). {:pattern (Seq.index bs i)}
i < Seq.length bs ==> buffer_readable h (Seq.index bs i).bi_buffer) /\
(forall (i1: nat) (i2: nat). {:pattern (Seq.index bs i1); (Seq.index bs i2)}
i1 < Seq.length bs /\ i2 < Seq.length bs ==>
buffer_info_disjoint (Seq.index bs i1) (Seq.index bs i2)) | false |
|
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.index | val index : Type0 | let index = (i:size_t{size_v i < 16}) | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 37,
"end_line": 26,
"start_col": 0,
"start_line": 26
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
let lanes = Spec.lanes
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
inline_for_extraction
let state (w:lanes) = lbuffer (uint32xN w) 16ul | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Lib.IntTypes.size_t",
"Prims.b2t",
"Prims.op_LessThan",
"Lib.IntTypes.size_v"
] | [] | false | false | false | true | true | let index =
| (i: size_t{size_v i < 16}) | false |
|
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.lanes | val lanes : Type0 | let lanes = Spec.lanes | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 19,
"start_col": 0,
"start_line": 19
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0" | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes"
] | [] | false | false | false | true | true | let lanes =
| Spec.lanes | false |
|
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.state | val state : w: Hacl.Impl.Chacha20.Core32xN.lanes -> Type0 | let state (w:lanes) = lbuffer (uint32xN w) 16ul | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 47,
"end_line": 24,
"start_col": 0,
"start_line": 24
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
let lanes = Spec.lanes
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | w: Hacl.Impl.Chacha20.Core32xN.lanes -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Chacha20.Core32xN.lanes",
"Lib.Buffer.lbuffer",
"Hacl.Impl.Chacha20.Core32xN.uint32xN",
"FStar.UInt32.__uint_to_t"
] | [] | false | false | false | true | true | let state (w: lanes) =
| lbuffer (uint32xN w) 16ul | false |
|
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.size_key | val size_key : Prims.int | let size_key = 32 | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 17,
"end_line": 18,
"start_col": 0,
"start_line": 18
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.int | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let size_key =
| 32 | false |
|
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.size_block | val size_block : Prims.int | let size_block = 64 | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 19,
"end_line": 19,
"start_col": 0,
"start_line": 19
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.int | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let size_block =
| 64 | false |
|
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.lanes | val lanes : Type0 | let lanes = n:width{n == 1 \/ n == 4 \/ n == 8} | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 47,
"end_line": 29,
"start_col": 0,
"start_line": 29
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block} | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Lib.IntVector.width",
"Prims.l_or",
"Prims.eq2",
"Prims.int"
] | [] | false | false | false | true | true | let lanes =
| n: width{n == 1 \/ n == 4 \/ n == 8} | false |
|
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.size_nonce | val size_nonce : Prims.int | let size_nonce = 12 | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 19,
"end_line": 20,
"start_col": 0,
"start_line": 20
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32 | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.int | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let size_nonce =
| 12 | false |
|
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.op_At | val op_At : f: (_: _ -> _) -> g: (_: _ -> _) -> x: _ -> _ | let op_At f g = fun x -> g (f x) | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 32,
"end_line": 38,
"start_col": 0,
"start_line": 38
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64) | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | f: (_: _ -> _) -> g: (_: _ -> _) -> x: _ -> _ | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let ( @ ) f g =
| fun x -> g (f x) | false |
|
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.double_round | val double_round (#w: lanes) : shuffle w | val double_round (#w: lanes) : shuffle w | let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 31,
"end_line": 77,
"start_col": 0,
"start_line": 76
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14 | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Spec.Chacha20.Vec.shuffle w | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes",
"Hacl.Spec.Chacha20.Vec.op_At",
"Hacl.Spec.Chacha20.Vec.state",
"Hacl.Spec.Chacha20.Vec.column_round",
"Hacl.Spec.Chacha20.Vec.diagonal_round",
"Hacl.Spec.Chacha20.Vec.shuffle"
] | [] | false | false | false | false | false | let double_round (#w: lanes) : shuffle w =
| column_round @ diagonal_round | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.rounds | val rounds (#w: lanes) (m: state w) : state w | val rounds (#w: lanes) (m: state w) : state w | let rounds (#w:lanes) (m:state w) : state w =
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round m))))))))) | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 39,
"end_line": 84,
"start_col": 0,
"start_line": 79
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14
let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round (* 2 rounds *) | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | m: Hacl.Spec.Chacha20.Vec.state w -> Hacl.Spec.Chacha20.Vec.state w | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes",
"Hacl.Spec.Chacha20.Vec.state",
"Hacl.Spec.Chacha20.Vec.double_round"
] | [] | false | false | false | false | false | let rounds (#w: lanes) (m: state w) : state w =
| double_round (double_round (double_round (double_round (double_round (double_round (double_round (double_round
(double_round (double_round m))))))))) | false |
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.uint32xN | val uint32xN : w: Hacl.Impl.Chacha20.Core32xN.lanes -> Type0 | let uint32xN (w:lanes) = vec_t U32 w | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 36,
"end_line": 22,
"start_col": 0,
"start_line": 22
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
let lanes = Spec.lanes | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | w: Hacl.Impl.Chacha20.Core32xN.lanes -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Chacha20.Core32xN.lanes",
"Lib.IntVector.vec_t",
"Lib.IntTypes.U32"
] | [] | false | false | false | true | true | let uint32xN (w: lanes) =
| vec_t U32 w | false |
|
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.create_state | val create_state: w:lanes -> StackInline (state w)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (vec_zero U32 w) /\
stack_allocated r h0 h1 (Seq.create 16 (vec_zero U32 w)))) | val create_state: w:lanes -> StackInline (state w)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (vec_zero U32 w) /\
stack_allocated r h0 h1 (Seq.create 16 (vec_zero U32 w)))) | let create_state w = create (size 16) (vec_zero U32 w) | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 54,
"end_line": 34,
"start_col": 0,
"start_line": 34
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
let lanes = Spec.lanes
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
inline_for_extraction
let state (w:lanes) = lbuffer (uint32xN w) 16ul
inline_for_extraction
let index = (i:size_t{size_v i < 16})
inline_for_extraction noextract
val create_state: w:lanes -> StackInline (state w)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (vec_zero U32 w) /\ | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | w: Hacl.Impl.Chacha20.Core32xN.lanes
-> FStar.HyperStack.ST.StackInline (Hacl.Impl.Chacha20.Core32xN.state w) | FStar.HyperStack.ST.StackInline | [] | [] | [
"Hacl.Impl.Chacha20.Core32xN.lanes",
"Lib.Buffer.create",
"Hacl.Impl.Chacha20.Core32xN.uint32xN",
"Lib.IntTypes.size",
"Lib.IntVector.vec_zero",
"Lib.IntTypes.U32",
"Lib.Buffer.lbuffer",
"Hacl.Impl.Chacha20.Core32xN.state"
] | [] | false | true | false | false | false | let create_state w =
| create (size 16) (vec_zero U32 w) | false |
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.copy_state | val copy_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == as_seq h0 ost)) | val copy_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == as_seq h0 ost)) | let copy_state #w st ost = copy st ost | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 38,
"end_line": 59,
"start_col": 0,
"start_line": 59
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
let lanes = Spec.lanes
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
inline_for_extraction
let state (w:lanes) = lbuffer (uint32xN w) 16ul
inline_for_extraction
let index = (i:size_t{size_v i < 16})
inline_for_extraction noextract
val create_state: w:lanes -> StackInline (state w)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (vec_zero U32 w) /\
stack_allocated r h0 h1 (Seq.create 16 (vec_zero U32 w))))
let create_state w = create (size 16) (vec_zero U32 w)
inline_for_extraction noextract
val add_counter:
#w:lanes
-> st:state w
-> c:size_t{w * v c <= max_size_t} ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.add_counter #w (v c) (as_seq h0 st)))
let add_counter #w st c =
let v = vec_load #U32 (u32 w *! size_to_uint32 c) w in
let old_c = st.(12ul) in
st.(size 12) <- old_c +| v
inline_for_extraction noextract
val copy_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\ | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | st: Hacl.Impl.Chacha20.Core32xN.state w -> ost: Hacl.Impl.Chacha20.Core32xN.state w
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.Chacha20.Core32xN.lanes",
"Hacl.Impl.Chacha20.Core32xN.state",
"Lib.Buffer.copy",
"Lib.Buffer.MUT",
"Hacl.Impl.Chacha20.Core32xN.uint32xN",
"FStar.UInt32.__uint_to_t",
"Prims.unit"
] | [] | false | true | false | false | false | let copy_state #w st ost =
| copy st ost | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.c1 | val c1 : FStar.UInt32.t | let c1 = 0x3320646eul | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 21,
"end_line": 102,
"start_col": 0,
"start_line": 102
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14
let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round (* 2 rounds *)
let rounds (#w:lanes) (m:state w) : state w =
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round m)))))))))
let sum_state (#w:lanes) (st1:state w) (st2:state w) : state w =
map2 (+|) st1 st2
let add_counter (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (st:state w) : state w =
let cv = vec_load (u32 w *! u32 ctr) w in
st.[12] <- st.[12] +| cv
let chacha20_core (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (s0:state w) : state w =
let k = add_counter ctr s0 in
let k = rounds k in
let k = sum_state k s0 in
add_counter ctr k
inline_for_extraction
let c0 = 0x61707865ul | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.UInt32.t | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt32.__uint_to_t"
] | [] | false | false | false | true | false | let c1 =
| 0x3320646eul | false |
|
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.c0 | val c0 : FStar.UInt32.t | let c0 = 0x61707865ul | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 21,
"end_line": 100,
"start_col": 0,
"start_line": 100
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14
let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round (* 2 rounds *)
let rounds (#w:lanes) (m:state w) : state w =
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round m)))))))))
let sum_state (#w:lanes) (st1:state w) (st2:state w) : state w =
map2 (+|) st1 st2
let add_counter (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (st:state w) : state w =
let cv = vec_load (u32 w *! u32 ctr) w in
st.[12] <- st.[12] +| cv
let chacha20_core (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (s0:state w) : state w =
let k = add_counter ctr s0 in
let k = rounds k in
let k = sum_state k s0 in
add_counter ctr k | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.UInt32.t | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt32.__uint_to_t"
] | [] | false | false | false | true | false | let c0 =
| 0x61707865ul | false |
|
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.chacha20_core | val chacha20_core (#w: lanes) (ctr: counter{w * ctr <= max_size_t}) (s0: state w) : state w | val chacha20_core (#w: lanes) (ctr: counter{w * ctr <= max_size_t}) (s0: state w) : state w | let chacha20_core (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (s0:state w) : state w =
let k = add_counter ctr s0 in
let k = rounds k in
let k = sum_state k s0 in
add_counter ctr k | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 19,
"end_line": 97,
"start_col": 0,
"start_line": 93
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14
let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round (* 2 rounds *)
let rounds (#w:lanes) (m:state w) : state w =
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round m)))))))))
let sum_state (#w:lanes) (st1:state w) (st2:state w) : state w =
map2 (+|) st1 st2
let add_counter (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (st:state w) : state w =
let cv = vec_load (u32 w *! u32 ctr) w in
st.[12] <- st.[12] +| cv | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
ctr: Hacl.Spec.Chacha20.Vec.counter{w * ctr <= Lib.IntTypes.max_size_t} ->
s0: Hacl.Spec.Chacha20.Vec.state w
-> Hacl.Spec.Chacha20.Vec.state w | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes",
"Hacl.Spec.Chacha20.Vec.counter",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.Mul.op_Star",
"Lib.IntTypes.max_size_t",
"Hacl.Spec.Chacha20.Vec.state",
"Hacl.Spec.Chacha20.Vec.add_counter",
"Hacl.Spec.Chacha20.Vec.sum_state",
"Hacl.Spec.Chacha20.Vec.rounds"
] | [] | false | false | false | false | false | let chacha20_core (#w: lanes) (ctr: counter{w * ctr <= max_size_t}) (s0: state w) : state w =
| let k = add_counter ctr s0 in
let k = rounds k in
let k = sum_state k s0 in
add_counter ctr k | false |
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.sum_state | val sum_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ eq_or_disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.sum_state (as_seq h0 st) (as_seq h0 ost))) | val sum_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ eq_or_disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.sum_state (as_seq h0 st) (as_seq h0 ost))) | let sum_state #w st ost = map2T (size 16) st ( +| ) st ost | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 59,
"end_line": 70,
"start_col": 0,
"start_line": 70
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
let lanes = Spec.lanes
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
inline_for_extraction
let state (w:lanes) = lbuffer (uint32xN w) 16ul
inline_for_extraction
let index = (i:size_t{size_v i < 16})
inline_for_extraction noextract
val create_state: w:lanes -> StackInline (state w)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (vec_zero U32 w) /\
stack_allocated r h0 h1 (Seq.create 16 (vec_zero U32 w))))
let create_state w = create (size 16) (vec_zero U32 w)
inline_for_extraction noextract
val add_counter:
#w:lanes
-> st:state w
-> c:size_t{w * v c <= max_size_t} ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.add_counter #w (v c) (as_seq h0 st)))
let add_counter #w st c =
let v = vec_load #U32 (u32 w *! size_to_uint32 c) w in
let old_c = st.(12ul) in
st.(size 12) <- old_c +| v
inline_for_extraction noextract
val copy_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == as_seq h0 ost))
let copy_state #w st ost = copy st ost
inline_for_extraction noextract
val sum_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ eq_or_disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\ | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | st: Hacl.Impl.Chacha20.Core32xN.state w -> ost: Hacl.Impl.Chacha20.Core32xN.state w
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.Chacha20.Core32xN.lanes",
"Hacl.Impl.Chacha20.Core32xN.state",
"Lib.Buffer.map2T",
"Lib.Buffer.MUT",
"Hacl.Impl.Chacha20.Core32xN.uint32xN",
"Lib.IntTypes.size",
"Lib.IntVector.op_Plus_Bar",
"Lib.IntTypes.U32",
"Prims.unit"
] | [] | false | true | false | false | false | let sum_state #w st ost =
| map2T (size 16) st ( +| ) st ost | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.uint32xN | val uint32xN : w: Hacl.Spec.Chacha20.Vec.lanes -> Type0 | let uint32xN (w:lanes) = vec_t U32 w | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 36,
"end_line": 31,
"start_col": 0,
"start_line": 31
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8} | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | w: Hacl.Spec.Chacha20.Vec.lanes -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes",
"Lib.IntVector.vec_t",
"Lib.IntTypes.U32"
] | [] | false | false | false | true | true | let uint32xN (w: lanes) =
| vec_t U32 w | false |
|
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.c2 | val c2 : FStar.UInt32.t | let c2 = 0x79622d32ul | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 21,
"end_line": 104,
"start_col": 0,
"start_line": 104
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14
let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round (* 2 rounds *)
let rounds (#w:lanes) (m:state w) : state w =
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round m)))))))))
let sum_state (#w:lanes) (st1:state w) (st2:state w) : state w =
map2 (+|) st1 st2
let add_counter (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (st:state w) : state w =
let cv = vec_load (u32 w *! u32 ctr) w in
st.[12] <- st.[12] +| cv
let chacha20_core (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (s0:state w) : state w =
let k = add_counter ctr s0 in
let k = rounds k in
let k = sum_state k s0 in
add_counter ctr k
inline_for_extraction
let c0 = 0x61707865ul
inline_for_extraction
let c1 = 0x3320646eul | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.UInt32.t | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt32.__uint_to_t"
] | [] | false | false | false | true | false | let c2 =
| 0x79622d32ul | false |
|
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.c3 | val c3 : FStar.UInt32.t | let c3 = 0x6b206574ul | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 21,
"end_line": 106,
"start_col": 0,
"start_line": 106
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14
let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round (* 2 rounds *)
let rounds (#w:lanes) (m:state w) : state w =
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round m)))))))))
let sum_state (#w:lanes) (st1:state w) (st2:state w) : state w =
map2 (+|) st1 st2
let add_counter (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (st:state w) : state w =
let cv = vec_load (u32 w *! u32 ctr) w in
st.[12] <- st.[12] +| cv
let chacha20_core (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (s0:state w) : state w =
let k = add_counter ctr s0 in
let k = rounds k in
let k = sum_state k s0 in
add_counter ctr k
inline_for_extraction
let c0 = 0x61707865ul
inline_for_extraction
let c1 = 0x3320646eul
inline_for_extraction
let c2 = 0x79622d32ul | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | FStar.UInt32.t | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt32.__uint_to_t"
] | [] | false | false | false | true | false | let c3 =
| 0x6b206574ul | false |
|
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.add_counter | val add_counter:
#w:lanes
-> st:state w
-> c:size_t{w * v c <= max_size_t} ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.add_counter #w (v c) (as_seq h0 st))) | val add_counter:
#w:lanes
-> st:state w
-> c:size_t{w * v c <= max_size_t} ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.add_counter #w (v c) (as_seq h0 st))) | let add_counter #w st c =
let v = vec_load #U32 (u32 w *! size_to_uint32 c) w in
let old_c = st.(12ul) in
st.(size 12) <- old_c +| v | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 28,
"end_line": 48,
"start_col": 0,
"start_line": 45
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
let lanes = Spec.lanes
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
inline_for_extraction
let state (w:lanes) = lbuffer (uint32xN w) 16ul
inline_for_extraction
let index = (i:size_t{size_v i < 16})
inline_for_extraction noextract
val create_state: w:lanes -> StackInline (state w)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (vec_zero U32 w) /\
stack_allocated r h0 h1 (Seq.create 16 (vec_zero U32 w))))
let create_state w = create (size 16) (vec_zero U32 w)
inline_for_extraction noextract
val add_counter:
#w:lanes
-> st:state w
-> c:size_t{w * v c <= max_size_t} ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\ | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
st: Hacl.Impl.Chacha20.Core32xN.state w ->
c: Lib.IntTypes.size_t{w * Lib.IntTypes.v c <= Lib.IntTypes.max_size_t}
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.Chacha20.Core32xN.lanes",
"Hacl.Impl.Chacha20.Core32xN.state",
"Lib.IntTypes.size_t",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.Mul.op_Star",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Lib.IntTypes.max_size_t",
"Lib.Buffer.op_Array_Assignment",
"Hacl.Impl.Chacha20.Core32xN.uint32xN",
"FStar.UInt32.__uint_to_t",
"Lib.IntTypes.size",
"Lib.IntVector.op_Plus_Bar",
"Prims.unit",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT",
"Lib.IntVector.vec_t",
"Prims.eq2",
"Lib.Sequence.lseq",
"Lib.IntTypes.int_t",
"Lib.IntTypes.SEC",
"Lib.IntVector.vec_v",
"Lib.Sequence.create",
"Lib.IntTypes.mul",
"Lib.IntTypes.mk_int",
"Lib.IntTypes.size_to_uint32",
"Lib.IntVector.vec_load",
"Lib.IntTypes.op_Star_Bang",
"Lib.IntTypes.u32"
] | [] | false | true | false | false | false | let add_counter #w st c =
| let v = vec_load #U32 (u32 w *! size_to_uint32 c) w in
let old_c = st.(12ul) in
st.(size 12) <- old_c +| v | false |
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.line | val line:
#w:lanes
-> st:state w
-> a:index -> b:index -> d:index
-> r:rotval U32 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.line (v a) (v b) (v d) r (as_seq h0 st))) | val line:
#w:lanes
-> st:state w
-> a:index -> b:index -> d:index
-> r:rotval U32 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.line (v a) (v b) (v d) r (as_seq h0 st))) | let line #w st a b d r =
st.(a) <- st.(a) +| st.(b);
let std = st.(d) ^| st.(a) in
st.(d) <- std <<<| r | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 162,
"start_col": 0,
"start_line": 159
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
let lanes = Spec.lanes
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
inline_for_extraction
let state (w:lanes) = lbuffer (uint32xN w) 16ul
inline_for_extraction
let index = (i:size_t{size_v i < 16})
inline_for_extraction noextract
val create_state: w:lanes -> StackInline (state w)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (vec_zero U32 w) /\
stack_allocated r h0 h1 (Seq.create 16 (vec_zero U32 w))))
let create_state w = create (size 16) (vec_zero U32 w)
inline_for_extraction noextract
val add_counter:
#w:lanes
-> st:state w
-> c:size_t{w * v c <= max_size_t} ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.add_counter #w (v c) (as_seq h0 st)))
let add_counter #w st c =
let v = vec_load #U32 (u32 w *! size_to_uint32 c) w in
let old_c = st.(12ul) in
st.(size 12) <- old_c +| v
inline_for_extraction noextract
val copy_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == as_seq h0 ost))
let copy_state #w st ost = copy st ost
inline_for_extraction noextract
val sum_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ eq_or_disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.sum_state (as_seq h0 st) (as_seq h0 ost)))
let sum_state #w st ost = map2T (size 16) st ( +| ) st ost
inline_for_extraction noextract
val transpose1: st:state 1 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose1 (as_seq h0 st)))
let transpose1 st = ()
inline_for_extraction noextract
val transpose4: st:state 4 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose4 (as_seq h0 st)))
let transpose4 st =
let (st0, st1, st2, st3) = (st.(0ul),st.(1ul),st.(2ul),st.(3ul)) in
let (st4, st5, st6, st7) = (st.(4ul),st.(5ul),st.(6ul),st.(7ul)) in
let (st8, st9, st10, st11) = (st.(8ul),st.(9ul),st.(10ul),st.(11ul)) in
let (st12, st13, st14, st15) = (st.(12ul),st.(13ul),st.(14ul),st.(15ul)) in
let (v0,v1,v2,v3) = VecTranspose.transpose4x4 (st0, st1, st2, st3) in
let (v4,v5,v6,v7) = VecTranspose.transpose4x4 (st4, st5, st6, st7) in
let (v8,v9,v10,v11) = VecTranspose.transpose4x4 (st8, st9, st10, st11) in
let (v12,v13,v14,v15) = VecTranspose.transpose4x4 (st12, st13, st14, st15) in
create16 #(uint32xN 4) st v0 v4 v8 v12 v1 v5 v9 v13 v2 v6 v10 v14 v3 v7 v11 v15
inline_for_extraction noextract
val transpose8: st:state 8 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose8 (as_seq h0 st)))
let transpose8 st =
let (st0,st1,st2,st3,st4,st5,st6,st7) = (st.(0ul),st.(1ul),st.(2ul),st.(3ul),st.(4ul),st.(5ul),st.(6ul),st.(7ul)) in
let (st8,st9,st10,st11,st12,st13,st14,st15) = (st.(8ul),st.(9ul),st.(10ul),st.(11ul),st.(12ul),st.(13ul),st.(14ul),st.(15ul)) in
let (v0,v1,v2,v3,v4,v5,v6,v7) = VecTranspose.transpose8x8 (st0,st1,st2,st3,st4,st5,st6,st7) in
let (v8,v9,v10,v11,v12,v13,v14,v15) = VecTranspose.transpose8x8 (st8,st9,st10,st11,st12,st13,st14,st15) in
create16 #(uint32xN 8) st v0 v8 v1 v9 v2 v10 v3 v11 v4 v12 v5 v13 v6 v14 v7 v15
inline_for_extraction noextract
val transpose:
#w:lanes
-> st:state w ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose (as_seq h0 st)))
let transpose #w st =
match w with
| 1 -> transpose1 st
| 4 -> transpose4 st
| 8 -> transpose8 st
inline_for_extraction noextract
val xor_block:
#w:lanes
-> o:lbuffer uint8 ((4ul *! size w) *! 16ul)
-> st:state w
-> b:lbuffer uint8 ((4ul *! size w) *! 16ul) ->
Stack unit
(requires (fun h -> live h o /\ live h st /\ live h b /\
disjoint st b /\ disjoint st o /\ eq_or_disjoint b o))
(ensures (fun h0 _ h1 -> modifies (loc st |+| loc o) h0 h1 /\
as_seq h1 o == Spec.xor_block #w (as_seq h0 st) (as_seq h0 b)))
let xor_block #w o st b =
let h0 = ST.get () in
map_blocks_multi h0 (size w *! 4ul) 16ul b o
(fun h -> Spec.xor_block_f #w (as_seq h0 st))
(fun i ->
[@inline_let]
let bs = normalize_term (size w *! 4ul) in
let x = vec_load_le U32 w (sub b (i *! bs) bs) in
let y = x ^| st.(i) in
vec_store_le #U32 #w (sub o (i *! bs) bs) y
)
inline_for_extraction noextract
val line:
#w:lanes
-> st:state w
-> a:index -> b:index -> d:index
-> r:rotval U32 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\ | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
st: Hacl.Impl.Chacha20.Core32xN.state w ->
a: Hacl.Impl.Chacha20.Core32xN.index ->
b: Hacl.Impl.Chacha20.Core32xN.index ->
d: Hacl.Impl.Chacha20.Core32xN.index ->
r: Lib.IntTypes.rotval Lib.IntTypes.U32
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.Chacha20.Core32xN.lanes",
"Hacl.Impl.Chacha20.Core32xN.state",
"Hacl.Impl.Chacha20.Core32xN.index",
"Lib.IntTypes.rotval",
"Lib.IntTypes.U32",
"Lib.Buffer.op_Array_Assignment",
"Hacl.Impl.Chacha20.Core32xN.uint32xN",
"FStar.UInt32.__uint_to_t",
"Lib.IntVector.op_Less_Less_Less_Bar",
"Prims.unit",
"Lib.IntVector.vec_t",
"Lib.IntVector.op_Hat_Bar",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT",
"Lib.IntVector.op_Plus_Bar"
] | [] | false | true | false | false | false | let line #w st a b d r =
| st.(a) <- st.(a) +| st.(b);
let std = st.(d) ^| st.(a) in
st.(d) <- std <<<| r | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.diagonal_round | val diagonal_round (#w: lanes) : shuffle w | val diagonal_round (#w: lanes) : shuffle w | let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14 | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 25,
"end_line": 74,
"start_col": 0,
"start_line": 70
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15 | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Spec.Chacha20.Vec.shuffle w | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes",
"Hacl.Spec.Chacha20.Vec.op_At",
"Hacl.Spec.Chacha20.Vec.state",
"Hacl.Spec.Chacha20.Vec.quarter_round",
"Hacl.Spec.Chacha20.Vec.shuffle"
] | [] | false | false | false | false | false | let diagonal_round (#w: lanes) : shuffle w =
| quarter_round 0 5 10 15 @ quarter_round 1 6 11 12 @ quarter_round 2 7 8 13 @ quarter_round 3 4 9 14 | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.column_round | val column_round (#w: lanes) : shuffle w | val column_round (#w: lanes) : shuffle w | let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15 | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 25,
"end_line": 68,
"start_col": 0,
"start_line": 64
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7) | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Hacl.Spec.Chacha20.Vec.shuffle w | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes",
"Hacl.Spec.Chacha20.Vec.op_At",
"Hacl.Spec.Chacha20.Vec.state",
"Hacl.Spec.Chacha20.Vec.quarter_round",
"Hacl.Spec.Chacha20.Vec.shuffle"
] | [] | false | false | false | false | false | let column_round (#w: lanes) : shuffle w =
| quarter_round 0 4 8 12 @ quarter_round 1 5 9 13 @ quarter_round 2 6 10 14 @ quarter_round 3 7 11 15 | false |
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.transpose | val transpose:
#w:lanes
-> st:state w ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose (as_seq h0 st))) | val transpose:
#w:lanes
-> st:state w ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose (as_seq h0 st))) | let transpose #w st =
match w with
| 1 -> transpose1 st
| 4 -> transpose4 st
| 8 -> transpose8 st | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 22,
"end_line": 124,
"start_col": 0,
"start_line": 120
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
let lanes = Spec.lanes
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
inline_for_extraction
let state (w:lanes) = lbuffer (uint32xN w) 16ul
inline_for_extraction
let index = (i:size_t{size_v i < 16})
inline_for_extraction noextract
val create_state: w:lanes -> StackInline (state w)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (vec_zero U32 w) /\
stack_allocated r h0 h1 (Seq.create 16 (vec_zero U32 w))))
let create_state w = create (size 16) (vec_zero U32 w)
inline_for_extraction noextract
val add_counter:
#w:lanes
-> st:state w
-> c:size_t{w * v c <= max_size_t} ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.add_counter #w (v c) (as_seq h0 st)))
let add_counter #w st c =
let v = vec_load #U32 (u32 w *! size_to_uint32 c) w in
let old_c = st.(12ul) in
st.(size 12) <- old_c +| v
inline_for_extraction noextract
val copy_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == as_seq h0 ost))
let copy_state #w st ost = copy st ost
inline_for_extraction noextract
val sum_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ eq_or_disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.sum_state (as_seq h0 st) (as_seq h0 ost)))
let sum_state #w st ost = map2T (size 16) st ( +| ) st ost
inline_for_extraction noextract
val transpose1: st:state 1 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose1 (as_seq h0 st)))
let transpose1 st = ()
inline_for_extraction noextract
val transpose4: st:state 4 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose4 (as_seq h0 st)))
let transpose4 st =
let (st0, st1, st2, st3) = (st.(0ul),st.(1ul),st.(2ul),st.(3ul)) in
let (st4, st5, st6, st7) = (st.(4ul),st.(5ul),st.(6ul),st.(7ul)) in
let (st8, st9, st10, st11) = (st.(8ul),st.(9ul),st.(10ul),st.(11ul)) in
let (st12, st13, st14, st15) = (st.(12ul),st.(13ul),st.(14ul),st.(15ul)) in
let (v0,v1,v2,v3) = VecTranspose.transpose4x4 (st0, st1, st2, st3) in
let (v4,v5,v6,v7) = VecTranspose.transpose4x4 (st4, st5, st6, st7) in
let (v8,v9,v10,v11) = VecTranspose.transpose4x4 (st8, st9, st10, st11) in
let (v12,v13,v14,v15) = VecTranspose.transpose4x4 (st12, st13, st14, st15) in
create16 #(uint32xN 4) st v0 v4 v8 v12 v1 v5 v9 v13 v2 v6 v10 v14 v3 v7 v11 v15
inline_for_extraction noextract
val transpose8: st:state 8 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose8 (as_seq h0 st)))
let transpose8 st =
let (st0,st1,st2,st3,st4,st5,st6,st7) = (st.(0ul),st.(1ul),st.(2ul),st.(3ul),st.(4ul),st.(5ul),st.(6ul),st.(7ul)) in
let (st8,st9,st10,st11,st12,st13,st14,st15) = (st.(8ul),st.(9ul),st.(10ul),st.(11ul),st.(12ul),st.(13ul),st.(14ul),st.(15ul)) in
let (v0,v1,v2,v3,v4,v5,v6,v7) = VecTranspose.transpose8x8 (st0,st1,st2,st3,st4,st5,st6,st7) in
let (v8,v9,v10,v11,v12,v13,v14,v15) = VecTranspose.transpose8x8 (st8,st9,st10,st11,st12,st13,st14,st15) in
create16 #(uint32xN 8) st v0 v8 v1 v9 v2 v10 v3 v11 v4 v12 v5 v13 v6 v14 v7 v15
inline_for_extraction noextract
val transpose:
#w:lanes
-> st:state w ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\ | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | st: Hacl.Impl.Chacha20.Core32xN.state w -> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.Chacha20.Core32xN.lanes",
"Hacl.Impl.Chacha20.Core32xN.state",
"Hacl.Impl.Chacha20.Core32xN.transpose1",
"Prims.unit",
"Hacl.Impl.Chacha20.Core32xN.transpose4",
"Hacl.Impl.Chacha20.Core32xN.transpose8"
] | [] | false | true | false | false | false | let transpose #w st =
| match w with
| 1 -> transpose1 st
| 4 -> transpose4 st
| 8 -> transpose8 st | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.sum_state | val sum_state (#w: lanes) (st1 st2: state w) : state w | val sum_state (#w: lanes) (st1 st2: state w) : state w | let sum_state (#w:lanes) (st1:state w) (st2:state w) : state w =
map2 (+|) st1 st2 | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 19,
"end_line": 87,
"start_col": 0,
"start_line": 86
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14
let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round (* 2 rounds *)
let rounds (#w:lanes) (m:state w) : state w =
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round m))))))))) | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | st1: Hacl.Spec.Chacha20.Vec.state w -> st2: Hacl.Spec.Chacha20.Vec.state w
-> Hacl.Spec.Chacha20.Vec.state w | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes",
"Hacl.Spec.Chacha20.Vec.state",
"Lib.Sequence.map2",
"Hacl.Spec.Chacha20.Vec.uint32xN",
"Lib.IntVector.op_Plus_Bar",
"Lib.IntTypes.U32"
] | [] | false | false | false | false | false | let sum_state (#w: lanes) (st1 st2: state w) : state w =
| map2 ( +| ) st1 st2 | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.line | val line (#w: lanes) (a b d: idx) (s: rotval U32) (m: state w) : state w | val line (#w: lanes) (a b d: idx) (s: rotval U32) (m: state w) : state w | let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 56,
"start_col": 0,
"start_line": 53
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x) | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
a: Hacl.Spec.Chacha20.Vec.idx ->
b: Hacl.Spec.Chacha20.Vec.idx ->
d: Hacl.Spec.Chacha20.Vec.idx ->
s: Lib.IntTypes.rotval Lib.IntTypes.U32 ->
m: Hacl.Spec.Chacha20.Vec.state w
-> Hacl.Spec.Chacha20.Vec.state w | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes",
"Hacl.Spec.Chacha20.Vec.idx",
"Lib.IntTypes.rotval",
"Lib.IntTypes.U32",
"Hacl.Spec.Chacha20.Vec.state",
"Lib.Sequence.lseq",
"Hacl.Spec.Chacha20.Vec.uint32xN",
"Prims.l_and",
"Prims.eq2",
"FStar.Seq.Base.seq",
"Lib.Sequence.to_seq",
"FStar.Seq.Base.upd",
"Lib.IntVector.op_Less_Less_Less_Bar",
"Lib.IntVector.op_Hat_Bar",
"Lib.Sequence.index",
"Prims.l_Forall",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_Subtraction",
"Prims.pow2",
"Prims.l_imp",
"Prims.op_LessThan",
"Prims.op_disEquality",
"Prims.l_or",
"FStar.Seq.Base.index",
"Lib.Sequence.op_String_Assignment",
"Lib.Sequence.op_String_Access",
"Lib.IntVector.op_Plus_Bar"
] | [] | false | false | false | false | false | let line (#w: lanes) (a b d: idx) (s: rotval U32) (m: state w) : state w =
| let m = m.[ a ] <- m.[ a ] +| m.[ b ] in
let m = m.[ d ] <- (m.[ d ] ^| m.[ a ]) <<<| s in
m | false |
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.quarter_round | val quarter_round:
#w:lanes
-> st:state w
-> a:index -> b:index -> c:index -> d:index ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.quarter_round (v a) (v b) (v c) (v d) (as_seq h0 st))) | val quarter_round:
#w:lanes
-> st:state w
-> a:index -> b:index -> c:index -> d:index ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.quarter_round (v a) (v b) (v c) (v d) (as_seq h0 st))) | let quarter_round #w st a b c d =
line st a b d (size 16);
line st c d b (size 12);
line st a b d (size 8);
line st c d b (size 7) | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 24,
"end_line": 177,
"start_col": 0,
"start_line": 173
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
let lanes = Spec.lanes
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
inline_for_extraction
let state (w:lanes) = lbuffer (uint32xN w) 16ul
inline_for_extraction
let index = (i:size_t{size_v i < 16})
inline_for_extraction noextract
val create_state: w:lanes -> StackInline (state w)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (vec_zero U32 w) /\
stack_allocated r h0 h1 (Seq.create 16 (vec_zero U32 w))))
let create_state w = create (size 16) (vec_zero U32 w)
inline_for_extraction noextract
val add_counter:
#w:lanes
-> st:state w
-> c:size_t{w * v c <= max_size_t} ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.add_counter #w (v c) (as_seq h0 st)))
let add_counter #w st c =
let v = vec_load #U32 (u32 w *! size_to_uint32 c) w in
let old_c = st.(12ul) in
st.(size 12) <- old_c +| v
inline_for_extraction noextract
val copy_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == as_seq h0 ost))
let copy_state #w st ost = copy st ost
inline_for_extraction noextract
val sum_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ eq_or_disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.sum_state (as_seq h0 st) (as_seq h0 ost)))
let sum_state #w st ost = map2T (size 16) st ( +| ) st ost
inline_for_extraction noextract
val transpose1: st:state 1 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose1 (as_seq h0 st)))
let transpose1 st = ()
inline_for_extraction noextract
val transpose4: st:state 4 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose4 (as_seq h0 st)))
let transpose4 st =
let (st0, st1, st2, st3) = (st.(0ul),st.(1ul),st.(2ul),st.(3ul)) in
let (st4, st5, st6, st7) = (st.(4ul),st.(5ul),st.(6ul),st.(7ul)) in
let (st8, st9, st10, st11) = (st.(8ul),st.(9ul),st.(10ul),st.(11ul)) in
let (st12, st13, st14, st15) = (st.(12ul),st.(13ul),st.(14ul),st.(15ul)) in
let (v0,v1,v2,v3) = VecTranspose.transpose4x4 (st0, st1, st2, st3) in
let (v4,v5,v6,v7) = VecTranspose.transpose4x4 (st4, st5, st6, st7) in
let (v8,v9,v10,v11) = VecTranspose.transpose4x4 (st8, st9, st10, st11) in
let (v12,v13,v14,v15) = VecTranspose.transpose4x4 (st12, st13, st14, st15) in
create16 #(uint32xN 4) st v0 v4 v8 v12 v1 v5 v9 v13 v2 v6 v10 v14 v3 v7 v11 v15
inline_for_extraction noextract
val transpose8: st:state 8 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose8 (as_seq h0 st)))
let transpose8 st =
let (st0,st1,st2,st3,st4,st5,st6,st7) = (st.(0ul),st.(1ul),st.(2ul),st.(3ul),st.(4ul),st.(5ul),st.(6ul),st.(7ul)) in
let (st8,st9,st10,st11,st12,st13,st14,st15) = (st.(8ul),st.(9ul),st.(10ul),st.(11ul),st.(12ul),st.(13ul),st.(14ul),st.(15ul)) in
let (v0,v1,v2,v3,v4,v5,v6,v7) = VecTranspose.transpose8x8 (st0,st1,st2,st3,st4,st5,st6,st7) in
let (v8,v9,v10,v11,v12,v13,v14,v15) = VecTranspose.transpose8x8 (st8,st9,st10,st11,st12,st13,st14,st15) in
create16 #(uint32xN 8) st v0 v8 v1 v9 v2 v10 v3 v11 v4 v12 v5 v13 v6 v14 v7 v15
inline_for_extraction noextract
val transpose:
#w:lanes
-> st:state w ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose (as_seq h0 st)))
let transpose #w st =
match w with
| 1 -> transpose1 st
| 4 -> transpose4 st
| 8 -> transpose8 st
inline_for_extraction noextract
val xor_block:
#w:lanes
-> o:lbuffer uint8 ((4ul *! size w) *! 16ul)
-> st:state w
-> b:lbuffer uint8 ((4ul *! size w) *! 16ul) ->
Stack unit
(requires (fun h -> live h o /\ live h st /\ live h b /\
disjoint st b /\ disjoint st o /\ eq_or_disjoint b o))
(ensures (fun h0 _ h1 -> modifies (loc st |+| loc o) h0 h1 /\
as_seq h1 o == Spec.xor_block #w (as_seq h0 st) (as_seq h0 b)))
let xor_block #w o st b =
let h0 = ST.get () in
map_blocks_multi h0 (size w *! 4ul) 16ul b o
(fun h -> Spec.xor_block_f #w (as_seq h0 st))
(fun i ->
[@inline_let]
let bs = normalize_term (size w *! 4ul) in
let x = vec_load_le U32 w (sub b (i *! bs) bs) in
let y = x ^| st.(i) in
vec_store_le #U32 #w (sub o (i *! bs) bs) y
)
inline_for_extraction noextract
val line:
#w:lanes
-> st:state w
-> a:index -> b:index -> d:index
-> r:rotval U32 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.line (v a) (v b) (v d) r (as_seq h0 st)))
let line #w st a b d r =
st.(a) <- st.(a) +| st.(b);
let std = st.(d) ^| st.(a) in
st.(d) <- std <<<| r
inline_for_extraction noextract
val quarter_round:
#w:lanes
-> st:state w
-> a:index -> b:index -> c:index -> d:index ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\ | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
st: Hacl.Impl.Chacha20.Core32xN.state w ->
a: Hacl.Impl.Chacha20.Core32xN.index ->
b: Hacl.Impl.Chacha20.Core32xN.index ->
c: Hacl.Impl.Chacha20.Core32xN.index ->
d: Hacl.Impl.Chacha20.Core32xN.index
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.Chacha20.Core32xN.lanes",
"Hacl.Impl.Chacha20.Core32xN.state",
"Hacl.Impl.Chacha20.Core32xN.index",
"Hacl.Impl.Chacha20.Core32xN.line",
"Lib.IntTypes.size",
"Prims.unit"
] | [] | false | true | false | false | false | let quarter_round #w st a b c d =
| line st a b d (size 16);
line st c d b (size 12);
line st a b d (size 8);
line st c d b (size 7) | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.add_counter | val add_counter (#w: lanes) (ctr: counter{w * ctr <= max_size_t}) (st: state w) : state w | val add_counter (#w: lanes) (ctr: counter{w * ctr <= max_size_t}) (st: state w) : state w | let add_counter (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (st:state w) : state w =
let cv = vec_load (u32 w *! u32 ctr) w in
st.[12] <- st.[12] +| cv | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 26,
"end_line": 91,
"start_col": 0,
"start_line": 89
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14
let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round (* 2 rounds *)
let rounds (#w:lanes) (m:state w) : state w =
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round m)))))))))
let sum_state (#w:lanes) (st1:state w) (st2:state w) : state w =
map2 (+|) st1 st2 | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
ctr: Hacl.Spec.Chacha20.Vec.counter{w * ctr <= Lib.IntTypes.max_size_t} ->
st: Hacl.Spec.Chacha20.Vec.state w
-> Hacl.Spec.Chacha20.Vec.state w | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes",
"Hacl.Spec.Chacha20.Vec.counter",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.Mul.op_Star",
"Lib.IntTypes.max_size_t",
"Hacl.Spec.Chacha20.Vec.state",
"Lib.Sequence.op_String_Assignment",
"Hacl.Spec.Chacha20.Vec.uint32xN",
"Lib.IntVector.op_Plus_Bar",
"Lib.IntTypes.U32",
"Lib.Sequence.op_String_Access",
"Lib.IntVector.vec_t",
"Prims.eq2",
"Lib.Sequence.lseq",
"Lib.IntTypes.int_t",
"Lib.IntTypes.SEC",
"Lib.IntVector.vec_v",
"Lib.Sequence.create",
"Lib.IntTypes.mul",
"Lib.IntTypes.mk_int",
"Lib.IntVector.vec_load",
"Lib.IntTypes.op_Star_Bang",
"Lib.IntTypes.u32"
] | [] | false | false | false | false | false | let add_counter (#w: lanes) (ctr: counter{w * ctr <= max_size_t}) (st: state w) : state w =
| let cv = vec_load (u32 w *! u32 ctr) w in
st.[ 12 ] <- st.[ 12 ] +| cv | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.transpose_state | val transpose_state (#w: lanes) (st: state w) : lseq (lseq uint32 16) w | val transpose_state (#w: lanes) (st: state w) : lseq (lseq uint32 16) w | let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x) | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 6,
"end_line": 50,
"start_col": 0,
"start_line": 43
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | st: Hacl.Spec.Chacha20.Vec.state w -> Lib.Sequence.lseq (Lib.Sequence.lseq Lib.IntTypes.uint32 16) w | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes",
"Hacl.Spec.Chacha20.Vec.state",
"Lib.Sequence.createi",
"Lib.Sequence.lseq",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U32",
"Lib.IntTypes.SEC",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Lib.Sequence.create16",
"Lib.Sequence.op_String_Access",
"Lib.IntTypes.uint_t",
"Lib.IntVector.vec_v",
"Hacl.Spec.Chacha20.Vec.uint32xN",
"Lib.IntTypes.uint32"
] | [] | false | false | false | false | false | let transpose_state (#w: lanes) (st: state w) : lseq (lseq uint32 16) w =
| createi w
(fun i ->
let x:lseq uint32 16 =
create16 (vec_v st.[ 0 ]).[ i ] (vec_v st.[ 1 ]).[ i ] (vec_v st.[ 2 ]).[ i ]
(vec_v st.[ 3 ]).[ i ] (vec_v st.[ 4 ]).[ i ] (vec_v st.[ 5 ]).[ i ]
(vec_v st.[ 6 ]).[ i ] (vec_v st.[ 7 ]).[ i ] (vec_v st.[ 8 ]).[ i ]
(vec_v st.[ 9 ]).[ i ] (vec_v st.[ 10 ]).[ i ] (vec_v st.[ 11 ]).[ i ]
(vec_v st.[ 12 ]).[ i ] (vec_v st.[ 13 ]).[ i ] (vec_v st.[ 14 ]).[ i ]
(vec_v st.[ 15 ]).[ i ]
in
x) | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.chacha20_encrypt_bytes | val chacha20_encrypt_bytes:
#w:lanes
-> k: key
-> n: nonce
-> c: counter
-> msg: bytes{length msg <= max_size_t}
-> cipher: bytes{length cipher == length msg} | val chacha20_encrypt_bytes:
#w:lanes
-> k: key
-> n: nonce
-> c: counter
-> msg: bytes{length msg <= max_size_t}
-> cipher: bytes{length cipher == length msg} | let chacha20_encrypt_bytes #w key nonce ctr0 msg =
let st0 = chacha20_init #w key nonce ctr0 in
chacha20_update #w st0 msg | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 28,
"end_line": 209,
"start_col": 0,
"start_line": 207
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14
let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round (* 2 rounds *)
let rounds (#w:lanes) (m:state w) : state w =
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round m)))))))))
let sum_state (#w:lanes) (st1:state w) (st2:state w) : state w =
map2 (+|) st1 st2
let add_counter (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (st:state w) : state w =
let cv = vec_load (u32 w *! u32 ctr) w in
st.[12] <- st.[12] +| cv
let chacha20_core (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (s0:state w) : state w =
let k = add_counter ctr s0 in
let k = rounds k in
let k = sum_state k s0 in
add_counter ctr k
inline_for_extraction
let c0 = 0x61707865ul
inline_for_extraction
let c1 = 0x3320646eul
inline_for_extraction
let c2 = 0x79622d32ul
inline_for_extraction
let c3 = 0x6b206574ul
let chacha20_constants : lseq size_t 4 =
[@ inline_let]
let l = [c0;c1;c2;c3] in
assert_norm(List.Tot.length l == 4);
createL l
let setup1 (k:key) (n:nonce) (ctr0:counter) : lseq uint32 16 =
Scalar.setup k n ctr0 (create 16 (u32 0))
inline_for_extraction
let vec_load_i (#t:v_inttype) (w:width) (x:uint_t t SEC) = vec_load #t x w
let chacha20_init (#w:lanes) (k:key) (n:nonce) (ctr0:counter) : state w =
let st1 = setup1 k n ctr0 in
let st = map (vec_load_i w) st1 in
let c = vec_counter U32 w in
st.[12] <- st.[12] +| c
let transpose1 (st:state 1) : state 1 = st
let transpose4 (st:state 4) : state 4 =
let (v0,v1,v2,v3) = VecTranspose.transpose4x4 (st.[0],st.[1],st.[2],st.[3]) in
let (v4,v5,v6,v7) = VecTranspose.transpose4x4 (st.[4],st.[5],st.[6],st.[7]) in
let (v8,v9,v10,v11) = VecTranspose.transpose4x4 (st.[8],st.[9],st.[10],st.[11]) in
let (v12,v13,v14,v15) = VecTranspose.transpose4x4 (st.[12],st.[13],st.[14],st.[15]) in
create16 v0 v4 v8 v12 v1 v5 v9 v13 v2 v6 v10 v14 v3 v7 v11 v15
let transpose8 (st:state 8) : state 8 =
let (v0,v1,v2,v3,v4,v5,v6,v7) = VecTranspose.transpose8x8 (st.[0],st.[1],st.[2],st.[3],st.[4],st.[5],st.[6],st.[7]) in
let (v8,v9,v10,v11,v12,v13,v14,v15) = VecTranspose.transpose8x8 (st.[8],st.[9],st.[10],st.[11],st.[12],st.[13],st.[14],st.[15]) in
create16 v0 v8 v1 v9 v2 v10 v3 v11 v4 v12 v5 v13 v6 v14 v7 v15
let transpose (#w:lanes) (st:state w) : state w =
match w with
| 1 -> transpose1 st
| 4 -> transpose4 st
| 8 -> transpose8 st
// let store_block0 (#w:lanes) (st:state w) : Tot block1 =
// let bl = create 64 (u8 0) in
// repeati (16 / w)
// (fun i bl -> update_sub bl (i * w * 4) (w * 4) (vec_to_bytes_le st.[i])) bl
// let chacha20_key_block0 (#w:lanes) (k:key) (n:nonce) : Tot block1 =
// let st0 = chacha20_init #w k n 0 in
// let k = chacha20_core 0 st0 in
// store_block0 k
let xor_block_f (#w:lanes) (k:state w) (i:nat{i < 16}) (b:lbytes (w * 4)) : lbytes (w * 4) =
let x = vec_from_bytes_le U32 w b in
let y = x ^| k.[i] in
vec_to_bytes_le y
let xor_block (#w:lanes) (k:state w) (b:blocks w) : blocks w =
map_blocks_multi (w * 4) 16 16 b (xor_block_f #w k)
val chacha20_encrypt_block:
#w: lanes
-> st0: state w
-> incr: counter{incr * w <= max_size_t}
-> b: blocks w ->
Tot (blocks w)
let chacha20_encrypt_block #w st0 incr b =
let k = chacha20_core incr st0 in
let k = transpose k in
xor_block k b
val chacha20_encrypt_last:
#w: lanes
-> st0: state w
-> incr: counter{incr * w <= max_size_t}
-> len: size_nat{len < w * size_block}
-> b: lbytes len ->
Tot (lbytes len)
let chacha20_encrypt_last #w st0 incr len b =
let plain = create (w * size_block) (u8 0) in
let plain = update_sub plain 0 len b in
let cipher = chacha20_encrypt_block st0 incr plain in
sub cipher 0 len
val chacha20_update:
#w:lanes
-> st0: state w
-> msg: bytes{length msg <= max_size_t}
-> cipher: bytes{length cipher == length msg}
let chacha20_update #w st0 msg =
let cipher = msg in
map_blocks (w * size_block) cipher
(chacha20_encrypt_block st0)
(chacha20_encrypt_last st0)
val chacha20_encrypt_bytes:
#w:lanes
-> k: key
-> n: nonce
-> c: counter
-> msg: bytes{length msg <= max_size_t}
-> cipher: bytes{length cipher == length msg} | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
k: Hacl.Spec.Chacha20.Vec.key ->
n: Hacl.Spec.Chacha20.Vec.nonce ->
c: Hacl.Spec.Chacha20.Vec.counter ->
msg: Lib.ByteSequence.bytes{Lib.Sequence.length msg <= Lib.IntTypes.max_size_t}
-> cipher: Lib.ByteSequence.bytes{Lib.Sequence.length cipher == Lib.Sequence.length msg} | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.lanes",
"Hacl.Spec.Chacha20.Vec.key",
"Hacl.Spec.Chacha20.Vec.nonce",
"Hacl.Spec.Chacha20.Vec.counter",
"Lib.ByteSequence.bytes",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Lib.Sequence.length",
"Lib.IntTypes.uint_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Lib.IntTypes.max_size_t",
"Hacl.Spec.Chacha20.Vec.chacha20_update",
"Hacl.Spec.Chacha20.Vec.state",
"Hacl.Spec.Chacha20.Vec.chacha20_init",
"Prims.eq2",
"Prims.nat"
] | [] | false | false | false | false | false | let chacha20_encrypt_bytes #w key nonce ctr0 msg =
| let st0 = chacha20_init #w key nonce ctr0 in
chacha20_update #w st0 msg | false |
Hacl.Impl.Chacha20.Core32xN.fst | Hacl.Impl.Chacha20.Core32xN.transpose4 | val transpose4: st:state 4 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose4 (as_seq h0 st))) | val transpose4: st:state 4 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose4 (as_seq h0 st))) | let transpose4 st =
let (st0, st1, st2, st3) = (st.(0ul),st.(1ul),st.(2ul),st.(3ul)) in
let (st4, st5, st6, st7) = (st.(4ul),st.(5ul),st.(6ul),st.(7ul)) in
let (st8, st9, st10, st11) = (st.(8ul),st.(9ul),st.(10ul),st.(11ul)) in
let (st12, st13, st14, st15) = (st.(12ul),st.(13ul),st.(14ul),st.(15ul)) in
let (v0,v1,v2,v3) = VecTranspose.transpose4x4 (st0, st1, st2, st3) in
let (v4,v5,v6,v7) = VecTranspose.transpose4x4 (st4, st5, st6, st7) in
let (v8,v9,v10,v11) = VecTranspose.transpose4x4 (st8, st9, st10, st11) in
let (v12,v13,v14,v15) = VecTranspose.transpose4x4 (st12, st13, st14, st15) in
create16 #(uint32xN 4) st v0 v4 v8 v12 v1 v5 v9 v13 v2 v6 v10 v14 v3 v7 v11 v15 | {
"file_name": "code/chacha20/Hacl.Impl.Chacha20.Core32xN.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 81,
"end_line": 96,
"start_col": 0,
"start_line": 87
} | module Hacl.Impl.Chacha20.Core32xN
module ST = FStar.HyperStack.ST
open FStar.HyperStack
open FStar.HyperStack.All
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Lib.ByteBuffer
open Lib.IntVector
module Spec = Hacl.Spec.Chacha20.Vec
module VecTranspose = Lib.IntVector.Transpose
module LSeq = Lib.Sequence
#reset-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
let lanes = Spec.lanes
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
inline_for_extraction
let state (w:lanes) = lbuffer (uint32xN w) 16ul
inline_for_extraction
let index = (i:size_t{size_v i < 16})
inline_for_extraction noextract
val create_state: w:lanes -> StackInline (state w)
(requires (fun h -> True))
(ensures (fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (vec_zero U32 w) /\
stack_allocated r h0 h1 (Seq.create 16 (vec_zero U32 w))))
let create_state w = create (size 16) (vec_zero U32 w)
inline_for_extraction noextract
val add_counter:
#w:lanes
-> st:state w
-> c:size_t{w * v c <= max_size_t} ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.add_counter #w (v c) (as_seq h0 st)))
let add_counter #w st c =
let v = vec_load #U32 (u32 w *! size_to_uint32 c) w in
let old_c = st.(12ul) in
st.(size 12) <- old_c +| v
inline_for_extraction noextract
val copy_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == as_seq h0 ost))
let copy_state #w st ost = copy st ost
inline_for_extraction noextract
val sum_state:
#w:lanes
-> st:state w
-> ost:state w ->
Stack unit
(requires (fun h -> live h st /\ live h ost /\ eq_or_disjoint st ost))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.sum_state (as_seq h0 st) (as_seq h0 ost)))
let sum_state #w st ost = map2T (size 16) st ( +| ) st ost
inline_for_extraction noextract
val transpose1: st:state 1 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Spec.transpose1 (as_seq h0 st)))
let transpose1 st = ()
inline_for_extraction noextract
val transpose4: st:state 4 ->
Stack unit
(requires (fun h -> live h st))
(ensures (fun h0 _ h1 -> modifies (loc st) h0 h1 /\ | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"Meta.Attribute.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Chacha20.Vec.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Chacha20.Core32xN.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Chacha20.Vec",
"short_module": "Spec"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | st: Hacl.Impl.Chacha20.Core32xN.state 4 -> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.Chacha20.Core32xN.state",
"Lib.IntVector.vec_t",
"Lib.IntTypes.U32",
"Lib.Buffer.create16",
"Hacl.Impl.Chacha20.Core32xN.uint32xN",
"Prims.unit",
"Lib.IntVector.Transpose.vec_t4",
"Lib.IntVector.Transpose.transpose4x4",
"FStar.Pervasives.Native.Mktuple4",
"FStar.Pervasives.Native.tuple4",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT",
"FStar.UInt32.__uint_to_t"
] | [] | false | true | false | false | false | let transpose4 st =
| let st0, st1, st2, st3 = (st.(0ul), st.(1ul), st.(2ul), st.(3ul)) in
let st4, st5, st6, st7 = (st.(4ul), st.(5ul), st.(6ul), st.(7ul)) in
let st8, st9, st10, st11 = (st.(8ul), st.(9ul), st.(10ul), st.(11ul)) in
let st12, st13, st14, st15 = (st.(12ul), st.(13ul), st.(14ul), st.(15ul)) in
let v0, v1, v2, v3 = VecTranspose.transpose4x4 (st0, st1, st2, st3) in
let v4, v5, v6, v7 = VecTranspose.transpose4x4 (st4, st5, st6, st7) in
let v8, v9, v10, v11 = VecTranspose.transpose4x4 (st8, st9, st10, st11) in
let v12, v13, v14, v15 = VecTranspose.transpose4x4 (st12, st13, st14, st15) in
create16 #(uint32xN 4) st v0 v4 v8 v12 v1 v5 v9 v13 v2 v6 v10 v14 v3 v7 v11 v15 | false |
Vale.Lib.Tactics.fst | Vale.Lib.Tactics.tf | val tf (t: term) : Tot (term -> Tac unit) | val tf (t: term) : Tot (term -> Tac unit) | let tf (t : term) : Tot (term -> Tac unit) =
match unsquash_term t with
| None -> and_elim
| _ -> squash_and_elim | {
"file_name": "vale/code/lib/util/Vale.Lib.Tactics.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 24,
"end_line": 23,
"start_col": 0,
"start_line": 20
} | module Vale.Lib.Tactics
open FStar.Mul
open FStar.Tactics
open FStar.Tactics.Derived
open FStar.Reflection.Formula
(***** Tactic to destruct conjuctions in context *)
private val __squash_and_elim : (#p:Type) -> (#q:Type) -> (#phi:Type) ->
squash (p /\ q) ->
squash (p ==> q ==> phi) ->
Lemma phi
let __squash_and_elim #p #q #phi p_and_q f = ()
let squash_and_elim (t : term) : Tac unit =
let ae = `__squash_and_elim in
apply_lemma (mk_e_app ae [t]) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Derived.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Reflection.Formula.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Lib.Tactics.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Reflection.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Derived",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t: FStar.Stubs.Reflection.Types.term -> _: FStar.Stubs.Reflection.Types.term
-> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.term",
"FStar.Reflection.V1.Derived.unsquash_term",
"FStar.Tactics.V1.Logic.and_elim",
"FStar.Pervasives.Native.option",
"Vale.Lib.Tactics.squash_and_elim",
"Prims.unit"
] | [] | false | true | false | false | false | let tf (t: term) : Tot (term -> Tac unit) =
| match unsquash_term t with
| None -> and_elim
| _ -> squash_and_elim | false |
Vale.AES.X64.AESCTRplain.fst | Vale.AES.X64.AESCTRplain.va_lemma_Aes_ctr_loop_body | val va_lemma_Aes_ctr_loop_body : va_b0:va_code -> va_s0:va_state -> alg:algorithm ->
old_plain_ptr:nat64 -> old_out_ptr:nat64 -> old_num_quad_blocks:nat64 -> count:nat ->
plain_b:buffer128 -> out_b:buffer128 -> key:(seq nat32) -> round_keys:(seq quad32) ->
keys_b:buffer128 -> icb_BE:quad32 -> iv:quad32
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Aes_ctr_loop_body alg) va_s0 /\ va_get_ok va_s0 /\
(sse_enabled /\ (0 < va_get_reg64 rRdx va_s0 /\ va_get_reg64 rRdx va_s0 <= old_num_quad_blocks)
/\ count == old_num_quad_blocks - va_get_reg64 rRdx va_s0 /\ Vale.X64.Decls.validSrcAddrs128
(va_get_mem_heaplet 0 va_s0) old_plain_ptr plain_b (old_num_quad_blocks `op_Multiply` 4)
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 1
va_s0) old_out_ptr out_b (old_num_quad_blocks `op_Multiply` 4) (va_get_mem_layout va_s0) Secret
/\ va_get_reg64 rR9 va_s0 == old_plain_ptr + count `op_Multiply` 64 /\ va_get_reg64 rR10 va_s0
== old_out_ptr + count `op_Multiply` 64 /\ old_plain_ptr + old_num_quad_blocks `op_Multiply` 64
< pow2_64 /\ old_out_ptr + old_num_quad_blocks `op_Multiply` 64 < pow2_64 /\
Vale.X64.Decls.buffer_length #Vale.X64.Memory.vuint128 plain_b <= Vale.X64.Decls.buffer_length
#Vale.X64.Memory.vuint128 out_b /\ va_get_xmm 0 va_s0 == Vale.Def.Words_s.Mkfour
#Vale.Def.Types_s.nat32 67438087 66051 202182159 134810123 /\ va_get_xmm 15 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 4 0 4 0 /\ 4 `op_Multiply` count < pow2_32 - 4
/\ va_get_xmm 9 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count) 1)))
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count) 0))) /\ va_get_xmm 10 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count) 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count) 2))) /\ aes_reqs alg key round_keys keys_b (va_get_reg64 rR8 va_s0)
(va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) /\ iv ==
Vale.Def.Types_s.reverse_bytes_quad32 icb_BE /\ va_get_reg64 rRdi va_s0 == Vale.Arch.Types.lo64
iv /\ Vale.AES.GCTR.gctr_partial_def alg (4 `op_Multiply` count)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) plain_b)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 1 va_s0) out_b) key icb_BE)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(Vale.X64.Decls.modifies_buffer128 out_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1
va_sM) /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) old_plain_ptr plain_b
(old_num_quad_blocks `op_Multiply` 4) (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) old_out_ptr out_b
(old_num_quad_blocks `op_Multiply` 4) (va_get_mem_layout va_sM) Secret /\ va_get_reg64 rR9
va_sM == va_get_reg64 rR9 va_s0 + 64 /\ va_get_reg64 rR10 va_sM == va_get_reg64 rR10 va_s0 + 64
/\ va_get_reg64 rRdx va_sM == va_get_reg64 rRdx va_s0 - 1 /\ aes_reqs alg key round_keys keys_b
(va_get_reg64 rR8 va_sM) (va_get_mem_heaplet 0 va_sM) (va_get_mem_layout va_sM) /\ va_get_xmm 9
va_sM == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 1)))
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 0))) /\ va_get_xmm 10 va_sM ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count + 4) 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count + 4) 2))) /\ Vale.AES.GCTR.gctr_partial_def alg (4 `op_Multiply` count + 4)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) plain_b)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 1 va_sM) out_b) key icb_BE) /\ va_state_eq
va_sM (va_update_mem_heaplet 1 va_sM (va_update_flags va_sM (va_update_reg64 rR12 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rR9 va_sM
(va_update_xmm 7 va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM (va_update_xmm 12 va_sM
(va_update_xmm 2 va_sM (va_update_xmm 5 va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM
(va_update_xmm 6 va_sM (va_update_xmm 10 va_sM (va_update_xmm 9 va_sM (va_update_ok va_sM
(va_update_mem va_sM va_s0))))))))))))))))))))) | val va_lemma_Aes_ctr_loop_body : va_b0:va_code -> va_s0:va_state -> alg:algorithm ->
old_plain_ptr:nat64 -> old_out_ptr:nat64 -> old_num_quad_blocks:nat64 -> count:nat ->
plain_b:buffer128 -> out_b:buffer128 -> key:(seq nat32) -> round_keys:(seq quad32) ->
keys_b:buffer128 -> icb_BE:quad32 -> iv:quad32
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Aes_ctr_loop_body alg) va_s0 /\ va_get_ok va_s0 /\
(sse_enabled /\ (0 < va_get_reg64 rRdx va_s0 /\ va_get_reg64 rRdx va_s0 <= old_num_quad_blocks)
/\ count == old_num_quad_blocks - va_get_reg64 rRdx va_s0 /\ Vale.X64.Decls.validSrcAddrs128
(va_get_mem_heaplet 0 va_s0) old_plain_ptr plain_b (old_num_quad_blocks `op_Multiply` 4)
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 1
va_s0) old_out_ptr out_b (old_num_quad_blocks `op_Multiply` 4) (va_get_mem_layout va_s0) Secret
/\ va_get_reg64 rR9 va_s0 == old_plain_ptr + count `op_Multiply` 64 /\ va_get_reg64 rR10 va_s0
== old_out_ptr + count `op_Multiply` 64 /\ old_plain_ptr + old_num_quad_blocks `op_Multiply` 64
< pow2_64 /\ old_out_ptr + old_num_quad_blocks `op_Multiply` 64 < pow2_64 /\
Vale.X64.Decls.buffer_length #Vale.X64.Memory.vuint128 plain_b <= Vale.X64.Decls.buffer_length
#Vale.X64.Memory.vuint128 out_b /\ va_get_xmm 0 va_s0 == Vale.Def.Words_s.Mkfour
#Vale.Def.Types_s.nat32 67438087 66051 202182159 134810123 /\ va_get_xmm 15 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 4 0 4 0 /\ 4 `op_Multiply` count < pow2_32 - 4
/\ va_get_xmm 9 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count) 1)))
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count) 0))) /\ va_get_xmm 10 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count) 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count) 2))) /\ aes_reqs alg key round_keys keys_b (va_get_reg64 rR8 va_s0)
(va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) /\ iv ==
Vale.Def.Types_s.reverse_bytes_quad32 icb_BE /\ va_get_reg64 rRdi va_s0 == Vale.Arch.Types.lo64
iv /\ Vale.AES.GCTR.gctr_partial_def alg (4 `op_Multiply` count)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) plain_b)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 1 va_s0) out_b) key icb_BE)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(Vale.X64.Decls.modifies_buffer128 out_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1
va_sM) /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) old_plain_ptr plain_b
(old_num_quad_blocks `op_Multiply` 4) (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) old_out_ptr out_b
(old_num_quad_blocks `op_Multiply` 4) (va_get_mem_layout va_sM) Secret /\ va_get_reg64 rR9
va_sM == va_get_reg64 rR9 va_s0 + 64 /\ va_get_reg64 rR10 va_sM == va_get_reg64 rR10 va_s0 + 64
/\ va_get_reg64 rRdx va_sM == va_get_reg64 rRdx va_s0 - 1 /\ aes_reqs alg key round_keys keys_b
(va_get_reg64 rR8 va_sM) (va_get_mem_heaplet 0 va_sM) (va_get_mem_layout va_sM) /\ va_get_xmm 9
va_sM == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 1)))
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 0))) /\ va_get_xmm 10 va_sM ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count + 4) 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count + 4) 2))) /\ Vale.AES.GCTR.gctr_partial_def alg (4 `op_Multiply` count + 4)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) plain_b)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 1 va_sM) out_b) key icb_BE) /\ va_state_eq
va_sM (va_update_mem_heaplet 1 va_sM (va_update_flags va_sM (va_update_reg64 rR12 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rR9 va_sM
(va_update_xmm 7 va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM (va_update_xmm 12 va_sM
(va_update_xmm 2 va_sM (va_update_xmm 5 va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM
(va_update_xmm 6 va_sM (va_update_xmm 10 va_sM (va_update_xmm 9 va_sM (va_update_ok va_sM
(va_update_mem va_sM va_s0))))))))))))))))))))) | let va_lemma_Aes_ctr_loop_body va_b0 va_s0 alg old_plain_ptr old_out_ptr old_num_quad_blocks count
plain_b out_b key round_keys keys_b icb_BE iv =
let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 1; va_Mod_flags; va_Mod_reg64 rR12; va_Mod_reg64
rR10; va_Mod_reg64 rRdx; va_Mod_reg64 rR9; va_Mod_xmm 7; va_Mod_xmm 14; va_Mod_xmm 13;
va_Mod_xmm 12; va_Mod_xmm 2; va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 6; va_Mod_xmm
10; va_Mod_xmm 9; va_Mod_ok; va_Mod_mem] in
let va_qc = va_qcode_Aes_ctr_loop_body va_mods alg old_plain_ptr old_out_ptr old_num_quad_blocks
count plain_b out_b key round_keys keys_b icb_BE iv in
let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Aes_ctr_loop_body alg) va_qc va_s0 (fun
va_s0 va_sM va_g -> let () = va_g in label va_range1
"***** POSTCONDITION NOT MET AT line 56 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_ok va_sM) /\ (label va_range1
"***** POSTCONDITION NOT MET AT line 121 column 53 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(Vale.X64.Decls.modifies_buffer128 out_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1
va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 124 column 101 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) old_plain_ptr plain_b
(old_num_quad_blocks `op_Multiply` 4) (va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 125 column 101 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) old_out_ptr out_b
(old_num_quad_blocks `op_Multiply` 4) (va_get_mem_layout va_sM) Secret) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 126 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_reg64 rR9 va_sM == va_get_reg64 rR9 va_s0 + 64) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 127 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_reg64 rR10 va_sM == va_get_reg64 rR10 va_s0 + 64) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 128 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_reg64 rRdx va_sM == va_get_reg64 rRdx va_s0 - 1) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 131 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(aes_reqs alg key round_keys keys_b (va_get_reg64 rR8 va_sM) (va_get_mem_heaplet 0 va_sM)
(va_get_mem_layout va_sM)) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 134 column 209 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_xmm 9 va_sM == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 1)))
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 0)))) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 135 column 209 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_xmm 10 va_sM == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 3)))
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 2)))) /\ label va_range1
"***** POSTCONDITION NOT MET AT line 138 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(Vale.AES.GCTR.gctr_partial_def alg (4 `op_Multiply` count + 4)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) plain_b)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 1 va_sM) out_b) key icb_BE))) in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([va_Mod_mem_heaplet 1; va_Mod_flags; va_Mod_reg64 rR12; va_Mod_reg64 rR10;
va_Mod_reg64 rRdx; va_Mod_reg64 rR9; va_Mod_xmm 7; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12;
va_Mod_xmm 2; va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 6; va_Mod_xmm 10; va_Mod_xmm
9; va_Mod_ok; va_Mod_mem]) va_sM va_s0;
(va_sM, va_fM) | {
"file_name": "obj/Vale.AES.X64.AESCTRplain.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 16,
"end_line": 420,
"start_col": 0,
"start_line": 365
} | module Vale.AES.X64.AESCTRplain
open Vale.Def.Prop_s
open Vale.Def.Opaque_s
open Vale.Def.Words_s
open Vale.Def.Types_s
open FStar.Seq
open Vale.AES.AES_s
open Vale.X64.Machine_s
open Vale.X64.Memory
open Vale.X64.State
open Vale.X64.Decls
open Vale.X64.InsBasic
open Vale.X64.InsMem
open Vale.X64.InsVector
open Vale.X64.InsAes
open Vale.X64.QuickCode
open Vale.X64.QuickCodes
open Vale.Arch.Types
open Vale.AES.AES_helpers
open Vale.Poly1305.Math // For lemma_poly_bits64()
open Vale.AES.GCTR_s
open Vale.AES.GCTR
open Vale.Arch.TypesNative
open Vale.AES.X64.AESCTR
open Vale.X64.CPU_Features_s
//-- Aes_ctr_loop_body
#push-options "--z3rlimit 400"
val va_code_Aes_ctr_loop_body : alg:algorithm -> Tot va_code
[@ "opaque_to_smt" va_qattr]
let va_code_Aes_ctr_loop_body alg =
(va_Block (va_CCons (va_code_Pinsrq (va_op_xmm_xmm 2) (va_op_opr64_reg64 rRdi) 0) (va_CCons
(va_code_Pinsrq (va_op_xmm_xmm 12) (va_op_opr64_reg64 rRdi) 0) (va_CCons (va_code_Pinsrq
(va_op_xmm_xmm 13) (va_op_opr64_reg64 rRdi) 0) (va_CCons (va_code_Pinsrq (va_op_xmm_xmm 14)
(va_op_opr64_reg64 rRdi) 0) (va_CCons (va_code_Shufpd (va_op_xmm_xmm 2) (va_op_xmm_xmm 9) 2)
(va_CCons (va_code_Shufpd (va_op_xmm_xmm 12) (va_op_xmm_xmm 9) 0) (va_CCons (va_code_Shufpd
(va_op_xmm_xmm 13) (va_op_xmm_xmm 10) 2) (va_CCons (va_code_Shufpd (va_op_xmm_xmm 14)
(va_op_xmm_xmm 10) 0) (va_CCons (va_code_Pshufb64 (va_op_xmm_xmm 9) (va_op_xmm_xmm 0))
(va_CCons (va_code_Pshufb64 (va_op_xmm_xmm 10) (va_op_xmm_xmm 0)) (va_CCons
(va_code_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 3) (va_op_reg_opr64_reg64
rR8) 0 Secret) (va_CCons (va_code_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm
4) (va_op_reg_opr64_reg64 rR8) 16 Secret) (va_CCons (va_code_Load128_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 5) (va_op_reg_opr64_reg64 rR8) 32 Secret)
(va_CCons (va_code_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 6)
(va_op_reg_opr64_reg64 rR8) 48 Secret) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block
(va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_Block (va_CNil ())) (va_CCons
(va_code_Paddd (va_op_xmm_xmm 9) (va_op_xmm_xmm 15)) (va_CCons (va_code_Paddd (va_op_xmm_xmm
10) (va_op_xmm_xmm 15)) (va_CCons (va_code_Pxor (va_op_xmm_xmm 2) (va_op_xmm_xmm 3)) (va_CCons
(va_code_Pxor (va_op_xmm_xmm 12) (va_op_xmm_xmm 3)) (va_CCons (va_code_Pxor (va_op_xmm_xmm 13)
(va_op_xmm_xmm 3)) (va_CCons (va_code_Pxor (va_op_xmm_xmm 14) (va_op_xmm_xmm 3)) (va_CCons
(va_code_Pshufb64 (va_op_xmm_xmm 9) (va_op_xmm_xmm 0)) (va_CCons (va_code_Pshufb64
(va_op_xmm_xmm 10) (va_op_xmm_xmm 0)) (va_CCons (va_code_Aes_ctr_encrypt alg) (va_CCons
(va_code_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7) (va_op_reg_opr64_reg64
rR9) 0 Secret) (va_CCons (va_code_Pxor (va_op_xmm_xmm 2) (va_op_xmm_xmm 7)) (va_CCons
(va_code_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7) (va_op_reg_opr64_reg64
rR9) 16 Secret) (va_CCons (va_code_Pxor (va_op_xmm_xmm 12) (va_op_xmm_xmm 7)) (va_CCons
(va_code_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7) (va_op_reg_opr64_reg64
rR9) 32 Secret) (va_CCons (va_code_Pxor (va_op_xmm_xmm 13) (va_op_xmm_xmm 7)) (va_CCons
(va_code_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7) (va_op_reg_opr64_reg64
rR9) 48 Secret) (va_CCons (va_code_Pxor (va_op_xmm_xmm 14) (va_op_xmm_xmm 7)) (va_CCons
(va_code_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rR10)
(va_op_xmm_xmm 2) 0 Secret) (va_CCons (va_code_Store128_buffer (va_op_heaplet_mem_heaplet 1)
(va_op_reg_opr64_reg64 rR10) (va_op_xmm_xmm 12) 16 Secret) (va_CCons (va_code_Store128_buffer
(va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rR10) (va_op_xmm_xmm 13) 32 Secret)
(va_CCons (va_code_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rR10)
(va_op_xmm_xmm 14) 48 Secret) (va_CCons (va_Block (va_CNil ())) (va_CCons (va_code_Sub64
(va_op_dst_opr64_reg64 rRdx) (va_const_opr64 1)) (va_CCons (va_code_Add64
(va_op_dst_opr64_reg64 rR9) (va_const_opr64 64)) (va_CCons (va_code_Add64
(va_op_dst_opr64_reg64 rR10) (va_const_opr64 64)) (va_CNil
())))))))))))))))))))))))))))))))))))))))))))))
val va_codegen_success_Aes_ctr_loop_body : alg:algorithm -> Tot va_pbool
[@ "opaque_to_smt" va_qattr]
let va_codegen_success_Aes_ctr_loop_body alg =
(va_pbool_and (va_codegen_success_Pinsrq (va_op_xmm_xmm 2) (va_op_opr64_reg64 rRdi) 0)
(va_pbool_and (va_codegen_success_Pinsrq (va_op_xmm_xmm 12) (va_op_opr64_reg64 rRdi) 0)
(va_pbool_and (va_codegen_success_Pinsrq (va_op_xmm_xmm 13) (va_op_opr64_reg64 rRdi) 0)
(va_pbool_and (va_codegen_success_Pinsrq (va_op_xmm_xmm 14) (va_op_opr64_reg64 rRdi) 0)
(va_pbool_and (va_codegen_success_Shufpd (va_op_xmm_xmm 2) (va_op_xmm_xmm 9) 2) (va_pbool_and
(va_codegen_success_Shufpd (va_op_xmm_xmm 12) (va_op_xmm_xmm 9) 0) (va_pbool_and
(va_codegen_success_Shufpd (va_op_xmm_xmm 13) (va_op_xmm_xmm 10) 2) (va_pbool_and
(va_codegen_success_Shufpd (va_op_xmm_xmm 14) (va_op_xmm_xmm 10) 0) (va_pbool_and
(va_codegen_success_Pshufb64 (va_op_xmm_xmm 9) (va_op_xmm_xmm 0)) (va_pbool_and
(va_codegen_success_Pshufb64 (va_op_xmm_xmm 10) (va_op_xmm_xmm 0)) (va_pbool_and
(va_codegen_success_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 3)
(va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Load128_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 4) (va_op_reg_opr64_reg64 rR8) 16 Secret)
(va_pbool_and (va_codegen_success_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm
5) (va_op_reg_opr64_reg64 rR8) 32 Secret) (va_pbool_and (va_codegen_success_Load128_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 6) (va_op_reg_opr64_reg64 rR8) 48 Secret)
(va_pbool_and (va_codegen_success_Paddd (va_op_xmm_xmm 9) (va_op_xmm_xmm 15)) (va_pbool_and
(va_codegen_success_Paddd (va_op_xmm_xmm 10) (va_op_xmm_xmm 15)) (va_pbool_and
(va_codegen_success_Pxor (va_op_xmm_xmm 2) (va_op_xmm_xmm 3)) (va_pbool_and
(va_codegen_success_Pxor (va_op_xmm_xmm 12) (va_op_xmm_xmm 3)) (va_pbool_and
(va_codegen_success_Pxor (va_op_xmm_xmm 13) (va_op_xmm_xmm 3)) (va_pbool_and
(va_codegen_success_Pxor (va_op_xmm_xmm 14) (va_op_xmm_xmm 3)) (va_pbool_and
(va_codegen_success_Pshufb64 (va_op_xmm_xmm 9) (va_op_xmm_xmm 0)) (va_pbool_and
(va_codegen_success_Pshufb64 (va_op_xmm_xmm 10) (va_op_xmm_xmm 0)) (va_pbool_and
(va_codegen_success_Aes_ctr_encrypt alg) (va_pbool_and (va_codegen_success_Load128_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7) (va_op_reg_opr64_reg64 rR9) 0 Secret)
(va_pbool_and (va_codegen_success_Pxor (va_op_xmm_xmm 2) (va_op_xmm_xmm 7)) (va_pbool_and
(va_codegen_success_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7)
(va_op_reg_opr64_reg64 rR9) 16 Secret) (va_pbool_and (va_codegen_success_Pxor (va_op_xmm_xmm
12) (va_op_xmm_xmm 7)) (va_pbool_and (va_codegen_success_Load128_buffer
(va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7) (va_op_reg_opr64_reg64 rR9) 32 Secret)
(va_pbool_and (va_codegen_success_Pxor (va_op_xmm_xmm 13) (va_op_xmm_xmm 7)) (va_pbool_and
(va_codegen_success_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7)
(va_op_reg_opr64_reg64 rR9) 48 Secret) (va_pbool_and (va_codegen_success_Pxor (va_op_xmm_xmm
14) (va_op_xmm_xmm 7)) (va_pbool_and (va_codegen_success_Store128_buffer
(va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rR10) (va_op_xmm_xmm 2) 0 Secret)
(va_pbool_and (va_codegen_success_Store128_buffer (va_op_heaplet_mem_heaplet 1)
(va_op_reg_opr64_reg64 rR10) (va_op_xmm_xmm 12) 16 Secret) (va_pbool_and
(va_codegen_success_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rR10)
(va_op_xmm_xmm 13) 32 Secret) (va_pbool_and (va_codegen_success_Store128_buffer
(va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rR10) (va_op_xmm_xmm 14) 48 Secret)
(va_pbool_and (va_codegen_success_Sub64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 1))
(va_pbool_and (va_codegen_success_Add64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 64))
(va_pbool_and (va_codegen_success_Add64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 64))
(va_ttrue ())))))))))))))))))))))))))))))))))))))))
[@ "opaque_to_smt" va_qattr]
let va_qcode_Aes_ctr_loop_body (va_mods:va_mods_t) (alg:algorithm) (old_plain_ptr:nat64)
(old_out_ptr:nat64) (old_num_quad_blocks:nat64) (count:nat) (plain_b:buffer128) (out_b:buffer128)
(key:(seq nat32)) (round_keys:(seq quad32)) (keys_b:buffer128) (icb_BE:quad32) (iv:quad32) :
(va_quickCode unit (va_code_Aes_ctr_loop_body alg)) =
(qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let
(va_arg94:Vale.Def.Types_s.quad32) = iv in let (va_arg93:Vale.Def.Types_s.quad32) = va_get_xmm
2 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 140 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.lemma_insrq_extrq_relations va_arg93 va_arg94) (let
(va_arg92:Vale.Def.Types_s.quad32) = iv in let (va_arg91:Vale.Def.Types_s.quad32) = va_get_xmm
12 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 141 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.lemma_insrq_extrq_relations va_arg91 va_arg92) (let
(va_arg90:Vale.Def.Types_s.quad32) = iv in let (va_arg89:Vale.Def.Types_s.quad32) = va_get_xmm
13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 142 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.lemma_insrq_extrq_relations va_arg89 va_arg90) (let
(va_arg88:Vale.Def.Types_s.quad32) = iv in let (va_arg87:Vale.Def.Types_s.quad32) = va_get_xmm
14 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 143 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(fun (_:unit) -> Vale.Arch.Types.lemma_insrq_extrq_relations va_arg87 va_arg88) (va_QSeq
va_range1
"***** PRECONDITION NOT MET AT line 144 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pinsrq (va_op_xmm_xmm 2) (va_op_opr64_reg64 rRdi) 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 145 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pinsrq (va_op_xmm_xmm 12) (va_op_opr64_reg64 rRdi) 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 146 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pinsrq (va_op_xmm_xmm 13) (va_op_opr64_reg64 rRdi) 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 147 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pinsrq (va_op_xmm_xmm 14) (va_op_opr64_reg64 rRdi) 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 149 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Shufpd (va_op_xmm_xmm 2) (va_op_xmm_xmm 9) 2) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 150 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Shufpd (va_op_xmm_xmm 12) (va_op_xmm_xmm 9) 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 151 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Shufpd (va_op_xmm_xmm 13) (va_op_xmm_xmm 10) 2) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 152 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Shufpd (va_op_xmm_xmm 14) (va_op_xmm_xmm 10) 0) (fun (va_s:va_state) _ -> let
(va_arg86:Vale.Def.Types_s.quad32) = icb_BE in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 154 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(fun (_:unit) -> Vale.Def.Types_s.reveal_reverse_bytes_quad32 va_arg86) (let
(va_arg85:Vale.Def.Types_s.quad32) = va_get_xmm 2 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 155 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(fun (_:unit) -> Vale.Def.Types_s.reveal_reverse_bytes_quad32 va_arg85) (let
(va_arg84:Vale.Def.Types_s.quad32) = va_get_xmm 12 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 156 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(fun (_:unit) -> Vale.Def.Types_s.reveal_reverse_bytes_quad32 va_arg84) (let
(va_arg83:Vale.Def.Types_s.quad32) = va_get_xmm 13 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 157 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(fun (_:unit) -> Vale.Def.Types_s.reveal_reverse_bytes_quad32 va_arg83) (let
(va_arg82:Vale.Def.Types_s.quad32) = va_get_xmm 14 va_s in va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 158 column 32 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(fun (_:unit) -> Vale.Def.Types_s.reveal_reverse_bytes_quad32 va_arg82) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 160 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pshufb64 (va_op_xmm_xmm 9) (va_op_xmm_xmm 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 161 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pshufb64 (va_op_xmm_xmm 10) (va_op_xmm_xmm 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 164 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 3) (va_op_reg_opr64_reg64
rR8) 0 Secret keys_b 0) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 165 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 4) (va_op_reg_opr64_reg64
rR8) 16 Secret keys_b 1) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 166 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 5) (va_op_reg_opr64_reg64
rR8) 32 Secret keys_b 2) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 167 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 6) (va_op_reg_opr64_reg64
rR8) 48 Secret keys_b 3) (fun (va_s:va_state) _ -> va_qAssertSquash va_range1
"***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 168 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) =
i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) quad32
round_keys 0) (fun _ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 168 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_xmm 3 va_s == FStar.Seq.Base.index #quad32 round_keys 0) (va_qAssertSquash va_range1
"***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 169 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) =
i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) quad32
round_keys 1) (fun _ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 169 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_xmm 4 va_s == FStar.Seq.Base.index #quad32 round_keys 1) (va_qAssertSquash va_range1
"***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 170 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) =
i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) quad32
round_keys 2) (fun _ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 170 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_xmm 5 va_s == FStar.Seq.Base.index #quad32 round_keys 2) (va_qAssertSquash va_range1
"***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 171 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
((fun a_539 (s_540:(FStar.Seq.Base.seq a_539)) (i_541:Prims.nat) -> let (i_515:Prims.nat) =
i_541 in Prims.b2t (Prims.op_LessThan i_515 (FStar.Seq.Base.length #a_539 s_540))) quad32
round_keys 3) (fun _ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 171 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_xmm 6 va_s == FStar.Seq.Base.index #quad32 round_keys 3) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 174 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Paddd (va_op_xmm_xmm 9) (va_op_xmm_xmm 15)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 175 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Paddd (va_op_xmm_xmm 10) (va_op_xmm_xmm 15)) (fun (va_s:va_state) _ -> let
(in1:quad32) = va_get_xmm 2 va_s in let (in2:quad32) = va_get_xmm 12 va_s in let (in3:quad32) =
va_get_xmm 13 va_s in let (in4:quad32) = va_get_xmm 14 va_s in va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 184 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pxor (va_op_xmm_xmm 2) (va_op_xmm_xmm 3)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 185 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pxor (va_op_xmm_xmm 12) (va_op_xmm_xmm 3)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 186 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pxor (va_op_xmm_xmm 13) (va_op_xmm_xmm 3)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 187 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pxor (va_op_xmm_xmm 14) (va_op_xmm_xmm 3)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 189 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pshufb64 (va_op_xmm_xmm 9) (va_op_xmm_xmm 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 190 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pshufb64 (va_op_xmm_xmm 10) (va_op_xmm_xmm 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 192 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Aes_ctr_encrypt alg key round_keys keys_b in1 in2 in3 in4) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 196 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7) (va_op_reg_opr64_reg64
rR9) 0 Secret plain_b (4 `op_Multiply` count + 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 197 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pxor (va_op_xmm_xmm 2) (va_op_xmm_xmm 7)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 198 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7) (va_op_reg_opr64_reg64
rR9) 16 Secret plain_b (4 `op_Multiply` count + 1)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 199 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pxor (va_op_xmm_xmm 12) (va_op_xmm_xmm 7)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 200 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7) (va_op_reg_opr64_reg64
rR9) 32 Secret plain_b (4 `op_Multiply` count + 2)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 201 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pxor (va_op_xmm_xmm 13) (va_op_xmm_xmm 7)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 202 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Load128_buffer (va_op_heaplet_mem_heaplet 0) (va_op_xmm_xmm 7) (va_op_reg_opr64_reg64
rR9) 48 Secret plain_b (4 `op_Multiply` count + 3)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 203 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Pxor (va_op_xmm_xmm 14) (va_op_xmm_xmm 7)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 206 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rR10)
(va_op_xmm_xmm 2) 0 Secret out_b (4 `op_Multiply` count + 0)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 207 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rR10)
(va_op_xmm_xmm 12) 16 Secret out_b (4 `op_Multiply` count + 1)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 208 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rR10)
(va_op_xmm_xmm 13) 32 Secret out_b (4 `op_Multiply` count + 2)) (va_QBind va_range1
"***** PRECONDITION NOT MET AT line 209 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Store128_buffer (va_op_heaplet_mem_heaplet 1) (va_op_reg_opr64_reg64 rR10)
(va_op_xmm_xmm 14) 48 Secret out_b (4 `op_Multiply` count + 3)) (fun (va_s:va_state) _ ->
va_qPURE va_range1
"***** PRECONDITION NOT MET AT line 211 column 37 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(fun (_:unit) -> Vale.Arch.TypesNative.lemma_quad32_xor_commutes_forall ()) (va_qAssertSquash
va_range1
"***** EXPRESSION PRECONDITIONS NOT MET WITHIN line 214 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
((fun a_1906 (s_1907:(FStar.Seq.Base.seq a_1906)) (i_1908:Prims.nat) (j_1909:Prims.nat) -> let
(j_1869:Prims.nat) = j_1909 in Prims.b2t (Prims.op_AmpAmp (Prims.op_LessThanOrEqual i_1908
j_1869) (Prims.op_LessThanOrEqual j_1869 (FStar.Seq.Base.length #a_1906 s_1907))))
Vale.X64.Decls.quad32 (Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 1 va_s) out_b) 0 (4
`op_Multiply` count) /\ (fun a_1906 (s_1907:(FStar.Seq.Base.seq a_1906)) (i_1908:Prims.nat)
(j_1909:Prims.nat) -> let (j_1869:Prims.nat) = j_1909 in Prims.b2t (Prims.op_AmpAmp
(Prims.op_LessThanOrEqual i_1908 j_1869) (Prims.op_LessThanOrEqual j_1869
(FStar.Seq.Base.length #a_1906 s_1907)))) Vale.X64.Decls.quad32
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 1 va_old_s) out_b) 0 (4 `op_Multiply`
count)) (fun _ -> va_qAssert va_range1
"***** PRECONDITION NOT MET AT line 214 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(FStar.Seq.Base.slice #Vale.X64.Decls.quad32 (Vale.X64.Decls.buffer128_as_seq
(va_get_mem_heaplet 1 va_s) out_b) 0 (4 `op_Multiply` count) == FStar.Seq.Base.slice
#Vale.X64.Decls.quad32 (Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 1 va_old_s) out_b)
0 (4 `op_Multiply` count)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 216 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Sub64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 1)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 217 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Add64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 64)) (va_QSeq va_range1
"***** PRECONDITION NOT MET AT line 218 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_quick_Add64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 64)) (va_QEmpty
(())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
val va_lemma_Aes_ctr_loop_body : va_b0:va_code -> va_s0:va_state -> alg:algorithm ->
old_plain_ptr:nat64 -> old_out_ptr:nat64 -> old_num_quad_blocks:nat64 -> count:nat ->
plain_b:buffer128 -> out_b:buffer128 -> key:(seq nat32) -> round_keys:(seq quad32) ->
keys_b:buffer128 -> icb_BE:quad32 -> iv:quad32
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Aes_ctr_loop_body alg) va_s0 /\ va_get_ok va_s0 /\
(sse_enabled /\ (0 < va_get_reg64 rRdx va_s0 /\ va_get_reg64 rRdx va_s0 <= old_num_quad_blocks)
/\ count == old_num_quad_blocks - va_get_reg64 rRdx va_s0 /\ Vale.X64.Decls.validSrcAddrs128
(va_get_mem_heaplet 0 va_s0) old_plain_ptr plain_b (old_num_quad_blocks `op_Multiply` 4)
(va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 1
va_s0) old_out_ptr out_b (old_num_quad_blocks `op_Multiply` 4) (va_get_mem_layout va_s0) Secret
/\ va_get_reg64 rR9 va_s0 == old_plain_ptr + count `op_Multiply` 64 /\ va_get_reg64 rR10 va_s0
== old_out_ptr + count `op_Multiply` 64 /\ old_plain_ptr + old_num_quad_blocks `op_Multiply` 64
< pow2_64 /\ old_out_ptr + old_num_quad_blocks `op_Multiply` 64 < pow2_64 /\
Vale.X64.Decls.buffer_length #Vale.X64.Memory.vuint128 plain_b <= Vale.X64.Decls.buffer_length
#Vale.X64.Memory.vuint128 out_b /\ va_get_xmm 0 va_s0 == Vale.Def.Words_s.Mkfour
#Vale.Def.Types_s.nat32 67438087 66051 202182159 134810123 /\ va_get_xmm 15 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 4 0 4 0 /\ 4 `op_Multiply` count < pow2_32 - 4
/\ va_get_xmm 9 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count) 1)))
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count) 0))) /\ va_get_xmm 10 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count) 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count) 2))) /\ aes_reqs alg key round_keys keys_b (va_get_reg64 rR8 va_s0)
(va_get_mem_heaplet 0 va_s0) (va_get_mem_layout va_s0) /\ iv ==
Vale.Def.Types_s.reverse_bytes_quad32 icb_BE /\ va_get_reg64 rRdi va_s0 == Vale.Arch.Types.lo64
iv /\ Vale.AES.GCTR.gctr_partial_def alg (4 `op_Multiply` count)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_s0) plain_b)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 1 va_s0) out_b) key icb_BE)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(Vale.X64.Decls.modifies_buffer128 out_b (va_get_mem_heaplet 1 va_s0) (va_get_mem_heaplet 1
va_sM) /\ Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM) old_plain_ptr plain_b
(old_num_quad_blocks `op_Multiply` 4) (va_get_mem_layout va_sM) Secret /\
Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM) old_out_ptr out_b
(old_num_quad_blocks `op_Multiply` 4) (va_get_mem_layout va_sM) Secret /\ va_get_reg64 rR9
va_sM == va_get_reg64 rR9 va_s0 + 64 /\ va_get_reg64 rR10 va_sM == va_get_reg64 rR10 va_s0 + 64
/\ va_get_reg64 rRdx va_sM == va_get_reg64 rRdx va_s0 - 1 /\ aes_reqs alg key round_keys keys_b
(va_get_reg64 rR8 va_sM) (va_get_mem_heaplet 0 va_sM) (va_get_mem_layout va_sM) /\ va_get_xmm 9
va_sM == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 1)))
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv) (Vale.Def.Types_s.reverse_bytes_nat32
(Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 0))) /\ va_get_xmm 10 va_sM ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count + 4) 3))) (Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32
(Vale.Def.Words_s.__proj__Mkfour__item__lo0 icb_BE) (Vale.Arch.Types.add_wrap32 (4
`op_Multiply` count + 4) 2))) /\ Vale.AES.GCTR.gctr_partial_def alg (4 `op_Multiply` count + 4)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) plain_b)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 1 va_sM) out_b) key icb_BE) /\ va_state_eq
va_sM (va_update_mem_heaplet 1 va_sM (va_update_flags va_sM (va_update_reg64 rR12 va_sM
(va_update_reg64 rR10 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rR9 va_sM
(va_update_xmm 7 va_sM (va_update_xmm 14 va_sM (va_update_xmm 13 va_sM (va_update_xmm 12 va_sM
(va_update_xmm 2 va_sM (va_update_xmm 5 va_sM (va_update_xmm 4 va_sM (va_update_xmm 3 va_sM
(va_update_xmm 6 va_sM (va_update_xmm 10 va_sM (va_update_xmm 9 va_sM (va_update_ok va_sM
(va_update_mem va_sM va_s0))))))))))))))))))))) | {
"checked_file": "/",
"dependencies": [
"Vale.X64.State.fsti.checked",
"Vale.X64.QuickCodes.fsti.checked",
"Vale.X64.QuickCode.fst.checked",
"Vale.X64.Memory.fsti.checked",
"Vale.X64.Machine_s.fst.checked",
"Vale.X64.InsVector.fsti.checked",
"Vale.X64.InsMem.fsti.checked",
"Vale.X64.InsBasic.fsti.checked",
"Vale.X64.InsAes.fsti.checked",
"Vale.X64.Flags.fsti.checked",
"Vale.X64.Decls.fsti.checked",
"Vale.X64.CPU_Features_s.fst.checked",
"Vale.Poly1305.Math.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Def.Prop_s.fst.checked",
"Vale.Def.Opaque_s.fsti.checked",
"Vale.Arch.TypesNative.fsti.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.X64.AESCTR.fsti.checked",
"Vale.AES.GCTR_s.fst.checked",
"Vale.AES.GCTR.fsti.checked",
"Vale.AES.AES_s.fst.checked",
"Vale.AES.AES_helpers.fsti.checked",
"prims.fst.checked",
"FStar.Seq.Base.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.AES.X64.AESCTRplain.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Poly1305.Math // For lemma_poly_bits64()",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64.AESCTR",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GCTR",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GCTR_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Poly1305.Math",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.AES_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.AES_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.CPU_Features_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64.AESCTR",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GCTR",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GCTR_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Poly1305.Math",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.AES_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsAes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.AES_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Seq",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Words_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Opaque_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 400,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
va_b0: Vale.X64.Decls.va_code ->
va_s0: Vale.X64.Decls.va_state ->
alg: Vale.AES.AES_common_s.algorithm ->
old_plain_ptr: Vale.X64.Memory.nat64 ->
old_out_ptr: Vale.X64.Memory.nat64 ->
old_num_quad_blocks: Vale.X64.Memory.nat64 ->
count: Prims.nat ->
plain_b: Vale.X64.Memory.buffer128 ->
out_b: Vale.X64.Memory.buffer128 ->
key: FStar.Seq.Base.seq Vale.X64.Memory.nat32 ->
round_keys: FStar.Seq.Base.seq Vale.X64.Decls.quad32 ->
keys_b: Vale.X64.Memory.buffer128 ->
icb_BE: Vale.X64.Decls.quad32 ->
iv: Vale.X64.Decls.quad32
-> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) | Prims.Ghost | [] | [] | [
"Vale.X64.Decls.va_code",
"Vale.X64.Decls.va_state",
"Vale.AES.AES_common_s.algorithm",
"Vale.X64.Memory.nat64",
"Prims.nat",
"Vale.X64.Memory.buffer128",
"FStar.Seq.Base.seq",
"Vale.X64.Memory.nat32",
"Vale.X64.Decls.quad32",
"Vale.X64.QuickCodes.fuel",
"Prims.unit",
"FStar.Pervasives.Native.Mktuple2",
"Vale.X64.Decls.va_fuel",
"Vale.X64.QuickCode.va_lemma_norm_mods",
"Prims.Cons",
"Vale.X64.QuickCode.mod_t",
"Vale.X64.QuickCode.va_Mod_mem_heaplet",
"Vale.X64.QuickCode.va_Mod_flags",
"Vale.X64.QuickCode.va_Mod_reg64",
"Vale.X64.Machine_s.rR12",
"Vale.X64.Machine_s.rR10",
"Vale.X64.Machine_s.rRdx",
"Vale.X64.Machine_s.rR9",
"Vale.X64.QuickCode.va_Mod_xmm",
"Vale.X64.QuickCode.va_Mod_ok",
"Vale.X64.QuickCode.va_Mod_mem",
"Prims.Nil",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.list",
"Vale.X64.QuickCode.__proj__QProc__item__mods",
"Vale.AES.X64.AESCTRplain.va_code_Aes_ctr_loop_body",
"FStar.Pervasives.Native.tuple2",
"FStar.Pervasives.Native.tuple3",
"Vale.X64.State.vale_state",
"Vale.X64.QuickCodes.va_wp_sound_code_norm",
"Prims.l_and",
"Vale.X64.QuickCodes.label",
"Vale.X64.QuickCodes.va_range1",
"Prims.b2t",
"Vale.X64.Decls.va_get_ok",
"Vale.X64.Decls.modifies_buffer128",
"Vale.X64.Decls.va_get_mem_heaplet",
"Vale.X64.Decls.validSrcAddrs128",
"Prims.op_Multiply",
"Vale.X64.Decls.va_get_mem_layout",
"Vale.Arch.HeapTypes_s.Secret",
"Vale.X64.Decls.validDstAddrs128",
"Prims.int",
"Vale.X64.Decls.va_get_reg64",
"Prims.op_Addition",
"Prims.op_Subtraction",
"Vale.AES.X64.AESCTR.aes_reqs",
"Vale.X64.Machine_s.rR8",
"Vale.Def.Words_s.four",
"Vale.Def.Types_s.nat32",
"Vale.X64.Decls.va_get_xmm",
"Vale.Def.Words_s.Mkfour",
"Vale.Def.Words_s.__proj__Mkfour__item__hi2",
"Vale.Def.Types_s.reverse_bytes_nat32",
"Vale.Arch.Types.add_wrap32",
"Vale.Def.Words_s.__proj__Mkfour__item__lo0",
"Vale.AES.GCTR.gctr_partial_def",
"Vale.X64.Decls.buffer128_as_seq",
"Vale.X64.QuickCode.quickCode",
"Vale.AES.X64.AESCTRplain.va_qcode_Aes_ctr_loop_body"
] | [] | false | false | false | false | false | let va_lemma_Aes_ctr_loop_body
va_b0
va_s0
alg
old_plain_ptr
old_out_ptr
old_num_quad_blocks
count
plain_b
out_b
key
round_keys
keys_b
icb_BE
iv
=
| let va_mods:va_mods_t =
[
va_Mod_mem_heaplet 1; va_Mod_flags; va_Mod_reg64 rR12; va_Mod_reg64 rR10; va_Mod_reg64 rRdx;
va_Mod_reg64 rR9; va_Mod_xmm 7; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm 2;
va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 6; va_Mod_xmm 10; va_Mod_xmm 9; va_Mod_ok;
va_Mod_mem
]
in
let va_qc =
va_qcode_Aes_ctr_loop_body va_mods alg old_plain_ptr old_out_ptr old_num_quad_blocks count plain_b
out_b key round_keys keys_b icb_BE iv
in
let va_sM, va_fM, va_g =
va_wp_sound_code_norm (va_code_Aes_ctr_loop_body alg)
va_qc
va_s0
(fun va_s0 va_sM va_g ->
let () = va_g in
label va_range1
"***** POSTCONDITION NOT MET AT line 56 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_ok va_sM) /\
(label va_range1
"***** POSTCONDITION NOT MET AT line 121 column 53 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(Vale.X64.Decls.modifies_buffer128 out_b
(va_get_mem_heaplet 1 va_s0)
(va_get_mem_heaplet 1 va_sM)) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 124 column 101 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(Vale.X64.Decls.validSrcAddrs128 (va_get_mem_heaplet 0 va_sM)
old_plain_ptr
plain_b
(old_num_quad_blocks `op_Multiply` 4)
(va_get_mem_layout va_sM)
Secret) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 125 column 101 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(Vale.X64.Decls.validDstAddrs128 (va_get_mem_heaplet 1 va_sM)
old_out_ptr
out_b
(old_num_quad_blocks `op_Multiply` 4)
(va_get_mem_layout va_sM)
Secret) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 126 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_reg64 rR9 va_sM == va_get_reg64 rR9 va_s0 + 64) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 127 column 41 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_reg64 rR10 va_sM == va_get_reg64 rR10 va_s0 + 64) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 128 column 52 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_reg64 rRdx va_sM == va_get_reg64 rRdx va_s0 - 1) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 131 column 74 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(aes_reqs alg
key
round_keys
keys_b
(va_get_reg64 rR8 va_sM)
(va_get_mem_heaplet 0 va_sM)
(va_get_mem_layout va_sM)) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 134 column 209 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_xmm 9 va_sM ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0
icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 1)))
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0
icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 0)))) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 135 column 209 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(va_get_xmm 10 va_sM ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0
icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 3)))
(Vale.Def.Words_s.__proj__Mkfour__item__hi2 iv)
(Vale.Def.Types_s.reverse_bytes_nat32 (Vale.Arch.Types.add_wrap32 (Vale.Def.Words_s.__proj__Mkfour__item__lo0
icb_BE)
(Vale.Arch.Types.add_wrap32 (4 `op_Multiply` count + 4) 2)))) /\
label va_range1
"***** POSTCONDITION NOT MET AT line 138 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/Intel/aes/x64/Vale.AES.X64.AESCTRplain.vaf *****"
(Vale.AES.GCTR.gctr_partial_def alg
(4 `op_Multiply` count + 4)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 0 va_sM) plain_b)
(Vale.X64.Decls.buffer128_as_seq (va_get_mem_heaplet 1 va_sM) out_b)
key
icb_BE)))
in
assert_norm (va_qc.mods == va_mods);
va_lemma_norm_mods ([
va_Mod_mem_heaplet 1; va_Mod_flags; va_Mod_reg64 rR12; va_Mod_reg64 rR10; va_Mod_reg64 rRdx;
va_Mod_reg64 rR9; va_Mod_xmm 7; va_Mod_xmm 14; va_Mod_xmm 13; va_Mod_xmm 12; va_Mod_xmm 2;
va_Mod_xmm 5; va_Mod_xmm 4; va_Mod_xmm 3; va_Mod_xmm 6; va_Mod_xmm 10; va_Mod_xmm 9; va_Mod_ok;
va_Mod_mem
])
va_sM
va_s0;
(va_sM, va_fM) | false |
Vale.Lib.Tactics.fst | Vale.Lib.Tactics.squash_and_elim | val squash_and_elim (t: term) : Tac unit | val squash_and_elim (t: term) : Tac unit | let squash_and_elim (t : term) : Tac unit =
let ae = `__squash_and_elim in
apply_lemma (mk_e_app ae [t]) | {
"file_name": "vale/code/lib/util/Vale.Lib.Tactics.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 18,
"start_col": 0,
"start_line": 16
} | module Vale.Lib.Tactics
open FStar.Mul
open FStar.Tactics
open FStar.Tactics.Derived
open FStar.Reflection.Formula
(***** Tactic to destruct conjuctions in context *)
private val __squash_and_elim : (#p:Type) -> (#q:Type) -> (#phi:Type) ->
squash (p /\ q) ->
squash (p ==> q ==> phi) ->
Lemma phi
let __squash_and_elim #p #q #phi p_and_q f = () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Derived.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Reflection.Formula.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Lib.Tactics.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Reflection.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Derived",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | t: FStar.Stubs.Reflection.Types.term -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"FStar.Stubs.Reflection.Types.term",
"FStar.Tactics.V1.Derived.apply_lemma",
"FStar.Reflection.V1.Derived.mk_e_app",
"Prims.Cons",
"Prims.Nil",
"Prims.unit"
] | [] | false | true | false | false | false | let squash_and_elim (t: term) : Tac unit =
| let ae = `__squash_and_elim in
apply_lemma (mk_e_app ae [t]) | false |
Vale.Lib.Tactics.fst | Vale.Lib.Tactics.destruct_conj | val destruct_conj: Prims.unit -> Tac unit | val destruct_conj: Prims.unit -> Tac unit | let destruct_conj () : Tac unit =
let e = cur_env () in
iterate_env (binders_of_env e) | {
"file_name": "vale/code/lib/util/Vale.Lib.Tactics.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 33,
"end_line": 45,
"start_col": 0,
"start_line": 43
} | module Vale.Lib.Tactics
open FStar.Mul
open FStar.Tactics
open FStar.Tactics.Derived
open FStar.Reflection.Formula
(***** Tactic to destruct conjuctions in context *)
private val __squash_and_elim : (#p:Type) -> (#q:Type) -> (#phi:Type) ->
squash (p /\ q) ->
squash (p ==> q ==> phi) ->
Lemma phi
let __squash_and_elim #p #q #phi p_and_q f = ()
let squash_and_elim (t : term) : Tac unit =
let ae = `__squash_and_elim in
apply_lemma (mk_e_app ae [t])
let tf (t : term) : Tot (term -> Tac unit) =
match unsquash_term t with
| None -> and_elim
| _ -> squash_and_elim
let rec iterate_env (bs : binders) : Tac unit =
match bs with
| [] -> ()
| b :: bs ->
let ty = type_of_binder b in
let elim = tf ty in
begin
match term_as_formula_total ty with
| And _ _ ->
elim (pack (Tv_Var (bv_of_binder b)));
clear b;
let t1 = implies_intro () in
let t2 = implies_intro () in
iterate_env (t1 :: t2 :: bs)
| _ -> iterate_env bs
end | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Derived.fst.checked",
"FStar.Tactics.fst.checked",
"FStar.Reflection.Formula.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.Lib.Tactics.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Reflection.Formula",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics.Derived",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Tactics",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> FStar.Tactics.Effect.Tac Prims.unit | FStar.Tactics.Effect.Tac | [] | [] | [
"Prims.unit",
"Vale.Lib.Tactics.iterate_env",
"FStar.Stubs.Reflection.V1.Builtins.binders_of_env",
"FStar.Stubs.Reflection.Types.env",
"FStar.Tactics.V1.Derived.cur_env"
] | [] | false | true | false | false | false | let destruct_conj () : Tac unit =
| let e = cur_env () in
iterate_env (binders_of_env e) | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.setup1 | val setup1 (k: key) (n: nonce) (ctr0: counter) : lseq uint32 16 | val setup1 (k: key) (n: nonce) (ctr0: counter) : lseq uint32 16 | let setup1 (k:key) (n:nonce) (ctr0:counter) : lseq uint32 16 =
Scalar.setup k n ctr0 (create 16 (u32 0)) | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 43,
"end_line": 115,
"start_col": 0,
"start_line": 114
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14
let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round (* 2 rounds *)
let rounds (#w:lanes) (m:state w) : state w =
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round m)))))))))
let sum_state (#w:lanes) (st1:state w) (st2:state w) : state w =
map2 (+|) st1 st2
let add_counter (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (st:state w) : state w =
let cv = vec_load (u32 w *! u32 ctr) w in
st.[12] <- st.[12] +| cv
let chacha20_core (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (s0:state w) : state w =
let k = add_counter ctr s0 in
let k = rounds k in
let k = sum_state k s0 in
add_counter ctr k
inline_for_extraction
let c0 = 0x61707865ul
inline_for_extraction
let c1 = 0x3320646eul
inline_for_extraction
let c2 = 0x79622d32ul
inline_for_extraction
let c3 = 0x6b206574ul
let chacha20_constants : lseq size_t 4 =
[@ inline_let]
let l = [c0;c1;c2;c3] in
assert_norm(List.Tot.length l == 4);
createL l | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
k: Hacl.Spec.Chacha20.Vec.key ->
n: Hacl.Spec.Chacha20.Vec.nonce ->
ctr0: Hacl.Spec.Chacha20.Vec.counter
-> Lib.Sequence.lseq Lib.IntTypes.uint32 16 | Prims.Tot | [
"total"
] | [] | [
"Hacl.Spec.Chacha20.Vec.key",
"Hacl.Spec.Chacha20.Vec.nonce",
"Hacl.Spec.Chacha20.Vec.counter",
"Spec.Chacha20.setup",
"Lib.Sequence.create",
"Lib.IntTypes.uint32",
"Lib.IntTypes.u32",
"Lib.Sequence.lseq"
] | [] | false | false | false | false | false | let setup1 (k: key) (n: nonce) (ctr0: counter) : lseq uint32 16 =
| Scalar.setup k n ctr0 (create 16 (u32 0)) | false |
Hacl.Spec.Chacha20.Vec.fst | Hacl.Spec.Chacha20.Vec.vec_load_i | val vec_load_i : w: Lib.IntVector.width -> x: Lib.IntTypes.uint_t t Lib.IntTypes.SEC
-> v: Lib.IntVector.vec_t t w {Lib.IntVector.vec_v v == Lib.Sequence.create w x} | let vec_load_i (#t:v_inttype) (w:width) (x:uint_t t SEC) = vec_load #t x w | {
"file_name": "code/chacha20/Hacl.Spec.Chacha20.Vec.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 74,
"end_line": 118,
"start_col": 0,
"start_line": 118
} | module Hacl.Spec.Chacha20.Vec
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.LoopCombinators
open Lib.IntVector
module Scalar = Spec.Chacha20
module VecTranspose = Lib.IntVector.Transpose
#set-options "--z3rlimit 50 --max_fuel 0 --max_ifuel 0"
/// Constants and Types
let size_key = 32
let size_block = 64
let size_nonce = 12
type key = lbytes size_key
type block1 = lbytes size_block
type nonce = lbytes size_nonce
type counter = size_nat
type subblock = b:bytes{length b <= size_block}
// Internally, blocks are represented as 16 x 4-byte integers
let lanes = n:width{n == 1 \/ n == 4 \/ n == 8}
inline_for_extraction
let uint32xN (w:lanes) = vec_t U32 w
type state (w:lanes) = lseq (uint32xN w) 16
type idx = n:size_nat{n < 16}
type shuffle (w:lanes) = state w -> state w
type blocks (w:lanes) = lbytes (w * 64)
// Using @ as a functional substitute for ;
let op_At f g = fun x -> g (f x)
/// Specification
let transpose_state (#w:lanes) (st:state w) : lseq (lseq uint32 16) w =
createi w (fun i ->
let x : lseq uint32 16 = create16
(vec_v st.[0]).[i] (vec_v st.[1]).[i] (vec_v st.[2]).[i] (vec_v st.[3]).[i]
(vec_v st.[4]).[i] (vec_v st.[5]).[i] (vec_v st.[6]).[i] (vec_v st.[7]).[i]
(vec_v st.[8]).[i] (vec_v st.[9]).[i] (vec_v st.[10]).[i] (vec_v st.[11]).[i]
(vec_v st.[12]).[i] (vec_v st.[13]).[i] (vec_v st.[14]).[i] (vec_v st.[15]).[i] in
x)
let line (#w:lanes) (a:idx) (b:idx) (d:idx) (s:rotval U32) (m:state w) : state w =
let m = m.[a] <- m.[a] +| m.[b] in
let m = m.[d] <- (m.[d] ^| m.[a]) <<<| s in
m
let quarter_round (#w:lanes) a b c d : shuffle w =
line a b d (size 16) @
line c d b (size 12) @
line a b d (size 8) @
line c d b (size 7)
let column_round (#w:lanes) : shuffle w =
quarter_round 0 4 8 12 @
quarter_round 1 5 9 13 @
quarter_round 2 6 10 14 @
quarter_round 3 7 11 15
let diagonal_round (#w:lanes) : shuffle w =
quarter_round 0 5 10 15 @
quarter_round 1 6 11 12 @
quarter_round 2 7 8 13 @
quarter_round 3 4 9 14
let double_round (#w:lanes) : shuffle w =
column_round @ diagonal_round (* 2 rounds *)
let rounds (#w:lanes) (m:state w) : state w =
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round (
double_round (double_round m)))))))))
let sum_state (#w:lanes) (st1:state w) (st2:state w) : state w =
map2 (+|) st1 st2
let add_counter (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (st:state w) : state w =
let cv = vec_load (u32 w *! u32 ctr) w in
st.[12] <- st.[12] +| cv
let chacha20_core (#w:lanes) (ctr:counter{w * ctr <= max_size_t}) (s0:state w) : state w =
let k = add_counter ctr s0 in
let k = rounds k in
let k = sum_state k s0 in
add_counter ctr k
inline_for_extraction
let c0 = 0x61707865ul
inline_for_extraction
let c1 = 0x3320646eul
inline_for_extraction
let c2 = 0x79622d32ul
inline_for_extraction
let c3 = 0x6b206574ul
let chacha20_constants : lseq size_t 4 =
[@ inline_let]
let l = [c0;c1;c2;c3] in
assert_norm(List.Tot.length l == 4);
createL l
let setup1 (k:key) (n:nonce) (ctr0:counter) : lseq uint32 16 =
Scalar.setup k n ctr0 (create 16 (u32 0)) | {
"checked_file": "/",
"dependencies": [
"Spec.Chacha20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntVector.Transpose.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.List.Tot.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Chacha20.Vec.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.IntVector.Transpose",
"short_module": "VecTranspose"
},
{
"abbrev": true,
"full_module": "Spec.Chacha20",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.LoopCombinators",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Chacha20",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 0,
"max_ifuel": 0,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | w: Lib.IntVector.width -> x: Lib.IntTypes.uint_t t Lib.IntTypes.SEC
-> v: Lib.IntVector.vec_t t w {Lib.IntVector.vec_v v == Lib.Sequence.create w x} | Prims.Tot | [
"total"
] | [] | [
"Lib.IntVector.v_inttype",
"Lib.IntVector.width",
"Lib.IntTypes.uint_t",
"Lib.IntTypes.SEC",
"Lib.IntVector.vec_load",
"Lib.IntVector.vec_t",
"Prims.eq2",
"Lib.Sequence.lseq",
"Lib.IntTypes.int_t",
"Lib.IntVector.vec_v",
"Lib.Sequence.create"
] | [] | false | false | false | false | false | let vec_load_i (#t: v_inttype) (w: width) (x: uint_t t SEC) =
| vec_load #t x w | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.