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.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.uint8 | val uint8 : Type0 | let uint8 = Lib.IntTypes.uint8 | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 30,
"end_line": 22,
"start_col": 0,
"start_line": 22
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// ======================================= | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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 | Type0 | Prims.Tot | [
"total"
] | [] | [
"Lib.IntTypes.uint8"
] | [] | false | false | false | true | true | let uint8 =
| Lib.IntTypes.uint8 | false |
|
Hacl.Bignum.Multiplication.fst | Hacl.Bignum.Multiplication.bn_mul | val bn_mul: #t:limb_t -> bn_mul_st t | val bn_mul: #t:limb_t -> bn_mul_st t | let bn_mul #t aLen a bLen b res =
[@inline_let]
let resLen = aLen +! bLen in
memset res (uint #t 0) resLen;
let h0 = ST.get () in
LSeq.eq_intro (LSeq.sub (as_seq h0 res) 0 (v resLen)) (as_seq h0 res);
[@ inline_let]
let spec h = S.bn_mul_ (as_seq h a) (as_seq h b) in
loop1 h0 bLen res spec
(fun j ->
Loops.unfold_repeati (v bLen) (spec h0) (as_seq h0 res) (v j);
let bj = b.(j) in
res.(aLen +! j) <- bn_mul1_lshift_add aLen a bj (aLen +! bLen) j res
) | {
"file_name": "code/bignum/Hacl.Bignum.Multiplication.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 153,
"start_col": 0,
"start_line": 138
} | module Hacl.Bignum.Multiplication
open FStar.HyperStack
open FStar.HyperStack.ST
open FStar.Mul
open Lib.IntTypes
open Lib.Buffer
open Hacl.Bignum.Definitions
open Hacl.Bignum.Base
open Hacl.Impl.Lib
module ST = FStar.HyperStack.ST
module LSeq = Lib.Sequence
module B = LowStar.Buffer
module S = Hacl.Spec.Bignum.Multiplication
module SS = Hacl.Spec.Bignum.Squaring
module Loops = Lib.LoopCombinators
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
val bn_mul1:
#t:limb_t
-> aLen:size_t
-> a:lbignum t aLen
-> l:limb t
-> res:lbignum t aLen ->
Stack (limb t)
(requires fun h ->
live h a /\ live h res /\ eq_or_disjoint a res)
(ensures fun h0 c_out h1 -> modifies (loc res) h0 h1 /\
(c_out, as_seq h1 res) == S.bn_mul1 (as_seq h0 a) l)
let bn_mul1 #t aLen a l res =
push_frame ();
let c = create 1ul (uint #t 0) in
[@inline_let]
let refl h i = LSeq.index (as_seq h c) 0 in
[@inline_let]
let footprint (i:size_nat{i <= v aLen}) : GTot (l:B.loc{B.loc_disjoint l (loc res) /\
B.address_liveness_insensitive_locs `B.loc_includes` l}) = loc c in
[@inline_let]
let spec h = S.bn_mul1_f (as_seq h a) l in
let h0 = ST.get () in
fill_elems4 h0 aLen res refl footprint spec
(fun i ->
let h1 = ST.get () in
let a_i = a.(i) in
let res_i = sub res i 1ul in
c.(0ul) <- mul_wide_add_st a_i l c.(0ul) res_i;
lemma_eq_disjoint aLen aLen 1ul res a c i h0 h1
);
let c = c.(0ul) in
pop_frame ();
c
inline_for_extraction noextract
val bn_mul1_add_in_place:
#t:limb_t
-> aLen:size_t
-> a:lbignum t aLen
-> l:limb t
-> res:lbignum t aLen ->
Stack (limb t)
(requires fun h ->
live h a /\ live h res /\ disjoint res a)
(ensures fun h0 c_out h1 -> modifies (loc res) h0 h1 /\
(c_out, as_seq h1 res) == S.bn_mul1_add_in_place (as_seq h0 a) l (as_seq h0 res))
let bn_mul1_add_in_place #t aLen a l res =
push_frame ();
let c = create 1ul (uint #t 0) in
[@inline_let]
let refl h i = LSeq.index (as_seq h c) 0 in
[@inline_let]
let footprint (i:size_nat{i <= v aLen}) : GTot (l:B.loc{B.loc_disjoint l (loc res) /\
B.address_liveness_insensitive_locs `B.loc_includes` l}) = loc c in
[@inline_let]
let spec h = S.bn_mul1_add_in_place_f (as_seq h a) l (as_seq h res) in
let h0 = ST.get () in
fill_elems4 h0 aLen res refl footprint spec
(fun i ->
let a_i = a.(i) in
let res_i = sub res i 1ul in
c.(0ul) <- mul_wide_add2_st a_i l c.(0ul) res_i
);
let c = c.(0ul) in
pop_frame ();
c
inline_for_extraction noextract
val bn_mul1_lshift_add:
#t:limb_t
-> aLen:size_t
-> a:lbignum t aLen
-> b_j:limb t
-> resLen:size_t
-> j:size_t{v j + v aLen <= v resLen}
-> res:lbignum t resLen ->
Stack (limb t)
(requires fun h -> live h a /\ live h res /\ disjoint res a)
(ensures fun h0 c h1 -> modifies (loc res) h0 h1 /\
(c, as_seq h1 res) == S.bn_mul1_lshift_add (as_seq h0 a) b_j (v j) (as_seq h0 res))
let bn_mul1_lshift_add #t aLen a b_j resLen j res =
let res_j = sub res j aLen in
let h0 = ST.get () in
update_sub_f_carry h0 res j aLen
(fun h -> S.bn_mul1_add_in_place (as_seq h0 a) b_j (as_seq h0 res_j))
(fun _ -> bn_mul1_add_in_place aLen a b_j res_j)
inline_for_extraction noextract
let bn_mul_st (t:limb_t) =
aLen:size_t
-> a:lbignum t aLen
-> bLen:size_t{v aLen + v bLen <= max_size_t}
-> b:lbignum t bLen
-> res:lbignum t (aLen +! bLen) ->
Stack unit
(requires fun h ->
live h a /\ live h b /\ live h res /\
disjoint res a /\ disjoint res b /\ eq_or_disjoint a b)
(ensures fun h0 _ h1 -> modifies (loc res) h0 h1 /\
as_seq h1 res == S.bn_mul (as_seq h0 a) (as_seq h0 b))
inline_for_extraction noextract | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowStar.Ignore.fsti.checked",
"LowStar.Buffer.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.LoopCombinators.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Spec.Bignum.Squaring.fst.checked",
"Hacl.Spec.Bignum.Multiplication.fst.checked",
"Hacl.Impl.Lib.fst.checked",
"Hacl.Bignum.Definitions.fst.checked",
"Hacl.Bignum.Base.fst.checked",
"Hacl.Bignum.Addition.fst.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Bignum.Multiplication.fst"
} | [
{
"abbrev": true,
"full_module": "Lib.LoopCombinators",
"short_module": "Loops"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Squaring",
"short_module": "SS"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Bignum.Multiplication",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "Lib.Sequence",
"short_module": "LSeq"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Bignum.Base",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Bignum.Definitions",
"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.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Bignum",
"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 | Hacl.Bignum.Multiplication.bn_mul_st t | Prims.Tot | [
"total"
] | [] | [
"Hacl.Bignum.Definitions.limb_t",
"Lib.IntTypes.size_t",
"Hacl.Bignum.Definitions.lbignum",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_Addition",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Lib.IntTypes.max_size_t",
"Lib.IntTypes.op_Plus_Bang",
"Lib.Buffer.loop1",
"Hacl.Bignum.Definitions.limb",
"Prims.op_LessThan",
"Lib.Buffer.op_Array_Assignment",
"Prims.unit",
"Hacl.Bignum.Multiplication.bn_mul1_lshift_add",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT",
"Lib.LoopCombinators.unfold_repeati",
"Hacl.Spec.Bignum.Definitions.lbignum",
"Lib.Buffer.as_seq",
"FStar.Monotonic.HyperStack.mem",
"Prims.nat",
"Prims.op_Subtraction",
"Prims.pow2",
"Hacl.Spec.Bignum.Multiplication.bn_mul_",
"Lib.Sequence.eq_intro",
"Lib.Sequence.sub",
"FStar.HyperStack.ST.get",
"Lib.Buffer.memset",
"Lib.IntTypes.uint",
"Lib.IntTypes.SEC",
"Lib.IntTypes.int_t"
] | [] | false | false | false | false | false | let bn_mul #t aLen a bLen b res =
| [@@ inline_let ]let resLen = aLen +! bLen in
memset res (uint #t 0) resLen;
let h0 = ST.get () in
LSeq.eq_intro (LSeq.sub (as_seq h0 res) 0 (v resLen)) (as_seq h0 res);
[@@ inline_let ]let spec h = S.bn_mul_ (as_seq h a) (as_seq h b) in
loop1 h0
bLen
res
spec
(fun j ->
Loops.unfold_repeati (v bLen) (spec h0) (as_seq h0 res) (v j);
let bj = b.(j) in
res.(aLen +! j) <- bn_mul1_lshift_add aLen a bj (aLen +! bLen) j res) | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.validator_error_generic | val validator_error_generic:validator_error | val validator_error_generic:validator_error | let validator_error_generic : validator_error = normalize_term (set_validator_error_kind 0uL 1uL) | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 97,
"end_line": 120,
"start_col": 0,
"start_line": 120
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width
let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code
let get_validator_error_pos_eq_pos (x: pos_t) : Lemma
(get_validator_error_pos x == x)
[SMTPat (get_validator_error_pos x)]
= BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64 (64 - error_width) (U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL)) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | EverParse3d.ErrorCode.validator_error | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.normalize_term",
"EverParse3d.ErrorCode.validator_error",
"EverParse3d.ErrorCode.set_validator_error_kind",
"FStar.UInt64.__uint_to_t"
] | [] | false | false | false | true | false | let validator_error_generic:validator_error =
| normalize_term (set_validator_error_kind 0uL 1uL) | false |
Spec.HKDF.Test.fst | Spec.HKDF.Test.test | val test : _: Prims.unit -> FStar.All.ALL Prims.bool | let test () =
let res = List.for_all test_one test_vectors in
if res then begin IO.print_string "\n\nHKDF: Success!\n"; true end
else begin IO.print_string "\n\nHKDF: Failure :(\n"; false end | {
"file_name": "specs/tests/Spec.HKDF.Test.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 64,
"end_line": 256,
"start_col": 0,
"start_line": 253
} | module Spec.HKDF.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
module HMAC = Spec.Agile.HMAC
module HKDF = Spec.Agile.HKDF
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_hash = Spec.Hash.Definitions.SHA2_256
let test1_ikm : lbytes 22 =
let l = List.Tot.map u8_from_UInt8 [
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy
] in
assert_norm (List.Tot.length l == 22);
of_list l
let test1_salt : lbytes 13 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy
] in
assert_norm (List.Tot.length l == 13);
of_list l
let test1_info : lbytes 10 =
let l = List.Tot.map u8_from_UInt8 [
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy
] in
assert_norm (List.Tot.length l == 10);
of_list l
let test1_len = 42
let test1_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x07uy; 0x77uy; 0x09uy; 0x36uy; 0x2cuy; 0x2euy; 0x32uy; 0xdfuy;
0x0duy; 0xdcuy; 0x3fuy; 0x0duy; 0xc4uy; 0x7buy; 0xbauy; 0x63uy;
0x90uy; 0xb6uy; 0xc7uy; 0x3buy; 0xb5uy; 0x0fuy; 0x9cuy; 0x31uy;
0x22uy; 0xecuy; 0x84uy; 0x4auy; 0xd7uy; 0xc2uy; 0xb3uy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_expected_okm : lbytes 42 =
let l = List.Tot.map u8_from_UInt8 [
0x3cuy; 0xb2uy; 0x5fuy; 0x25uy; 0xfauy; 0xacuy; 0xd5uy; 0x7auy;
0x90uy; 0x43uy; 0x4fuy; 0x64uy; 0xd0uy; 0x36uy; 0x2fuy; 0x2auy;
0x2duy; 0x2duy; 0x0auy; 0x90uy; 0xcfuy; 0x1auy; 0x5auy; 0x4cuy;
0x5duy; 0xb0uy; 0x2duy; 0x56uy; 0xecuy; 0xc4uy; 0xc5uy; 0xbfuy;
0x34uy; 0x00uy; 0x72uy; 0x08uy; 0xd5uy; 0xb8uy; 0x87uy; 0x18uy;
0x58uy; 0x65uy
] in
assert_norm (List.Tot.length l == 42);
of_list l
/// Test 2
let test2_hash = Spec.Hash.Definitions.SHA2_256
let test2_ikm : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy; 0x0duy; 0x0euy; 0x0fuy;
0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy; 0x16uy; 0x17uy;
0x18uy; 0x19uy; 0x1auy; 0x1buy; 0x1cuy; 0x1duy; 0x1euy; 0x1fuy;
0x20uy; 0x21uy; 0x22uy; 0x23uy; 0x24uy; 0x25uy; 0x26uy; 0x27uy;
0x28uy; 0x29uy; 0x2auy; 0x2buy; 0x2cuy; 0x2duy; 0x2euy; 0x2fuy;
0x30uy; 0x31uy; 0x32uy; 0x33uy; 0x34uy; 0x35uy; 0x36uy; 0x37uy;
0x38uy; 0x39uy; 0x3auy; 0x3buy; 0x3cuy; 0x3duy; 0x3euy; 0x3fuy;
0x40uy; 0x41uy; 0x42uy; 0x43uy; 0x44uy; 0x45uy; 0x46uy; 0x47uy;
0x48uy; 0x49uy; 0x4auy; 0x4buy; 0x4cuy; 0x4duy; 0x4euy; 0x4fuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_salt : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x60uy; 0x61uy; 0x62uy; 0x63uy; 0x64uy; 0x65uy; 0x66uy; 0x67uy;
0x68uy; 0x69uy; 0x6auy; 0x6buy; 0x6cuy; 0x6duy; 0x6euy; 0x6fuy;
0x70uy; 0x71uy; 0x72uy; 0x73uy; 0x74uy; 0x75uy; 0x76uy; 0x77uy;
0x78uy; 0x79uy; 0x7auy; 0x7buy; 0x7cuy; 0x7duy; 0x7euy; 0x7fuy;
0x80uy; 0x81uy; 0x82uy; 0x83uy; 0x84uy; 0x85uy; 0x86uy; 0x87uy;
0x88uy; 0x89uy; 0x8auy; 0x8buy; 0x8cuy; 0x8duy; 0x8euy; 0x8fuy;
0x90uy; 0x91uy; 0x92uy; 0x93uy; 0x94uy; 0x95uy; 0x96uy; 0x97uy;
0x98uy; 0x99uy; 0x9auy; 0x9buy; 0x9cuy; 0x9duy; 0x9euy; 0x9fuy;
0xa0uy; 0xa1uy; 0xa2uy; 0xa3uy; 0xa4uy; 0xa5uy; 0xa6uy; 0xa7uy;
0xa8uy; 0xa9uy; 0xaauy; 0xabuy; 0xacuy; 0xaduy; 0xaeuy; 0xafuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_info : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0xb0uy; 0xb1uy; 0xb2uy; 0xb3uy; 0xb4uy; 0xb5uy; 0xb6uy; 0xb7uy;
0xb8uy; 0xb9uy; 0xbauy; 0xbbuy; 0xbcuy; 0xbduy; 0xbeuy; 0xbfuy;
0xc0uy; 0xc1uy; 0xc2uy; 0xc3uy; 0xc4uy; 0xc5uy; 0xc6uy; 0xc7uy;
0xc8uy; 0xc9uy; 0xcauy; 0xcbuy; 0xccuy; 0xcduy; 0xceuy; 0xcfuy;
0xd0uy; 0xd1uy; 0xd2uy; 0xd3uy; 0xd4uy; 0xd5uy; 0xd6uy; 0xd7uy;
0xd8uy; 0xd9uy; 0xdauy; 0xdbuy; 0xdcuy; 0xdduy; 0xdeuy; 0xdfuy;
0xe0uy; 0xe1uy; 0xe2uy; 0xe3uy; 0xe4uy; 0xe5uy; 0xe6uy; 0xe7uy;
0xe8uy; 0xe9uy; 0xeauy; 0xebuy; 0xecuy; 0xeduy; 0xeeuy; 0xefuy;
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy; 0xfauy; 0xfbuy; 0xfcuy; 0xfduy; 0xfeuy; 0xffuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_len = 82
let test2_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x06uy; 0xa6uy; 0xb8uy; 0x8cuy; 0x58uy; 0x53uy; 0x36uy; 0x1auy;
0x06uy; 0x10uy; 0x4cuy; 0x9cuy; 0xebuy; 0x35uy; 0xb4uy; 0x5cuy;
0xefuy; 0x76uy; 0x00uy; 0x14uy; 0x90uy; 0x46uy; 0x71uy; 0x01uy;
0x4auy; 0x19uy; 0x3fuy; 0x40uy; 0xc1uy; 0x5fuy; 0xc2uy; 0x44uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_expected_okm : lbytes 82 =
let l = List.Tot.map u8_from_UInt8 [
0xb1uy; 0x1euy; 0x39uy; 0x8duy; 0xc8uy; 0x03uy; 0x27uy; 0xa1uy;
0xc8uy; 0xe7uy; 0xf7uy; 0x8cuy; 0x59uy; 0x6auy; 0x49uy; 0x34uy;
0x4fuy; 0x01uy; 0x2euy; 0xdauy; 0x2duy; 0x4euy; 0xfauy; 0xd8uy;
0xa0uy; 0x50uy; 0xccuy; 0x4cuy; 0x19uy; 0xafuy; 0xa9uy; 0x7cuy;
0x59uy; 0x04uy; 0x5auy; 0x99uy; 0xcauy; 0xc7uy; 0x82uy; 0x72uy;
0x71uy; 0xcbuy; 0x41uy; 0xc6uy; 0x5euy; 0x59uy; 0x0euy; 0x09uy;
0xdauy; 0x32uy; 0x75uy; 0x60uy; 0x0cuy; 0x2fuy; 0x09uy; 0xb8uy;
0x36uy; 0x77uy; 0x93uy; 0xa9uy; 0xacuy; 0xa3uy; 0xdbuy; 0x71uy;
0xccuy; 0x30uy; 0xc5uy; 0x81uy; 0x79uy; 0xecuy; 0x3euy; 0x87uy;
0xc1uy; 0x4cuy; 0x01uy; 0xd5uy; 0xc1uy; 0xf3uy; 0x43uy; 0x4fuy;
0x1duy; 0x87uy
] in
assert_norm (List.Tot.length l == 82);
of_list l
/// Test 3
let test3_hash = Spec.Hash.Definitions.SHA2_256
let test3_ikm : lbytes 22 =
let l = List.Tot.map u8_from_UInt8 [
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy
] in
assert_norm (List.Tot.length l == 22);
of_list l
let test3_salt : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test3_info : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test3_len = 42
let test3_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x19uy; 0xefuy; 0x24uy; 0xa3uy; 0x2cuy; 0x71uy; 0x7buy; 0x16uy;
0x7fuy; 0x33uy; 0xa9uy; 0x1duy; 0x6fuy; 0x64uy; 0x8buy; 0xdfuy;
0x96uy; 0x59uy; 0x67uy; 0x76uy; 0xafuy; 0xdbuy; 0x63uy; 0x77uy;
0xacuy; 0x43uy; 0x4cuy; 0x1cuy; 0x29uy; 0x3cuy; 0xcbuy; 0x04uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_expected_okm : lbytes 42 =
let l = List.Tot.map u8_from_UInt8 [
0x8duy; 0xa4uy; 0xe7uy; 0x75uy; 0xa5uy; 0x63uy; 0xc1uy; 0x8fuy;
0x71uy; 0x5fuy; 0x80uy; 0x2auy; 0x06uy; 0x3cuy; 0x5auy; 0x31uy;
0xb8uy; 0xa1uy; 0x1fuy; 0x5cuy; 0x5euy; 0xe1uy; 0x87uy; 0x9euy;
0xc3uy; 0x45uy; 0x4euy; 0x5fuy; 0x3cuy; 0x73uy; 0x8duy; 0x2duy;
0x9duy; 0x20uy; 0x13uy; 0x95uy; 0xfauy; 0xa4uy; 0xb6uy; 0x1auy;
0x96uy; 0xc8uy
] in
assert_norm (List.Tot.length l == 42);
of_list l
noeq type vec =
| Vec :
a:Spec.Hash.Definitions.fixed_len_alg
-> salt:bytes{HMAC.keysized a (length salt)}
-> ikm:bytes{HKDF.extract_ikm_length_pred a (length ikm)}
-> expected_prk:lbytes (Spec.Hash.Definitions.hash_length a)
-> info:bytes{HKDF.expand_info_length_pred a (length info)}
-> out_len:nat{HKDF.expand_output_length_pred a out_len}
-> expected_okm:lbytes out_len -> vec
let _: squash (pow2 32 < pow2 61 /\ pow2 32 < pow2 125) =
Math.Lemmas.pow2_lt_compat 61 32;
Math.Lemmas.pow2_lt_compat 125 32
let test_vectors: list vec = [
Vec test1_hash test1_salt test1_ikm
test1_expected_prk test1_info test1_len test1_expected_okm;
Vec test2_hash test2_salt test2_ikm
test2_expected_prk test2_info test2_len test2_expected_okm;
Vec test3_hash test3_salt test3_ikm
test3_expected_prk test3_info test3_len test3_expected_okm ]
#set-options "--ifuel 2"
let test_one (v:vec) =
let Vec a salt ikm expected_prk info out_len expected_okm = v in
let test_prk = HKDF.extract a salt ikm in
let test_okm = HKDF.expand a expected_prk info out_len in
IO.print_string "\nPRK:";
let r_a = PS.print_compare true (length expected_prk) expected_prk test_prk in
IO.print_string "\nOKM:";
let r_b = PS.print_compare true (length expected_okm) expected_okm test_okm in
let res = r_a && r_b in
if r_a then IO.print_string "\nHKDF Extract: Success!\n"
else IO.print_string "\nHKDF Extract: Failure :(\n";
if r_b then IO.print_string "HKDF Expand: Success!\n"
else IO.print_string "HKDF Expand: Failure :(\n";
res | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.HMAC.fsti.checked",
"Spec.Agile.HKDF.fsti.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.PrintSequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": false,
"source_file": "Spec.HKDF.Test.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Agile.HKDF",
"short_module": "HKDF"
},
{
"abbrev": true,
"full_module": "Spec.Agile.HMAC",
"short_module": "HMAC"
},
{
"abbrev": true,
"full_module": "Lib.PrintSequence",
"short_module": "PS"
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.RawIntTypes",
"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": "Spec.HKDF",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.HKDF",
"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": 2,
"max_fuel": 0,
"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": 50,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | _: Prims.unit -> FStar.All.ALL Prims.bool | FStar.All.ALL | [] | [] | [
"Prims.unit",
"Prims.bool",
"FStar.IO.print_string",
"FStar.List.for_all",
"Spec.HKDF.Test.vec",
"Spec.HKDF.Test.test_one",
"Spec.HKDF.Test.test_vectors"
] | [] | false | true | false | false | false | let test () =
| let res = List.for_all test_one test_vectors in
if res
then
(IO.print_string "\n\nHKDF: Success!\n";
true)
else
(IO.print_string "\n\nHKDF: Failure :(\n";
false) | false |
|
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.validator_max_length | val validator_max_length:(u: U64.t{4 <= U64.v u /\ U64.v u == pow2 pos_width - 1}) | val validator_max_length:(u: U64.t{4 <= U64.v u /\ U64.v u == pow2 pos_width - 1}) | let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 18,
"end_line": 20,
"start_col": 0,
"start_line": 15
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | u0:
FStar.UInt64.t
{4 <= FStar.UInt64.v u0 /\ FStar.UInt64.v u0 == Prims.pow2 EverParse3d.ErrorCode.pos_width - 1} | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.normalize_term",
"FStar.UInt64.t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.UInt64.v",
"Prims.eq2",
"Prims.int",
"Prims.op_Subtraction",
"Prims.pow2",
"EverParse3d.ErrorCode.pos_width",
"Prims.unit",
"FStar.Pervasives.normalize_term_spec",
"FStar.UInt64.uint_to_t",
"FStar.Math.Lemmas.pow2_le_compat"
] | [] | false | false | false | false | false | let validator_max_length:(u: U64.t{4 <= U64.v u /\ U64.v u == pow2 pos_width - 1}) =
| FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@@ inline_let ]let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x | false |
Spec.HKDF.Test.fst | Spec.HKDF.Test.test2_expected_okm | val test2_expected_okm:lbytes 82 | val test2_expected_okm:lbytes 82 | let test2_expected_okm : lbytes 82 =
let l = List.Tot.map u8_from_UInt8 [
0xb1uy; 0x1euy; 0x39uy; 0x8duy; 0xc8uy; 0x03uy; 0x27uy; 0xa1uy;
0xc8uy; 0xe7uy; 0xf7uy; 0x8cuy; 0x59uy; 0x6auy; 0x49uy; 0x34uy;
0x4fuy; 0x01uy; 0x2euy; 0xdauy; 0x2duy; 0x4euy; 0xfauy; 0xd8uy;
0xa0uy; 0x50uy; 0xccuy; 0x4cuy; 0x19uy; 0xafuy; 0xa9uy; 0x7cuy;
0x59uy; 0x04uy; 0x5auy; 0x99uy; 0xcauy; 0xc7uy; 0x82uy; 0x72uy;
0x71uy; 0xcbuy; 0x41uy; 0xc6uy; 0x5euy; 0x59uy; 0x0euy; 0x09uy;
0xdauy; 0x32uy; 0x75uy; 0x60uy; 0x0cuy; 0x2fuy; 0x09uy; 0xb8uy;
0x36uy; 0x77uy; 0x93uy; 0xa9uy; 0xacuy; 0xa3uy; 0xdbuy; 0x71uy;
0xccuy; 0x30uy; 0xc5uy; 0x81uy; 0x79uy; 0xecuy; 0x3euy; 0x87uy;
0xc1uy; 0x4cuy; 0x01uy; 0xd5uy; 0xc1uy; 0xf3uy; 0x43uy; 0x4fuy;
0x1duy; 0x87uy
] in
assert_norm (List.Tot.length l == 82);
of_list l | {
"file_name": "specs/tests/Spec.HKDF.Test.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 11,
"end_line": 154,
"start_col": 0,
"start_line": 139
} | module Spec.HKDF.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
module HMAC = Spec.Agile.HMAC
module HKDF = Spec.Agile.HKDF
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_hash = Spec.Hash.Definitions.SHA2_256
let test1_ikm : lbytes 22 =
let l = List.Tot.map u8_from_UInt8 [
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy
] in
assert_norm (List.Tot.length l == 22);
of_list l
let test1_salt : lbytes 13 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy
] in
assert_norm (List.Tot.length l == 13);
of_list l
let test1_info : lbytes 10 =
let l = List.Tot.map u8_from_UInt8 [
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy
] in
assert_norm (List.Tot.length l == 10);
of_list l
let test1_len = 42
let test1_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x07uy; 0x77uy; 0x09uy; 0x36uy; 0x2cuy; 0x2euy; 0x32uy; 0xdfuy;
0x0duy; 0xdcuy; 0x3fuy; 0x0duy; 0xc4uy; 0x7buy; 0xbauy; 0x63uy;
0x90uy; 0xb6uy; 0xc7uy; 0x3buy; 0xb5uy; 0x0fuy; 0x9cuy; 0x31uy;
0x22uy; 0xecuy; 0x84uy; 0x4auy; 0xd7uy; 0xc2uy; 0xb3uy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_expected_okm : lbytes 42 =
let l = List.Tot.map u8_from_UInt8 [
0x3cuy; 0xb2uy; 0x5fuy; 0x25uy; 0xfauy; 0xacuy; 0xd5uy; 0x7auy;
0x90uy; 0x43uy; 0x4fuy; 0x64uy; 0xd0uy; 0x36uy; 0x2fuy; 0x2auy;
0x2duy; 0x2duy; 0x0auy; 0x90uy; 0xcfuy; 0x1auy; 0x5auy; 0x4cuy;
0x5duy; 0xb0uy; 0x2duy; 0x56uy; 0xecuy; 0xc4uy; 0xc5uy; 0xbfuy;
0x34uy; 0x00uy; 0x72uy; 0x08uy; 0xd5uy; 0xb8uy; 0x87uy; 0x18uy;
0x58uy; 0x65uy
] in
assert_norm (List.Tot.length l == 42);
of_list l
/// Test 2
let test2_hash = Spec.Hash.Definitions.SHA2_256
let test2_ikm : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy; 0x0duy; 0x0euy; 0x0fuy;
0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy; 0x16uy; 0x17uy;
0x18uy; 0x19uy; 0x1auy; 0x1buy; 0x1cuy; 0x1duy; 0x1euy; 0x1fuy;
0x20uy; 0x21uy; 0x22uy; 0x23uy; 0x24uy; 0x25uy; 0x26uy; 0x27uy;
0x28uy; 0x29uy; 0x2auy; 0x2buy; 0x2cuy; 0x2duy; 0x2euy; 0x2fuy;
0x30uy; 0x31uy; 0x32uy; 0x33uy; 0x34uy; 0x35uy; 0x36uy; 0x37uy;
0x38uy; 0x39uy; 0x3auy; 0x3buy; 0x3cuy; 0x3duy; 0x3euy; 0x3fuy;
0x40uy; 0x41uy; 0x42uy; 0x43uy; 0x44uy; 0x45uy; 0x46uy; 0x47uy;
0x48uy; 0x49uy; 0x4auy; 0x4buy; 0x4cuy; 0x4duy; 0x4euy; 0x4fuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_salt : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x60uy; 0x61uy; 0x62uy; 0x63uy; 0x64uy; 0x65uy; 0x66uy; 0x67uy;
0x68uy; 0x69uy; 0x6auy; 0x6buy; 0x6cuy; 0x6duy; 0x6euy; 0x6fuy;
0x70uy; 0x71uy; 0x72uy; 0x73uy; 0x74uy; 0x75uy; 0x76uy; 0x77uy;
0x78uy; 0x79uy; 0x7auy; 0x7buy; 0x7cuy; 0x7duy; 0x7euy; 0x7fuy;
0x80uy; 0x81uy; 0x82uy; 0x83uy; 0x84uy; 0x85uy; 0x86uy; 0x87uy;
0x88uy; 0x89uy; 0x8auy; 0x8buy; 0x8cuy; 0x8duy; 0x8euy; 0x8fuy;
0x90uy; 0x91uy; 0x92uy; 0x93uy; 0x94uy; 0x95uy; 0x96uy; 0x97uy;
0x98uy; 0x99uy; 0x9auy; 0x9buy; 0x9cuy; 0x9duy; 0x9euy; 0x9fuy;
0xa0uy; 0xa1uy; 0xa2uy; 0xa3uy; 0xa4uy; 0xa5uy; 0xa6uy; 0xa7uy;
0xa8uy; 0xa9uy; 0xaauy; 0xabuy; 0xacuy; 0xaduy; 0xaeuy; 0xafuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_info : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0xb0uy; 0xb1uy; 0xb2uy; 0xb3uy; 0xb4uy; 0xb5uy; 0xb6uy; 0xb7uy;
0xb8uy; 0xb9uy; 0xbauy; 0xbbuy; 0xbcuy; 0xbduy; 0xbeuy; 0xbfuy;
0xc0uy; 0xc1uy; 0xc2uy; 0xc3uy; 0xc4uy; 0xc5uy; 0xc6uy; 0xc7uy;
0xc8uy; 0xc9uy; 0xcauy; 0xcbuy; 0xccuy; 0xcduy; 0xceuy; 0xcfuy;
0xd0uy; 0xd1uy; 0xd2uy; 0xd3uy; 0xd4uy; 0xd5uy; 0xd6uy; 0xd7uy;
0xd8uy; 0xd9uy; 0xdauy; 0xdbuy; 0xdcuy; 0xdduy; 0xdeuy; 0xdfuy;
0xe0uy; 0xe1uy; 0xe2uy; 0xe3uy; 0xe4uy; 0xe5uy; 0xe6uy; 0xe7uy;
0xe8uy; 0xe9uy; 0xeauy; 0xebuy; 0xecuy; 0xeduy; 0xeeuy; 0xefuy;
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy; 0xfauy; 0xfbuy; 0xfcuy; 0xfduy; 0xfeuy; 0xffuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_len = 82
let test2_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x06uy; 0xa6uy; 0xb8uy; 0x8cuy; 0x58uy; 0x53uy; 0x36uy; 0x1auy;
0x06uy; 0x10uy; 0x4cuy; 0x9cuy; 0xebuy; 0x35uy; 0xb4uy; 0x5cuy;
0xefuy; 0x76uy; 0x00uy; 0x14uy; 0x90uy; 0x46uy; 0x71uy; 0x01uy;
0x4auy; 0x19uy; 0x3fuy; 0x40uy; 0xc1uy; 0x5fuy; 0xc2uy; 0x44uy
] in
assert_norm (List.Tot.length l == 32);
of_list l | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.HMAC.fsti.checked",
"Spec.Agile.HKDF.fsti.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.PrintSequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": false,
"source_file": "Spec.HKDF.Test.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Agile.HKDF",
"short_module": "HKDF"
},
{
"abbrev": true,
"full_module": "Spec.Agile.HMAC",
"short_module": "HMAC"
},
{
"abbrev": true,
"full_module": "Lib.PrintSequence",
"short_module": "PS"
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.RawIntTypes",
"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": "Spec.HKDF",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.HKDF",
"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 | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 82 | Prims.Tot | [
"total"
] | [] | [
"Lib.Sequence.of_list",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Prims.list",
"FStar.List.Tot.Base.map",
"FStar.UInt8.t",
"Lib.RawIntTypes.u8_from_UInt8",
"Prims.Cons",
"FStar.UInt8.__uint_to_t",
"Prims.Nil"
] | [] | false | false | false | false | false | let test2_expected_okm:lbytes 82 =
| let l =
List.Tot.map u8_from_UInt8
[
0xb1uy; 0x1euy; 0x39uy; 0x8duy; 0xc8uy; 0x03uy; 0x27uy; 0xa1uy; 0xc8uy; 0xe7uy; 0xf7uy; 0x8cuy;
0x59uy; 0x6auy; 0x49uy; 0x34uy; 0x4fuy; 0x01uy; 0x2euy; 0xdauy; 0x2duy; 0x4euy; 0xfauy; 0xd8uy;
0xa0uy; 0x50uy; 0xccuy; 0x4cuy; 0x19uy; 0xafuy; 0xa9uy; 0x7cuy; 0x59uy; 0x04uy; 0x5auy; 0x99uy;
0xcauy; 0xc7uy; 0x82uy; 0x72uy; 0x71uy; 0xcbuy; 0x41uy; 0xc6uy; 0x5euy; 0x59uy; 0x0euy; 0x09uy;
0xdauy; 0x32uy; 0x75uy; 0x60uy; 0x0cuy; 0x2fuy; 0x09uy; 0xb8uy; 0x36uy; 0x77uy; 0x93uy; 0xa9uy;
0xacuy; 0xa3uy; 0xdbuy; 0x71uy; 0xccuy; 0x30uy; 0xc5uy; 0x81uy; 0x79uy; 0xecuy; 0x3euy; 0x87uy;
0xc1uy; 0x4cuy; 0x01uy; 0xd5uy; 0xc1uy; 0xf3uy; 0x43uy; 0x4fuy; 0x1duy; 0x87uy
]
in
assert_norm (List.Tot.length l == 82);
of_list l | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.validator_error_not_enough_data | val validator_error_not_enough_data:validator_error | val validator_error_not_enough_data:validator_error | let validator_error_not_enough_data : validator_error = normalize_term (set_validator_error_kind 0uL 2uL) | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 105,
"end_line": 123,
"start_col": 0,
"start_line": 123
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width
let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code
let get_validator_error_pos_eq_pos (x: pos_t) : Lemma
(get_validator_error_pos x == x)
[SMTPat (get_validator_error_pos x)]
= BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64 (64 - error_width) (U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL))
[@ CMacro ]
let validator_error_generic : validator_error = normalize_term (set_validator_error_kind 0uL 1uL) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | EverParse3d.ErrorCode.validator_error | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.normalize_term",
"EverParse3d.ErrorCode.validator_error",
"EverParse3d.ErrorCode.set_validator_error_kind",
"FStar.UInt64.__uint_to_t"
] | [] | false | false | false | true | false | let validator_error_not_enough_data:validator_error =
| normalize_term (set_validator_error_kind 0uL 2uL) | false |
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.finish_ | val finish_ : k: Spec.Poly1305.key -> _: (Spec.Poly1305.felem * _) -> Spec.Poly1305.tag | let finish_ k (acc, r) =
Spec.Poly1305.poly1305_finish k acc | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 37,
"end_line": 170,
"start_col": 0,
"start_line": 169
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x
inline_for_extraction noextract
let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit
inline_for_extraction noextract
let as_lib_k (x: B.buffer uint8 { B.length x = 32 }): Lib.Buffer.lbuffer uint8 32ul =
x
inline_for_extraction noextract
let num_lanes (fs : field_spec) : F32xN.lanes =
match fs with
| M32 -> 1
| M128 -> 2
| M256 -> 4
inline_for_extraction noextract
let stateful_poly1305_ctx (fs : field_spec) : I.stateful unit =
I.Stateful
(fun () -> t fs)
(fun #_ _ s -> B.loc_addr_of_buffer (as_raw s))
(fun #_ _ s -> B.freeable (as_raw s))
(fun #_ h s -> B.live h (as_raw s) /\ P.state_inv_t h (as_lib s))
(fun () -> Spec.Poly1305.felem & Spec.Poly1305.felem)
(fun () h s -> P.as_get_acc h (as_lib s), P.as_get_r h (as_lib s))
(fun #_ _ _ -> ())
(fun #_ l s h0 h1 ->
P.reveal_ctx_inv (as_lib s) h0 h1;
B.modifies_buffer_elim (as_raw s) l h0 h1)
(fun #_ _ _ _ _ -> ())
(fun () ->
[@inline_let]
let n = num_lanes fs in
let r = B.alloca (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun () r ->
[@inline_let]
let n = num_lanes fs in
let r = B.malloc r (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun _ s -> B.free s)
(fun _ src dst ->
let h0 = ST.get () in
B.blit src 0ul dst 0ul 25ul;
let h1 = ST.get () in
P.reveal_ctx_inv' (as_lib src) (as_lib dst) h0 h1)
/// Interlude for spec equivalence proofs
/// =====================================
///
/// A quick explanation about this proof of equivalence. At the spec level,
/// ``poly1305_update`` needs both ``r`` and the accumulator ``acc``. This thus
/// makes poly1305 update a function of two arguments. However, the streaming
/// facility is constructed over specifications that take one single argument.
/// Not a problem! We carry the pair ``(r, acc)`` as our "streaming functor
/// accumulator", and we now have to show that a specification in terms of
/// ``update (update (r, acc) init)`` is the same as poly1305. For that, we need
/// to do a little proof of equivalence to show first that this is the same as
/// ``(update r) ((update r) acc)`` (note that the update function now becomes a
/// partial application), then use the update-multi-repeat conversion lemma to
/// get the original specification of poly1305.
inline_for_extraction noextract
let block = (block: S.seq uint8 { S.length block = Spec.Poly1305.size_block })
inline_for_extraction noextract
let update_ (acc, r) (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc, r
/// Same as [update_], but with the input not necessarily a full block (can be smaller)
inline_for_extraction noextract
let update__ (acc, r) (input: S.seq uint8{S.length input <= Spec.Poly1305.size_block}) =
Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r
inline_for_extraction noextract
let update' r acc (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc
inline_for_extraction noextract
let update_multi =
Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block update_
inline_for_extraction noextract
let update_multi' r =
Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block (update' r)
#push-options "--fuel 1"
inline_for_extraction noextract
let rec with_or_without_r (acc r: Spec.Poly1305.felem) (blocks: S.seq uint8):
Lemma
(requires
S.length blocks % Spec.Poly1305.size_block = 0)
(ensures
update_multi (acc, r) blocks == (update_multi' r acc blocks, r))
(decreases (S.length blocks))
=
if S.length blocks = 0 then
()
else
let block, rem = Lib.UpdateMulti.split_block Spec.Poly1305.size_block blocks 1 in
let acc = update' r acc block in
with_or_without_r acc r rem
#pop-options
inline_for_extraction noextract
let update_last (acc, r) (input: S.seq uint8 { S.length input <= Spec.Poly1305.size_block }) =
if S.length input = 0 then
acc, r
else
Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r
inline_for_extraction noextract
let update_last' r acc (input: S.seq uint8 { S.length input <= Spec.Poly1305.size_block }) =
if S.length input = 0 then
acc
else
Spec.Poly1305.poly1305_update1 r (S.length input) input acc | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 | k: Spec.Poly1305.key -> _: (Spec.Poly1305.felem * _) -> Spec.Poly1305.tag | Prims.Tot | [
"total"
] | [] | [
"Spec.Poly1305.key",
"FStar.Pervasives.Native.tuple2",
"Spec.Poly1305.felem",
"Spec.Poly1305.poly1305_finish",
"Spec.Poly1305.tag"
] | [] | false | false | false | true | false | let finish_ k (acc, r) =
| Spec.Poly1305.poly1305_finish k acc | false |
|
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.spec | val spec : k: Spec.Poly1305.key -> input: Lib.ByteSequence.bytes -> Spec.Poly1305.tag | let spec k input =
Spec.Poly1305.poly1305_mac input k | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 36,
"end_line": 174,
"start_col": 0,
"start_line": 173
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x
inline_for_extraction noextract
let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit
inline_for_extraction noextract
let as_lib_k (x: B.buffer uint8 { B.length x = 32 }): Lib.Buffer.lbuffer uint8 32ul =
x
inline_for_extraction noextract
let num_lanes (fs : field_spec) : F32xN.lanes =
match fs with
| M32 -> 1
| M128 -> 2
| M256 -> 4
inline_for_extraction noextract
let stateful_poly1305_ctx (fs : field_spec) : I.stateful unit =
I.Stateful
(fun () -> t fs)
(fun #_ _ s -> B.loc_addr_of_buffer (as_raw s))
(fun #_ _ s -> B.freeable (as_raw s))
(fun #_ h s -> B.live h (as_raw s) /\ P.state_inv_t h (as_lib s))
(fun () -> Spec.Poly1305.felem & Spec.Poly1305.felem)
(fun () h s -> P.as_get_acc h (as_lib s), P.as_get_r h (as_lib s))
(fun #_ _ _ -> ())
(fun #_ l s h0 h1 ->
P.reveal_ctx_inv (as_lib s) h0 h1;
B.modifies_buffer_elim (as_raw s) l h0 h1)
(fun #_ _ _ _ _ -> ())
(fun () ->
[@inline_let]
let n = num_lanes fs in
let r = B.alloca (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun () r ->
[@inline_let]
let n = num_lanes fs in
let r = B.malloc r (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun _ s -> B.free s)
(fun _ src dst ->
let h0 = ST.get () in
B.blit src 0ul dst 0ul 25ul;
let h1 = ST.get () in
P.reveal_ctx_inv' (as_lib src) (as_lib dst) h0 h1)
/// Interlude for spec equivalence proofs
/// =====================================
///
/// A quick explanation about this proof of equivalence. At the spec level,
/// ``poly1305_update`` needs both ``r`` and the accumulator ``acc``. This thus
/// makes poly1305 update a function of two arguments. However, the streaming
/// facility is constructed over specifications that take one single argument.
/// Not a problem! We carry the pair ``(r, acc)`` as our "streaming functor
/// accumulator", and we now have to show that a specification in terms of
/// ``update (update (r, acc) init)`` is the same as poly1305. For that, we need
/// to do a little proof of equivalence to show first that this is the same as
/// ``(update r) ((update r) acc)`` (note that the update function now becomes a
/// partial application), then use the update-multi-repeat conversion lemma to
/// get the original specification of poly1305.
inline_for_extraction noextract
let block = (block: S.seq uint8 { S.length block = Spec.Poly1305.size_block })
inline_for_extraction noextract
let update_ (acc, r) (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc, r
/// Same as [update_], but with the input not necessarily a full block (can be smaller)
inline_for_extraction noextract
let update__ (acc, r) (input: S.seq uint8{S.length input <= Spec.Poly1305.size_block}) =
Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r
inline_for_extraction noextract
let update' r acc (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc
inline_for_extraction noextract
let update_multi =
Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block update_
inline_for_extraction noextract
let update_multi' r =
Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block (update' r)
#push-options "--fuel 1"
inline_for_extraction noextract
let rec with_or_without_r (acc r: Spec.Poly1305.felem) (blocks: S.seq uint8):
Lemma
(requires
S.length blocks % Spec.Poly1305.size_block = 0)
(ensures
update_multi (acc, r) blocks == (update_multi' r acc blocks, r))
(decreases (S.length blocks))
=
if S.length blocks = 0 then
()
else
let block, rem = Lib.UpdateMulti.split_block Spec.Poly1305.size_block blocks 1 in
let acc = update' r acc block in
with_or_without_r acc r rem
#pop-options
inline_for_extraction noextract
let update_last (acc, r) (input: S.seq uint8 { S.length input <= Spec.Poly1305.size_block }) =
if S.length input = 0 then
acc, r
else
Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r
inline_for_extraction noextract
let update_last' r acc (input: S.seq uint8 { S.length input <= Spec.Poly1305.size_block }) =
if S.length input = 0 then
acc
else
Spec.Poly1305.poly1305_update1 r (S.length input) input acc
inline_for_extraction noextract
let finish_ k (acc, r) =
Spec.Poly1305.poly1305_finish k acc | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 | k: Spec.Poly1305.key -> input: Lib.ByteSequence.bytes -> Spec.Poly1305.tag | Prims.Tot | [
"total"
] | [] | [
"Spec.Poly1305.key",
"Lib.ByteSequence.bytes",
"Spec.Poly1305.poly1305_mac",
"Spec.Poly1305.tag"
] | [] | false | false | false | true | false | let spec k input =
| Spec.Poly1305.poly1305_mac input k | false |
|
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.validator_error_impossible | val validator_error_impossible:validator_error | val validator_error_impossible:validator_error | let validator_error_impossible : validator_error = normalize_term (set_validator_error_kind 0uL 3uL) | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 100,
"end_line": 126,
"start_col": 0,
"start_line": 126
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width
let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code
let get_validator_error_pos_eq_pos (x: pos_t) : Lemma
(get_validator_error_pos x == x)
[SMTPat (get_validator_error_pos x)]
= BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64 (64 - error_width) (U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL))
[@ CMacro ]
let validator_error_generic : validator_error = normalize_term (set_validator_error_kind 0uL 1uL)
[@ CMacro ]
let validator_error_not_enough_data : validator_error = normalize_term (set_validator_error_kind 0uL 2uL) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | EverParse3d.ErrorCode.validator_error | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.normalize_term",
"EverParse3d.ErrorCode.validator_error",
"EverParse3d.ErrorCode.set_validator_error_kind",
"FStar.UInt64.__uint_to_t"
] | [] | false | false | false | true | false | let validator_error_impossible:validator_error =
| normalize_term (set_validator_error_kind 0uL 3uL) | false |
Spec.HKDF.Test.fst | Spec.HKDF.Test.test3_expected_okm | val test3_expected_okm:lbytes 42 | val test3_expected_okm:lbytes 42 | let test3_expected_okm : lbytes 42 =
let l = List.Tot.map u8_from_UInt8 [
0x8duy; 0xa4uy; 0xe7uy; 0x75uy; 0xa5uy; 0x63uy; 0xc1uy; 0x8fuy;
0x71uy; 0x5fuy; 0x80uy; 0x2auy; 0x06uy; 0x3cuy; 0x5auy; 0x31uy;
0xb8uy; 0xa1uy; 0x1fuy; 0x5cuy; 0x5euy; 0xe1uy; 0x87uy; 0x9euy;
0xc3uy; 0x45uy; 0x4euy; 0x5fuy; 0x3cuy; 0x73uy; 0x8duy; 0x2duy;
0x9duy; 0x20uy; 0x13uy; 0x95uy; 0xfauy; 0xa4uy; 0xb6uy; 0x1auy;
0x96uy; 0xc8uy
] in
assert_norm (List.Tot.length l == 42);
of_list l | {
"file_name": "specs/tests/Spec.HKDF.Test.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 11,
"end_line": 205,
"start_col": 0,
"start_line": 195
} | module Spec.HKDF.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
module HMAC = Spec.Agile.HMAC
module HKDF = Spec.Agile.HKDF
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_hash = Spec.Hash.Definitions.SHA2_256
let test1_ikm : lbytes 22 =
let l = List.Tot.map u8_from_UInt8 [
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy
] in
assert_norm (List.Tot.length l == 22);
of_list l
let test1_salt : lbytes 13 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy
] in
assert_norm (List.Tot.length l == 13);
of_list l
let test1_info : lbytes 10 =
let l = List.Tot.map u8_from_UInt8 [
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy
] in
assert_norm (List.Tot.length l == 10);
of_list l
let test1_len = 42
let test1_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x07uy; 0x77uy; 0x09uy; 0x36uy; 0x2cuy; 0x2euy; 0x32uy; 0xdfuy;
0x0duy; 0xdcuy; 0x3fuy; 0x0duy; 0xc4uy; 0x7buy; 0xbauy; 0x63uy;
0x90uy; 0xb6uy; 0xc7uy; 0x3buy; 0xb5uy; 0x0fuy; 0x9cuy; 0x31uy;
0x22uy; 0xecuy; 0x84uy; 0x4auy; 0xd7uy; 0xc2uy; 0xb3uy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_expected_okm : lbytes 42 =
let l = List.Tot.map u8_from_UInt8 [
0x3cuy; 0xb2uy; 0x5fuy; 0x25uy; 0xfauy; 0xacuy; 0xd5uy; 0x7auy;
0x90uy; 0x43uy; 0x4fuy; 0x64uy; 0xd0uy; 0x36uy; 0x2fuy; 0x2auy;
0x2duy; 0x2duy; 0x0auy; 0x90uy; 0xcfuy; 0x1auy; 0x5auy; 0x4cuy;
0x5duy; 0xb0uy; 0x2duy; 0x56uy; 0xecuy; 0xc4uy; 0xc5uy; 0xbfuy;
0x34uy; 0x00uy; 0x72uy; 0x08uy; 0xd5uy; 0xb8uy; 0x87uy; 0x18uy;
0x58uy; 0x65uy
] in
assert_norm (List.Tot.length l == 42);
of_list l
/// Test 2
let test2_hash = Spec.Hash.Definitions.SHA2_256
let test2_ikm : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy; 0x0duy; 0x0euy; 0x0fuy;
0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy; 0x16uy; 0x17uy;
0x18uy; 0x19uy; 0x1auy; 0x1buy; 0x1cuy; 0x1duy; 0x1euy; 0x1fuy;
0x20uy; 0x21uy; 0x22uy; 0x23uy; 0x24uy; 0x25uy; 0x26uy; 0x27uy;
0x28uy; 0x29uy; 0x2auy; 0x2buy; 0x2cuy; 0x2duy; 0x2euy; 0x2fuy;
0x30uy; 0x31uy; 0x32uy; 0x33uy; 0x34uy; 0x35uy; 0x36uy; 0x37uy;
0x38uy; 0x39uy; 0x3auy; 0x3buy; 0x3cuy; 0x3duy; 0x3euy; 0x3fuy;
0x40uy; 0x41uy; 0x42uy; 0x43uy; 0x44uy; 0x45uy; 0x46uy; 0x47uy;
0x48uy; 0x49uy; 0x4auy; 0x4buy; 0x4cuy; 0x4duy; 0x4euy; 0x4fuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_salt : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x60uy; 0x61uy; 0x62uy; 0x63uy; 0x64uy; 0x65uy; 0x66uy; 0x67uy;
0x68uy; 0x69uy; 0x6auy; 0x6buy; 0x6cuy; 0x6duy; 0x6euy; 0x6fuy;
0x70uy; 0x71uy; 0x72uy; 0x73uy; 0x74uy; 0x75uy; 0x76uy; 0x77uy;
0x78uy; 0x79uy; 0x7auy; 0x7buy; 0x7cuy; 0x7duy; 0x7euy; 0x7fuy;
0x80uy; 0x81uy; 0x82uy; 0x83uy; 0x84uy; 0x85uy; 0x86uy; 0x87uy;
0x88uy; 0x89uy; 0x8auy; 0x8buy; 0x8cuy; 0x8duy; 0x8euy; 0x8fuy;
0x90uy; 0x91uy; 0x92uy; 0x93uy; 0x94uy; 0x95uy; 0x96uy; 0x97uy;
0x98uy; 0x99uy; 0x9auy; 0x9buy; 0x9cuy; 0x9duy; 0x9euy; 0x9fuy;
0xa0uy; 0xa1uy; 0xa2uy; 0xa3uy; 0xa4uy; 0xa5uy; 0xa6uy; 0xa7uy;
0xa8uy; 0xa9uy; 0xaauy; 0xabuy; 0xacuy; 0xaduy; 0xaeuy; 0xafuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_info : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0xb0uy; 0xb1uy; 0xb2uy; 0xb3uy; 0xb4uy; 0xb5uy; 0xb6uy; 0xb7uy;
0xb8uy; 0xb9uy; 0xbauy; 0xbbuy; 0xbcuy; 0xbduy; 0xbeuy; 0xbfuy;
0xc0uy; 0xc1uy; 0xc2uy; 0xc3uy; 0xc4uy; 0xc5uy; 0xc6uy; 0xc7uy;
0xc8uy; 0xc9uy; 0xcauy; 0xcbuy; 0xccuy; 0xcduy; 0xceuy; 0xcfuy;
0xd0uy; 0xd1uy; 0xd2uy; 0xd3uy; 0xd4uy; 0xd5uy; 0xd6uy; 0xd7uy;
0xd8uy; 0xd9uy; 0xdauy; 0xdbuy; 0xdcuy; 0xdduy; 0xdeuy; 0xdfuy;
0xe0uy; 0xe1uy; 0xe2uy; 0xe3uy; 0xe4uy; 0xe5uy; 0xe6uy; 0xe7uy;
0xe8uy; 0xe9uy; 0xeauy; 0xebuy; 0xecuy; 0xeduy; 0xeeuy; 0xefuy;
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy; 0xfauy; 0xfbuy; 0xfcuy; 0xfduy; 0xfeuy; 0xffuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_len = 82
let test2_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x06uy; 0xa6uy; 0xb8uy; 0x8cuy; 0x58uy; 0x53uy; 0x36uy; 0x1auy;
0x06uy; 0x10uy; 0x4cuy; 0x9cuy; 0xebuy; 0x35uy; 0xb4uy; 0x5cuy;
0xefuy; 0x76uy; 0x00uy; 0x14uy; 0x90uy; 0x46uy; 0x71uy; 0x01uy;
0x4auy; 0x19uy; 0x3fuy; 0x40uy; 0xc1uy; 0x5fuy; 0xc2uy; 0x44uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_expected_okm : lbytes 82 =
let l = List.Tot.map u8_from_UInt8 [
0xb1uy; 0x1euy; 0x39uy; 0x8duy; 0xc8uy; 0x03uy; 0x27uy; 0xa1uy;
0xc8uy; 0xe7uy; 0xf7uy; 0x8cuy; 0x59uy; 0x6auy; 0x49uy; 0x34uy;
0x4fuy; 0x01uy; 0x2euy; 0xdauy; 0x2duy; 0x4euy; 0xfauy; 0xd8uy;
0xa0uy; 0x50uy; 0xccuy; 0x4cuy; 0x19uy; 0xafuy; 0xa9uy; 0x7cuy;
0x59uy; 0x04uy; 0x5auy; 0x99uy; 0xcauy; 0xc7uy; 0x82uy; 0x72uy;
0x71uy; 0xcbuy; 0x41uy; 0xc6uy; 0x5euy; 0x59uy; 0x0euy; 0x09uy;
0xdauy; 0x32uy; 0x75uy; 0x60uy; 0x0cuy; 0x2fuy; 0x09uy; 0xb8uy;
0x36uy; 0x77uy; 0x93uy; 0xa9uy; 0xacuy; 0xa3uy; 0xdbuy; 0x71uy;
0xccuy; 0x30uy; 0xc5uy; 0x81uy; 0x79uy; 0xecuy; 0x3euy; 0x87uy;
0xc1uy; 0x4cuy; 0x01uy; 0xd5uy; 0xc1uy; 0xf3uy; 0x43uy; 0x4fuy;
0x1duy; 0x87uy
] in
assert_norm (List.Tot.length l == 82);
of_list l
/// Test 3
let test3_hash = Spec.Hash.Definitions.SHA2_256
let test3_ikm : lbytes 22 =
let l = List.Tot.map u8_from_UInt8 [
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy
] in
assert_norm (List.Tot.length l == 22);
of_list l
let test3_salt : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test3_info : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test3_len = 42
let test3_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x19uy; 0xefuy; 0x24uy; 0xa3uy; 0x2cuy; 0x71uy; 0x7buy; 0x16uy;
0x7fuy; 0x33uy; 0xa9uy; 0x1duy; 0x6fuy; 0x64uy; 0x8buy; 0xdfuy;
0x96uy; 0x59uy; 0x67uy; 0x76uy; 0xafuy; 0xdbuy; 0x63uy; 0x77uy;
0xacuy; 0x43uy; 0x4cuy; 0x1cuy; 0x29uy; 0x3cuy; 0xcbuy; 0x04uy
] in
assert_norm (List.Tot.length l == 32);
of_list l | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.HMAC.fsti.checked",
"Spec.Agile.HKDF.fsti.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.PrintSequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": false,
"source_file": "Spec.HKDF.Test.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Agile.HKDF",
"short_module": "HKDF"
},
{
"abbrev": true,
"full_module": "Spec.Agile.HMAC",
"short_module": "HMAC"
},
{
"abbrev": true,
"full_module": "Lib.PrintSequence",
"short_module": "PS"
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.RawIntTypes",
"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": "Spec.HKDF",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.HKDF",
"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 | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 42 | Prims.Tot | [
"total"
] | [] | [
"Lib.Sequence.of_list",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Prims.list",
"FStar.List.Tot.Base.map",
"FStar.UInt8.t",
"Lib.RawIntTypes.u8_from_UInt8",
"Prims.Cons",
"FStar.UInt8.__uint_to_t",
"Prims.Nil"
] | [] | false | false | false | false | false | let test3_expected_okm:lbytes 42 =
| let l =
List.Tot.map u8_from_UInt8
[
0x8duy; 0xa4uy; 0xe7uy; 0x75uy; 0xa5uy; 0x63uy; 0xc1uy; 0x8fuy; 0x71uy; 0x5fuy; 0x80uy; 0x2auy;
0x06uy; 0x3cuy; 0x5auy; 0x31uy; 0xb8uy; 0xa1uy; 0x1fuy; 0x5cuy; 0x5euy; 0xe1uy; 0x87uy; 0x9euy;
0xc3uy; 0x45uy; 0x4euy; 0x5fuy; 0x3cuy; 0x73uy; 0x8duy; 0x2duy; 0x9duy; 0x20uy; 0x13uy; 0x95uy;
0xfauy; 0xa4uy; 0xb6uy; 0x1auy; 0x96uy; 0xc8uy
]
in
assert_norm (List.Tot.length l == 42);
of_list l | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.get_validator_error_field | val get_validator_error_field (x: U64.t) (lo: nat) (hi: nat{lo < hi /\ hi <= error_width})
: Tot (code: U64.t{0 <= U64.v code /\ U64.v code < pow2 (hi - lo)}) | val get_validator_error_field (x: U64.t) (lo: nat) (hi: nat{lo < hi /\ hi <= error_width})
: Tot (code: U64.t{0 <= U64.v code /\ U64.v code < pow2 (hi - lo)}) | let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 5,
"end_line": 45,
"start_col": 0,
"start_line": 40
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
x: FStar.UInt64.t ->
lo: Prims.nat ->
hi: Prims.nat{lo < hi /\ hi <= EverParse3d.ErrorCode.error_width}
-> code: FStar.UInt64.t{0 <= FStar.UInt64.v code /\ FStar.UInt64.v code < Prims.pow2 (hi - lo)} | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt64.t",
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.op_LessThanOrEqual",
"EverParse3d.ErrorCode.error_width",
"Prims.eq2",
"FStar.UInt.uint_t",
"LowParse.BitFields.__proj__Mkuint_t__item__v",
"LowParse.BitFields.uint64",
"LowParse.BitFields.get_bitfield",
"Prims.op_Addition",
"EverParse3d.ErrorCode.pos_width",
"LowParse.BitFields.__proj__Mkuint_t__item__get_bitfield",
"FStar.UInt64.v",
"Prims.pow2",
"Prims.op_Subtraction"
] | [] | false | false | false | false | false | let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat{lo < hi /\ hi <= error_width})
: Tot (code: U64.t{0 <= U64.v code /\ U64.v code < pow2 (hi - lo)}) =
| [@@ inline_let ]let res = BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi) in
res | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.validator_error_list_size_not_multiple | val validator_error_list_size_not_multiple:validator_error | val validator_error_list_size_not_multiple:validator_error | let validator_error_list_size_not_multiple : validator_error = normalize_term (set_validator_error_kind 0uL 4uL) | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 112,
"end_line": 129,
"start_col": 0,
"start_line": 129
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width
let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code
let get_validator_error_pos_eq_pos (x: pos_t) : Lemma
(get_validator_error_pos x == x)
[SMTPat (get_validator_error_pos x)]
= BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64 (64 - error_width) (U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL))
[@ CMacro ]
let validator_error_generic : validator_error = normalize_term (set_validator_error_kind 0uL 1uL)
[@ CMacro ]
let validator_error_not_enough_data : validator_error = normalize_term (set_validator_error_kind 0uL 2uL)
[@ CMacro ]
let validator_error_impossible : validator_error = normalize_term (set_validator_error_kind 0uL 3uL) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | EverParse3d.ErrorCode.validator_error | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.normalize_term",
"EverParse3d.ErrorCode.validator_error",
"EverParse3d.ErrorCode.set_validator_error_kind",
"FStar.UInt64.__uint_to_t"
] | [] | false | false | false | true | false | let validator_error_list_size_not_multiple:validator_error =
| normalize_term (set_validator_error_kind 0uL 4uL) | false |
Spec.HKDF.Test.fst | Spec.HKDF.Test.test3_expected_prk | val test3_expected_prk:lbytes 32 | val test3_expected_prk:lbytes 32 | let test3_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x19uy; 0xefuy; 0x24uy; 0xa3uy; 0x2cuy; 0x71uy; 0x7buy; 0x16uy;
0x7fuy; 0x33uy; 0xa9uy; 0x1duy; 0x6fuy; 0x64uy; 0x8buy; 0xdfuy;
0x96uy; 0x59uy; 0x67uy; 0x76uy; 0xafuy; 0xdbuy; 0x63uy; 0x77uy;
0xacuy; 0x43uy; 0x4cuy; 0x1cuy; 0x29uy; 0x3cuy; 0xcbuy; 0x04uy
] in
assert_norm (List.Tot.length l == 32);
of_list l | {
"file_name": "specs/tests/Spec.HKDF.Test.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 11,
"end_line": 192,
"start_col": 0,
"start_line": 184
} | module Spec.HKDF.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
module HMAC = Spec.Agile.HMAC
module HKDF = Spec.Agile.HKDF
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_hash = Spec.Hash.Definitions.SHA2_256
let test1_ikm : lbytes 22 =
let l = List.Tot.map u8_from_UInt8 [
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy
] in
assert_norm (List.Tot.length l == 22);
of_list l
let test1_salt : lbytes 13 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy
] in
assert_norm (List.Tot.length l == 13);
of_list l
let test1_info : lbytes 10 =
let l = List.Tot.map u8_from_UInt8 [
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy
] in
assert_norm (List.Tot.length l == 10);
of_list l
let test1_len = 42
let test1_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x07uy; 0x77uy; 0x09uy; 0x36uy; 0x2cuy; 0x2euy; 0x32uy; 0xdfuy;
0x0duy; 0xdcuy; 0x3fuy; 0x0duy; 0xc4uy; 0x7buy; 0xbauy; 0x63uy;
0x90uy; 0xb6uy; 0xc7uy; 0x3buy; 0xb5uy; 0x0fuy; 0x9cuy; 0x31uy;
0x22uy; 0xecuy; 0x84uy; 0x4auy; 0xd7uy; 0xc2uy; 0xb3uy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_expected_okm : lbytes 42 =
let l = List.Tot.map u8_from_UInt8 [
0x3cuy; 0xb2uy; 0x5fuy; 0x25uy; 0xfauy; 0xacuy; 0xd5uy; 0x7auy;
0x90uy; 0x43uy; 0x4fuy; 0x64uy; 0xd0uy; 0x36uy; 0x2fuy; 0x2auy;
0x2duy; 0x2duy; 0x0auy; 0x90uy; 0xcfuy; 0x1auy; 0x5auy; 0x4cuy;
0x5duy; 0xb0uy; 0x2duy; 0x56uy; 0xecuy; 0xc4uy; 0xc5uy; 0xbfuy;
0x34uy; 0x00uy; 0x72uy; 0x08uy; 0xd5uy; 0xb8uy; 0x87uy; 0x18uy;
0x58uy; 0x65uy
] in
assert_norm (List.Tot.length l == 42);
of_list l
/// Test 2
let test2_hash = Spec.Hash.Definitions.SHA2_256
let test2_ikm : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy; 0x0duy; 0x0euy; 0x0fuy;
0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy; 0x16uy; 0x17uy;
0x18uy; 0x19uy; 0x1auy; 0x1buy; 0x1cuy; 0x1duy; 0x1euy; 0x1fuy;
0x20uy; 0x21uy; 0x22uy; 0x23uy; 0x24uy; 0x25uy; 0x26uy; 0x27uy;
0x28uy; 0x29uy; 0x2auy; 0x2buy; 0x2cuy; 0x2duy; 0x2euy; 0x2fuy;
0x30uy; 0x31uy; 0x32uy; 0x33uy; 0x34uy; 0x35uy; 0x36uy; 0x37uy;
0x38uy; 0x39uy; 0x3auy; 0x3buy; 0x3cuy; 0x3duy; 0x3euy; 0x3fuy;
0x40uy; 0x41uy; 0x42uy; 0x43uy; 0x44uy; 0x45uy; 0x46uy; 0x47uy;
0x48uy; 0x49uy; 0x4auy; 0x4buy; 0x4cuy; 0x4duy; 0x4euy; 0x4fuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_salt : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x60uy; 0x61uy; 0x62uy; 0x63uy; 0x64uy; 0x65uy; 0x66uy; 0x67uy;
0x68uy; 0x69uy; 0x6auy; 0x6buy; 0x6cuy; 0x6duy; 0x6euy; 0x6fuy;
0x70uy; 0x71uy; 0x72uy; 0x73uy; 0x74uy; 0x75uy; 0x76uy; 0x77uy;
0x78uy; 0x79uy; 0x7auy; 0x7buy; 0x7cuy; 0x7duy; 0x7euy; 0x7fuy;
0x80uy; 0x81uy; 0x82uy; 0x83uy; 0x84uy; 0x85uy; 0x86uy; 0x87uy;
0x88uy; 0x89uy; 0x8auy; 0x8buy; 0x8cuy; 0x8duy; 0x8euy; 0x8fuy;
0x90uy; 0x91uy; 0x92uy; 0x93uy; 0x94uy; 0x95uy; 0x96uy; 0x97uy;
0x98uy; 0x99uy; 0x9auy; 0x9buy; 0x9cuy; 0x9duy; 0x9euy; 0x9fuy;
0xa0uy; 0xa1uy; 0xa2uy; 0xa3uy; 0xa4uy; 0xa5uy; 0xa6uy; 0xa7uy;
0xa8uy; 0xa9uy; 0xaauy; 0xabuy; 0xacuy; 0xaduy; 0xaeuy; 0xafuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_info : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0xb0uy; 0xb1uy; 0xb2uy; 0xb3uy; 0xb4uy; 0xb5uy; 0xb6uy; 0xb7uy;
0xb8uy; 0xb9uy; 0xbauy; 0xbbuy; 0xbcuy; 0xbduy; 0xbeuy; 0xbfuy;
0xc0uy; 0xc1uy; 0xc2uy; 0xc3uy; 0xc4uy; 0xc5uy; 0xc6uy; 0xc7uy;
0xc8uy; 0xc9uy; 0xcauy; 0xcbuy; 0xccuy; 0xcduy; 0xceuy; 0xcfuy;
0xd0uy; 0xd1uy; 0xd2uy; 0xd3uy; 0xd4uy; 0xd5uy; 0xd6uy; 0xd7uy;
0xd8uy; 0xd9uy; 0xdauy; 0xdbuy; 0xdcuy; 0xdduy; 0xdeuy; 0xdfuy;
0xe0uy; 0xe1uy; 0xe2uy; 0xe3uy; 0xe4uy; 0xe5uy; 0xe6uy; 0xe7uy;
0xe8uy; 0xe9uy; 0xeauy; 0xebuy; 0xecuy; 0xeduy; 0xeeuy; 0xefuy;
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy; 0xfauy; 0xfbuy; 0xfcuy; 0xfduy; 0xfeuy; 0xffuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_len = 82
let test2_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x06uy; 0xa6uy; 0xb8uy; 0x8cuy; 0x58uy; 0x53uy; 0x36uy; 0x1auy;
0x06uy; 0x10uy; 0x4cuy; 0x9cuy; 0xebuy; 0x35uy; 0xb4uy; 0x5cuy;
0xefuy; 0x76uy; 0x00uy; 0x14uy; 0x90uy; 0x46uy; 0x71uy; 0x01uy;
0x4auy; 0x19uy; 0x3fuy; 0x40uy; 0xc1uy; 0x5fuy; 0xc2uy; 0x44uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_expected_okm : lbytes 82 =
let l = List.Tot.map u8_from_UInt8 [
0xb1uy; 0x1euy; 0x39uy; 0x8duy; 0xc8uy; 0x03uy; 0x27uy; 0xa1uy;
0xc8uy; 0xe7uy; 0xf7uy; 0x8cuy; 0x59uy; 0x6auy; 0x49uy; 0x34uy;
0x4fuy; 0x01uy; 0x2euy; 0xdauy; 0x2duy; 0x4euy; 0xfauy; 0xd8uy;
0xa0uy; 0x50uy; 0xccuy; 0x4cuy; 0x19uy; 0xafuy; 0xa9uy; 0x7cuy;
0x59uy; 0x04uy; 0x5auy; 0x99uy; 0xcauy; 0xc7uy; 0x82uy; 0x72uy;
0x71uy; 0xcbuy; 0x41uy; 0xc6uy; 0x5euy; 0x59uy; 0x0euy; 0x09uy;
0xdauy; 0x32uy; 0x75uy; 0x60uy; 0x0cuy; 0x2fuy; 0x09uy; 0xb8uy;
0x36uy; 0x77uy; 0x93uy; 0xa9uy; 0xacuy; 0xa3uy; 0xdbuy; 0x71uy;
0xccuy; 0x30uy; 0xc5uy; 0x81uy; 0x79uy; 0xecuy; 0x3euy; 0x87uy;
0xc1uy; 0x4cuy; 0x01uy; 0xd5uy; 0xc1uy; 0xf3uy; 0x43uy; 0x4fuy;
0x1duy; 0x87uy
] in
assert_norm (List.Tot.length l == 82);
of_list l
/// Test 3
let test3_hash = Spec.Hash.Definitions.SHA2_256
let test3_ikm : lbytes 22 =
let l = List.Tot.map u8_from_UInt8 [
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy
] in
assert_norm (List.Tot.length l == 22);
of_list l
let test3_salt : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test3_info : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test3_len = 42 | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.HMAC.fsti.checked",
"Spec.Agile.HKDF.fsti.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.PrintSequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": false,
"source_file": "Spec.HKDF.Test.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Agile.HKDF",
"short_module": "HKDF"
},
{
"abbrev": true,
"full_module": "Spec.Agile.HMAC",
"short_module": "HMAC"
},
{
"abbrev": true,
"full_module": "Lib.PrintSequence",
"short_module": "PS"
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.RawIntTypes",
"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": "Spec.HKDF",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.HKDF",
"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 | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 32 | Prims.Tot | [
"total"
] | [] | [
"Lib.Sequence.of_list",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Prims.list",
"FStar.List.Tot.Base.map",
"FStar.UInt8.t",
"Lib.RawIntTypes.u8_from_UInt8",
"Prims.Cons",
"FStar.UInt8.__uint_to_t",
"Prims.Nil"
] | [] | false | false | false | false | false | let test3_expected_prk:lbytes 32 =
| let l =
List.Tot.map u8_from_UInt8
[
0x19uy; 0xefuy; 0x24uy; 0xa3uy; 0x2cuy; 0x71uy; 0x7buy; 0x16uy; 0x7fuy; 0x33uy; 0xa9uy; 0x1duy;
0x6fuy; 0x64uy; 0x8buy; 0xdfuy; 0x96uy; 0x59uy; 0x67uy; 0x76uy; 0xafuy; 0xdbuy; 0x63uy; 0x77uy;
0xacuy; 0x43uy; 0x4cuy; 0x1cuy; 0x29uy; 0x3cuy; 0xcbuy; 0x04uy
]
in
assert_norm (List.Tot.length l == 32);
of_list l | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.get_validator_error_pos | val get_validator_error_pos (x: U64.t) : Tot pos_t | val get_validator_error_pos (x: U64.t) : Tot pos_t | let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width) | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 43,
"end_line": 91,
"start_col": 0,
"start_line": 90
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: FStar.UInt64.t -> EverParse3d.ErrorCode.pos_t | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt64.t",
"LowParse.BitFields.__proj__Mkuint_t__item__get_bitfield",
"LowParse.BitFields.uint64",
"EverParse3d.ErrorCode.pos_width",
"EverParse3d.ErrorCode.pos_t"
] | [] | false | false | false | true | false | let get_validator_error_pos (x: U64.t) : Tot pos_t =
| (BF.uint64.BF.get_bitfield x 0 pos_width) | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.get_validator_error_kind | val get_validator_error_kind (error: U64.t)
: Tot (code: U64.t{0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) | val get_validator_error_kind (error: U64.t)
: Tot (code: U64.t{0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) | let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 47,
"end_line": 99,
"start_col": 0,
"start_line": 97
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | error: FStar.UInt64.t
-> code:
FStar.UInt64.t
{ 0 <= FStar.UInt64.v code /\
FStar.UInt64.v code <
FStar.Pervasives.normalize_term (Prims.pow2 EverParse3d.ErrorCode.error_width) } | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt64.t",
"EverParse3d.ErrorCode.get_validator_error_field",
"EverParse3d.ErrorCode.error_width",
"Prims.unit",
"FStar.Pervasives.normalize_term_spec",
"Prims.pos",
"Prims.pow2",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.UInt64.v",
"Prims.op_LessThan",
"FStar.Pervasives.normalize_term",
"Prims.int"
] | [] | false | false | false | false | false | let get_validator_error_kind (error: U64.t)
: Tot (code: U64.t{0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) =
| normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.set_validator_error_field | val set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat{lo < hi /\ hi <= error_width})
(code: U64.t{0 < U64.v code /\ U64.v code < pow2 (hi - lo)})
: Tot validator_error | val set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat{lo < hi /\ hi <= error_width})
(code: U64.t{0 < U64.v code /\ U64.v code < pow2 (hi - lo)})
: Tot validator_error | let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 5,
"end_line": 62,
"start_col": 0,
"start_line": 49
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
x: FStar.UInt64.t ->
lo: Prims.nat ->
hi: Prims.nat{lo < hi /\ hi <= EverParse3d.ErrorCode.error_width} ->
code: FStar.UInt64.t{0 < FStar.UInt64.v code /\ FStar.UInt64.v code < Prims.pow2 (hi - lo)}
-> EverParse3d.ErrorCode.validator_error | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt64.t",
"Prims.nat",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.op_LessThanOrEqual",
"EverParse3d.ErrorCode.error_width",
"FStar.UInt64.v",
"Prims.pow2",
"Prims.op_Subtraction",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"EverParse3d.ErrorCode.pos_width",
"Prims.op_Addition",
"EverParse3d.ErrorCode.validator_max_length",
"FStar.Classical.move_requires",
"FStar.UInt64.n",
"LowParse.BitFields.get_bitfield",
"LowParse.BitFields.lt_pow2_get_bitfield_hi",
"Prims._assert",
"Prims.op_GreaterThan",
"LowParse.BitFields.get_bitfield_zero_inner",
"LowParse.BitFields.get_bitfield_set_bitfield_same",
"FStar.UInt.uint_t",
"LowParse.BitFields.__proj__Mkuint_t__item__v",
"LowParse.BitFields.uint64",
"LowParse.BitFields.set_bitfield",
"LowParse.BitFields.__proj__Mkuint_t__item__set_bitfield",
"EverParse3d.ErrorCode.validator_error"
] | [] | false | false | false | false | false | let set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat{lo < hi /\ hi <= error_width})
(code: U64.t{0 < U64.v code /\ U64.v code < pow2 (hi - lo)})
: Tot validator_error =
| [@@ inline_let ]let res = BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code in
[@@ inline_let ]let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.get_validator_error_pos_eq_pos | val get_validator_error_pos_eq_pos (x: pos_t)
: Lemma (get_validator_error_pos x == x) [SMTPat (get_validator_error_pos x)] | val get_validator_error_pos_eq_pos (x: pos_t)
: Lemma (get_validator_error_pos x == x) [SMTPat (get_validator_error_pos x)] | let get_validator_error_pos_eq_pos (x: pos_t) : Lemma
(get_validator_error_pos x == x)
[SMTPat (get_validator_error_pos x)]
= BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64 (64 - error_width) (U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL)) | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 58,
"end_line": 117,
"start_col": 0,
"start_line": 107
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width
let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | x: EverParse3d.ErrorCode.pos_t
-> FStar.Pervasives.Lemma (ensures EverParse3d.ErrorCode.get_validator_error_pos x == x)
[SMTPat (EverParse3d.ErrorCode.get_validator_error_pos x)] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"EverParse3d.ErrorCode.pos_t",
"LowParse.BitFields.get_bitfield_partition_2",
"Prims.op_Subtraction",
"EverParse3d.ErrorCode.error_width",
"FStar.UInt64.v",
"LowParse.BitFields.__proj__Mkuint_t__item__set_bitfield",
"FStar.UInt64.t",
"LowParse.BitFields.uint64",
"EverParse3d.ErrorCode.pos_width",
"FStar.UInt64.__uint_to_t",
"Prims.unit",
"LowParse.BitFields.get_bitfield_set_bitfield_same",
"LowParse.BitFields.get_bitfield_set_bitfield_other",
"Prims._assert",
"Prims.eq2",
"Prims.int",
"LowParse.BitFields.get_bitfield",
"LowParse.BitFields.lt_pow2_get_bitfield_hi",
"LowParse.BitFields.get_bitfield_full",
"LowParse.BitFields.get_bitfield_size",
"Prims.l_True",
"Prims.squash",
"EverParse3d.ErrorCode.get_validator_error_pos",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat",
"Prims.Nil"
] | [] | true | false | true | false | false | let get_validator_error_pos_eq_pos (x: pos_t)
: Lemma (get_validator_error_pos x == x) [SMTPat (get_validator_error_pos x)] =
| BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64
(64 - error_width)
(U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL)) | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.validator_error_action_failed | val validator_error_action_failed:validator_error | val validator_error_action_failed:validator_error | let validator_error_action_failed : validator_error = normalize_term (set_validator_error_kind 0uL 5uL) | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 103,
"end_line": 132,
"start_col": 0,
"start_line": 132
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width
let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code
let get_validator_error_pos_eq_pos (x: pos_t) : Lemma
(get_validator_error_pos x == x)
[SMTPat (get_validator_error_pos x)]
= BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64 (64 - error_width) (U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL))
[@ CMacro ]
let validator_error_generic : validator_error = normalize_term (set_validator_error_kind 0uL 1uL)
[@ CMacro ]
let validator_error_not_enough_data : validator_error = normalize_term (set_validator_error_kind 0uL 2uL)
[@ CMacro ]
let validator_error_impossible : validator_error = normalize_term (set_validator_error_kind 0uL 3uL)
[@ CMacro ]
let validator_error_list_size_not_multiple : validator_error = normalize_term (set_validator_error_kind 0uL 4uL) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | EverParse3d.ErrorCode.validator_error | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.normalize_term",
"EverParse3d.ErrorCode.validator_error",
"EverParse3d.ErrorCode.set_validator_error_kind",
"FStar.UInt64.__uint_to_t"
] | [] | false | false | false | true | false | let validator_error_action_failed:validator_error =
| normalize_term (set_validator_error_kind 0uL 5uL) | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.set_validator_error_kind | val set_validator_error_kind
(error: U64.t)
(code: U64.t{0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)})
: Tot validator_error | val set_validator_error_kind
(error: U64.t)
(code: U64.t{0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)})
: Tot validator_error | let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 52,
"end_line": 95,
"start_col": 0,
"start_line": 93
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
error: FStar.UInt64.t ->
code:
FStar.UInt64.t
{ 0 < FStar.UInt64.v code /\
FStar.UInt64.v code <
FStar.Pervasives.normalize_term (Prims.pow2 EverParse3d.ErrorCode.error_width) }
-> EverParse3d.ErrorCode.validator_error | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt64.t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.UInt64.v",
"FStar.Pervasives.normalize_term",
"Prims.int",
"Prims.pow2",
"EverParse3d.ErrorCode.error_width",
"EverParse3d.ErrorCode.set_validator_error_field",
"Prims.unit",
"FStar.Pervasives.normalize_term_spec",
"Prims.pos",
"EverParse3d.ErrorCode.validator_error"
] | [] | false | false | false | false | false | let set_validator_error_kind
(error: U64.t)
(code: U64.t{0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)})
: Tot validator_error =
| normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.validator_error_constraint_failed | val validator_error_constraint_failed:validator_error | val validator_error_constraint_failed:validator_error | let validator_error_constraint_failed : validator_error = normalize_term (set_validator_error_kind 0uL 6uL) | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 107,
"end_line": 135,
"start_col": 0,
"start_line": 135
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width
let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code
let get_validator_error_pos_eq_pos (x: pos_t) : Lemma
(get_validator_error_pos x == x)
[SMTPat (get_validator_error_pos x)]
= BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64 (64 - error_width) (U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL))
[@ CMacro ]
let validator_error_generic : validator_error = normalize_term (set_validator_error_kind 0uL 1uL)
[@ CMacro ]
let validator_error_not_enough_data : validator_error = normalize_term (set_validator_error_kind 0uL 2uL)
[@ CMacro ]
let validator_error_impossible : validator_error = normalize_term (set_validator_error_kind 0uL 3uL)
[@ CMacro ]
let validator_error_list_size_not_multiple : validator_error = normalize_term (set_validator_error_kind 0uL 4uL)
[@ CMacro ]
let validator_error_action_failed : validator_error = normalize_term (set_validator_error_kind 0uL 5uL) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | EverParse3d.ErrorCode.validator_error | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.normalize_term",
"EverParse3d.ErrorCode.validator_error",
"EverParse3d.ErrorCode.set_validator_error_kind",
"FStar.UInt64.__uint_to_t"
] | [] | false | false | false | true | false | let validator_error_constraint_failed:validator_error =
| normalize_term (set_validator_error_kind 0uL 6uL) | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.set_validator_error_pos | val set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error | val set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error | let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 5,
"end_line": 86,
"start_col": 0,
"start_line": 73
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= () | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 16,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | error: EverParse3d.ErrorCode.validator_error -> position: EverParse3d.ErrorCode.pos_t
-> EverParse3d.ErrorCode.validator_error | Prims.Tot | [
"total"
] | [] | [
"EverParse3d.ErrorCode.validator_error",
"EverParse3d.ErrorCode.pos_t",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"Prims.pow2",
"EverParse3d.ErrorCode.pos_width",
"Prims.op_Addition",
"FStar.UInt64.v",
"EverParse3d.ErrorCode.validator_max_length",
"FStar.Classical.move_requires",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.UInt64.n",
"Prims.op_LessThan",
"LowParse.BitFields.get_bitfield",
"LowParse.BitFields.lt_pow2_get_bitfield_hi",
"LowParse.BitFields.get_bitfield_hi_lt_pow2",
"Prims._assert",
"LowParse.BitFields.ubitfield",
"Prims.op_Subtraction",
"LowParse.BitFields.get_bitfield_set_bitfield_other",
"FStar.UInt64.t",
"FStar.UInt.uint_t",
"LowParse.BitFields.__proj__Mkuint_t__item__v",
"LowParse.BitFields.uint64",
"LowParse.BitFields.set_bitfield",
"LowParse.BitFields.__proj__Mkuint_t__item__set_bitfield"
] | [] | false | false | false | true | false | let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
| [@@ inline_let ]let res = BF.uint64.BF.set_bitfield error 0 pos_width position in
[@@ inline_let ]let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res | false |
Spec.HKDF.Test.fst | Spec.HKDF.Test.test2_salt | val test2_salt:lbytes 80 | val test2_salt:lbytes 80 | let test2_salt : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x60uy; 0x61uy; 0x62uy; 0x63uy; 0x64uy; 0x65uy; 0x66uy; 0x67uy;
0x68uy; 0x69uy; 0x6auy; 0x6buy; 0x6cuy; 0x6duy; 0x6euy; 0x6fuy;
0x70uy; 0x71uy; 0x72uy; 0x73uy; 0x74uy; 0x75uy; 0x76uy; 0x77uy;
0x78uy; 0x79uy; 0x7auy; 0x7buy; 0x7cuy; 0x7duy; 0x7euy; 0x7fuy;
0x80uy; 0x81uy; 0x82uy; 0x83uy; 0x84uy; 0x85uy; 0x86uy; 0x87uy;
0x88uy; 0x89uy; 0x8auy; 0x8buy; 0x8cuy; 0x8duy; 0x8euy; 0x8fuy;
0x90uy; 0x91uy; 0x92uy; 0x93uy; 0x94uy; 0x95uy; 0x96uy; 0x97uy;
0x98uy; 0x99uy; 0x9auy; 0x9buy; 0x9cuy; 0x9duy; 0x9euy; 0x9fuy;
0xa0uy; 0xa1uy; 0xa2uy; 0xa3uy; 0xa4uy; 0xa5uy; 0xa6uy; 0xa7uy;
0xa8uy; 0xa9uy; 0xaauy; 0xabuy; 0xacuy; 0xaduy; 0xaeuy; 0xafuy
] in
assert_norm (List.Tot.length l == 80);
of_list l | {
"file_name": "specs/tests/Spec.HKDF.Test.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 11,
"end_line": 107,
"start_col": 0,
"start_line": 93
} | module Spec.HKDF.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
module HMAC = Spec.Agile.HMAC
module HKDF = Spec.Agile.HKDF
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_hash = Spec.Hash.Definitions.SHA2_256
let test1_ikm : lbytes 22 =
let l = List.Tot.map u8_from_UInt8 [
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy
] in
assert_norm (List.Tot.length l == 22);
of_list l
let test1_salt : lbytes 13 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy
] in
assert_norm (List.Tot.length l == 13);
of_list l
let test1_info : lbytes 10 =
let l = List.Tot.map u8_from_UInt8 [
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy
] in
assert_norm (List.Tot.length l == 10);
of_list l
let test1_len = 42
let test1_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x07uy; 0x77uy; 0x09uy; 0x36uy; 0x2cuy; 0x2euy; 0x32uy; 0xdfuy;
0x0duy; 0xdcuy; 0x3fuy; 0x0duy; 0xc4uy; 0x7buy; 0xbauy; 0x63uy;
0x90uy; 0xb6uy; 0xc7uy; 0x3buy; 0xb5uy; 0x0fuy; 0x9cuy; 0x31uy;
0x22uy; 0xecuy; 0x84uy; 0x4auy; 0xd7uy; 0xc2uy; 0xb3uy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_expected_okm : lbytes 42 =
let l = List.Tot.map u8_from_UInt8 [
0x3cuy; 0xb2uy; 0x5fuy; 0x25uy; 0xfauy; 0xacuy; 0xd5uy; 0x7auy;
0x90uy; 0x43uy; 0x4fuy; 0x64uy; 0xd0uy; 0x36uy; 0x2fuy; 0x2auy;
0x2duy; 0x2duy; 0x0auy; 0x90uy; 0xcfuy; 0x1auy; 0x5auy; 0x4cuy;
0x5duy; 0xb0uy; 0x2duy; 0x56uy; 0xecuy; 0xc4uy; 0xc5uy; 0xbfuy;
0x34uy; 0x00uy; 0x72uy; 0x08uy; 0xd5uy; 0xb8uy; 0x87uy; 0x18uy;
0x58uy; 0x65uy
] in
assert_norm (List.Tot.length l == 42);
of_list l
/// Test 2
let test2_hash = Spec.Hash.Definitions.SHA2_256
let test2_ikm : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy; 0x0duy; 0x0euy; 0x0fuy;
0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy; 0x16uy; 0x17uy;
0x18uy; 0x19uy; 0x1auy; 0x1buy; 0x1cuy; 0x1duy; 0x1euy; 0x1fuy;
0x20uy; 0x21uy; 0x22uy; 0x23uy; 0x24uy; 0x25uy; 0x26uy; 0x27uy;
0x28uy; 0x29uy; 0x2auy; 0x2buy; 0x2cuy; 0x2duy; 0x2euy; 0x2fuy;
0x30uy; 0x31uy; 0x32uy; 0x33uy; 0x34uy; 0x35uy; 0x36uy; 0x37uy;
0x38uy; 0x39uy; 0x3auy; 0x3buy; 0x3cuy; 0x3duy; 0x3euy; 0x3fuy;
0x40uy; 0x41uy; 0x42uy; 0x43uy; 0x44uy; 0x45uy; 0x46uy; 0x47uy;
0x48uy; 0x49uy; 0x4auy; 0x4buy; 0x4cuy; 0x4duy; 0x4euy; 0x4fuy
] in
assert_norm (List.Tot.length l == 80);
of_list l | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.HMAC.fsti.checked",
"Spec.Agile.HKDF.fsti.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.PrintSequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": false,
"source_file": "Spec.HKDF.Test.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Agile.HKDF",
"short_module": "HKDF"
},
{
"abbrev": true,
"full_module": "Spec.Agile.HMAC",
"short_module": "HMAC"
},
{
"abbrev": true,
"full_module": "Lib.PrintSequence",
"short_module": "PS"
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.RawIntTypes",
"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": "Spec.HKDF",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.HKDF",
"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 | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 80 | Prims.Tot | [
"total"
] | [] | [
"Lib.Sequence.of_list",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Prims.list",
"FStar.List.Tot.Base.map",
"FStar.UInt8.t",
"Lib.RawIntTypes.u8_from_UInt8",
"Prims.Cons",
"FStar.UInt8.__uint_to_t",
"Prims.Nil"
] | [] | false | false | false | false | false | let test2_salt:lbytes 80 =
| let l =
List.Tot.map u8_from_UInt8
[
0x60uy; 0x61uy; 0x62uy; 0x63uy; 0x64uy; 0x65uy; 0x66uy; 0x67uy; 0x68uy; 0x69uy; 0x6auy; 0x6buy;
0x6cuy; 0x6duy; 0x6euy; 0x6fuy; 0x70uy; 0x71uy; 0x72uy; 0x73uy; 0x74uy; 0x75uy; 0x76uy; 0x77uy;
0x78uy; 0x79uy; 0x7auy; 0x7buy; 0x7cuy; 0x7duy; 0x7euy; 0x7fuy; 0x80uy; 0x81uy; 0x82uy; 0x83uy;
0x84uy; 0x85uy; 0x86uy; 0x87uy; 0x88uy; 0x89uy; 0x8auy; 0x8buy; 0x8cuy; 0x8duy; 0x8euy; 0x8fuy;
0x90uy; 0x91uy; 0x92uy; 0x93uy; 0x94uy; 0x95uy; 0x96uy; 0x97uy; 0x98uy; 0x99uy; 0x9auy; 0x9buy;
0x9cuy; 0x9duy; 0x9euy; 0x9fuy; 0xa0uy; 0xa1uy; 0xa2uy; 0xa3uy; 0xa4uy; 0xa5uy; 0xa6uy; 0xa7uy;
0xa8uy; 0xa9uy; 0xaauy; 0xabuy; 0xacuy; 0xaduy; 0xaeuy; 0xafuy
]
in
assert_norm (List.Tot.length l == 80);
of_list l | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.error_reason_of_result | val error_reason_of_result (code: U64.t) : string | val error_reason_of_result (code: U64.t) : string | let error_reason_of_result (code:U64.t) : string =
match (get_validator_error_kind code) with
| 1uL -> "generic error"
| 2uL -> "not enough data"
| 3uL -> "impossible"
| 4uL -> "list size not multiple of element size"
| 5uL -> "action failed"
| 6uL -> "constraint failed"
| 7uL -> "unexpected padding"
| _ -> "unspecified" | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 22,
"end_line": 149,
"start_col": 0,
"start_line": 140
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width
let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code
let get_validator_error_pos_eq_pos (x: pos_t) : Lemma
(get_validator_error_pos x == x)
[SMTPat (get_validator_error_pos x)]
= BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64 (64 - error_width) (U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL))
[@ CMacro ]
let validator_error_generic : validator_error = normalize_term (set_validator_error_kind 0uL 1uL)
[@ CMacro ]
let validator_error_not_enough_data : validator_error = normalize_term (set_validator_error_kind 0uL 2uL)
[@ CMacro ]
let validator_error_impossible : validator_error = normalize_term (set_validator_error_kind 0uL 3uL)
[@ CMacro ]
let validator_error_list_size_not_multiple : validator_error = normalize_term (set_validator_error_kind 0uL 4uL)
[@ CMacro ]
let validator_error_action_failed : validator_error = normalize_term (set_validator_error_kind 0uL 5uL)
[@ CMacro ]
let validator_error_constraint_failed : validator_error = normalize_term (set_validator_error_kind 0uL 6uL)
[@ CMacro ]
let validator_error_unexpected_padding : validator_error = normalize_term (set_validator_error_kind 0uL 7uL) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | code: FStar.UInt64.t -> Prims.string | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt64.t",
"EverParse3d.ErrorCode.get_validator_error_kind",
"Prims.string"
] | [] | false | false | false | true | false | let error_reason_of_result (code: U64.t) : string =
| match (get_validator_error_kind code) with
| 1uL -> "generic error"
| 2uL -> "not enough data"
| 3uL -> "impossible"
| 4uL -> "list size not multiple of element size"
| 5uL -> "action failed"
| 6uL -> "constraint failed"
| 7uL -> "unexpected padding"
| _ -> "unspecified" | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.get_validator_error_kind_set_validator_error_kind | val get_validator_error_kind_set_validator_error_kind
(error: U64.t)
(code: U64.t{0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)})
: Lemma (get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))] | val get_validator_error_kind_set_validator_error_kind
(error: U64.t)
(code: U64.t{0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)})
: Lemma (get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))] | let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 78,
"end_line": 105,
"start_col": 0,
"start_line": 101
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
error: FStar.UInt64.t ->
code:
FStar.UInt64.t
{ 0 < FStar.UInt64.v code /\
FStar.UInt64.v code <
FStar.Pervasives.normalize_term (Prims.pow2 EverParse3d.ErrorCode.error_width) }
-> FStar.Pervasives.Lemma
(ensures
EverParse3d.ErrorCode.get_validator_error_kind (EverParse3d.ErrorCode.set_validator_error_kind
error
code) ==
code)
[
SMTPat (EverParse3d.ErrorCode.get_validator_error_kind (EverParse3d.ErrorCode.set_validator_error_kind
error
code))
] | FStar.Pervasives.Lemma | [
"lemma"
] | [] | [
"FStar.UInt64.t",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"FStar.UInt64.v",
"FStar.Pervasives.normalize_term",
"Prims.int",
"Prims.pow2",
"EverParse3d.ErrorCode.error_width",
"EverParse3d.ErrorCode.get_validator_error_field_set_validator_error_field",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.pos",
"Prims.l_True",
"Prims.squash",
"Prims.l_or",
"Prims.op_LessThanOrEqual",
"EverParse3d.ErrorCode.get_validator_error_kind",
"EverParse3d.ErrorCode.set_validator_error_kind",
"Prims.Cons",
"FStar.Pervasives.pattern",
"FStar.Pervasives.smt_pat",
"Prims.Nil"
] | [] | true | false | true | false | false | let get_validator_error_kind_set_validator_error_kind
(error: U64.t)
(code: U64.t{0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)})
: Lemma (get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))] =
| assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.validator_error_unexpected_padding | val validator_error_unexpected_padding:validator_error | val validator_error_unexpected_padding:validator_error | let validator_error_unexpected_padding : validator_error = normalize_term (set_validator_error_kind 0uL 7uL) | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 108,
"end_line": 138,
"start_col": 0,
"start_line": 138
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width
let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code
let get_validator_error_pos_eq_pos (x: pos_t) : Lemma
(get_validator_error_pos x == x)
[SMTPat (get_validator_error_pos x)]
= BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64 (64 - error_width) (U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL))
[@ CMacro ]
let validator_error_generic : validator_error = normalize_term (set_validator_error_kind 0uL 1uL)
[@ CMacro ]
let validator_error_not_enough_data : validator_error = normalize_term (set_validator_error_kind 0uL 2uL)
[@ CMacro ]
let validator_error_impossible : validator_error = normalize_term (set_validator_error_kind 0uL 3uL)
[@ CMacro ]
let validator_error_list_size_not_multiple : validator_error = normalize_term (set_validator_error_kind 0uL 4uL)
[@ CMacro ]
let validator_error_action_failed : validator_error = normalize_term (set_validator_error_kind 0uL 5uL)
[@ CMacro ]
let validator_error_constraint_failed : validator_error = normalize_term (set_validator_error_kind 0uL 6uL) | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | EverParse3d.ErrorCode.validator_error | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.normalize_term",
"EverParse3d.ErrorCode.validator_error",
"EverParse3d.ErrorCode.set_validator_error_kind",
"FStar.UInt64.__uint_to_t"
] | [] | false | false | false | true | false | let validator_error_unexpected_padding:validator_error =
| normalize_term (set_validator_error_kind 0uL 7uL) | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.pow2_128 | val pow2_128 : Prims.int | let pow2_128 = Vale.Def.Words_s.pow2_128 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 47,
"end_line": 8,
"start_col": 7,
"start_line": 8
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.int | Prims.Tot | [
"total"
] | [] | [
"Vale.Def.Words_s.pow2_128"
] | [] | false | false | false | true | false | let pow2_128 =
| Vale.Def.Words_s.pow2_128 | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.pow2_64 | val pow2_64 : Prims.int | let pow2_64 = Vale.Def.Words_s.pow2_64 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 45,
"end_line": 7,
"start_col": 7,
"start_line": 7
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = () | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.int | Prims.Tot | [
"total"
] | [] | [
"Vale.Def.Words_s.pow2_64"
] | [] | false | false | false | true | false | let pow2_64 =
| Vale.Def.Words_s.pow2_64 | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.pow2_32 | val pow2_32 : Prims.int | let pow2_32 = Vale.Def.Words_s.pow2_32 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 45,
"end_line": 6,
"start_col": 7,
"start_line": 6
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.int | Prims.Tot | [
"total"
] | [] | [
"Vale.Def.Words_s.pow2_32"
] | [] | false | false | false | true | false | let pow2_32 =
| Vale.Def.Words_s.pow2_32 | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.nat64 | val nat64 : Type0 | let nat64 = Vale.Def.Types_s.nat64 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 41,
"end_line": 10,
"start_col": 7,
"start_line": 10
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.Def.Types_s.nat64"
] | [] | false | false | false | true | true | let nat64 =
| Vale.Def.Types_s.nat64 | false |
|
Hacl.Impl.Salsa20.Core32.fst | Hacl.Impl.Salsa20.Core32.index | val index : Type0 | let index = i:size_t{size_v i < 16} | {
"file_name": "code/salsa20/Hacl.Impl.Salsa20.Core32.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 35,
"end_line": 16,
"start_col": 0,
"start_line": 16
} | module Hacl.Impl.Salsa20.Core32
open FStar.HyperStack
open FStar.HyperStack.All
open Lib.IntTypes
open Lib.Sequence
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module Spec = Spec.Salsa20 | {
"checked_file": "/",
"dependencies": [
"Spec.Salsa20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Salsa20.Core32.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Salsa20",
"short_module": "Spec"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"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.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Salsa20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Salsa20",
"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 | 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 |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.fCarry | val fCarry:flag | val fCarry:flag | let fCarry : flag = 0 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 43,
"end_line": 18,
"start_col": 19,
"start_line": 18
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16} | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.flag | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let fCarry:flag =
| 0 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.nat128 | val nat128 : Type0 | let nat128 = Vale.Def.Words_s.nat128 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 43,
"end_line": 13,
"start_col": 7,
"start_line": 13
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} = | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.Def.Words_s.nat128"
] | [] | false | false | false | true | true | let nat128 =
| Vale.Def.Words_s.nat128 | false |
|
Hacl.Impl.Salsa20.Core32.fst | Hacl.Impl.Salsa20.Core32.state | val state : Type0 | let state = lbuffer uint32 16ul | {
"file_name": "code/salsa20/Hacl.Impl.Salsa20.Core32.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 31,
"end_line": 15,
"start_col": 0,
"start_line": 15
} | module Hacl.Impl.Salsa20.Core32
open FStar.HyperStack
open FStar.HyperStack.All
open Lib.IntTypes
open Lib.Sequence
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module Spec = Spec.Salsa20 | {
"checked_file": "/",
"dependencies": [
"Spec.Salsa20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Salsa20.Core32.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Salsa20",
"short_module": "Spec"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"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.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Salsa20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Salsa20",
"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 | Type0 | Prims.Tot | [
"total"
] | [] | [
"Lib.Buffer.lbuffer",
"Lib.IntTypes.uint32",
"FStar.UInt32.__uint_to_t"
] | [] | false | false | false | true | true | let state =
| lbuffer uint32 16ul | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.quad32 | val quad32 : Prims.eqtype | let quad32 = Vale.Def.Types_s.quad32 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 43,
"end_line": 14,
"start_col": 7,
"start_line": 14
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 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.X64.Machine_s.fst | Vale.X64.Machine_s.fOverflow | val fOverflow:flag | val fOverflow:flag | let fOverflow : flag = 11 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 44,
"end_line": 19,
"start_col": 19,
"start_line": 19
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16} | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.flag | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let fOverflow:flag =
| 11 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_file_id | val reg_file_id : Type0 | let reg_file_id = rf:nat{rf < n_reg_files} | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 42,
"end_line": 22,
"start_col": 0,
"start_line": 22
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Vale.X64.Machine_s.n_reg_files"
] | [] | false | false | false | true | true | let reg_file_id =
| rf: nat{rf < n_reg_files} | false |
|
Spec.HKDF.Test.fst | Spec.HKDF.Test.test2_info | val test2_info:lbytes 80 | val test2_info:lbytes 80 | let test2_info : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0xb0uy; 0xb1uy; 0xb2uy; 0xb3uy; 0xb4uy; 0xb5uy; 0xb6uy; 0xb7uy;
0xb8uy; 0xb9uy; 0xbauy; 0xbbuy; 0xbcuy; 0xbduy; 0xbeuy; 0xbfuy;
0xc0uy; 0xc1uy; 0xc2uy; 0xc3uy; 0xc4uy; 0xc5uy; 0xc6uy; 0xc7uy;
0xc8uy; 0xc9uy; 0xcauy; 0xcbuy; 0xccuy; 0xcduy; 0xceuy; 0xcfuy;
0xd0uy; 0xd1uy; 0xd2uy; 0xd3uy; 0xd4uy; 0xd5uy; 0xd6uy; 0xd7uy;
0xd8uy; 0xd9uy; 0xdauy; 0xdbuy; 0xdcuy; 0xdduy; 0xdeuy; 0xdfuy;
0xe0uy; 0xe1uy; 0xe2uy; 0xe3uy; 0xe4uy; 0xe5uy; 0xe6uy; 0xe7uy;
0xe8uy; 0xe9uy; 0xeauy; 0xebuy; 0xecuy; 0xeduy; 0xeeuy; 0xefuy;
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy; 0xfauy; 0xfbuy; 0xfcuy; 0xfduy; 0xfeuy; 0xffuy
] in
assert_norm (List.Tot.length l == 80);
of_list l | {
"file_name": "specs/tests/Spec.HKDF.Test.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 11,
"end_line": 124,
"start_col": 0,
"start_line": 110
} | module Spec.HKDF.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
module HMAC = Spec.Agile.HMAC
module HKDF = Spec.Agile.HKDF
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_hash = Spec.Hash.Definitions.SHA2_256
let test1_ikm : lbytes 22 =
let l = List.Tot.map u8_from_UInt8 [
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy
] in
assert_norm (List.Tot.length l == 22);
of_list l
let test1_salt : lbytes 13 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy
] in
assert_norm (List.Tot.length l == 13);
of_list l
let test1_info : lbytes 10 =
let l = List.Tot.map u8_from_UInt8 [
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy
] in
assert_norm (List.Tot.length l == 10);
of_list l
let test1_len = 42
let test1_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x07uy; 0x77uy; 0x09uy; 0x36uy; 0x2cuy; 0x2euy; 0x32uy; 0xdfuy;
0x0duy; 0xdcuy; 0x3fuy; 0x0duy; 0xc4uy; 0x7buy; 0xbauy; 0x63uy;
0x90uy; 0xb6uy; 0xc7uy; 0x3buy; 0xb5uy; 0x0fuy; 0x9cuy; 0x31uy;
0x22uy; 0xecuy; 0x84uy; 0x4auy; 0xd7uy; 0xc2uy; 0xb3uy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_expected_okm : lbytes 42 =
let l = List.Tot.map u8_from_UInt8 [
0x3cuy; 0xb2uy; 0x5fuy; 0x25uy; 0xfauy; 0xacuy; 0xd5uy; 0x7auy;
0x90uy; 0x43uy; 0x4fuy; 0x64uy; 0xd0uy; 0x36uy; 0x2fuy; 0x2auy;
0x2duy; 0x2duy; 0x0auy; 0x90uy; 0xcfuy; 0x1auy; 0x5auy; 0x4cuy;
0x5duy; 0xb0uy; 0x2duy; 0x56uy; 0xecuy; 0xc4uy; 0xc5uy; 0xbfuy;
0x34uy; 0x00uy; 0x72uy; 0x08uy; 0xd5uy; 0xb8uy; 0x87uy; 0x18uy;
0x58uy; 0x65uy
] in
assert_norm (List.Tot.length l == 42);
of_list l
/// Test 2
let test2_hash = Spec.Hash.Definitions.SHA2_256
let test2_ikm : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy; 0x0duy; 0x0euy; 0x0fuy;
0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy; 0x16uy; 0x17uy;
0x18uy; 0x19uy; 0x1auy; 0x1buy; 0x1cuy; 0x1duy; 0x1euy; 0x1fuy;
0x20uy; 0x21uy; 0x22uy; 0x23uy; 0x24uy; 0x25uy; 0x26uy; 0x27uy;
0x28uy; 0x29uy; 0x2auy; 0x2buy; 0x2cuy; 0x2duy; 0x2euy; 0x2fuy;
0x30uy; 0x31uy; 0x32uy; 0x33uy; 0x34uy; 0x35uy; 0x36uy; 0x37uy;
0x38uy; 0x39uy; 0x3auy; 0x3buy; 0x3cuy; 0x3duy; 0x3euy; 0x3fuy;
0x40uy; 0x41uy; 0x42uy; 0x43uy; 0x44uy; 0x45uy; 0x46uy; 0x47uy;
0x48uy; 0x49uy; 0x4auy; 0x4buy; 0x4cuy; 0x4duy; 0x4euy; 0x4fuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_salt : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x60uy; 0x61uy; 0x62uy; 0x63uy; 0x64uy; 0x65uy; 0x66uy; 0x67uy;
0x68uy; 0x69uy; 0x6auy; 0x6buy; 0x6cuy; 0x6duy; 0x6euy; 0x6fuy;
0x70uy; 0x71uy; 0x72uy; 0x73uy; 0x74uy; 0x75uy; 0x76uy; 0x77uy;
0x78uy; 0x79uy; 0x7auy; 0x7buy; 0x7cuy; 0x7duy; 0x7euy; 0x7fuy;
0x80uy; 0x81uy; 0x82uy; 0x83uy; 0x84uy; 0x85uy; 0x86uy; 0x87uy;
0x88uy; 0x89uy; 0x8auy; 0x8buy; 0x8cuy; 0x8duy; 0x8euy; 0x8fuy;
0x90uy; 0x91uy; 0x92uy; 0x93uy; 0x94uy; 0x95uy; 0x96uy; 0x97uy;
0x98uy; 0x99uy; 0x9auy; 0x9buy; 0x9cuy; 0x9duy; 0x9euy; 0x9fuy;
0xa0uy; 0xa1uy; 0xa2uy; 0xa3uy; 0xa4uy; 0xa5uy; 0xa6uy; 0xa7uy;
0xa8uy; 0xa9uy; 0xaauy; 0xabuy; 0xacuy; 0xaduy; 0xaeuy; 0xafuy
] in
assert_norm (List.Tot.length l == 80);
of_list l | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.HMAC.fsti.checked",
"Spec.Agile.HKDF.fsti.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.PrintSequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": false,
"source_file": "Spec.HKDF.Test.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Agile.HKDF",
"short_module": "HKDF"
},
{
"abbrev": true,
"full_module": "Spec.Agile.HMAC",
"short_module": "HMAC"
},
{
"abbrev": true,
"full_module": "Lib.PrintSequence",
"short_module": "PS"
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.RawIntTypes",
"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": "Spec.HKDF",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.HKDF",
"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 | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 80 | Prims.Tot | [
"total"
] | [] | [
"Lib.Sequence.of_list",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.int",
"FStar.List.Tot.Base.length",
"Prims.list",
"FStar.List.Tot.Base.map",
"FStar.UInt8.t",
"Lib.RawIntTypes.u8_from_UInt8",
"Prims.Cons",
"FStar.UInt8.__uint_to_t",
"Prims.Nil"
] | [] | false | false | false | false | false | let test2_info:lbytes 80 =
| let l =
List.Tot.map u8_from_UInt8
[
0xb0uy; 0xb1uy; 0xb2uy; 0xb3uy; 0xb4uy; 0xb5uy; 0xb6uy; 0xb7uy; 0xb8uy; 0xb9uy; 0xbauy; 0xbbuy;
0xbcuy; 0xbduy; 0xbeuy; 0xbfuy; 0xc0uy; 0xc1uy; 0xc2uy; 0xc3uy; 0xc4uy; 0xc5uy; 0xc6uy; 0xc7uy;
0xc8uy; 0xc9uy; 0xcauy; 0xcbuy; 0xccuy; 0xcduy; 0xceuy; 0xcfuy; 0xd0uy; 0xd1uy; 0xd2uy; 0xd3uy;
0xd4uy; 0xd5uy; 0xd6uy; 0xd7uy; 0xd8uy; 0xd9uy; 0xdauy; 0xdbuy; 0xdcuy; 0xdduy; 0xdeuy; 0xdfuy;
0xe0uy; 0xe1uy; 0xe2uy; 0xe3uy; 0xe4uy; 0xe5uy; 0xe6uy; 0xe7uy; 0xe8uy; 0xe9uy; 0xeauy; 0xebuy;
0xecuy; 0xeduy; 0xeeuy; 0xefuy; 0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy; 0xfauy; 0xfbuy; 0xfcuy; 0xfduy; 0xfeuy; 0xffuy
]
in
assert_norm (List.Tot.length l == 80);
of_list l | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.check_constraint_ok | val check_constraint_ok (ok: bool) (position: pos_t) : Tot U64.t | val check_constraint_ok (ok: bool) (position: pos_t) : Tot U64.t | let check_constraint_ok (ok:bool) (position: pos_t): Tot U64.t =
if ok
then position
else set_validator_error_pos validator_error_constraint_failed position | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 77,
"end_line": 154,
"start_col": 0,
"start_line": 151
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width
let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code
let get_validator_error_pos_eq_pos (x: pos_t) : Lemma
(get_validator_error_pos x == x)
[SMTPat (get_validator_error_pos x)]
= BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64 (64 - error_width) (U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL))
[@ CMacro ]
let validator_error_generic : validator_error = normalize_term (set_validator_error_kind 0uL 1uL)
[@ CMacro ]
let validator_error_not_enough_data : validator_error = normalize_term (set_validator_error_kind 0uL 2uL)
[@ CMacro ]
let validator_error_impossible : validator_error = normalize_term (set_validator_error_kind 0uL 3uL)
[@ CMacro ]
let validator_error_list_size_not_multiple : validator_error = normalize_term (set_validator_error_kind 0uL 4uL)
[@ CMacro ]
let validator_error_action_failed : validator_error = normalize_term (set_validator_error_kind 0uL 5uL)
[@ CMacro ]
let validator_error_constraint_failed : validator_error = normalize_term (set_validator_error_kind 0uL 6uL)
[@ CMacro ]
let validator_error_unexpected_padding : validator_error = normalize_term (set_validator_error_kind 0uL 7uL)
let error_reason_of_result (code:U64.t) : string =
match (get_validator_error_kind code) with
| 1uL -> "generic error"
| 2uL -> "not enough data"
| 3uL -> "impossible"
| 4uL -> "list size not multiple of element size"
| 5uL -> "action failed"
| 6uL -> "constraint failed"
| 7uL -> "unexpected padding"
| _ -> "unspecified" | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | ok: Prims.bool -> position: EverParse3d.ErrorCode.pos_t -> FStar.UInt64.t | Prims.Tot | [
"total"
] | [] | [
"Prims.bool",
"EverParse3d.ErrorCode.pos_t",
"EverParse3d.ErrorCode.set_validator_error_pos",
"EverParse3d.ErrorCode.validator_error_constraint_failed",
"FStar.UInt64.t"
] | [] | false | false | false | true | false | let check_constraint_ok (ok: bool) (position: pos_t) : Tot U64.t =
| if ok then position else set_validator_error_pos validator_error_constraint_failed position | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.t_reg | val t_reg (r: reg) : Type0 | val t_reg (r: reg) : Type0 | let t_reg (r:reg) : Type0 = t_reg_file r.rf | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 43,
"end_line": 38,
"start_col": 0,
"start_line": 38
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | r: Vale.X64.Machine_s.reg -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.reg",
"Vale.X64.Machine_s.t_reg_file",
"Vale.X64.Machine_s.__proj__Reg__item__rf"
] | [] | false | false | false | true | true | let t_reg (r: reg) : Type0 =
| t_reg_file r.rf | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.n_reg_files | val n_reg_files : Prims.int | let n_reg_files = 2 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 19,
"end_line": 21,
"start_col": 0,
"start_line": 21
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.int | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let n_reg_files =
| 2 | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_id | val reg_id (rf: reg_file_id) : Type0 | val reg_id (rf: reg_file_id) : Type0 | let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf} | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 58,
"end_line": 32,
"start_col": 0,
"start_line": 32
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | rf: Vale.X64.Machine_s.reg_file_id -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.reg_file_id",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Vale.X64.Machine_s.n_regs"
] | [] | false | false | false | true | true | let reg_id (rf: reg_file_id) : Type0 =
| r: nat{r < n_regs rf} | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_64 | val reg_64:Type0 | val reg_64:Type0 | let reg_64 : Type0 = r:nat{r < 16} | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 34,
"end_line": 68,
"start_col": 0,
"start_line": 68
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan"
] | [] | false | false | false | true | true | let reg_64:Type0 =
| r: nat{r < 16} | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_xmm | val reg_xmm:Type0 | val reg_xmm:Type0 | let reg_xmm : Type0 = r:nat{r < 16} | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 35,
"end_line": 69,
"start_col": 0,
"start_line": 69
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Type0 | Prims.Tot | [
"total"
] | [] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan"
] | [] | false | false | false | true | true | let reg_xmm:Type0 =
| r: nat{r < 16} | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rRcx | val rRcx:reg_64 | val rRcx:reg_64 | let rRcx : reg_64 = 2 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 73,
"start_col": 19,
"start_line": 73
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rRcx:reg_64 =
| 2 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rRbx | val rRbx:reg_64 | val rRbx:reg_64 | let rRbx : reg_64 = 1 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 72,
"start_col": 19,
"start_line": 72
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16} | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rRbx:reg_64 =
| 1 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rRsp | val rRsp:reg_64 | val rRsp:reg_64 | let rRsp : reg_64 = 7 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 78,
"start_col": 19,
"start_line": 78
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rRsp:reg_64 =
| 7 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rRax | val rRax:reg_64 | val rRax:reg_64 | let rRax : reg_64 = 0 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 71,
"start_col": 19,
"start_line": 71
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16} | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rRax:reg_64 =
| 0 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rRbp | val rRbp:reg_64 | val rRbp:reg_64 | let rRbp : reg_64 = 6 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 77,
"start_col": 19,
"start_line": 77
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rRbp:reg_64 =
| 6 | false |
EverParse3d.ErrorCode.fst | EverParse3d.ErrorCode.is_range_okay | val is_range_okay (size offset access_size: U32.t) : bool | val is_range_okay (size offset access_size: U32.t) : bool | let is_range_okay (size offset access_size:U32.t)
: bool
= let open U32 in
size >=^ access_size &&
size -^ access_size >=^ offset | {
"file_name": "src/3d/prelude/EverParse3d.ErrorCode.fst",
"git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | {
"end_col": 34,
"end_line": 166,
"start_col": 0,
"start_line": 162
} | module EverParse3d.ErrorCode
module U64 = FStar.UInt64
module BF = LowParse.BitFields
inline_for_extraction
noextract
let error_width = 4
inline_for_extraction
noextract
let pos_width = normalize_term (64 - error_width)
[@ CMacro ]
let validator_max_length : (u: U64.t { 4 <= U64.v u /\ U64.v u == pow2 pos_width - 1 } ) =
FStar.Math.Lemmas.pow2_le_compat 64 pos_width;
[@inline_let]
let x = U64.uint_to_t (pow2 pos_width - 1) in
normalize_term_spec x;
normalize_term x
let is_error (positionOrError: U64.t) : Tot bool = positionOrError `U64.gt` validator_max_length
let is_success (positionOrError: U64.t) : Tot bool = positionOrError `U64.lte` validator_max_length
inline_for_extraction
noextract
type validator_error = (u: U64.t { is_error u } )
inline_for_extraction
noextract
let pos_t = (pos: U64.t {is_success pos})
module BF = LowParse.BitFields
#push-options "--z3rlimit 16"
inline_for_extraction
noextract
let get_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < pow2 (hi - lo) }) =
[@inline_let]
let res =
BF.uint64.BF.get_bitfield x (pos_width + lo) (pos_width + hi)
in
res
inline_for_extraction
noextract
let set_validator_error_field (x: U64.t) (lo: nat) (hi: nat { lo < hi /\ hi <= error_width }) (code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) }) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield x (pos_width + lo) (pos_width + hi) code
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_same #64 (U64.v x) (pos_width + lo) (pos_width + hi) (U64.v code);
BF.get_bitfield_zero_inner (U64.v res) pos_width 64 (pos_width + lo) (pos_width + hi);
assert (BF.get_bitfield (U64.v res) pos_width 64 > 0);
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
let get_validator_error_field_set_validator_error_field
(x: U64.t)
(lo: nat)
(hi: nat { lo < hi /\ hi <= error_width })
(code: U64.t { 0 < U64.v code /\ U64.v code < pow2 (hi - lo) })
: Lemma
(get_validator_error_field (set_validator_error_field x lo hi code) lo hi == code)
= ()
let set_validator_error_pos (error: validator_error) (position: pos_t) : Tot validator_error =
[@inline_let]
let res =
BF.uint64.BF.set_bitfield error 0 pos_width position
in
[@inline_let]
let _ =
BF.get_bitfield_set_bitfield_other (U64.v error) 0 pos_width (U64.v position) pos_width 64;
assert (BF.get_bitfield (U64.v res) pos_width 64 == BF.get_bitfield (U64.v error) pos_width 64);
Classical.move_requires (BF.get_bitfield_hi_lt_pow2 (U64.v error)) pos_width;
Classical.move_requires (BF.lt_pow2_get_bitfield_hi (U64.v res)) pos_width;
assert_norm (pow2 pos_width == U64.v validator_max_length + 1)
in
res
#pop-options
let get_validator_error_pos (x: U64.t) : Tot pos_t =
(BF.uint64.BF.get_bitfield x 0 pos_width)
let set_validator_error_kind (error: U64.t) (code: U64.t { 0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) : Tot validator_error =
normalize_term_spec (pow2 error_width);
set_validator_error_field error 0 error_width code
let get_validator_error_kind (error: U64.t) : Tot (code: U64.t { 0 <= U64.v code /\ U64.v code < normalize_term (pow2 error_width) }) =
normalize_term_spec (pow2 error_width);
get_validator_error_field error 0 error_width
let get_validator_error_kind_set_validator_error_kind (error: U64.t) (code: U64.t {0 < U64.v code /\ U64.v code < normalize_term (pow2 error_width)}) : Lemma
(get_validator_error_kind (set_validator_error_kind error code) == code)
[SMTPat (get_validator_error_kind (set_validator_error_kind error code))]
= assert_norm (normalize_term (pow2 error_width) == pow2 error_width);
get_validator_error_field_set_validator_error_field error 0 error_width code
let get_validator_error_pos_eq_pos (x: pos_t) : Lemma
(get_validator_error_pos x == x)
[SMTPat (get_validator_error_pos x)]
= BF.get_bitfield_size pos_width 64 (U64.v x) 0 pos_width;
BF.get_bitfield_full #pos_width (U64.v x);
BF.lt_pow2_get_bitfield_hi #64 (U64.v x) (64 - error_width);
assert (BF.get_bitfield #64 (U64.v x) pos_width 64 == 0);
BF.get_bitfield_set_bitfield_other #64 (U64.v x) pos_width 64 0 0 pos_width;
BF.get_bitfield_set_bitfield_same #64 (U64.v x) pos_width 64 0;
BF.get_bitfield_partition_2 #64 (64 - error_width) (U64.v x)
(U64.v (BF.uint64.BF.set_bitfield x pos_width 64 0uL))
[@ CMacro ]
let validator_error_generic : validator_error = normalize_term (set_validator_error_kind 0uL 1uL)
[@ CMacro ]
let validator_error_not_enough_data : validator_error = normalize_term (set_validator_error_kind 0uL 2uL)
[@ CMacro ]
let validator_error_impossible : validator_error = normalize_term (set_validator_error_kind 0uL 3uL)
[@ CMacro ]
let validator_error_list_size_not_multiple : validator_error = normalize_term (set_validator_error_kind 0uL 4uL)
[@ CMacro ]
let validator_error_action_failed : validator_error = normalize_term (set_validator_error_kind 0uL 5uL)
[@ CMacro ]
let validator_error_constraint_failed : validator_error = normalize_term (set_validator_error_kind 0uL 6uL)
[@ CMacro ]
let validator_error_unexpected_padding : validator_error = normalize_term (set_validator_error_kind 0uL 7uL)
let error_reason_of_result (code:U64.t) : string =
match (get_validator_error_kind code) with
| 1uL -> "generic error"
| 2uL -> "not enough data"
| 3uL -> "impossible"
| 4uL -> "list size not multiple of element size"
| 5uL -> "action failed"
| 6uL -> "constraint failed"
| 7uL -> "unexpected padding"
| _ -> "unspecified"
let check_constraint_ok (ok:bool) (position: pos_t): Tot U64.t =
if ok
then position
else set_validator_error_pos validator_error_constraint_failed position
////////////////////////////////////////////////////////////////////////////////
// Some generic helpers
////////////////////////////////////////////////////////////////////////////////
module U32 = FStar.UInt32 | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"LowParse.BitFields.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "EverParse3d.ErrorCode.fst"
} | [
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "LowParse.BitFields",
"short_module": "BF"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": false,
"full_module": "EverParse3d",
"short_module": null
},
{
"abbrev": false,
"full_module": "EverParse3d",
"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": 2,
"max_fuel": 0,
"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": true,
"z3cliopt": [
"smt.qi.eager_threshold=10"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | size: FStar.UInt32.t -> offset: FStar.UInt32.t -> access_size: FStar.UInt32.t -> Prims.bool | Prims.Tot | [
"total"
] | [] | [
"FStar.UInt32.t",
"Prims.op_AmpAmp",
"FStar.UInt32.op_Greater_Equals_Hat",
"FStar.UInt32.op_Subtraction_Hat",
"Prims.bool"
] | [] | false | false | false | true | false | let is_range_okay (size offset access_size: U32.t) : bool =
| let open U32 in size >=^ access_size && size -^ access_size >=^ offset | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rRdx | val rRdx:reg_64 | val rRdx:reg_64 | let rRdx : reg_64 = 3 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 74,
"start_col": 19,
"start_line": 74
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rRdx:reg_64 =
| 3 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rRdi | val rRdi:reg_64 | val rRdi:reg_64 | let rRdi : reg_64 = 5 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 76,
"start_col": 19,
"start_line": 76
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rRdi:reg_64 =
| 5 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rR8 | val rR8:reg_64 | val rR8:reg_64 | let rR8 : reg_64 = 8 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 79,
"start_col": 19,
"start_line": 79
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rR8:reg_64 =
| 8 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rRsi | val rRsi:reg_64 | val rRsi:reg_64 | let rRsi : reg_64 = 4 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 75,
"start_col": 19,
"start_line": 75
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rRsi:reg_64 =
| 4 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.int_to_nat64 | val int_to_nat64 (i: int) : n: nat64{0 <= i && i < pow2_64 ==> i == n} | val int_to_nat64 (i: int) : n: nat64{0 <= i && i < pow2_64 ==> i == n} | let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 12,
"start_col": 0,
"start_line": 11
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | i: Prims.int -> n: Vale.X64.Machine_s.nat64{0 <= i && i < Vale.X64.Machine_s.pow2_64 ==> i == n} | Prims.Tot | [
"total"
] | [] | [
"Prims.int",
"Vale.Def.Words_s.int_to_natN",
"Vale.X64.Machine_s.pow2_64",
"Vale.X64.Machine_s.nat64",
"Prims.l_imp",
"Prims.b2t",
"Prims.op_AmpAmp",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"Prims.eq2"
] | [] | false | false | false | false | false | let int_to_nat64 (i: int) : n: nat64{0 <= i && i < pow2_64 ==> i == n} =
| Vale.Def.Words_s.int_to_natN pow2_64 i | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rR9 | val rR9:reg_64 | val rR9:reg_64 | let rR9 : reg_64 = 9 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 40,
"end_line": 80,
"start_col": 19,
"start_line": 80
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rR9:reg_64 =
| 9 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rR10 | val rR10:reg_64 | val rR10:reg_64 | let rR10 : reg_64 = 10 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 41,
"end_line": 81,
"start_col": 19,
"start_line": 81
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rR10:reg_64 =
| 10 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rR11 | val rR11:reg_64 | val rR11:reg_64 | let rR11 : reg_64 = 11 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 41,
"end_line": 82,
"start_col": 19,
"start_line": 82
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rR11:reg_64 =
| 11 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.t_reg_file | val t_reg_file (rf: reg_file_id) : Type0 | val t_reg_file (rf: reg_file_id) : Type0 | let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 15,
"end_line": 30,
"start_col": 0,
"start_line": 27
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | rf: Vale.X64.Machine_s.reg_file_id -> Type0 | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.reg_file_id",
"Vale.X64.Machine_s.nat64",
"Vale.X64.Machine_s.quad32"
] | [] | false | false | false | true | true | let t_reg_file (rf: reg_file_id) : Type0 =
| match rf with
| 0 -> nat64
| 1 -> quad32 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rR12 | val rR12:reg_64 | val rR12:reg_64 | let rR12 : reg_64 = 12 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 41,
"end_line": 83,
"start_col": 19,
"start_line": 83
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rR12:reg_64 =
| 12 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rR13 | val rR13:reg_64 | val rR13:reg_64 | let rR13 : reg_64 = 13 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 41,
"end_line": 84,
"start_col": 19,
"start_line": 84
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rR13:reg_64 =
| 13 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.n_regs | val n_regs (rf: reg_file_id) : nat | val n_regs (rf: reg_file_id) : nat | let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 11,
"end_line": 26,
"start_col": 0,
"start_line": 23
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | rf: Vale.X64.Machine_s.reg_file_id -> Prims.nat | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.reg_file_id",
"Prims.nat"
] | [] | false | false | false | true | false | let n_regs (rf: reg_file_id) : nat =
| match rf with
| 0 -> 16
| 1 -> 16 | false |
Spec.HKDF.Test.fst | Spec.HKDF.Test.test_vectors | val test_vectors:list vec | val test_vectors:list vec | let test_vectors: list vec = [
Vec test1_hash test1_salt test1_ikm
test1_expected_prk test1_info test1_len test1_expected_okm;
Vec test2_hash test2_salt test2_ikm
test2_expected_prk test2_info test2_len test2_expected_okm;
Vec test3_hash test3_salt test3_ikm
test3_expected_prk test3_info test3_len test3_expected_okm ] | {
"file_name": "specs/tests/Spec.HKDF.Test.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 66,
"end_line": 230,
"start_col": 0,
"start_line": 224
} | module Spec.HKDF.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
module HMAC = Spec.Agile.HMAC
module HKDF = Spec.Agile.HKDF
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_hash = Spec.Hash.Definitions.SHA2_256
let test1_ikm : lbytes 22 =
let l = List.Tot.map u8_from_UInt8 [
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy
] in
assert_norm (List.Tot.length l == 22);
of_list l
let test1_salt : lbytes 13 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy
] in
assert_norm (List.Tot.length l == 13);
of_list l
let test1_info : lbytes 10 =
let l = List.Tot.map u8_from_UInt8 [
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy
] in
assert_norm (List.Tot.length l == 10);
of_list l
let test1_len = 42
let test1_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x07uy; 0x77uy; 0x09uy; 0x36uy; 0x2cuy; 0x2euy; 0x32uy; 0xdfuy;
0x0duy; 0xdcuy; 0x3fuy; 0x0duy; 0xc4uy; 0x7buy; 0xbauy; 0x63uy;
0x90uy; 0xb6uy; 0xc7uy; 0x3buy; 0xb5uy; 0x0fuy; 0x9cuy; 0x31uy;
0x22uy; 0xecuy; 0x84uy; 0x4auy; 0xd7uy; 0xc2uy; 0xb3uy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_expected_okm : lbytes 42 =
let l = List.Tot.map u8_from_UInt8 [
0x3cuy; 0xb2uy; 0x5fuy; 0x25uy; 0xfauy; 0xacuy; 0xd5uy; 0x7auy;
0x90uy; 0x43uy; 0x4fuy; 0x64uy; 0xd0uy; 0x36uy; 0x2fuy; 0x2auy;
0x2duy; 0x2duy; 0x0auy; 0x90uy; 0xcfuy; 0x1auy; 0x5auy; 0x4cuy;
0x5duy; 0xb0uy; 0x2duy; 0x56uy; 0xecuy; 0xc4uy; 0xc5uy; 0xbfuy;
0x34uy; 0x00uy; 0x72uy; 0x08uy; 0xd5uy; 0xb8uy; 0x87uy; 0x18uy;
0x58uy; 0x65uy
] in
assert_norm (List.Tot.length l == 42);
of_list l
/// Test 2
let test2_hash = Spec.Hash.Definitions.SHA2_256
let test2_ikm : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy;
0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy; 0x0duy; 0x0euy; 0x0fuy;
0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy; 0x16uy; 0x17uy;
0x18uy; 0x19uy; 0x1auy; 0x1buy; 0x1cuy; 0x1duy; 0x1euy; 0x1fuy;
0x20uy; 0x21uy; 0x22uy; 0x23uy; 0x24uy; 0x25uy; 0x26uy; 0x27uy;
0x28uy; 0x29uy; 0x2auy; 0x2buy; 0x2cuy; 0x2duy; 0x2euy; 0x2fuy;
0x30uy; 0x31uy; 0x32uy; 0x33uy; 0x34uy; 0x35uy; 0x36uy; 0x37uy;
0x38uy; 0x39uy; 0x3auy; 0x3buy; 0x3cuy; 0x3duy; 0x3euy; 0x3fuy;
0x40uy; 0x41uy; 0x42uy; 0x43uy; 0x44uy; 0x45uy; 0x46uy; 0x47uy;
0x48uy; 0x49uy; 0x4auy; 0x4buy; 0x4cuy; 0x4duy; 0x4euy; 0x4fuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_salt : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0x60uy; 0x61uy; 0x62uy; 0x63uy; 0x64uy; 0x65uy; 0x66uy; 0x67uy;
0x68uy; 0x69uy; 0x6auy; 0x6buy; 0x6cuy; 0x6duy; 0x6euy; 0x6fuy;
0x70uy; 0x71uy; 0x72uy; 0x73uy; 0x74uy; 0x75uy; 0x76uy; 0x77uy;
0x78uy; 0x79uy; 0x7auy; 0x7buy; 0x7cuy; 0x7duy; 0x7euy; 0x7fuy;
0x80uy; 0x81uy; 0x82uy; 0x83uy; 0x84uy; 0x85uy; 0x86uy; 0x87uy;
0x88uy; 0x89uy; 0x8auy; 0x8buy; 0x8cuy; 0x8duy; 0x8euy; 0x8fuy;
0x90uy; 0x91uy; 0x92uy; 0x93uy; 0x94uy; 0x95uy; 0x96uy; 0x97uy;
0x98uy; 0x99uy; 0x9auy; 0x9buy; 0x9cuy; 0x9duy; 0x9euy; 0x9fuy;
0xa0uy; 0xa1uy; 0xa2uy; 0xa3uy; 0xa4uy; 0xa5uy; 0xa6uy; 0xa7uy;
0xa8uy; 0xa9uy; 0xaauy; 0xabuy; 0xacuy; 0xaduy; 0xaeuy; 0xafuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_info : lbytes 80 =
let l = List.Tot.map u8_from_UInt8 [
0xb0uy; 0xb1uy; 0xb2uy; 0xb3uy; 0xb4uy; 0xb5uy; 0xb6uy; 0xb7uy;
0xb8uy; 0xb9uy; 0xbauy; 0xbbuy; 0xbcuy; 0xbduy; 0xbeuy; 0xbfuy;
0xc0uy; 0xc1uy; 0xc2uy; 0xc3uy; 0xc4uy; 0xc5uy; 0xc6uy; 0xc7uy;
0xc8uy; 0xc9uy; 0xcauy; 0xcbuy; 0xccuy; 0xcduy; 0xceuy; 0xcfuy;
0xd0uy; 0xd1uy; 0xd2uy; 0xd3uy; 0xd4uy; 0xd5uy; 0xd6uy; 0xd7uy;
0xd8uy; 0xd9uy; 0xdauy; 0xdbuy; 0xdcuy; 0xdduy; 0xdeuy; 0xdfuy;
0xe0uy; 0xe1uy; 0xe2uy; 0xe3uy; 0xe4uy; 0xe5uy; 0xe6uy; 0xe7uy;
0xe8uy; 0xe9uy; 0xeauy; 0xebuy; 0xecuy; 0xeduy; 0xeeuy; 0xefuy;
0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy;
0xf8uy; 0xf9uy; 0xfauy; 0xfbuy; 0xfcuy; 0xfduy; 0xfeuy; 0xffuy
] in
assert_norm (List.Tot.length l == 80);
of_list l
let test2_len = 82
let test2_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x06uy; 0xa6uy; 0xb8uy; 0x8cuy; 0x58uy; 0x53uy; 0x36uy; 0x1auy;
0x06uy; 0x10uy; 0x4cuy; 0x9cuy; 0xebuy; 0x35uy; 0xb4uy; 0x5cuy;
0xefuy; 0x76uy; 0x00uy; 0x14uy; 0x90uy; 0x46uy; 0x71uy; 0x01uy;
0x4auy; 0x19uy; 0x3fuy; 0x40uy; 0xc1uy; 0x5fuy; 0xc2uy; 0x44uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_expected_okm : lbytes 82 =
let l = List.Tot.map u8_from_UInt8 [
0xb1uy; 0x1euy; 0x39uy; 0x8duy; 0xc8uy; 0x03uy; 0x27uy; 0xa1uy;
0xc8uy; 0xe7uy; 0xf7uy; 0x8cuy; 0x59uy; 0x6auy; 0x49uy; 0x34uy;
0x4fuy; 0x01uy; 0x2euy; 0xdauy; 0x2duy; 0x4euy; 0xfauy; 0xd8uy;
0xa0uy; 0x50uy; 0xccuy; 0x4cuy; 0x19uy; 0xafuy; 0xa9uy; 0x7cuy;
0x59uy; 0x04uy; 0x5auy; 0x99uy; 0xcauy; 0xc7uy; 0x82uy; 0x72uy;
0x71uy; 0xcbuy; 0x41uy; 0xc6uy; 0x5euy; 0x59uy; 0x0euy; 0x09uy;
0xdauy; 0x32uy; 0x75uy; 0x60uy; 0x0cuy; 0x2fuy; 0x09uy; 0xb8uy;
0x36uy; 0x77uy; 0x93uy; 0xa9uy; 0xacuy; 0xa3uy; 0xdbuy; 0x71uy;
0xccuy; 0x30uy; 0xc5uy; 0x81uy; 0x79uy; 0xecuy; 0x3euy; 0x87uy;
0xc1uy; 0x4cuy; 0x01uy; 0xd5uy; 0xc1uy; 0xf3uy; 0x43uy; 0x4fuy;
0x1duy; 0x87uy
] in
assert_norm (List.Tot.length l == 82);
of_list l
/// Test 3
let test3_hash = Spec.Hash.Definitions.SHA2_256
let test3_ikm : lbytes 22 =
let l = List.Tot.map u8_from_UInt8 [
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy;
0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy; 0x0buy
] in
assert_norm (List.Tot.length l == 22);
of_list l
let test3_salt : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test3_info : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test3_len = 42
let test3_expected_prk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x19uy; 0xefuy; 0x24uy; 0xa3uy; 0x2cuy; 0x71uy; 0x7buy; 0x16uy;
0x7fuy; 0x33uy; 0xa9uy; 0x1duy; 0x6fuy; 0x64uy; 0x8buy; 0xdfuy;
0x96uy; 0x59uy; 0x67uy; 0x76uy; 0xafuy; 0xdbuy; 0x63uy; 0x77uy;
0xacuy; 0x43uy; 0x4cuy; 0x1cuy; 0x29uy; 0x3cuy; 0xcbuy; 0x04uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_expected_okm : lbytes 42 =
let l = List.Tot.map u8_from_UInt8 [
0x8duy; 0xa4uy; 0xe7uy; 0x75uy; 0xa5uy; 0x63uy; 0xc1uy; 0x8fuy;
0x71uy; 0x5fuy; 0x80uy; 0x2auy; 0x06uy; 0x3cuy; 0x5auy; 0x31uy;
0xb8uy; 0xa1uy; 0x1fuy; 0x5cuy; 0x5euy; 0xe1uy; 0x87uy; 0x9euy;
0xc3uy; 0x45uy; 0x4euy; 0x5fuy; 0x3cuy; 0x73uy; 0x8duy; 0x2duy;
0x9duy; 0x20uy; 0x13uy; 0x95uy; 0xfauy; 0xa4uy; 0xb6uy; 0x1auy;
0x96uy; 0xc8uy
] in
assert_norm (List.Tot.length l == 42);
of_list l
noeq type vec =
| Vec :
a:Spec.Hash.Definitions.fixed_len_alg
-> salt:bytes{HMAC.keysized a (length salt)}
-> ikm:bytes{HKDF.extract_ikm_length_pred a (length ikm)}
-> expected_prk:lbytes (Spec.Hash.Definitions.hash_length a)
-> info:bytes{HKDF.expand_info_length_pred a (length info)}
-> out_len:nat{HKDF.expand_output_length_pred a out_len}
-> expected_okm:lbytes out_len -> vec
let _: squash (pow2 32 < pow2 61 /\ pow2 32 < pow2 125) =
Math.Lemmas.pow2_lt_compat 61 32;
Math.Lemmas.pow2_lt_compat 125 32 | {
"checked_file": "/",
"dependencies": [
"Spec.Hash.Definitions.fst.checked",
"Spec.Agile.HMAC.fsti.checked",
"Spec.Agile.HKDF.fsti.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.PrintSequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.UInt8.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked"
],
"interface_file": false,
"source_file": "Spec.HKDF.Test.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Agile.HKDF",
"short_module": "HKDF"
},
{
"abbrev": true,
"full_module": "Spec.Agile.HMAC",
"short_module": "HMAC"
},
{
"abbrev": true,
"full_module": "Lib.PrintSequence",
"short_module": "PS"
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.RawIntTypes",
"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": "Spec.HKDF",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.HKDF",
"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 | Prims.list Spec.HKDF.Test.vec | Prims.Tot | [
"total"
] | [] | [
"Prims.Cons",
"Spec.HKDF.Test.vec",
"Spec.HKDF.Test.Vec",
"Spec.HKDF.Test.test1_hash",
"Spec.HKDF.Test.test1_salt",
"Spec.HKDF.Test.test1_ikm",
"Spec.HKDF.Test.test1_expected_prk",
"Spec.HKDF.Test.test1_info",
"Spec.HKDF.Test.test1_len",
"Spec.HKDF.Test.test1_expected_okm",
"Spec.HKDF.Test.test2_hash",
"Spec.HKDF.Test.test2_salt",
"Spec.HKDF.Test.test2_ikm",
"Spec.HKDF.Test.test2_expected_prk",
"Spec.HKDF.Test.test2_info",
"Spec.HKDF.Test.test2_len",
"Spec.HKDF.Test.test2_expected_okm",
"Spec.HKDF.Test.test3_hash",
"Spec.HKDF.Test.test3_salt",
"Spec.HKDF.Test.test3_ikm",
"Spec.HKDF.Test.test3_expected_prk",
"Spec.HKDF.Test.test3_info",
"Spec.HKDF.Test.test3_len",
"Spec.HKDF.Test.test3_expected_okm",
"Prims.Nil"
] | [] | false | false | false | true | false | let test_vectors:list vec =
| [
Vec test1_hash test1_salt test1_ikm test1_expected_prk test1_info test1_len test1_expected_okm;
Vec test2_hash test2_salt test2_ikm test2_expected_prk test2_info test2_len test2_expected_okm;
Vec test3_hash test3_salt test3_ikm test3_expected_prk test3_info test3_len test3_expected_okm
] | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rR14 | val rR14:reg_64 | val rR14:reg_64 | let rR14 : reg_64 = 14 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 41,
"end_line": 85,
"start_col": 19,
"start_line": 85
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rR14:reg_64 =
| 14 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.rR15 | val rR15:reg_64 | val rR15:reg_64 | let rR15 : reg_64 = 15 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 41,
"end_line": 86,
"start_col": 19,
"start_line": 86
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg_64 | Prims.Tot | [
"total"
] | [] | [] | [] | false | false | false | true | false | let rR15:reg_64 =
| 15 | false |
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.num_lanes | val num_lanes (fs: field_spec) : F32xN.lanes | val num_lanes (fs: field_spec) : F32xN.lanes | let num_lanes (fs : field_spec) : F32xN.lanes =
match fs with
| M32 -> 1
| M128 -> 2
| M256 -> 4 | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 13,
"end_line": 59,
"start_col": 0,
"start_line": 55
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x
inline_for_extraction noextract
let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit
inline_for_extraction noextract
let as_lib_k (x: B.buffer uint8 { B.length x = 32 }): Lib.Buffer.lbuffer uint8 32ul =
x | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 | fs: Hacl.Impl.Poly1305.Fields.field_spec -> Hacl.Spec.Poly1305.Field32xN.lanes | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Poly1305.Fields.field_spec",
"Hacl.Spec.Poly1305.Field32xN.lanes"
] | [] | false | false | false | true | false | let num_lanes (fs: field_spec) : F32xN.lanes =
| match fs with
| M32 -> 1
| M128 -> 2
| M256 -> 4 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.oreg | val oreg (r: reg) : operand_rf r.rf | val oreg (r: reg) : operand_rf r.rf | let oreg (r:reg) : operand_rf r.rf =
OReg r.r | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 10,
"end_line": 66,
"start_col": 7,
"start_line": 65
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf) | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | r: Vale.X64.Machine_s.reg -> Vale.X64.Machine_s.operand_rf (Reg?.rf r) | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.reg",
"Vale.X64.Machine_s.OReg",
"Vale.X64.Machine_s.t_reg_file",
"Vale.X64.Machine_s.__proj__Reg__item__rf",
"Vale.X64.Machine_s.reg_id",
"Vale.X64.Machine_s.__proj__Reg__item__r",
"Vale.X64.Machine_s.operand_rf"
] | [] | false | false | false | false | false | let oreg (r: reg) : operand_rf r.rf =
| OReg r.r | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.t_reg_to_int | val t_reg_to_int (rf: reg_file_id) (v: t_reg_file rf) : int | val t_reg_to_int (rf: reg_file_id) (v: t_reg_file rf) : int | let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 10,
"end_line": 44,
"start_col": 0,
"start_line": 41
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | rf: Vale.X64.Machine_s.reg_file_id -> v: Vale.X64.Machine_s.t_reg_file rf -> Prims.int | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.reg_file_id",
"Vale.X64.Machine_s.t_reg_file",
"Prims.int"
] | [] | false | false | false | false | false | let t_reg_to_int (rf: reg_file_id) (v: t_reg_file rf) : int =
| match rf with
| 0 -> v
| 1 -> 0 | false |
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.update_multi' | val update_multi' : r: Spec.Poly1305.felem ->
acc: Spec.Poly1305.felem ->
blocks: FStar.Seq.Base.seq Lib.UpdateMulti.uint8
-> Prims.Pure Spec.Poly1305.felem | let update_multi' r =
Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block (update' r) | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 70,
"end_line": 134,
"start_col": 0,
"start_line": 133
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x
inline_for_extraction noextract
let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit
inline_for_extraction noextract
let as_lib_k (x: B.buffer uint8 { B.length x = 32 }): Lib.Buffer.lbuffer uint8 32ul =
x
inline_for_extraction noextract
let num_lanes (fs : field_spec) : F32xN.lanes =
match fs with
| M32 -> 1
| M128 -> 2
| M256 -> 4
inline_for_extraction noextract
let stateful_poly1305_ctx (fs : field_spec) : I.stateful unit =
I.Stateful
(fun () -> t fs)
(fun #_ _ s -> B.loc_addr_of_buffer (as_raw s))
(fun #_ _ s -> B.freeable (as_raw s))
(fun #_ h s -> B.live h (as_raw s) /\ P.state_inv_t h (as_lib s))
(fun () -> Spec.Poly1305.felem & Spec.Poly1305.felem)
(fun () h s -> P.as_get_acc h (as_lib s), P.as_get_r h (as_lib s))
(fun #_ _ _ -> ())
(fun #_ l s h0 h1 ->
P.reveal_ctx_inv (as_lib s) h0 h1;
B.modifies_buffer_elim (as_raw s) l h0 h1)
(fun #_ _ _ _ _ -> ())
(fun () ->
[@inline_let]
let n = num_lanes fs in
let r = B.alloca (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun () r ->
[@inline_let]
let n = num_lanes fs in
let r = B.malloc r (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun _ s -> B.free s)
(fun _ src dst ->
let h0 = ST.get () in
B.blit src 0ul dst 0ul 25ul;
let h1 = ST.get () in
P.reveal_ctx_inv' (as_lib src) (as_lib dst) h0 h1)
/// Interlude for spec equivalence proofs
/// =====================================
///
/// A quick explanation about this proof of equivalence. At the spec level,
/// ``poly1305_update`` needs both ``r`` and the accumulator ``acc``. This thus
/// makes poly1305 update a function of two arguments. However, the streaming
/// facility is constructed over specifications that take one single argument.
/// Not a problem! We carry the pair ``(r, acc)`` as our "streaming functor
/// accumulator", and we now have to show that a specification in terms of
/// ``update (update (r, acc) init)`` is the same as poly1305. For that, we need
/// to do a little proof of equivalence to show first that this is the same as
/// ``(update r) ((update r) acc)`` (note that the update function now becomes a
/// partial application), then use the update-multi-repeat conversion lemma to
/// get the original specification of poly1305.
inline_for_extraction noextract
let block = (block: S.seq uint8 { S.length block = Spec.Poly1305.size_block })
inline_for_extraction noextract
let update_ (acc, r) (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc, r
/// Same as [update_], but with the input not necessarily a full block (can be smaller)
inline_for_extraction noextract
let update__ (acc, r) (input: S.seq uint8{S.length input <= Spec.Poly1305.size_block}) =
Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r
inline_for_extraction noextract
let update' r acc (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc
inline_for_extraction noextract
let update_multi =
Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block update_ | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 |
r: Spec.Poly1305.felem ->
acc: Spec.Poly1305.felem ->
blocks: FStar.Seq.Base.seq Lib.UpdateMulti.uint8
-> Prims.Pure Spec.Poly1305.felem | Prims.Pure | [
""
] | [] | [
"Spec.Poly1305.felem",
"Lib.UpdateMulti.mk_update_multi",
"Spec.Poly1305.size_block",
"Hacl.Streaming.Poly1305.update'",
"FStar.Seq.Base.seq",
"Lib.UpdateMulti.uint8",
"FStar.Seq.Base.length",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.op_Modulus",
"Prims.l_True"
] | [] | false | false | false | false | false | let update_multi' r =
| Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block (update' r) | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.operand_rf | val operand_rf (rf: reg_file_id) : eqtype | val operand_rf (rf: reg_file_id) : eqtype | let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf) | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 37,
"end_line": 62,
"start_col": 0,
"start_line": 61
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | rf: Vale.X64.Machine_s.reg_file_id -> Prims.eqtype | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.reg_file_id",
"Vale.X64.Machine_s.operand",
"Vale.X64.Machine_s.t_reg_file",
"Vale.X64.Machine_s.reg_id",
"Prims.eqtype"
] | [] | false | false | false | true | false | let operand_rf (rf: reg_file_id) : eqtype =
| operand (t_reg_file rf) (reg_id rf) | false |
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.block | val block : Type0 | let block = (block: S.seq uint8 { S.length block = Spec.Poly1305.size_block }) | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 78,
"end_line": 113,
"start_col": 0,
"start_line": 113
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x
inline_for_extraction noextract
let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit
inline_for_extraction noextract
let as_lib_k (x: B.buffer uint8 { B.length x = 32 }): Lib.Buffer.lbuffer uint8 32ul =
x
inline_for_extraction noextract
let num_lanes (fs : field_spec) : F32xN.lanes =
match fs with
| M32 -> 1
| M128 -> 2
| M256 -> 4
inline_for_extraction noextract
let stateful_poly1305_ctx (fs : field_spec) : I.stateful unit =
I.Stateful
(fun () -> t fs)
(fun #_ _ s -> B.loc_addr_of_buffer (as_raw s))
(fun #_ _ s -> B.freeable (as_raw s))
(fun #_ h s -> B.live h (as_raw s) /\ P.state_inv_t h (as_lib s))
(fun () -> Spec.Poly1305.felem & Spec.Poly1305.felem)
(fun () h s -> P.as_get_acc h (as_lib s), P.as_get_r h (as_lib s))
(fun #_ _ _ -> ())
(fun #_ l s h0 h1 ->
P.reveal_ctx_inv (as_lib s) h0 h1;
B.modifies_buffer_elim (as_raw s) l h0 h1)
(fun #_ _ _ _ _ -> ())
(fun () ->
[@inline_let]
let n = num_lanes fs in
let r = B.alloca (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun () r ->
[@inline_let]
let n = num_lanes fs in
let r = B.malloc r (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun _ s -> B.free s)
(fun _ src dst ->
let h0 = ST.get () in
B.blit src 0ul dst 0ul 25ul;
let h1 = ST.get () in
P.reveal_ctx_inv' (as_lib src) (as_lib dst) h0 h1)
/// Interlude for spec equivalence proofs
/// =====================================
///
/// A quick explanation about this proof of equivalence. At the spec level,
/// ``poly1305_update`` needs both ``r`` and the accumulator ``acc``. This thus
/// makes poly1305 update a function of two arguments. However, the streaming
/// facility is constructed over specifications that take one single argument.
/// Not a problem! We carry the pair ``(r, acc)`` as our "streaming functor
/// accumulator", and we now have to show that a specification in terms of
/// ``update (update (r, acc) init)`` is the same as poly1305. For that, we need
/// to do a little proof of equivalence to show first that this is the same as
/// ``(update r) ((update r) acc)`` (note that the update function now becomes a
/// partial application), then use the update-multi-repeat conversion lemma to
/// get the original specification of poly1305. | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 | Type0 | Prims.Tot | [
"total"
] | [] | [
"FStar.Seq.Base.seq",
"Hacl.Streaming.Poly1305.uint8",
"Prims.b2t",
"Prims.op_Equality",
"Prims.nat",
"FStar.Seq.Base.length",
"Spec.Poly1305.size_block"
] | [] | false | false | false | true | true | let block =
| (block: S.seq uint8 {S.length block = Spec.Poly1305.size_block}) | false |
|
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.update_ | val update_ : _: (Spec.Poly1305.felem * Spec.Poly1305.felem) -> block: Hacl.Streaming.Poly1305.block
-> Spec.Poly1305.felem * Spec.Poly1305.felem | let update_ (acc, r) (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc, r | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 72,
"end_line": 117,
"start_col": 0,
"start_line": 116
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x
inline_for_extraction noextract
let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit
inline_for_extraction noextract
let as_lib_k (x: B.buffer uint8 { B.length x = 32 }): Lib.Buffer.lbuffer uint8 32ul =
x
inline_for_extraction noextract
let num_lanes (fs : field_spec) : F32xN.lanes =
match fs with
| M32 -> 1
| M128 -> 2
| M256 -> 4
inline_for_extraction noextract
let stateful_poly1305_ctx (fs : field_spec) : I.stateful unit =
I.Stateful
(fun () -> t fs)
(fun #_ _ s -> B.loc_addr_of_buffer (as_raw s))
(fun #_ _ s -> B.freeable (as_raw s))
(fun #_ h s -> B.live h (as_raw s) /\ P.state_inv_t h (as_lib s))
(fun () -> Spec.Poly1305.felem & Spec.Poly1305.felem)
(fun () h s -> P.as_get_acc h (as_lib s), P.as_get_r h (as_lib s))
(fun #_ _ _ -> ())
(fun #_ l s h0 h1 ->
P.reveal_ctx_inv (as_lib s) h0 h1;
B.modifies_buffer_elim (as_raw s) l h0 h1)
(fun #_ _ _ _ _ -> ())
(fun () ->
[@inline_let]
let n = num_lanes fs in
let r = B.alloca (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun () r ->
[@inline_let]
let n = num_lanes fs in
let r = B.malloc r (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun _ s -> B.free s)
(fun _ src dst ->
let h0 = ST.get () in
B.blit src 0ul dst 0ul 25ul;
let h1 = ST.get () in
P.reveal_ctx_inv' (as_lib src) (as_lib dst) h0 h1)
/// Interlude for spec equivalence proofs
/// =====================================
///
/// A quick explanation about this proof of equivalence. At the spec level,
/// ``poly1305_update`` needs both ``r`` and the accumulator ``acc``. This thus
/// makes poly1305 update a function of two arguments. However, the streaming
/// facility is constructed over specifications that take one single argument.
/// Not a problem! We carry the pair ``(r, acc)`` as our "streaming functor
/// accumulator", and we now have to show that a specification in terms of
/// ``update (update (r, acc) init)`` is the same as poly1305. For that, we need
/// to do a little proof of equivalence to show first that this is the same as
/// ``(update r) ((update r) acc)`` (note that the update function now becomes a
/// partial application), then use the update-multi-repeat conversion lemma to
/// get the original specification of poly1305.
inline_for_extraction noextract
let block = (block: S.seq uint8 { S.length block = Spec.Poly1305.size_block }) | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 | _: (Spec.Poly1305.felem * Spec.Poly1305.felem) -> block: Hacl.Streaming.Poly1305.block
-> Spec.Poly1305.felem * Spec.Poly1305.felem | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Native.tuple2",
"Spec.Poly1305.felem",
"Hacl.Streaming.Poly1305.block",
"FStar.Pervasives.Native.Mktuple2",
"Spec.Poly1305.poly1305_update1",
"Spec.Poly1305.size_block"
] | [] | false | false | false | true | false | let update_ (acc, r) (block: block) =
| Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc, r | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_Rax | val reg_Rax:reg | val reg_Rax:reg | let reg_Rax : reg = Reg 0 0 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 88,
"start_col": 19,
"start_line": 88
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_Rax:reg =
| Reg 0 0 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_Rsi | val reg_Rsi:reg | val reg_Rsi:reg | let reg_Rsi : reg = Reg 0 4 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 92,
"start_col": 19,
"start_line": 92
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_Rsi:reg =
| Reg 0 4 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_Rcx | val reg_Rcx:reg | val reg_Rcx:reg | let reg_Rcx : reg = Reg 0 2 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 90,
"start_col": 19,
"start_line": 90
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_Rcx:reg =
| Reg 0 2 | false |
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.update_last' | val update_last' : r: Spec.Poly1305.felem ->
acc: Spec.Poly1305.felem ->
input:
FStar.Seq.Base.seq Hacl.Streaming.Poly1305.uint8
{FStar.Seq.Base.length input <= Spec.Poly1305.size_block}
-> Spec.Poly1305.felem | let update_last' r acc (input: S.seq uint8 { S.length input <= Spec.Poly1305.size_block }) =
if S.length input = 0 then
acc
else
Spec.Poly1305.poly1305_update1 r (S.length input) input acc | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 63,
"end_line": 166,
"start_col": 0,
"start_line": 162
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x
inline_for_extraction noextract
let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit
inline_for_extraction noextract
let as_lib_k (x: B.buffer uint8 { B.length x = 32 }): Lib.Buffer.lbuffer uint8 32ul =
x
inline_for_extraction noextract
let num_lanes (fs : field_spec) : F32xN.lanes =
match fs with
| M32 -> 1
| M128 -> 2
| M256 -> 4
inline_for_extraction noextract
let stateful_poly1305_ctx (fs : field_spec) : I.stateful unit =
I.Stateful
(fun () -> t fs)
(fun #_ _ s -> B.loc_addr_of_buffer (as_raw s))
(fun #_ _ s -> B.freeable (as_raw s))
(fun #_ h s -> B.live h (as_raw s) /\ P.state_inv_t h (as_lib s))
(fun () -> Spec.Poly1305.felem & Spec.Poly1305.felem)
(fun () h s -> P.as_get_acc h (as_lib s), P.as_get_r h (as_lib s))
(fun #_ _ _ -> ())
(fun #_ l s h0 h1 ->
P.reveal_ctx_inv (as_lib s) h0 h1;
B.modifies_buffer_elim (as_raw s) l h0 h1)
(fun #_ _ _ _ _ -> ())
(fun () ->
[@inline_let]
let n = num_lanes fs in
let r = B.alloca (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun () r ->
[@inline_let]
let n = num_lanes fs in
let r = B.malloc r (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun _ s -> B.free s)
(fun _ src dst ->
let h0 = ST.get () in
B.blit src 0ul dst 0ul 25ul;
let h1 = ST.get () in
P.reveal_ctx_inv' (as_lib src) (as_lib dst) h0 h1)
/// Interlude for spec equivalence proofs
/// =====================================
///
/// A quick explanation about this proof of equivalence. At the spec level,
/// ``poly1305_update`` needs both ``r`` and the accumulator ``acc``. This thus
/// makes poly1305 update a function of two arguments. However, the streaming
/// facility is constructed over specifications that take one single argument.
/// Not a problem! We carry the pair ``(r, acc)`` as our "streaming functor
/// accumulator", and we now have to show that a specification in terms of
/// ``update (update (r, acc) init)`` is the same as poly1305. For that, we need
/// to do a little proof of equivalence to show first that this is the same as
/// ``(update r) ((update r) acc)`` (note that the update function now becomes a
/// partial application), then use the update-multi-repeat conversion lemma to
/// get the original specification of poly1305.
inline_for_extraction noextract
let block = (block: S.seq uint8 { S.length block = Spec.Poly1305.size_block })
inline_for_extraction noextract
let update_ (acc, r) (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc, r
/// Same as [update_], but with the input not necessarily a full block (can be smaller)
inline_for_extraction noextract
let update__ (acc, r) (input: S.seq uint8{S.length input <= Spec.Poly1305.size_block}) =
Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r
inline_for_extraction noextract
let update' r acc (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc
inline_for_extraction noextract
let update_multi =
Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block update_
inline_for_extraction noextract
let update_multi' r =
Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block (update' r)
#push-options "--fuel 1"
inline_for_extraction noextract
let rec with_or_without_r (acc r: Spec.Poly1305.felem) (blocks: S.seq uint8):
Lemma
(requires
S.length blocks % Spec.Poly1305.size_block = 0)
(ensures
update_multi (acc, r) blocks == (update_multi' r acc blocks, r))
(decreases (S.length blocks))
=
if S.length blocks = 0 then
()
else
let block, rem = Lib.UpdateMulti.split_block Spec.Poly1305.size_block blocks 1 in
let acc = update' r acc block in
with_or_without_r acc r rem
#pop-options
inline_for_extraction noextract
let update_last (acc, r) (input: S.seq uint8 { S.length input <= Spec.Poly1305.size_block }) =
if S.length input = 0 then
acc, r
else
Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 |
r: Spec.Poly1305.felem ->
acc: Spec.Poly1305.felem ->
input:
FStar.Seq.Base.seq Hacl.Streaming.Poly1305.uint8
{FStar.Seq.Base.length input <= Spec.Poly1305.size_block}
-> Spec.Poly1305.felem | Prims.Tot | [
"total"
] | [] | [
"Spec.Poly1305.felem",
"FStar.Seq.Base.seq",
"Hacl.Streaming.Poly1305.uint8",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.Seq.Base.length",
"Spec.Poly1305.size_block",
"Prims.op_Equality",
"Prims.int",
"Prims.bool",
"Spec.Poly1305.poly1305_update1"
] | [] | false | false | false | false | false | let update_last' r acc (input: S.seq uint8 {S.length input <= Spec.Poly1305.size_block}) =
| if S.length input = 0 then acc else Spec.Poly1305.poly1305_update1 r (S.length input) input acc | false |
|
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.update' | val update' : r: Spec.Poly1305.felem -> acc: Spec.Poly1305.felem -> block: Hacl.Streaming.Poly1305.block
-> Spec.Poly1305.felem | let update' r acc (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 69,
"end_line": 126,
"start_col": 0,
"start_line": 125
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x
inline_for_extraction noextract
let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit
inline_for_extraction noextract
let as_lib_k (x: B.buffer uint8 { B.length x = 32 }): Lib.Buffer.lbuffer uint8 32ul =
x
inline_for_extraction noextract
let num_lanes (fs : field_spec) : F32xN.lanes =
match fs with
| M32 -> 1
| M128 -> 2
| M256 -> 4
inline_for_extraction noextract
let stateful_poly1305_ctx (fs : field_spec) : I.stateful unit =
I.Stateful
(fun () -> t fs)
(fun #_ _ s -> B.loc_addr_of_buffer (as_raw s))
(fun #_ _ s -> B.freeable (as_raw s))
(fun #_ h s -> B.live h (as_raw s) /\ P.state_inv_t h (as_lib s))
(fun () -> Spec.Poly1305.felem & Spec.Poly1305.felem)
(fun () h s -> P.as_get_acc h (as_lib s), P.as_get_r h (as_lib s))
(fun #_ _ _ -> ())
(fun #_ l s h0 h1 ->
P.reveal_ctx_inv (as_lib s) h0 h1;
B.modifies_buffer_elim (as_raw s) l h0 h1)
(fun #_ _ _ _ _ -> ())
(fun () ->
[@inline_let]
let n = num_lanes fs in
let r = B.alloca (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun () r ->
[@inline_let]
let n = num_lanes fs in
let r = B.malloc r (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun _ s -> B.free s)
(fun _ src dst ->
let h0 = ST.get () in
B.blit src 0ul dst 0ul 25ul;
let h1 = ST.get () in
P.reveal_ctx_inv' (as_lib src) (as_lib dst) h0 h1)
/// Interlude for spec equivalence proofs
/// =====================================
///
/// A quick explanation about this proof of equivalence. At the spec level,
/// ``poly1305_update`` needs both ``r`` and the accumulator ``acc``. This thus
/// makes poly1305 update a function of two arguments. However, the streaming
/// facility is constructed over specifications that take one single argument.
/// Not a problem! We carry the pair ``(r, acc)`` as our "streaming functor
/// accumulator", and we now have to show that a specification in terms of
/// ``update (update (r, acc) init)`` is the same as poly1305. For that, we need
/// to do a little proof of equivalence to show first that this is the same as
/// ``(update r) ((update r) acc)`` (note that the update function now becomes a
/// partial application), then use the update-multi-repeat conversion lemma to
/// get the original specification of poly1305.
inline_for_extraction noextract
let block = (block: S.seq uint8 { S.length block = Spec.Poly1305.size_block })
inline_for_extraction noextract
let update_ (acc, r) (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc, r
/// Same as [update_], but with the input not necessarily a full block (can be smaller)
inline_for_extraction noextract
let update__ (acc, r) (input: S.seq uint8{S.length input <= Spec.Poly1305.size_block}) =
Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 | r: Spec.Poly1305.felem -> acc: Spec.Poly1305.felem -> block: Hacl.Streaming.Poly1305.block
-> Spec.Poly1305.felem | Prims.Tot | [
"total"
] | [] | [
"Spec.Poly1305.felem",
"Hacl.Streaming.Poly1305.block",
"Spec.Poly1305.poly1305_update1",
"Spec.Poly1305.size_block"
] | [] | false | false | false | true | false | let update' r acc (block: block) =
| Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_Rbx | val reg_Rbx:reg | val reg_Rbx:reg | let reg_Rbx : reg = Reg 0 1 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 89,
"start_col": 19,
"start_line": 89
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_Rbx:reg =
| Reg 0 1 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_Rdx | val reg_Rdx:reg | val reg_Rdx:reg | let reg_Rdx : reg = Reg 0 3 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 91,
"start_col": 19,
"start_line": 91
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_Rdx:reg =
| Reg 0 3 | false |
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.update_last | val update_last : _: (Spec.Poly1305.felem * Spec.Poly1305.felem) ->
input:
FStar.Seq.Base.seq Hacl.Streaming.Poly1305.uint8
{FStar.Seq.Base.length input <= Spec.Poly1305.size_block}
-> Spec.Poly1305.felem * Spec.Poly1305.felem | let update_last (acc, r) (input: S.seq uint8 { S.length input <= Spec.Poly1305.size_block }) =
if S.length input = 0 then
acc, r
else
Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 66,
"end_line": 159,
"start_col": 0,
"start_line": 155
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x
inline_for_extraction noextract
let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit
inline_for_extraction noextract
let as_lib_k (x: B.buffer uint8 { B.length x = 32 }): Lib.Buffer.lbuffer uint8 32ul =
x
inline_for_extraction noextract
let num_lanes (fs : field_spec) : F32xN.lanes =
match fs with
| M32 -> 1
| M128 -> 2
| M256 -> 4
inline_for_extraction noextract
let stateful_poly1305_ctx (fs : field_spec) : I.stateful unit =
I.Stateful
(fun () -> t fs)
(fun #_ _ s -> B.loc_addr_of_buffer (as_raw s))
(fun #_ _ s -> B.freeable (as_raw s))
(fun #_ h s -> B.live h (as_raw s) /\ P.state_inv_t h (as_lib s))
(fun () -> Spec.Poly1305.felem & Spec.Poly1305.felem)
(fun () h s -> P.as_get_acc h (as_lib s), P.as_get_r h (as_lib s))
(fun #_ _ _ -> ())
(fun #_ l s h0 h1 ->
P.reveal_ctx_inv (as_lib s) h0 h1;
B.modifies_buffer_elim (as_raw s) l h0 h1)
(fun #_ _ _ _ _ -> ())
(fun () ->
[@inline_let]
let n = num_lanes fs in
let r = B.alloca (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun () r ->
[@inline_let]
let n = num_lanes fs in
let r = B.malloc r (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun _ s -> B.free s)
(fun _ src dst ->
let h0 = ST.get () in
B.blit src 0ul dst 0ul 25ul;
let h1 = ST.get () in
P.reveal_ctx_inv' (as_lib src) (as_lib dst) h0 h1)
/// Interlude for spec equivalence proofs
/// =====================================
///
/// A quick explanation about this proof of equivalence. At the spec level,
/// ``poly1305_update`` needs both ``r`` and the accumulator ``acc``. This thus
/// makes poly1305 update a function of two arguments. However, the streaming
/// facility is constructed over specifications that take one single argument.
/// Not a problem! We carry the pair ``(r, acc)`` as our "streaming functor
/// accumulator", and we now have to show that a specification in terms of
/// ``update (update (r, acc) init)`` is the same as poly1305. For that, we need
/// to do a little proof of equivalence to show first that this is the same as
/// ``(update r) ((update r) acc)`` (note that the update function now becomes a
/// partial application), then use the update-multi-repeat conversion lemma to
/// get the original specification of poly1305.
inline_for_extraction noextract
let block = (block: S.seq uint8 { S.length block = Spec.Poly1305.size_block })
inline_for_extraction noextract
let update_ (acc, r) (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc, r
/// Same as [update_], but with the input not necessarily a full block (can be smaller)
inline_for_extraction noextract
let update__ (acc, r) (input: S.seq uint8{S.length input <= Spec.Poly1305.size_block}) =
Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r
inline_for_extraction noextract
let update' r acc (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc
inline_for_extraction noextract
let update_multi =
Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block update_
inline_for_extraction noextract
let update_multi' r =
Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block (update' r)
#push-options "--fuel 1"
inline_for_extraction noextract
let rec with_or_without_r (acc r: Spec.Poly1305.felem) (blocks: S.seq uint8):
Lemma
(requires
S.length blocks % Spec.Poly1305.size_block = 0)
(ensures
update_multi (acc, r) blocks == (update_multi' r acc blocks, r))
(decreases (S.length blocks))
=
if S.length blocks = 0 then
()
else
let block, rem = Lib.UpdateMulti.split_block Spec.Poly1305.size_block blocks 1 in
let acc = update' r acc block in
with_or_without_r acc r rem
#pop-options | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 |
_: (Spec.Poly1305.felem * Spec.Poly1305.felem) ->
input:
FStar.Seq.Base.seq Hacl.Streaming.Poly1305.uint8
{FStar.Seq.Base.length input <= Spec.Poly1305.size_block}
-> Spec.Poly1305.felem * Spec.Poly1305.felem | Prims.Tot | [
"total"
] | [] | [
"FStar.Pervasives.Native.tuple2",
"Spec.Poly1305.felem",
"FStar.Seq.Base.seq",
"Hacl.Streaming.Poly1305.uint8",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"FStar.Seq.Base.length",
"Spec.Poly1305.size_block",
"Prims.op_Equality",
"Prims.int",
"FStar.Pervasives.Native.Mktuple2",
"Prims.bool",
"Spec.Poly1305.poly1305_update1"
] | [] | false | false | false | false | false | let update_last (acc, r) (input: S.seq uint8 {S.length input <= Spec.Poly1305.size_block}) =
| if S.length input = 0
then acc, r
else Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.operand128 | val operand128:eqtype | val operand128:eqtype | let operand128:eqtype = operand quad32 reg_xmm | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 109,
"start_col": 0,
"start_line": 109
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2
[@va_qattr] unfold let reg_Rdx : reg = Reg 0 3
[@va_qattr] unfold let reg_Rsi : reg = Reg 0 4
[@va_qattr] unfold let reg_Rdi : reg = Reg 0 5
[@va_qattr] unfold let reg_Rbp : reg = Reg 0 6
[@va_qattr] unfold let reg_Rsp : reg = Reg 0 7
[@va_qattr] unfold let reg_R8 : reg = Reg 0 8
[@va_qattr] unfold let reg_R9 : reg = Reg 0 9
[@va_qattr] unfold let reg_R10 : reg = Reg 0 10
[@va_qattr] unfold let reg_R11 : reg = Reg 0 11
[@va_qattr] unfold let reg_R12 : reg = Reg 0 12
[@va_qattr] unfold let reg_R13 : reg = Reg 0 13
[@va_qattr] unfold let reg_R14 : reg = Reg 0 14
[@va_qattr] unfold let reg_R15 : reg = Reg 0 15
[@va_qattr]
let operand64:eqtype = operand nat64 reg_64 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.eqtype | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.operand",
"Vale.X64.Machine_s.quad32",
"Vale.X64.Machine_s.reg_xmm"
] | [] | false | false | false | true | false | let operand128:eqtype =
| operand quad32 reg_xmm | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_Rsp | val reg_Rsp:reg | val reg_Rsp:reg | let reg_Rsp : reg = Reg 0 7 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 95,
"start_col": 19,
"start_line": 95
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2
[@va_qattr] unfold let reg_Rdx : reg = Reg 0 3
[@va_qattr] unfold let reg_Rsi : reg = Reg 0 4
[@va_qattr] unfold let reg_Rdi : reg = Reg 0 5 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_Rsp:reg =
| Reg 0 7 | false |
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.as_lib_k | val as_lib_k (x: B.buffer uint8 {B.length x = 32}) : Lib.Buffer.lbuffer uint8 32ul | val as_lib_k (x: B.buffer uint8 {B.length x = 32}) : Lib.Buffer.lbuffer uint8 32ul | let as_lib_k (x: B.buffer uint8 { B.length x = 32 }): Lib.Buffer.lbuffer uint8 32ul =
x | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 52,
"start_col": 0,
"start_line": 51
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x
inline_for_extraction noextract
let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 | x: LowStar.Buffer.buffer Hacl.Streaming.Poly1305.uint8 {LowStar.Monotonic.Buffer.length x = 32}
-> Lib.Buffer.lbuffer Hacl.Streaming.Poly1305.uint8 32ul | Prims.Tot | [
"total"
] | [] | [
"LowStar.Buffer.buffer",
"Hacl.Streaming.Poly1305.uint8",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"LowStar.Monotonic.Buffer.length",
"LowStar.Buffer.trivial_preorder",
"Lib.Buffer.lbuffer",
"FStar.UInt32.__uint_to_t"
] | [] | false | false | false | false | false | let as_lib_k (x: B.buffer uint8 {B.length x = 32}) : Lib.Buffer.lbuffer uint8 32ul =
| x | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_R15 | val reg_R15:reg | val reg_R15:reg | let reg_R15 : reg = Reg 0 15 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 47,
"end_line": 103,
"start_col": 19,
"start_line": 103
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2
[@va_qattr] unfold let reg_Rdx : reg = Reg 0 3
[@va_qattr] unfold let reg_Rsi : reg = Reg 0 4
[@va_qattr] unfold let reg_Rdi : reg = Reg 0 5
[@va_qattr] unfold let reg_Rbp : reg = Reg 0 6
[@va_qattr] unfold let reg_Rsp : reg = Reg 0 7
[@va_qattr] unfold let reg_R8 : reg = Reg 0 8
[@va_qattr] unfold let reg_R9 : reg = Reg 0 9
[@va_qattr] unfold let reg_R10 : reg = Reg 0 10
[@va_qattr] unfold let reg_R11 : reg = Reg 0 11
[@va_qattr] unfold let reg_R12 : reg = Reg 0 12
[@va_qattr] unfold let reg_R13 : reg = Reg 0 13 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_R15:reg =
| Reg 0 15 | false |
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.update_multi | val update_multi : acc: (Spec.Poly1305.felem * Spec.Poly1305.felem) -> blocks: FStar.Seq.Base.seq Lib.UpdateMulti.uint8
-> Prims.Pure (Spec.Poly1305.felem * Spec.Poly1305.felem) | let update_multi =
Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block update_ | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 66,
"end_line": 130,
"start_col": 0,
"start_line": 129
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x
inline_for_extraction noextract
let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit
inline_for_extraction noextract
let as_lib_k (x: B.buffer uint8 { B.length x = 32 }): Lib.Buffer.lbuffer uint8 32ul =
x
inline_for_extraction noextract
let num_lanes (fs : field_spec) : F32xN.lanes =
match fs with
| M32 -> 1
| M128 -> 2
| M256 -> 4
inline_for_extraction noextract
let stateful_poly1305_ctx (fs : field_spec) : I.stateful unit =
I.Stateful
(fun () -> t fs)
(fun #_ _ s -> B.loc_addr_of_buffer (as_raw s))
(fun #_ _ s -> B.freeable (as_raw s))
(fun #_ h s -> B.live h (as_raw s) /\ P.state_inv_t h (as_lib s))
(fun () -> Spec.Poly1305.felem & Spec.Poly1305.felem)
(fun () h s -> P.as_get_acc h (as_lib s), P.as_get_r h (as_lib s))
(fun #_ _ _ -> ())
(fun #_ l s h0 h1 ->
P.reveal_ctx_inv (as_lib s) h0 h1;
B.modifies_buffer_elim (as_raw s) l h0 h1)
(fun #_ _ _ _ _ -> ())
(fun () ->
[@inline_let]
let n = num_lanes fs in
let r = B.alloca (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun () r ->
[@inline_let]
let n = num_lanes fs in
let r = B.malloc r (F32xN.zero n) 25ul in
let h1 = ST.get () in
P.ctx_inv_zeros #fs r h1;
r)
(fun _ s -> B.free s)
(fun _ src dst ->
let h0 = ST.get () in
B.blit src 0ul dst 0ul 25ul;
let h1 = ST.get () in
P.reveal_ctx_inv' (as_lib src) (as_lib dst) h0 h1)
/// Interlude for spec equivalence proofs
/// =====================================
///
/// A quick explanation about this proof of equivalence. At the spec level,
/// ``poly1305_update`` needs both ``r`` and the accumulator ``acc``. This thus
/// makes poly1305 update a function of two arguments. However, the streaming
/// facility is constructed over specifications that take one single argument.
/// Not a problem! We carry the pair ``(r, acc)`` as our "streaming functor
/// accumulator", and we now have to show that a specification in terms of
/// ``update (update (r, acc) init)`` is the same as poly1305. For that, we need
/// to do a little proof of equivalence to show first that this is the same as
/// ``(update r) ((update r) acc)`` (note that the update function now becomes a
/// partial application), then use the update-multi-repeat conversion lemma to
/// get the original specification of poly1305.
inline_for_extraction noextract
let block = (block: S.seq uint8 { S.length block = Spec.Poly1305.size_block })
inline_for_extraction noextract
let update_ (acc, r) (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc, r
/// Same as [update_], but with the input not necessarily a full block (can be smaller)
inline_for_extraction noextract
let update__ (acc, r) (input: S.seq uint8{S.length input <= Spec.Poly1305.size_block}) =
Spec.Poly1305.poly1305_update1 r (S.length input) input acc, r
inline_for_extraction noextract
let update' r acc (block: block) =
Spec.Poly1305.poly1305_update1 r Spec.Poly1305.size_block block acc | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 | acc: (Spec.Poly1305.felem * Spec.Poly1305.felem) -> blocks: FStar.Seq.Base.seq Lib.UpdateMulti.uint8
-> Prims.Pure (Spec.Poly1305.felem * Spec.Poly1305.felem) | Prims.Pure | [
""
] | [] | [
"Lib.UpdateMulti.mk_update_multi",
"FStar.Pervasives.Native.tuple2",
"Spec.Poly1305.felem",
"Spec.Poly1305.size_block",
"Hacl.Streaming.Poly1305.update_"
] | [] | false | false | false | false | false | let update_multi =
| Lib.UpdateMulti.mk_update_multi Spec.Poly1305.size_block update_ | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_R8 | val reg_R8:reg | val reg_R8:reg | let reg_R8 : reg = Reg 0 8 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 96,
"start_col": 19,
"start_line": 96
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2
[@va_qattr] unfold let reg_Rdx : reg = Reg 0 3
[@va_qattr] unfold let reg_Rsi : reg = Reg 0 4
[@va_qattr] unfold let reg_Rdi : reg = Reg 0 5
[@va_qattr] unfold let reg_Rbp : reg = Reg 0 6 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_R8:reg =
| Reg 0 8 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_Rbp | val reg_Rbp:reg | val reg_Rbp:reg | let reg_Rbp : reg = Reg 0 6 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 94,
"start_col": 19,
"start_line": 94
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2
[@va_qattr] unfold let reg_Rdx : reg = Reg 0 3
[@va_qattr] unfold let reg_Rsi : reg = Reg 0 4 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_Rbp:reg =
| Reg 0 6 | false |
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.poly1305_key | val poly1305_key : Hacl.Streaming.Interface.stateful Prims.unit | let poly1305_key = I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 72,
"end_line": 48,
"start_col": 0,
"start_line": 48
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x
inline_for_extraction noextract
let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 | Hacl.Streaming.Interface.stateful Prims.unit | Prims.Tot | [
"total"
] | [] | [
"Hacl.Streaming.Interface.stateful_buffer",
"Hacl.Streaming.Poly1305.uint8",
"FStar.UInt32.__uint_to_t",
"Lib.IntTypes.u8",
"Prims.unit"
] | [] | false | false | false | true | false | let poly1305_key =
| I.stateful_buffer uint8 32ul (Lib.IntTypes.u8 0) unit | false |
|
Hacl.Streaming.Poly1305.fst | Hacl.Streaming.Poly1305.as_lib | val as_lib (#fs: field_spec) (x: t fs) : P.poly1305_ctx fs | val as_lib (#fs: field_spec) (x: t fs) : P.poly1305_ctx fs | let as_lib (#fs : field_spec) (x: t fs): P.poly1305_ctx fs =
assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x | {
"file_name": "code/streaming/Hacl.Streaming.Poly1305.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 3,
"end_line": 45,
"start_col": 0,
"start_line": 43
} | module Hacl.Streaming.Poly1305
module HS = FStar.HyperStack
module B = LowStar.Buffer
module G = FStar.Ghost
module S = FStar.Seq
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module F = Hacl.Streaming.Functor
module I = Hacl.Streaming.Interface
module P = Hacl.Impl.Poly1305
module F32xN = Hacl.Spec.Poly1305.Field32xN
module ST = FStar.HyperStack.ST
open LowStar.BufferOps
open FStar.Mul
/// Opening a bunch of modules for Poly1305
/// =======================================
inline_for_extraction noextract
let uint8 = Lib.IntTypes.uint8
inline_for_extraction noextract
let uint32 = Lib.IntTypes.uint32
open Hacl.Impl.Poly1305.Fields
/// An instance of the stateful type class for poly1305 state
/// =========================================================
///
/// We use a custom view that separates r and acc, to respect abstraction boundaries established by Poly1305.
#set-options "--fuel 0 --ifuel 1 --z3rlimit 100"
inline_for_extraction noextract
let t (fs : field_spec) = b:B.buffer (limb fs) { B.length b == 25 }
inline_for_extraction noextract
let as_raw (#fs : field_spec) (x: t fs): B.buffer (limb fs) = x | {
"checked_file": "/",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"LowStar.BufferOps.fst.checked",
"LowStar.Buffer.fst.checked",
"Lib.UpdateMulti.Lemmas.fsti.checked",
"Lib.UpdateMulti.fst.checked",
"Lib.Sequence.Lemmas.fsti.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.Buffer.fsti.checked",
"Hacl.Streaming.Interface.fsti.checked",
"Hacl.Streaming.Functor.fsti.checked",
"Hacl.Spec.Poly1305.Field32xN.fst.checked",
"Hacl.Poly1305_32.fsti.checked",
"Hacl.Poly1305_256.fsti.checked",
"Hacl.Poly1305_128.fsti.checked",
"Hacl.Impl.Poly1305.Fields.fst.checked",
"Hacl.Impl.Poly1305.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.fst.checked",
"FStar.Ghost.fsti.checked",
"FStar.Calc.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Streaming.Poly1305.fst"
} | [
{
"abbrev": false,
"full_module": "Hacl.Impl.Poly1305.Fields",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowStar.BufferOps",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": true,
"full_module": "Hacl.Spec.Poly1305.Field32xN",
"short_module": "F32xN"
},
{
"abbrev": true,
"full_module": "Hacl.Impl.Poly1305",
"short_module": "P"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Interface",
"short_module": "I"
},
{
"abbrev": true,
"full_module": "Hacl.Streaming.Functor",
"short_module": "F"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "S"
},
{
"abbrev": true,
"full_module": "FStar.Ghost",
"short_module": "G"
},
{
"abbrev": true,
"full_module": "LowStar.Buffer",
"short_module": "B"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack",
"short_module": "HS"
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Streaming",
"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": 1,
"max_fuel": 0,
"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": 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 | x: Hacl.Streaming.Poly1305.t fs -> Hacl.Impl.Poly1305.poly1305_ctx fs | Prims.Tot | [
"total"
] | [] | [
"Hacl.Impl.Poly1305.Fields.field_spec",
"Hacl.Streaming.Poly1305.t",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"Prims.int",
"Lib.IntTypes.v",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Lib.IntTypes.add",
"Hacl.Impl.Poly1305.Fields.nlimb",
"Hacl.Impl.Poly1305.Fields.precomplen",
"Hacl.Impl.Poly1305.poly1305_ctx"
] | [] | false | false | false | false | false | let as_lib (#fs: field_spec) (x: t fs) : P.poly1305_ctx fs =
| assert (Lib.IntTypes.(v (add #U32 (nlimb fs) (precomplen fs))) == 25);
x | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.operand64 | val operand64:eqtype | val operand64:eqtype | let operand64:eqtype = operand nat64 reg_64 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 43,
"end_line": 106,
"start_col": 0,
"start_line": 106
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2
[@va_qattr] unfold let reg_Rdx : reg = Reg 0 3
[@va_qattr] unfold let reg_Rsi : reg = Reg 0 4
[@va_qattr] unfold let reg_Rdi : reg = Reg 0 5
[@va_qattr] unfold let reg_Rbp : reg = Reg 0 6
[@va_qattr] unfold let reg_Rsp : reg = Reg 0 7
[@va_qattr] unfold let reg_R8 : reg = Reg 0 8
[@va_qattr] unfold let reg_R9 : reg = Reg 0 9
[@va_qattr] unfold let reg_R10 : reg = Reg 0 10
[@va_qattr] unfold let reg_R11 : reg = Reg 0 11
[@va_qattr] unfold let reg_R12 : reg = Reg 0 12
[@va_qattr] unfold let reg_R13 : reg = Reg 0 13
[@va_qattr] unfold let reg_R14 : reg = Reg 0 14
[@va_qattr] unfold let reg_R15 : reg = Reg 0 15 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Prims.eqtype | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.operand",
"Vale.X64.Machine_s.nat64",
"Vale.X64.Machine_s.reg_64"
] | [] | false | false | false | true | false | let operand64:eqtype =
| operand nat64 reg_64 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_R10 | val reg_R10:reg | val reg_R10:reg | let reg_R10 : reg = Reg 0 10 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 47,
"end_line": 98,
"start_col": 19,
"start_line": 98
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2
[@va_qattr] unfold let reg_Rdx : reg = Reg 0 3
[@va_qattr] unfold let reg_Rsi : reg = Reg 0 4
[@va_qattr] unfold let reg_Rdi : reg = Reg 0 5
[@va_qattr] unfold let reg_Rbp : reg = Reg 0 6
[@va_qattr] unfold let reg_Rsp : reg = Reg 0 7
[@va_qattr] unfold let reg_R8 : reg = Reg 0 8 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_R10:reg =
| Reg 0 10 | false |
Hacl.Impl.Salsa20.Core32.fst | Hacl.Impl.Salsa20.Core32.sum_state | val sum_state:
st:state
-> ost:state ->
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 == Lib.Sequence.map2 (+.) (as_seq h0 st) (as_seq h0 ost)) | val sum_state:
st:state
-> ost:state ->
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 == Lib.Sequence.map2 (+.) (as_seq h0 st) (as_seq h0 ost)) | let sum_state st ost = map2T #MUT #MUT #uint32 #uint32 #uint32 (size 16) st ( +. ) st ost | {
"file_name": "code/salsa20/Hacl.Impl.Salsa20.Core32.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 89,
"end_line": 90,
"start_col": 0,
"start_line": 90
} | module Hacl.Impl.Salsa20.Core32
open FStar.HyperStack
open FStar.HyperStack.All
open Lib.IntTypes
open Lib.Sequence
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module Spec = Spec.Salsa20
let state = lbuffer uint32 16ul
let index = i:size_t{size_v i < 16}
inline_for_extraction
val create_state: unit ->
StackInline state
(requires fun h -> True)
(ensures fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (u32 0) /\
stack_allocated r h0 h1 (Seq.create 16 (u32 0)))
let create_state () = create (size 16) (u32 0)
inline_for_extraction
val load_state:
st:state
-> b:lbuffer uint8 64ul ->
Stack unit
(requires fun h -> live h st /\ live h b /\ disjoint st b)
(ensures fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Lib.ByteSequence.uints_from_bytes_le (as_seq h0 b))
let load_state st b =
uints_from_bytes_le st b
inline_for_extraction
val store_state:
b:lbuffer uint8 64ul
-> st:state ->
Stack unit
(requires fun h -> live h st /\ live h b /\ disjoint st b)
(ensures fun h0 _ h1 -> modifies (loc b) h0 h1 /\
as_seq h1 b == Lib.ByteSequence.uints_to_bytes_le (as_seq h0 st))
let store_state st b =
uints_to_bytes_le 16ul st b
inline_for_extraction
val set_counter:
st:state
-> c:size_t ->
Stack unit
(requires fun h -> live h st)
(ensures fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Seq.upd (as_seq h0 st) 8 (size_to_uint32 c))
let set_counter st c =
st.(size 8) <- size_to_uint32 c
inline_for_extraction
val copy_state:
st:state
-> ost:state ->
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 st ost = copy #MUT #uint32 #(size 16) st ost
inline_for_extraction
val sum_state:
st:state
-> ost:state ->
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 == Lib.Sequence.map2 (+.) (as_seq h0 st) (as_seq h0 ost)) | {
"checked_file": "/",
"dependencies": [
"Spec.Salsa20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Salsa20.Core32.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Salsa20",
"short_module": "Spec"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"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.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Salsa20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Salsa20",
"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 | st: Hacl.Impl.Salsa20.Core32.state -> ost: Hacl.Impl.Salsa20.Core32.state
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.Salsa20.Core32.state",
"Lib.Buffer.map2T",
"Lib.Buffer.MUT",
"Lib.IntTypes.uint32",
"Lib.IntTypes.size",
"Lib.IntTypes.op_Plus_Dot",
"Lib.IntTypes.U32",
"Lib.IntTypes.SEC",
"Prims.unit"
] | [] | false | true | false | false | false | let sum_state st ost =
| map2T #MUT #MUT #uint32 #uint32 #uint32 (size 16) st ( +. ) st ost | false |
FStar.DM4F.Heap.ST.fsti | FStar.DM4F.Heap.ST.lift_pure_state | val lift_pure_state : a: Type ->
wp: Prims.pure_wp a ->
h: FStar.DM4F.Heap.heap ->
p: FStar.DM4F.Heap.ST._dm4f_STATE_post a
-> Prims.pure_pre | let lift_pure_state (a:Type) (wp:pure_wp a) (h:heap) (p:STATE?.post a) = wp (fun a -> p (a, h)) | {
"file_name": "examples/dm4free/FStar.DM4F.Heap.ST.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 102,
"end_line": 45,
"start_col": 7,
"start_line": 45
} | (*
Copyright 2008-2018 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.
*)
(* A state monad with local state built using FStar.DM4F.Heap.
The very end of the file illustrates how recursion through the heap
is forbidden because of the universe constraints.
As such, in this model, storing stateful functions in the heap is
forbidden. However, storing non-stateful functions, e.g,. Tot or
Exception function in the heap is acceptable.
*)
module FStar.DM4F.Heap.ST
open FStar.DM4F.Heap
open FStar.DM4F.ST
////////////////////////////////////////////////////////////////////////////////
// Instruct F* to build a new STATE effect from the elaborated effect STATE_h
////////////////////////////////////////////////////////////////////////////////
reifiable reflectable total new_effect {
STATE : a:Type -> Effect
with repr = st heap
; bind = bind_st heap
; return = return_st heap
; get = get heap
; put = put heap
}
let get = STATE?.get
let put = STATE?.put | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.DM4F.ST.fst.checked",
"FStar.DM4F.Heap.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.DM4F.Heap.ST.fsti"
} | [
{
"abbrev": false,
"full_module": "FStar.DM4F.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"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": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
a: Type ->
wp: Prims.pure_wp a ->
h: FStar.DM4F.Heap.heap ->
p: FStar.DM4F.Heap.ST._dm4f_STATE_post a
-> Prims.pure_pre | Prims.Tot | [
"total"
] | [] | [
"Prims.pure_wp",
"FStar.DM4F.Heap.heap",
"FStar.DM4F.Heap.ST._dm4f_STATE_post",
"Prims.l_True",
"FStar.Pervasives.Native.Mktuple2",
"Prims.pure_pre"
] | [] | false | false | false | true | false | let lift_pure_state (a: Type) (wp: pure_wp a) (h: heap) (p: STATE?.post a) =
| wp (fun a -> p (a, h)) | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_R11 | val reg_R11:reg | val reg_R11:reg | let reg_R11 : reg = Reg 0 11 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 47,
"end_line": 99,
"start_col": 19,
"start_line": 99
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2
[@va_qattr] unfold let reg_Rdx : reg = Reg 0 3
[@va_qattr] unfold let reg_Rsi : reg = Reg 0 4
[@va_qattr] unfold let reg_Rdi : reg = Reg 0 5
[@va_qattr] unfold let reg_Rbp : reg = Reg 0 6
[@va_qattr] unfold let reg_Rsp : reg = Reg 0 7
[@va_qattr] unfold let reg_R8 : reg = Reg 0 8
[@va_qattr] unfold let reg_R9 : reg = Reg 0 9 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_R11:reg =
| Reg 0 11 | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_R12 | val reg_R12:reg | val reg_R12:reg | let reg_R12 : reg = Reg 0 12 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 47,
"end_line": 100,
"start_col": 19,
"start_line": 100
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2
[@va_qattr] unfold let reg_Rdx : reg = Reg 0 3
[@va_qattr] unfold let reg_Rsi : reg = Reg 0 4
[@va_qattr] unfold let reg_Rdi : reg = Reg 0 5
[@va_qattr] unfold let reg_Rbp : reg = Reg 0 6
[@va_qattr] unfold let reg_Rsp : reg = Reg 0 7
[@va_qattr] unfold let reg_R8 : reg = Reg 0 8
[@va_qattr] unfold let reg_R9 : reg = Reg 0 9
[@va_qattr] unfold let reg_R10 : reg = Reg 0 10 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_R12:reg =
| Reg 0 12 | false |
FStar.DM4F.Heap.ST.fsti | FStar.DM4F.Heap.ST.op_Colon_Equals | val op_Colon_Equals : r: FStar.DM4F.Heap.ref _ -> v: _ -> FStar.DM4F.Heap.ST.ST Prims.unit | let op_Colon_Equals = write | {
"file_name": "examples/dm4free/FStar.DM4F.Heap.ST.fsti",
"git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | {
"end_col": 28,
"end_line": 112,
"start_col": 1,
"start_line": 112
} | (*
Copyright 2008-2018 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.
*)
(* A state monad with local state built using FStar.DM4F.Heap.
The very end of the file illustrates how recursion through the heap
is forbidden because of the universe constraints.
As such, in this model, storing stateful functions in the heap is
forbidden. However, storing non-stateful functions, e.g,. Tot or
Exception function in the heap is acceptable.
*)
module FStar.DM4F.Heap.ST
open FStar.DM4F.Heap
open FStar.DM4F.ST
////////////////////////////////////////////////////////////////////////////////
// Instruct F* to build a new STATE effect from the elaborated effect STATE_h
////////////////////////////////////////////////////////////////////////////////
reifiable reflectable total new_effect {
STATE : a:Type -> Effect
with repr = st heap
; bind = bind_st heap
; return = return_st heap
; get = get heap
; put = put heap
}
let get = STATE?.get
let put = STATE?.put
unfold let lift_pure_state (a:Type) (wp:pure_wp a) (h:heap) (p:STATE?.post a) = wp (fun a -> p (a, h))
sub_effect PURE ~> STATE = lift_pure_state
//ST is an abbreviation for STATE with pre- and post-conditions
// aka requires and ensures clauses
effect ST (a:Type) (pre: STATE?.pre) (post: heap -> a -> heap -> Type0) =
STATE a (fun n0 p -> pre n0 /\ (forall a n1. pre n0 /\ post n0 a n1 ==> p (a, n1)))
//STNull is an abbreviation for stateful computations with trivial pre/post
effect STNull (a:Type) = ST a (fun h -> True) (fun _ _ _ -> True)
////////////////////////////////////////////////////////////////////////////////
//Next, given the primive global state actions STATE?.get and STATE?.put,
//we implement local state operations for allocating, reading and writing refs
////////////////////////////////////////////////////////////////////////////////
(* Allocation *)
let alloc (#a:Type) (init:a)
: ST (ref a)
(requires (fun h -> True))
(ensures (fun h0 r h1 ->
~ (h0 `contains` r) /\ //the ref r is fresh
h1 `contains_a_well_typed` r /\ //and is well-typed in h1
sel h1 r == init /\ //initialized to init
modifies Set.empty h0 h1)) //and no existing ref is modified
= let h0 = STATE?.get () in
let r, h1 = alloc h0 init in
STATE?.put h1;
r
let alloc_weak (#a:Type) (init:a)
:ST (ref a) (requires (fun h0 -> True))
(ensures (fun h0 r h1 -> h1 `contains_a_well_typed` r /\
(forall (a:Type) (r':ref a). h0 `contains_a_well_typed` r' ==> h1 `contains_a_well_typed` r')))
= let h0 = STATE?.get () in
let r, h1 = FStar.DM4F.Heap.alloc h0 init in
STATE?.put h1;
r
(* Reading, aka dereference *)
let read (#a:Type) (r:ref a)
: ST a
(requires (fun h -> h `contains_a_well_typed` r))
(ensures (fun h0 v h1 ->
h0 == h1 /\ //heap does not change
h1 `contains_a_well_typed` r /\
sel h1 r == v)) //returns the contents of r
= let h0 = STATE?.get () in
sel_tot h0 r
let (!) = read
let read_weak (#a:Type) (r:ref a)
: ST a (requires (fun h0 -> h0 `contains_a_well_typed` r))
(ensures (fun h0 v h1 -> forall (a:Type) (r:ref a). h0 `contains_a_well_typed` r ==> h1 `contains_a_well_typed` r))
= let h0 = STATE?.get () in
sel_tot h0 r
(* Writing, aka assignment *)
let write (#a:Type) (r:ref a) (v:a)
: ST unit
(requires (fun h -> h `contains_a_well_typed` r))
(ensures (fun h0 _ h1 -> h0 `contains_a_well_typed` r /\
h1 `contains_a_well_typed` r /\ //the heap remains well-typed
h1 == upd h0 r v)) //and is updated at location r only
= let h0 = STATE?.get () in | {
"checked_file": "/",
"dependencies": [
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.DM4F.ST.fst.checked",
"FStar.DM4F.Heap.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.DM4F.Heap.ST.fsti"
} | [
{
"abbrev": false,
"full_module": "FStar.DM4F.ST",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.DM4F.Heap",
"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": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | r: FStar.DM4F.Heap.ref _ -> v: _ -> FStar.DM4F.Heap.ST.ST Prims.unit | FStar.DM4F.Heap.ST.ST | [] | [] | [
"FStar.DM4F.Heap.ST.write",
"FStar.DM4F.Heap.ref",
"Prims.unit",
"FStar.DM4F.Heap.heap",
"FStar.DM4F.Heap.contains_a_well_typed",
"Prims.l_and",
"Prims.eq2",
"FStar.DM4F.Heap.upd"
] | [] | false | true | false | false | false | let op_Colon_Equals =
| write | false |
|
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_R9 | val reg_R9:reg | val reg_R9:reg | let reg_R9 : reg = Reg 0 9 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 97,
"start_col": 19,
"start_line": 97
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2
[@va_qattr] unfold let reg_Rdx : reg = Reg 0 3
[@va_qattr] unfold let reg_Rsi : reg = Reg 0 4
[@va_qattr] unfold let reg_Rdi : reg = Reg 0 5
[@va_qattr] unfold let reg_Rbp : reg = Reg 0 6
[@va_qattr] unfold let reg_Rsp : reg = Reg 0 7 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_R9:reg =
| Reg 0 9 | false |
Hacl.Impl.Salsa20.Core32.fst | Hacl.Impl.Salsa20.Core32.line | val line:
st:state
-> a:index
-> b:index
-> d:index
-> r:rotval U32 ->
Stack unit
(requires fun h -> live h st /\ v a <> v d)
(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:
st:state
-> a:index
-> b:index
-> d:index
-> r:rotval U32 ->
Stack unit
(requires fun h -> live h st /\ v a <> v d)
(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 st a b d r =
let sta = st.(a) in
let stb = st.(b) in
let std = st.(d) in
let sta = sta ^. ((stb +. std) <<<. r) in
st.(a) <- sta | {
"file_name": "code/salsa20/Hacl.Impl.Salsa20.Core32.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 15,
"end_line": 130,
"start_col": 0,
"start_line": 125
} | module Hacl.Impl.Salsa20.Core32
open FStar.HyperStack
open FStar.HyperStack.All
open Lib.IntTypes
open Lib.Sequence
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module Spec = Spec.Salsa20
let state = lbuffer uint32 16ul
let index = i:size_t{size_v i < 16}
inline_for_extraction
val create_state: unit ->
StackInline state
(requires fun h -> True)
(ensures fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (u32 0) /\
stack_allocated r h0 h1 (Seq.create 16 (u32 0)))
let create_state () = create (size 16) (u32 0)
inline_for_extraction
val load_state:
st:state
-> b:lbuffer uint8 64ul ->
Stack unit
(requires fun h -> live h st /\ live h b /\ disjoint st b)
(ensures fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Lib.ByteSequence.uints_from_bytes_le (as_seq h0 b))
let load_state st b =
uints_from_bytes_le st b
inline_for_extraction
val store_state:
b:lbuffer uint8 64ul
-> st:state ->
Stack unit
(requires fun h -> live h st /\ live h b /\ disjoint st b)
(ensures fun h0 _ h1 -> modifies (loc b) h0 h1 /\
as_seq h1 b == Lib.ByteSequence.uints_to_bytes_le (as_seq h0 st))
let store_state st b =
uints_to_bytes_le 16ul st b
inline_for_extraction
val set_counter:
st:state
-> c:size_t ->
Stack unit
(requires fun h -> live h st)
(ensures fun h0 _ h1 -> modifies (loc st) h0 h1 /\
as_seq h1 st == Seq.upd (as_seq h0 st) 8 (size_to_uint32 c))
let set_counter st c =
st.(size 8) <- size_to_uint32 c
inline_for_extraction
val copy_state:
st:state
-> ost:state ->
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 st ost = copy #MUT #uint32 #(size 16) st ost
inline_for_extraction
val sum_state:
st:state
-> ost:state ->
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 == Lib.Sequence.map2 (+.) (as_seq h0 st) (as_seq h0 ost))
let sum_state st ost = map2T #MUT #MUT #uint32 #uint32 #uint32 (size 16) st ( +. ) st ost
inline_for_extraction
val xor_block:
o:lbuffer uint8 64ul
-> st:state
-> b:lbuffer uint8 64ul ->
Stack unit
(requires fun h -> live h o /\ live h st /\ live h b)
(ensures fun h0 _ h1 -> modifies (loc o) h0 h1 /\
as_seq h1 o == Spec.xor_block (as_seq h0 st) (as_seq h0 b))
#set-options "--z3rlimit 100"
let xor_block o st b =
push_frame();
let bl = create_state() in
load_state bl b;
map2T (size 16) bl ( ^. ) bl st;
store_state o bl;
pop_frame()
inline_for_extraction
val line:
st:state
-> a:index
-> b:index
-> d:index
-> r:rotval U32 ->
Stack unit
(requires fun h -> live h st /\ v a <> v d)
(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)) | {
"checked_file": "/",
"dependencies": [
"Spec.Salsa20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Salsa20.Core32.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Salsa20",
"short_module": "Spec"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"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.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Salsa20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Salsa20",
"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": 100,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false |
st: Hacl.Impl.Salsa20.Core32.state ->
a: Hacl.Impl.Salsa20.Core32.index ->
b: Hacl.Impl.Salsa20.Core32.index ->
d: Hacl.Impl.Salsa20.Core32.index ->
r: Lib.IntTypes.rotval Lib.IntTypes.U32
-> FStar.HyperStack.ST.Stack Prims.unit | FStar.HyperStack.ST.Stack | [] | [] | [
"Hacl.Impl.Salsa20.Core32.state",
"Hacl.Impl.Salsa20.Core32.index",
"Lib.IntTypes.rotval",
"Lib.IntTypes.U32",
"Lib.Buffer.op_Array_Assignment",
"Lib.IntTypes.uint32",
"FStar.UInt32.__uint_to_t",
"Prims.unit",
"Lib.IntTypes.int_t",
"Lib.IntTypes.SEC",
"Lib.IntTypes.op_Hat_Dot",
"Lib.IntTypes.op_Less_Less_Less_Dot",
"Lib.IntTypes.op_Plus_Dot",
"Lib.Buffer.op_Array_Access",
"Lib.Buffer.MUT"
] | [] | false | true | false | false | false | let line st a b d r =
| let sta = st.(a) in
let stb = st.(b) in
let std = st.(d) in
let sta = sta ^. ((stb +. std) <<<. r) in
st.(a) <- sta | false |
Hacl.Impl.Salsa20.Core32.fst | Hacl.Impl.Salsa20.Core32.create_state | val create_state: unit ->
StackInline state
(requires fun h -> True)
(ensures fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (u32 0) /\
stack_allocated r h0 h1 (Seq.create 16 (u32 0))) | val create_state: unit ->
StackInline state
(requires fun h -> True)
(ensures fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (u32 0) /\
stack_allocated r h0 h1 (Seq.create 16 (u32 0))) | let create_state () = create (size 16) (u32 0) | {
"file_name": "code/salsa20/Hacl.Impl.Salsa20.Core32.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 27,
"start_col": 0,
"start_line": 27
} | module Hacl.Impl.Salsa20.Core32
open FStar.HyperStack
open FStar.HyperStack.All
open Lib.IntTypes
open Lib.Sequence
open Lib.Buffer
open Lib.ByteBuffer
module ST = FStar.HyperStack.ST
module Spec = Spec.Salsa20
let state = lbuffer uint32 16ul
let index = i:size_t{size_v i < 16}
inline_for_extraction
val create_state: unit ->
StackInline state
(requires fun h -> True)
(ensures fun h0 r h1 -> live h1 r /\
as_seq h1 r == Seq.create 16 (u32 0) /\
stack_allocated r h0 h1 (Seq.create 16 (u32 0))) | {
"checked_file": "/",
"dependencies": [
"Spec.Salsa20.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"Lib.ByteBuffer.fsti.checked",
"Lib.Buffer.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.HyperStack.ST.fsti.checked",
"FStar.HyperStack.All.fst.checked",
"FStar.HyperStack.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Impl.Salsa20.Core32.fst"
} | [
{
"abbrev": true,
"full_module": "Spec.Salsa20",
"short_module": "Spec"
},
{
"abbrev": true,
"full_module": "FStar.HyperStack.ST",
"short_module": "ST"
},
{
"abbrev": false,
"full_module": "Lib.ByteBuffer",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Buffer",
"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.HyperStack.All",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.HyperStack",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Salsa20",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Impl.Salsa20",
"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 | _: Prims.unit -> FStar.HyperStack.ST.StackInline Hacl.Impl.Salsa20.Core32.state | FStar.HyperStack.ST.StackInline | [] | [] | [
"Prims.unit",
"Lib.Buffer.create",
"Lib.IntTypes.uint32",
"Lib.IntTypes.size",
"Lib.IntTypes.u32",
"Lib.Buffer.lbuffer",
"Hacl.Impl.Salsa20.Core32.state"
] | [] | false | true | false | false | false | let create_state () =
| create (size 16) (u32 0) | false |
Vale.X64.Machine_s.fst | Vale.X64.Machine_s.reg_Rdi | val reg_Rdi:reg | val reg_Rdi:reg | let reg_Rdi : reg = Reg 0 5 | {
"file_name": "vale/specs/hardware/Vale.X64.Machine_s.fst",
"git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872",
"git_url": "https://github.com/project-everest/hacl-star.git",
"project_name": "hacl-star"
} | {
"end_col": 46,
"end_line": 93,
"start_col": 19,
"start_line": 93
} | module Vale.X64.Machine_s
open FStar.Mul
include Vale.Arch.HeapTypes_s
irreducible let va_qattr = ()
unfold let pow2_32 = Vale.Def.Words_s.pow2_32
unfold let pow2_64 = Vale.Def.Words_s.pow2_64
unfold let pow2_128 = Vale.Def.Words_s.pow2_128
unfold let nat64 = Vale.Def.Types_s.nat64
let int_to_nat64 (i:int) : n:nat64{0 <= i && i < pow2_64 ==> i == n} =
Vale.Def.Words_s.int_to_natN pow2_64 i
unfold let nat128 = Vale.Def.Words_s.nat128
unfold let quad32 = Vale.Def.Types_s.quad32
type flag:eqtype = i:int{0 <= i /\ i < 16}
[@va_qattr] unfold let fCarry : flag = 0
[@va_qattr] unfold let fOverflow : flag = 11
let n_reg_files = 2
let reg_file_id = rf:nat{rf < n_reg_files}
let n_regs (rf:reg_file_id) : nat =
match rf with
| 0 -> 16
| 1 -> 16
let t_reg_file (rf:reg_file_id) : Type0 =
match rf with
| 0 -> nat64
| 1 -> quad32
let reg_id (rf:reg_file_id) : Type0 = r:nat{r < n_regs rf}
[@va_qattr]
type reg =
| Reg: rf:reg_file_id -> r:reg_id rf -> reg
let t_reg (r:reg) : Type0 = t_reg_file r.rf
// Some register files can be used as integers (for addresses); others arbitrarily return 0
let t_reg_to_int (rf:reg_file_id) (v:t_reg_file rf) : int =
match rf with
| 0 -> v
| 1 -> 0
type maddr:eqtype =
| MConst: n:int -> maddr
| MReg: r:reg -> offset:int -> maddr
| MIndex: base:reg -> scale:int -> index:reg -> offset:int -> maddr
type tmaddr:eqtype = maddr & taint
[@va_qattr]
type operand (tc tr:eqtype) : eqtype =
| OConst: n:tc -> operand tc tr
| OReg: r:tr -> operand tc tr
| OMem: m:tmaddr -> operand tc tr
| OStack: m:tmaddr -> operand tc tr
[@va_qattr]
let operand_rf (rf:reg_file_id) : eqtype =
operand (t_reg_file rf) (reg_id rf)
[@va_qattr]
unfold let oreg (r:reg) : operand_rf r.rf =
OReg r.r
let reg_64 : Type0 = r:nat{r < 16}
let reg_xmm : Type0 = r:nat{r < 16}
[@va_qattr] unfold let rRax : reg_64 = 0
[@va_qattr] unfold let rRbx : reg_64 = 1
[@va_qattr] unfold let rRcx : reg_64 = 2
[@va_qattr] unfold let rRdx : reg_64 = 3
[@va_qattr] unfold let rRsi : reg_64 = 4
[@va_qattr] unfold let rRdi : reg_64 = 5
[@va_qattr] unfold let rRbp : reg_64 = 6
[@va_qattr] unfold let rRsp : reg_64 = 7
[@va_qattr] unfold let rR8 : reg_64 = 8
[@va_qattr] unfold let rR9 : reg_64 = 9
[@va_qattr] unfold let rR10 : reg_64 = 10
[@va_qattr] unfold let rR11 : reg_64 = 11
[@va_qattr] unfold let rR12 : reg_64 = 12
[@va_qattr] unfold let rR13 : reg_64 = 13
[@va_qattr] unfold let rR14 : reg_64 = 14
[@va_qattr] unfold let rR15 : reg_64 = 15
[@va_qattr] unfold let reg_Rax : reg = Reg 0 0
[@va_qattr] unfold let reg_Rbx : reg = Reg 0 1
[@va_qattr] unfold let reg_Rcx : reg = Reg 0 2
[@va_qattr] unfold let reg_Rdx : reg = Reg 0 3 | {
"checked_file": "/",
"dependencies": [
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.HeapTypes_s.fst.checked",
"prims.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": false,
"source_file": "Vale.X64.Machine_s.fst"
} | [
{
"abbrev": false,
"full_module": "Vale.Arch.HeapTypes_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | false | Vale.X64.Machine_s.reg | Prims.Tot | [
"total"
] | [] | [
"Vale.X64.Machine_s.Reg"
] | [] | false | false | false | true | false | let reg_Rdi:reg =
| Reg 0 5 | false |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.