effect
stringclasses 48
values | original_source_type
stringlengths 0
23k
| opens_and_abbrevs
listlengths 2
92
| isa_cross_project_example
bool 1
class | source_definition
stringlengths 9
57.9k
| partial_definition
stringlengths 7
23.3k
| is_div
bool 2
classes | is_type
null | is_proof
bool 2
classes | completed_definiton
stringlengths 1
250k
| dependencies
dict | effect_flags
sequencelengths 0
2
| ideal_premises
sequencelengths 0
236
| mutual_with
sequencelengths 0
11
| file_context
stringlengths 0
407k
| interleaved
bool 1
class | is_simply_typed
bool 2
classes | file_name
stringlengths 5
48
| vconfig
dict | is_simple_lemma
null | source_type
stringlengths 10
23k
| proof_features
sequencelengths 0
1
| name
stringlengths 8
95
| source
dict | verbose_type
stringlengths 1
7.42k
| source_range
dict |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Prims.Tot | val unsafe_size_from_limb (#t: limb_t) (x: limb t {v x <= max_size_t}) : size_t | [
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.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
}
] | false | let unsafe_size_from_limb (#t:limb_t) (x:limb t{v x <= max_size_t}) : size_t =
let open Lib.RawIntTypes in
match t with
| U32 -> u32_to_UInt32 x
| U64 -> u32_to_UInt32 (to_u32 x) | val unsafe_size_from_limb (#t: limb_t) (x: limb t {v x <= max_size_t}) : size_t
let unsafe_size_from_limb (#t: limb_t) (x: limb t {v x <= max_size_t}) : size_t = | false | null | false | let open Lib.RawIntTypes in
match t with
| U32 -> u32_to_UInt32 x
| U64 -> u32_to_UInt32 (to_u32 x) | {
"checked_file": "Hacl.Spec.Bignum.Base.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Base.fst"
} | [
"total"
] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Hacl.Spec.Bignum.Definitions.limb",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Lib.IntTypes.v",
"Lib.IntTypes.SEC",
"Lib.IntTypes.max_size_t",
"Lib.RawIntTypes.u32_to_UInt32",
"Lib.IntTypes.to_u32",
"Lib.IntTypes.size_t"
] | [] | module Hacl.Spec.Bignum.Base
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Hacl.Spec.Bignum.Definitions
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let carry (t:limb_t) = x:limb t{uint_v x == 0 \/ uint_v x == 1}
(**
This is non-stateful version of code/fallback functions
*)
inline_for_extraction noextract
val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c)
let addcarry #t cin x y =
let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c)
let subborrow #t cin x y =
let res = x -. y -. cin in
let c = logand (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (gt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b)
let mul_wide #t a b =
Math.Lemmas.lemma_mult_lt_sqr (v a) (v b) (pow2 (bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b in
to_u32 (res >>. 32ul), to_u32 res
| U64 ->
let res = mul64_wide a b in
to_u64 (res >>. 64ul), to_u64 res
val lemma_mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Lemma (v a * v b + v c + v d < pow2 (2 * bits t))
let lemma_mul_wide_add #t a b c d =
let n = pow2 (bits t) in
//assert (v a <= n - 1 /\ v b <= n - 1 /\ v c <= n - 1 /\ v d <= n - 1);
Math.Lemmas.lemma_mult_le_left (v a) (v b) (n - 1);
Math.Lemmas.lemma_mult_le_right (n - 1) (v a) (n - 1);
assert (v a * v b + v c + v d <= (n - 1) * (n - 1) + (n - 1) + (n - 1));
assert ((n - 1) * (n - 1) + (n - 1) + (n - 1) == n * n - 1)
val mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c)
let mul_wide_add #t a b c =
lemma_mul_wide_add a b c (uint #t 0);
Math.Lemmas.small_mod (v a * v b + v c) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c in
assert (v res == v a * v b + v c);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c in
assert (v res == v a * v b + v c);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo
val mul_wide_add2: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c + v d)
let mul_wide_add2 #t a b c d =
lemma_mul_wide_add a b c d;
Math.Lemmas.small_mod (v a * v b + v c + v d) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c +! to_u64 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c +! to_u128 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo
inline_for_extraction noextract
let mask_values (#t:limb_t) (x:limb t) =
v x = v (zeros t SEC) \/ v x = v (ones t SEC)
inline_for_extraction noextract
let unsafe_bool_of_limb0 (#t:limb_t) (m:limb t) : b:bool{b <==> v m = 0} =
let open Lib.RawIntTypes in
match t with
| U32 -> FStar.UInt32.(u32_to_UInt32 m =^ 0ul)
| U64 -> FStar.UInt64.(u64_to_UInt64 m =^ 0uL)
inline_for_extraction noextract
let unsafe_bool_of_limb (#t:limb_t) (m:limb t) : b:bool{b <==> v m = v (ones t SEC)} =
let open Lib.RawIntTypes in
match t with
| U32 -> FStar.UInt32.(u32_to_UInt32 m =^ u32_to_UInt32 (ones U32 SEC))
| U64 -> FStar.UInt64.(u64_to_UInt64 m =^ u64_to_UInt64 (ones U64 SEC))
inline_for_extraction noextract
let size_to_limb (#t:limb_t) (x:size_t) : limb t =
match t with
| U32 -> size_to_uint32 x
| U64 -> size_to_uint64 x
inline_for_extraction noextract | false | false | Hacl.Spec.Bignum.Base.fst | {
"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"
} | null | val unsafe_size_from_limb (#t: limb_t) (x: limb t {v x <= max_size_t}) : size_t | [] | Hacl.Spec.Bignum.Base.unsafe_size_from_limb | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Base.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Hacl.Spec.Bignum.Definitions.limb t {Lib.IntTypes.v x <= Lib.IntTypes.max_size_t}
-> Lib.IntTypes.size_t | {
"end_col": 35,
"end_line": 169,
"start_col": 2,
"start_line": 166
} |
Prims.Tot | val unsafe_bool_of_limb (#t: limb_t) (m: limb t) : b: bool{b <==> v m = v (ones t SEC)} | [
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.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
}
] | false | let unsafe_bool_of_limb (#t:limb_t) (m:limb t) : b:bool{b <==> v m = v (ones t SEC)} =
let open Lib.RawIntTypes in
match t with
| U32 -> FStar.UInt32.(u32_to_UInt32 m =^ u32_to_UInt32 (ones U32 SEC))
| U64 -> FStar.UInt64.(u64_to_UInt64 m =^ u64_to_UInt64 (ones U64 SEC)) | val unsafe_bool_of_limb (#t: limb_t) (m: limb t) : b: bool{b <==> v m = v (ones t SEC)}
let unsafe_bool_of_limb (#t: limb_t) (m: limb t) : b: bool{b <==> v m = v (ones t SEC)} = | false | null | false | let open Lib.RawIntTypes in
match t with
| U32 -> let open FStar.UInt32 in u32_to_UInt32 m =^ u32_to_UInt32 (ones U32 SEC)
| U64 -> let open FStar.UInt64 in u64_to_UInt64 m =^ u64_to_UInt64 (ones U64 SEC) | {
"checked_file": "Hacl.Spec.Bignum.Base.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Base.fst"
} | [
"total"
] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Hacl.Spec.Bignum.Definitions.limb",
"FStar.UInt32.op_Equals_Hat",
"Lib.RawIntTypes.u32_to_UInt32",
"Lib.IntTypes.ones",
"Lib.IntTypes.U32",
"Lib.IntTypes.SEC",
"FStar.UInt64.op_Equals_Hat",
"Lib.RawIntTypes.u64_to_UInt64",
"Lib.IntTypes.U64",
"Prims.bool",
"Prims.l_iff",
"Prims.b2t",
"Prims.op_Equality",
"Lib.IntTypes.range_t",
"Lib.IntTypes.v"
] | [] | module Hacl.Spec.Bignum.Base
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Hacl.Spec.Bignum.Definitions
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let carry (t:limb_t) = x:limb t{uint_v x == 0 \/ uint_v x == 1}
(**
This is non-stateful version of code/fallback functions
*)
inline_for_extraction noextract
val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c)
let addcarry #t cin x y =
let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c)
let subborrow #t cin x y =
let res = x -. y -. cin in
let c = logand (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (gt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b)
let mul_wide #t a b =
Math.Lemmas.lemma_mult_lt_sqr (v a) (v b) (pow2 (bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b in
to_u32 (res >>. 32ul), to_u32 res
| U64 ->
let res = mul64_wide a b in
to_u64 (res >>. 64ul), to_u64 res
val lemma_mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Lemma (v a * v b + v c + v d < pow2 (2 * bits t))
let lemma_mul_wide_add #t a b c d =
let n = pow2 (bits t) in
//assert (v a <= n - 1 /\ v b <= n - 1 /\ v c <= n - 1 /\ v d <= n - 1);
Math.Lemmas.lemma_mult_le_left (v a) (v b) (n - 1);
Math.Lemmas.lemma_mult_le_right (n - 1) (v a) (n - 1);
assert (v a * v b + v c + v d <= (n - 1) * (n - 1) + (n - 1) + (n - 1));
assert ((n - 1) * (n - 1) + (n - 1) + (n - 1) == n * n - 1)
val mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c)
let mul_wide_add #t a b c =
lemma_mul_wide_add a b c (uint #t 0);
Math.Lemmas.small_mod (v a * v b + v c) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c in
assert (v res == v a * v b + v c);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c in
assert (v res == v a * v b + v c);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo
val mul_wide_add2: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c + v d)
let mul_wide_add2 #t a b c d =
lemma_mul_wide_add a b c d;
Math.Lemmas.small_mod (v a * v b + v c + v d) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c +! to_u64 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c +! to_u128 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo
inline_for_extraction noextract
let mask_values (#t:limb_t) (x:limb t) =
v x = v (zeros t SEC) \/ v x = v (ones t SEC)
inline_for_extraction noextract
let unsafe_bool_of_limb0 (#t:limb_t) (m:limb t) : b:bool{b <==> v m = 0} =
let open Lib.RawIntTypes in
match t with
| U32 -> FStar.UInt32.(u32_to_UInt32 m =^ 0ul)
| U64 -> FStar.UInt64.(u64_to_UInt64 m =^ 0uL)
inline_for_extraction noextract | false | false | Hacl.Spec.Bignum.Base.fst | {
"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"
} | null | val unsafe_bool_of_limb (#t: limb_t) (m: limb t) : b: bool{b <==> v m = v (ones t SEC)} | [] | Hacl.Spec.Bignum.Base.unsafe_bool_of_limb | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Base.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | m: Hacl.Spec.Bignum.Definitions.limb t
-> b: Prims.bool{b <==> Lib.IntTypes.v m = Lib.IntTypes.v (Lib.IntTypes.ones t Lib.IntTypes.SEC)} | {
"end_col": 73,
"end_line": 154,
"start_col": 2,
"start_line": 151
} |
FStar.Pervasives.Lemma | val mask_select_lemma1: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> Lemma
(requires mask_values mask)
(ensures b ^. (mask &. (a ^. b)) == (if v mask = 0 then b else a)) | [
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.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
}
] | false | let mask_select_lemma1 #t mask a b =
let t1 = mask &. (a ^. b) in
let t2 = b ^. t1 in
logand_lemma mask (a ^.b);
if v mask = 0 then begin
assert (v t1 == 0);
logxor_lemma b t1;
assert (v t2 = v b);
() end
else begin
assert (v t1 == v (a ^. b));
logxor_lemma b a;
assert (v t2 = v a);
() end | val mask_select_lemma1: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> Lemma
(requires mask_values mask)
(ensures b ^. (mask &. (a ^. b)) == (if v mask = 0 then b else a))
let mask_select_lemma1 #t mask a b = | false | null | true | let t1 = mask &. (a ^. b) in
let t2 = b ^. t1 in
logand_lemma mask (a ^. b);
if v mask = 0
then
(assert (v t1 == 0);
logxor_lemma b t1;
assert (v t2 = v b);
())
else
(assert (v t1 == v (a ^. b));
logxor_lemma b a;
assert (v t2 = v a);
()) | {
"checked_file": "Hacl.Spec.Bignum.Base.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Base.fst"
} | [
"lemma"
] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Hacl.Spec.Bignum.Definitions.limb",
"Prims.op_Equality",
"Prims.int",
"Lib.IntTypes.v",
"Lib.IntTypes.SEC",
"Prims.unit",
"Prims._assert",
"Prims.b2t",
"Lib.IntTypes.range_t",
"Lib.IntTypes.logxor_lemma",
"Prims.eq2",
"Prims.bool",
"Lib.IntTypes.op_Hat_Dot",
"Lib.IntTypes.logand_lemma",
"Lib.IntTypes.int_t",
"Lib.IntTypes.op_Amp_Dot"
] | [] | module Hacl.Spec.Bignum.Base
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Hacl.Spec.Bignum.Definitions
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let carry (t:limb_t) = x:limb t{uint_v x == 0 \/ uint_v x == 1}
(**
This is non-stateful version of code/fallback functions
*)
inline_for_extraction noextract
val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c)
let addcarry #t cin x y =
let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c)
let subborrow #t cin x y =
let res = x -. y -. cin in
let c = logand (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (gt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b)
let mul_wide #t a b =
Math.Lemmas.lemma_mult_lt_sqr (v a) (v b) (pow2 (bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b in
to_u32 (res >>. 32ul), to_u32 res
| U64 ->
let res = mul64_wide a b in
to_u64 (res >>. 64ul), to_u64 res
val lemma_mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Lemma (v a * v b + v c + v d < pow2 (2 * bits t))
let lemma_mul_wide_add #t a b c d =
let n = pow2 (bits t) in
//assert (v a <= n - 1 /\ v b <= n - 1 /\ v c <= n - 1 /\ v d <= n - 1);
Math.Lemmas.lemma_mult_le_left (v a) (v b) (n - 1);
Math.Lemmas.lemma_mult_le_right (n - 1) (v a) (n - 1);
assert (v a * v b + v c + v d <= (n - 1) * (n - 1) + (n - 1) + (n - 1));
assert ((n - 1) * (n - 1) + (n - 1) + (n - 1) == n * n - 1)
val mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c)
let mul_wide_add #t a b c =
lemma_mul_wide_add a b c (uint #t 0);
Math.Lemmas.small_mod (v a * v b + v c) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c in
assert (v res == v a * v b + v c);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c in
assert (v res == v a * v b + v c);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo
val mul_wide_add2: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c + v d)
let mul_wide_add2 #t a b c d =
lemma_mul_wide_add a b c d;
Math.Lemmas.small_mod (v a * v b + v c + v d) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c +! to_u64 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c +! to_u128 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo
inline_for_extraction noextract
let mask_values (#t:limb_t) (x:limb t) =
v x = v (zeros t SEC) \/ v x = v (ones t SEC)
inline_for_extraction noextract
let unsafe_bool_of_limb0 (#t:limb_t) (m:limb t) : b:bool{b <==> v m = 0} =
let open Lib.RawIntTypes in
match t with
| U32 -> FStar.UInt32.(u32_to_UInt32 m =^ 0ul)
| U64 -> FStar.UInt64.(u64_to_UInt64 m =^ 0uL)
inline_for_extraction noextract
let unsafe_bool_of_limb (#t:limb_t) (m:limb t) : b:bool{b <==> v m = v (ones t SEC)} =
let open Lib.RawIntTypes in
match t with
| U32 -> FStar.UInt32.(u32_to_UInt32 m =^ u32_to_UInt32 (ones U32 SEC))
| U64 -> FStar.UInt64.(u64_to_UInt64 m =^ u64_to_UInt64 (ones U64 SEC))
inline_for_extraction noextract
let size_to_limb (#t:limb_t) (x:size_t) : limb t =
match t with
| U32 -> size_to_uint32 x
| U64 -> size_to_uint64 x
inline_for_extraction noextract
let unsafe_size_from_limb (#t:limb_t) (x:limb t{v x <= max_size_t}) : size_t =
let open Lib.RawIntTypes in
match t with
| U32 -> u32_to_UInt32 x
| U64 -> u32_to_UInt32 (to_u32 x)
inline_for_extraction noextract
val mask_select: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> limb t
let mask_select #t mask a b =
(mask &. a) |. ((lognot mask) &. b)
val mask_select_lemma: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> Lemma
(requires mask_values mask)
(ensures mask_select mask a b == (if v mask = 0 then b else a))
let mask_select_lemma #t mask a b =
if v mask = 0 then begin
logand_lemma mask a;
assert (v (mask &. a) = 0);
lognot_lemma mask;
assert (v (lognot mask) = v (ones t SEC));
logand_lemma (lognot mask) b;
assert (v ((lognot mask) &. b) == v b);
logor_lemma (mask &. a) ((lognot mask) &. b);
assert (v (mask_select mask a b) == v b) end
else begin
logand_lemma mask a;
assert (v (mask &. a) = v a);
lognot_lemma mask;
assert (v (lognot mask) = 0);
logand_lemma (lognot mask) b;
assert (v ((lognot mask) &. b) == 0);
logor_zeros (mask &. a);
assert (v (mask_select mask a b) == v a) end
val mask_select_lemma1: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> Lemma
(requires mask_values mask)
(ensures b ^. (mask &. (a ^. b)) == (if v mask = 0 then b else a)) | false | false | Hacl.Spec.Bignum.Base.fst | {
"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"
} | null | val mask_select_lemma1: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> Lemma
(requires mask_values mask)
(ensures b ^. (mask &. (a ^. b)) == (if v mask = 0 then b else a)) | [] | Hacl.Spec.Bignum.Base.mask_select_lemma1 | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Base.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
mask: Hacl.Spec.Bignum.Definitions.limb t ->
a: Hacl.Spec.Bignum.Definitions.limb t ->
b: Hacl.Spec.Bignum.Definitions.limb t
-> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Base.mask_values mask)
(ensures
b ^. (mask &. a ^. b) ==
(match Lib.IntTypes.v mask = 0 with
| true -> b
| _ -> a)) | {
"end_col": 10,
"end_line": 219,
"start_col": 36,
"start_line": 206
} |
FStar.Pervasives.Lemma | val lemma_mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Lemma (v a * v b + v c + v d < pow2 (2 * bits t)) | [
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.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
}
] | false | let lemma_mul_wide_add #t a b c d =
let n = pow2 (bits t) in
//assert (v a <= n - 1 /\ v b <= n - 1 /\ v c <= n - 1 /\ v d <= n - 1);
Math.Lemmas.lemma_mult_le_left (v a) (v b) (n - 1);
Math.Lemmas.lemma_mult_le_right (n - 1) (v a) (n - 1);
assert (v a * v b + v c + v d <= (n - 1) * (n - 1) + (n - 1) + (n - 1));
assert ((n - 1) * (n - 1) + (n - 1) + (n - 1) == n * n - 1) | val lemma_mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Lemma (v a * v b + v c + v d < pow2 (2 * bits t))
let lemma_mul_wide_add #t a b c d = | false | null | true | let n = pow2 (bits t) in
Math.Lemmas.lemma_mult_le_left (v a) (v b) (n - 1);
Math.Lemmas.lemma_mult_le_right (n - 1) (v a) (n - 1);
assert (v a * v b + v c + v d <= (n - 1) * (n - 1) + (n - 1) + (n - 1));
assert ((n - 1) * (n - 1) + (n - 1) + (n - 1) == n * n - 1) | {
"checked_file": "Hacl.Spec.Bignum.Base.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Base.fst"
} | [
"lemma"
] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Hacl.Spec.Bignum.Definitions.limb",
"Prims._assert",
"Prims.eq2",
"Prims.int",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Prims.op_Subtraction",
"Prims.unit",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Lib.IntTypes.v",
"Lib.IntTypes.SEC",
"FStar.Math.Lemmas.lemma_mult_le_right",
"FStar.Math.Lemmas.lemma_mult_le_left",
"Prims.pos",
"Prims.pow2",
"Lib.IntTypes.bits"
] | [] | module Hacl.Spec.Bignum.Base
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Hacl.Spec.Bignum.Definitions
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let carry (t:limb_t) = x:limb t{uint_v x == 0 \/ uint_v x == 1}
(**
This is non-stateful version of code/fallback functions
*)
inline_for_extraction noextract
val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c)
let addcarry #t cin x y =
let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c)
let subborrow #t cin x y =
let res = x -. y -. cin in
let c = logand (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (gt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b)
let mul_wide #t a b =
Math.Lemmas.lemma_mult_lt_sqr (v a) (v b) (pow2 (bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b in
to_u32 (res >>. 32ul), to_u32 res
| U64 ->
let res = mul64_wide a b in
to_u64 (res >>. 64ul), to_u64 res
val lemma_mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t -> | false | false | Hacl.Spec.Bignum.Base.fst | {
"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"
} | null | val lemma_mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Lemma (v a * v b + v c + v d < pow2 (2 * bits t)) | [] | Hacl.Spec.Bignum.Base.lemma_mul_wide_add | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Base.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Hacl.Spec.Bignum.Definitions.limb t ->
b: Hacl.Spec.Bignum.Definitions.limb t ->
c: Hacl.Spec.Bignum.Definitions.limb t ->
d: Hacl.Spec.Bignum.Definitions.limb t
-> FStar.Pervasives.Lemma
(ensures
Lib.IntTypes.v a * Lib.IntTypes.v b + Lib.IntTypes.v c + Lib.IntTypes.v d <
Prims.pow2 (2 * Lib.IntTypes.bits t)) | {
"end_col": 61,
"end_line": 75,
"start_col": 35,
"start_line": 69
} |
FStar.Pervasives.Lemma | val mask_select_lemma: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> Lemma
(requires mask_values mask)
(ensures mask_select mask a b == (if v mask = 0 then b else a)) | [
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.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
}
] | false | let mask_select_lemma #t mask a b =
if v mask = 0 then begin
logand_lemma mask a;
assert (v (mask &. a) = 0);
lognot_lemma mask;
assert (v (lognot mask) = v (ones t SEC));
logand_lemma (lognot mask) b;
assert (v ((lognot mask) &. b) == v b);
logor_lemma (mask &. a) ((lognot mask) &. b);
assert (v (mask_select mask a b) == v b) end
else begin
logand_lemma mask a;
assert (v (mask &. a) = v a);
lognot_lemma mask;
assert (v (lognot mask) = 0);
logand_lemma (lognot mask) b;
assert (v ((lognot mask) &. b) == 0);
logor_zeros (mask &. a);
assert (v (mask_select mask a b) == v a) end | val mask_select_lemma: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> Lemma
(requires mask_values mask)
(ensures mask_select mask a b == (if v mask = 0 then b else a))
let mask_select_lemma #t mask a b = | false | null | true | if v mask = 0
then
(logand_lemma mask a;
assert (v (mask &. a) = 0);
lognot_lemma mask;
assert (v (lognot mask) = v (ones t SEC));
logand_lemma (lognot mask) b;
assert (v ((lognot mask) &. b) == v b);
logor_lemma (mask &. a) ((lognot mask) &. b);
assert (v (mask_select mask a b) == v b))
else
(logand_lemma mask a;
assert (v (mask &. a) = v a);
lognot_lemma mask;
assert (v (lognot mask) = 0);
logand_lemma (lognot mask) b;
assert (v ((lognot mask) &. b) == 0);
logor_zeros (mask &. a);
assert (v (mask_select mask a b) == v a)) | {
"checked_file": "Hacl.Spec.Bignum.Base.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Base.fst"
} | [
"lemma"
] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Hacl.Spec.Bignum.Definitions.limb",
"Prims.op_Equality",
"Prims.int",
"Lib.IntTypes.v",
"Lib.IntTypes.SEC",
"Prims._assert",
"Prims.eq2",
"Lib.IntTypes.range_t",
"Hacl.Spec.Bignum.Base.mask_select",
"Prims.unit",
"Lib.IntTypes.logor_lemma",
"Lib.IntTypes.op_Amp_Dot",
"Lib.IntTypes.lognot",
"Lib.IntTypes.logand_lemma",
"Prims.b2t",
"Lib.IntTypes.ones",
"Lib.IntTypes.lognot_lemma",
"Prims.bool",
"Lib.IntTypes.logor_zeros"
] | [] | module Hacl.Spec.Bignum.Base
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Hacl.Spec.Bignum.Definitions
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let carry (t:limb_t) = x:limb t{uint_v x == 0 \/ uint_v x == 1}
(**
This is non-stateful version of code/fallback functions
*)
inline_for_extraction noextract
val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c)
let addcarry #t cin x y =
let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c)
let subborrow #t cin x y =
let res = x -. y -. cin in
let c = logand (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (gt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b)
let mul_wide #t a b =
Math.Lemmas.lemma_mult_lt_sqr (v a) (v b) (pow2 (bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b in
to_u32 (res >>. 32ul), to_u32 res
| U64 ->
let res = mul64_wide a b in
to_u64 (res >>. 64ul), to_u64 res
val lemma_mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Lemma (v a * v b + v c + v d < pow2 (2 * bits t))
let lemma_mul_wide_add #t a b c d =
let n = pow2 (bits t) in
//assert (v a <= n - 1 /\ v b <= n - 1 /\ v c <= n - 1 /\ v d <= n - 1);
Math.Lemmas.lemma_mult_le_left (v a) (v b) (n - 1);
Math.Lemmas.lemma_mult_le_right (n - 1) (v a) (n - 1);
assert (v a * v b + v c + v d <= (n - 1) * (n - 1) + (n - 1) + (n - 1));
assert ((n - 1) * (n - 1) + (n - 1) + (n - 1) == n * n - 1)
val mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c)
let mul_wide_add #t a b c =
lemma_mul_wide_add a b c (uint #t 0);
Math.Lemmas.small_mod (v a * v b + v c) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c in
assert (v res == v a * v b + v c);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c in
assert (v res == v a * v b + v c);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo
val mul_wide_add2: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c + v d)
let mul_wide_add2 #t a b c d =
lemma_mul_wide_add a b c d;
Math.Lemmas.small_mod (v a * v b + v c + v d) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c +! to_u64 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c +! to_u128 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo
inline_for_extraction noextract
let mask_values (#t:limb_t) (x:limb t) =
v x = v (zeros t SEC) \/ v x = v (ones t SEC)
inline_for_extraction noextract
let unsafe_bool_of_limb0 (#t:limb_t) (m:limb t) : b:bool{b <==> v m = 0} =
let open Lib.RawIntTypes in
match t with
| U32 -> FStar.UInt32.(u32_to_UInt32 m =^ 0ul)
| U64 -> FStar.UInt64.(u64_to_UInt64 m =^ 0uL)
inline_for_extraction noextract
let unsafe_bool_of_limb (#t:limb_t) (m:limb t) : b:bool{b <==> v m = v (ones t SEC)} =
let open Lib.RawIntTypes in
match t with
| U32 -> FStar.UInt32.(u32_to_UInt32 m =^ u32_to_UInt32 (ones U32 SEC))
| U64 -> FStar.UInt64.(u64_to_UInt64 m =^ u64_to_UInt64 (ones U64 SEC))
inline_for_extraction noextract
let size_to_limb (#t:limb_t) (x:size_t) : limb t =
match t with
| U32 -> size_to_uint32 x
| U64 -> size_to_uint64 x
inline_for_extraction noextract
let unsafe_size_from_limb (#t:limb_t) (x:limb t{v x <= max_size_t}) : size_t =
let open Lib.RawIntTypes in
match t with
| U32 -> u32_to_UInt32 x
| U64 -> u32_to_UInt32 (to_u32 x)
inline_for_extraction noextract
val mask_select: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> limb t
let mask_select #t mask a b =
(mask &. a) |. ((lognot mask) &. b)
val mask_select_lemma: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> Lemma
(requires mask_values mask)
(ensures mask_select mask a b == (if v mask = 0 then b else a)) | false | false | Hacl.Spec.Bignum.Base.fst | {
"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"
} | null | val mask_select_lemma: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> Lemma
(requires mask_values mask)
(ensures mask_select mask a b == (if v mask = 0 then b else a)) | [] | Hacl.Spec.Bignum.Base.mask_select_lemma | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Base.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
mask: Hacl.Spec.Bignum.Definitions.limb t ->
a: Hacl.Spec.Bignum.Definitions.limb t ->
b: Hacl.Spec.Bignum.Definitions.limb t
-> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Base.mask_values mask)
(ensures
Hacl.Spec.Bignum.Base.mask_select mask a b ==
(match Lib.IntTypes.v mask = 0 with
| true -> b
| _ -> a)) | {
"end_col": 48,
"end_line": 199,
"start_col": 2,
"start_line": 182
} |
FStar.Pervasives.Lemma | val lseq_mask_select_lemma: #t:limb_t -> #len:size_nat -> a:lseq (limb t) len -> b:lseq (limb t) len -> mask:limb t -> Lemma
(requires mask_values mask)
(ensures map2 (mask_select mask) a b == (if v mask = 0 then b else a)) | [
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.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
}
] | false | let lseq_mask_select_lemma #t #len a b mask =
let res = map2 (mask_select mask) a b in
let lemma_aux (i:nat{i < len}) : Lemma (v res.[i] == (if v mask = 0 then v b.[i] else v a.[i])) =
mask_select_lemma mask a.[i] b.[i] in
Classical.forall_intro lemma_aux;
if v mask = 0 then eq_intro res b else eq_intro res a | val lseq_mask_select_lemma: #t:limb_t -> #len:size_nat -> a:lseq (limb t) len -> b:lseq (limb t) len -> mask:limb t -> Lemma
(requires mask_values mask)
(ensures map2 (mask_select mask) a b == (if v mask = 0 then b else a))
let lseq_mask_select_lemma #t #len a b mask = | false | null | true | let res = map2 (mask_select mask) a b in
let lemma_aux (i: nat{i < len})
: Lemma (v res.[ i ] == (if v mask = 0 then v b.[ i ] else v a.[ i ])) =
mask_select_lemma mask a.[ i ] b.[ i ]
in
Classical.forall_intro lemma_aux;
if v mask = 0 then eq_intro res b else eq_intro res a | {
"checked_file": "Hacl.Spec.Bignum.Base.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Base.fst"
} | [
"lemma"
] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Lib.IntTypes.size_nat",
"Lib.Sequence.lseq",
"Hacl.Spec.Bignum.Definitions.limb",
"Prims.op_Equality",
"Prims.int",
"Lib.IntTypes.v",
"Lib.IntTypes.SEC",
"Lib.Sequence.eq_intro",
"Lib.IntTypes.int_t",
"Prims.bool",
"Prims.unit",
"FStar.Classical.forall_intro",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.eq2",
"Lib.IntTypes.range_t",
"Lib.Sequence.op_String_Access",
"Prims.l_True",
"Prims.squash",
"Lib.IntTypes.range",
"Lib.Sequence.index",
"Prims.Nil",
"FStar.Pervasives.pattern",
"Hacl.Spec.Bignum.Base.mask_select_lemma",
"Prims.l_Forall",
"Prims.l_imp",
"Hacl.Spec.Bignum.Base.mask_select",
"Lib.Sequence.map2"
] | [] | module Hacl.Spec.Bignum.Base
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Hacl.Spec.Bignum.Definitions
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let carry (t:limb_t) = x:limb t{uint_v x == 0 \/ uint_v x == 1}
(**
This is non-stateful version of code/fallback functions
*)
inline_for_extraction noextract
val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c)
let addcarry #t cin x y =
let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c)
let subborrow #t cin x y =
let res = x -. y -. cin in
let c = logand (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (gt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b)
let mul_wide #t a b =
Math.Lemmas.lemma_mult_lt_sqr (v a) (v b) (pow2 (bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b in
to_u32 (res >>. 32ul), to_u32 res
| U64 ->
let res = mul64_wide a b in
to_u64 (res >>. 64ul), to_u64 res
val lemma_mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Lemma (v a * v b + v c + v d < pow2 (2 * bits t))
let lemma_mul_wide_add #t a b c d =
let n = pow2 (bits t) in
//assert (v a <= n - 1 /\ v b <= n - 1 /\ v c <= n - 1 /\ v d <= n - 1);
Math.Lemmas.lemma_mult_le_left (v a) (v b) (n - 1);
Math.Lemmas.lemma_mult_le_right (n - 1) (v a) (n - 1);
assert (v a * v b + v c + v d <= (n - 1) * (n - 1) + (n - 1) + (n - 1));
assert ((n - 1) * (n - 1) + (n - 1) + (n - 1) == n * n - 1)
val mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c)
let mul_wide_add #t a b c =
lemma_mul_wide_add a b c (uint #t 0);
Math.Lemmas.small_mod (v a * v b + v c) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c in
assert (v res == v a * v b + v c);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c in
assert (v res == v a * v b + v c);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo
val mul_wide_add2: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c + v d)
let mul_wide_add2 #t a b c d =
lemma_mul_wide_add a b c d;
Math.Lemmas.small_mod (v a * v b + v c + v d) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c +! to_u64 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c +! to_u128 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo
inline_for_extraction noextract
let mask_values (#t:limb_t) (x:limb t) =
v x = v (zeros t SEC) \/ v x = v (ones t SEC)
inline_for_extraction noextract
let unsafe_bool_of_limb0 (#t:limb_t) (m:limb t) : b:bool{b <==> v m = 0} =
let open Lib.RawIntTypes in
match t with
| U32 -> FStar.UInt32.(u32_to_UInt32 m =^ 0ul)
| U64 -> FStar.UInt64.(u64_to_UInt64 m =^ 0uL)
inline_for_extraction noextract
let unsafe_bool_of_limb (#t:limb_t) (m:limb t) : b:bool{b <==> v m = v (ones t SEC)} =
let open Lib.RawIntTypes in
match t with
| U32 -> FStar.UInt32.(u32_to_UInt32 m =^ u32_to_UInt32 (ones U32 SEC))
| U64 -> FStar.UInt64.(u64_to_UInt64 m =^ u64_to_UInt64 (ones U64 SEC))
inline_for_extraction noextract
let size_to_limb (#t:limb_t) (x:size_t) : limb t =
match t with
| U32 -> size_to_uint32 x
| U64 -> size_to_uint64 x
inline_for_extraction noextract
let unsafe_size_from_limb (#t:limb_t) (x:limb t{v x <= max_size_t}) : size_t =
let open Lib.RawIntTypes in
match t with
| U32 -> u32_to_UInt32 x
| U64 -> u32_to_UInt32 (to_u32 x)
inline_for_extraction noextract
val mask_select: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> limb t
let mask_select #t mask a b =
(mask &. a) |. ((lognot mask) &. b)
val mask_select_lemma: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> Lemma
(requires mask_values mask)
(ensures mask_select mask a b == (if v mask = 0 then b else a))
let mask_select_lemma #t mask a b =
if v mask = 0 then begin
logand_lemma mask a;
assert (v (mask &. a) = 0);
lognot_lemma mask;
assert (v (lognot mask) = v (ones t SEC));
logand_lemma (lognot mask) b;
assert (v ((lognot mask) &. b) == v b);
logor_lemma (mask &. a) ((lognot mask) &. b);
assert (v (mask_select mask a b) == v b) end
else begin
logand_lemma mask a;
assert (v (mask &. a) = v a);
lognot_lemma mask;
assert (v (lognot mask) = 0);
logand_lemma (lognot mask) b;
assert (v ((lognot mask) &. b) == 0);
logor_zeros (mask &. a);
assert (v (mask_select mask a b) == v a) end
val mask_select_lemma1: #t:limb_t -> mask:limb t -> a:limb t -> b:limb t -> Lemma
(requires mask_values mask)
(ensures b ^. (mask &. (a ^. b)) == (if v mask = 0 then b else a))
let mask_select_lemma1 #t mask a b =
let t1 = mask &. (a ^. b) in
let t2 = b ^. t1 in
logand_lemma mask (a ^.b);
if v mask = 0 then begin
assert (v t1 == 0);
logxor_lemma b t1;
assert (v t2 = v b);
() end
else begin
assert (v t1 == v (a ^. b));
logxor_lemma b a;
assert (v t2 = v a);
() end
val lseq_mask_select_lemma: #t:limb_t -> #len:size_nat -> a:lseq (limb t) len -> b:lseq (limb t) len -> mask:limb t -> Lemma
(requires mask_values mask)
(ensures map2 (mask_select mask) a b == (if v mask = 0 then b else a)) | false | false | Hacl.Spec.Bignum.Base.fst | {
"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"
} | null | val lseq_mask_select_lemma: #t:limb_t -> #len:size_nat -> a:lseq (limb t) len -> b:lseq (limb t) len -> mask:limb t -> Lemma
(requires mask_values mask)
(ensures map2 (mask_select mask) a b == (if v mask = 0 then b else a)) | [] | Hacl.Spec.Bignum.Base.lseq_mask_select_lemma | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Base.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Lib.Sequence.lseq (Hacl.Spec.Bignum.Definitions.limb t) len ->
b: Lib.Sequence.lseq (Hacl.Spec.Bignum.Definitions.limb t) len ->
mask: Hacl.Spec.Bignum.Definitions.limb t
-> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Base.mask_values mask)
(ensures
Lib.Sequence.map2 (Hacl.Spec.Bignum.Base.mask_select mask) a b ==
(match Lib.IntTypes.v mask = 0 with
| true -> b
| _ -> a)) | {
"end_col": 55,
"end_line": 233,
"start_col": 45,
"start_line": 226
} |
Prims.Pure | val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b) | [
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.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
}
] | false | let mul_wide #t a b =
Math.Lemmas.lemma_mult_lt_sqr (v a) (v b) (pow2 (bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b in
to_u32 (res >>. 32ul), to_u32 res
| U64 ->
let res = mul64_wide a b in
to_u64 (res >>. 64ul), to_u64 res | val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b)
let mul_wide #t a b = | false | null | false | Math.Lemmas.lemma_mult_lt_sqr (v a) (v b) (pow2 (bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b in
to_u32 (res >>. 32ul), to_u32 res
| U64 ->
let res = mul64_wide a b in
to_u64 (res >>. 64ul), to_u64 res | {
"checked_file": "Hacl.Spec.Bignum.Base.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Base.fst"
} | [] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Hacl.Spec.Bignum.Definitions.limb",
"FStar.Pervasives.Native.Mktuple2",
"Lib.IntTypes.to_u32",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"Lib.IntTypes.op_Greater_Greater_Dot",
"FStar.UInt32.__uint_to_t",
"Lib.IntTypes.int_t",
"Lib.IntTypes.op_Star_Bang",
"Lib.IntTypes.to_u64",
"Lib.IntTypes.U128",
"Lib.IntTypes.mul64_wide",
"FStar.Pervasives.Native.tuple2",
"Prims.unit",
"FStar.Math.Lemmas.lemma_mult_lt_sqr",
"Lib.IntTypes.v",
"Prims.pow2",
"Lib.IntTypes.bits"
] | [] | module Hacl.Spec.Bignum.Base
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Hacl.Spec.Bignum.Definitions
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let carry (t:limb_t) = x:limb t{uint_v x == 0 \/ uint_v x == 1}
(**
This is non-stateful version of code/fallback functions
*)
inline_for_extraction noextract
val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c)
let addcarry #t cin x y =
let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c)
let subborrow #t cin x y =
let res = x -. y -. cin in
let c = logand (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (gt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b) | false | false | Hacl.Spec.Bignum.Base.fst | {
"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"
} | null | val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b) | [] | Hacl.Spec.Bignum.Base.mul_wide | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Base.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Hacl.Spec.Bignum.Definitions.limb t -> b: Hacl.Spec.Bignum.Definitions.limb t
-> Prims.Pure (Hacl.Spec.Bignum.Definitions.limb t * Hacl.Spec.Bignum.Definitions.limb t) | {
"end_col": 37,
"end_line": 64,
"start_col": 2,
"start_line": 57
} |
Prims.Pure | val mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c) | [
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.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
}
] | false | let mul_wide_add #t a b c =
lemma_mul_wide_add a b c (uint #t 0);
Math.Lemmas.small_mod (v a * v b + v c) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c in
assert (v res == v a * v b + v c);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c in
assert (v res == v a * v b + v c);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo | val mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c)
let mul_wide_add #t a b c = | false | null | false | lemma_mul_wide_add a b c (uint #t 0);
Math.Lemmas.small_mod (v a * v b + v c) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c in
assert (v res == v a * v b + v c);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c in
assert (v res == v a * v b + v c);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo | {
"checked_file": "Hacl.Spec.Bignum.Base.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Base.fst"
} | [] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Hacl.Spec.Bignum.Definitions.limb",
"FStar.Pervasives.Native.Mktuple2",
"Prims.unit",
"FStar.Math.Lemmas.euclidean_division_definition",
"Lib.IntTypes.v",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"Prims.pow2",
"Prims._assert",
"Prims.eq2",
"Prims.int",
"Lib.IntTypes.U32",
"Prims.op_Modulus",
"Lib.IntTypes.int_t",
"Lib.IntTypes.to_u32",
"Prims.op_Division",
"Lib.IntTypes.op_Greater_Greater_Dot",
"FStar.UInt32.__uint_to_t",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Lib.IntTypes.op_Plus_Bang",
"Lib.IntTypes.op_Star_Bang",
"Lib.IntTypes.to_u64",
"Lib.IntTypes.U128",
"Lib.IntTypes.mul64_wide",
"Lib.IntTypes.to_u128",
"FStar.Pervasives.Native.tuple2",
"FStar.Math.Lemmas.small_mod",
"Lib.IntTypes.bits",
"Hacl.Spec.Bignum.Base.lemma_mul_wide_add",
"Lib.IntTypes.uint"
] | [] | module Hacl.Spec.Bignum.Base
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Hacl.Spec.Bignum.Definitions
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let carry (t:limb_t) = x:limb t{uint_v x == 0 \/ uint_v x == 1}
(**
This is non-stateful version of code/fallback functions
*)
inline_for_extraction noextract
val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c)
let addcarry #t cin x y =
let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c)
let subborrow #t cin x y =
let res = x -. y -. cin in
let c = logand (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (gt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b)
let mul_wide #t a b =
Math.Lemmas.lemma_mult_lt_sqr (v a) (v b) (pow2 (bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b in
to_u32 (res >>. 32ul), to_u32 res
| U64 ->
let res = mul64_wide a b in
to_u64 (res >>. 64ul), to_u64 res
val lemma_mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Lemma (v a * v b + v c + v d < pow2 (2 * bits t))
let lemma_mul_wide_add #t a b c d =
let n = pow2 (bits t) in
//assert (v a <= n - 1 /\ v b <= n - 1 /\ v c <= n - 1 /\ v d <= n - 1);
Math.Lemmas.lemma_mult_le_left (v a) (v b) (n - 1);
Math.Lemmas.lemma_mult_le_right (n - 1) (v a) (n - 1);
assert (v a * v b + v c + v d <= (n - 1) * (n - 1) + (n - 1) + (n - 1));
assert ((n - 1) * (n - 1) + (n - 1) + (n - 1) == n * n - 1)
val mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c) | false | false | Hacl.Spec.Bignum.Base.fst | {
"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"
} | null | val mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c) | [] | Hacl.Spec.Bignum.Base.mul_wide_add | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Base.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Hacl.Spec.Bignum.Definitions.limb t ->
b: Hacl.Spec.Bignum.Definitions.limb t ->
c: Hacl.Spec.Bignum.Definitions.limb t
-> Prims.Pure (Hacl.Spec.Bignum.Definitions.limb t * Hacl.Spec.Bignum.Definitions.limb t) | {
"end_col": 10,
"end_line": 104,
"start_col": 2,
"start_line": 84
} |
Prims.Pure | val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c) | [
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.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
}
] | false | let subborrow #t cin x y =
let res = x -. y -. cin in
let c = logand (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (gt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res | val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c)
let subborrow #t cin x y = | false | null | false | let res = x -. y -. cin in
let c = logand (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (gt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res | {
"checked_file": "Hacl.Spec.Bignum.Base.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Base.fst"
} | [] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Hacl.Spec.Bignum.Base.carry",
"Hacl.Spec.Bignum.Definitions.limb",
"FStar.Pervasives.Native.Mktuple2",
"Prims.unit",
"Lib.IntTypes.logand_mask",
"Lib.IntTypes.SEC",
"Lib.IntTypes.logor",
"Lib.IntTypes.gt_mask",
"Lib.IntTypes.logand",
"Lib.IntTypes.eq_mask",
"Lib.IntTypes.uint",
"Lib.IntTypes.logor_lemma",
"Lib.IntTypes.logand_lemma",
"Lib.IntTypes.int_t",
"Lib.IntTypes.op_Subtraction_Dot",
"FStar.Pervasives.Native.tuple2"
] | [] | module Hacl.Spec.Bignum.Base
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Hacl.Spec.Bignum.Definitions
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let carry (t:limb_t) = x:limb t{uint_v x == 0 \/ uint_v x == 1}
(**
This is non-stateful version of code/fallback functions
*)
inline_for_extraction noextract
val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c)
let addcarry #t cin x y =
let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c) | false | false | Hacl.Spec.Bignum.Base.fst | {
"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"
} | null | val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c) | [] | Hacl.Spec.Bignum.Base.subborrow | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Base.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
c: Hacl.Spec.Bignum.Base.carry t ->
a: Hacl.Spec.Bignum.Definitions.limb t ->
b: Hacl.Spec.Bignum.Definitions.limb t
-> Prims.Pure (Hacl.Spec.Bignum.Base.carry t * Hacl.Spec.Bignum.Definitions.limb t) | {
"end_col": 8,
"end_line": 46,
"start_col": 26,
"start_line": 40
} |
Prims.Pure | val mul_wide_add2: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c + v d) | [
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.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
}
] | false | let mul_wide_add2 #t a b c d =
lemma_mul_wide_add a b c d;
Math.Lemmas.small_mod (v a * v b + v c + v d) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c +! to_u64 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c +! to_u128 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo | val mul_wide_add2: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c + v d)
let mul_wide_add2 #t a b c d = | false | null | false | lemma_mul_wide_add a b c d;
Math.Lemmas.small_mod (v a * v b + v c + v d) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c +! to_u64 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c +! to_u128 d in
assert (v res == v a * v b + v c + v d);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo | {
"checked_file": "Hacl.Spec.Bignum.Base.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Base.fst"
} | [] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Hacl.Spec.Bignum.Definitions.limb",
"FStar.Pervasives.Native.Mktuple2",
"Prims.unit",
"FStar.Math.Lemmas.euclidean_division_definition",
"Lib.IntTypes.v",
"Lib.IntTypes.U64",
"Lib.IntTypes.SEC",
"Prims.pow2",
"Prims._assert",
"Prims.eq2",
"Prims.int",
"Lib.IntTypes.U32",
"Prims.op_Modulus",
"Lib.IntTypes.int_t",
"Lib.IntTypes.to_u32",
"Prims.op_Division",
"Lib.IntTypes.op_Greater_Greater_Dot",
"FStar.UInt32.__uint_to_t",
"Prims.op_Addition",
"FStar.Mul.op_Star",
"Lib.IntTypes.op_Plus_Bang",
"Lib.IntTypes.op_Star_Bang",
"Lib.IntTypes.to_u64",
"Lib.IntTypes.U128",
"Lib.IntTypes.mul64_wide",
"Lib.IntTypes.to_u128",
"FStar.Pervasives.Native.tuple2",
"FStar.Math.Lemmas.small_mod",
"Lib.IntTypes.bits",
"Hacl.Spec.Bignum.Base.lemma_mul_wide_add"
] | [] | module Hacl.Spec.Bignum.Base
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Hacl.Spec.Bignum.Definitions
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let carry (t:limb_t) = x:limb t{uint_v x == 0 \/ uint_v x == 1}
(**
This is non-stateful version of code/fallback functions
*)
inline_for_extraction noextract
val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c)
let addcarry #t cin x y =
let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val subborrow: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r - uint_v c' * pow2 (bits t) == uint_v a - uint_v b - uint_v c)
let subborrow #t cin x y =
let res = x -. y -. cin in
let c = logand (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (gt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (gt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res
inline_for_extraction noextract
val mul_wide: #t:limb_t -> a:limb t -> b:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) ->
v lo + v hi * pow2 (bits t) == v a * v b)
let mul_wide #t a b =
Math.Lemmas.lemma_mult_lt_sqr (v a) (v b) (pow2 (bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b in
to_u32 (res >>. 32ul), to_u32 res
| U64 ->
let res = mul64_wide a b in
to_u64 (res >>. 64ul), to_u64 res
val lemma_mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Lemma (v a * v b + v c + v d < pow2 (2 * bits t))
let lemma_mul_wide_add #t a b c d =
let n = pow2 (bits t) in
//assert (v a <= n - 1 /\ v b <= n - 1 /\ v c <= n - 1 /\ v d <= n - 1);
Math.Lemmas.lemma_mult_le_left (v a) (v b) (n - 1);
Math.Lemmas.lemma_mult_le_right (n - 1) (v a) (n - 1);
assert (v a * v b + v c + v d <= (n - 1) * (n - 1) + (n - 1) + (n - 1));
assert ((n - 1) * (n - 1) + (n - 1) + (n - 1) == n * n - 1)
val mul_wide_add: #t:limb_t -> a:limb t -> b:limb t -> c:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c)
let mul_wide_add #t a b c =
lemma_mul_wide_add a b c (uint #t 0);
Math.Lemmas.small_mod (v a * v b + v c) (pow2 (2 * bits t));
match t with
| U32 ->
let res = to_u64 a *! to_u64 b +! to_u64 c in
assert (v res == v a * v b + v c);
let hi = to_u32 (res >>. 32ul) in
assert (v hi == v res / pow2 32);
let lo = to_u32 res in
assert (v lo == v res % pow2 32);
Math.Lemmas.euclidean_division_definition (v res) (pow2 32);
hi, lo
| U64 ->
let res = mul64_wide a b +! to_u128 c in
assert (v res == v a * v b + v c);
let hi = to_u64 (res >>. 64ul) in
assert (v hi == v res / pow2 64);
let lo = to_u64 res in
assert (v lo == v res % pow2 64);
Math.Lemmas.euclidean_division_definition (v res) (pow2 64);
hi, lo
val mul_wide_add2: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c + v d) | false | false | Hacl.Spec.Bignum.Base.fst | {
"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"
} | null | val mul_wide_add2: #t:limb_t -> a:limb t -> b:limb t -> c:limb t -> d:limb t ->
Pure (tuple2 (limb t) (limb t))
(requires True)
(ensures fun (hi, lo) -> v lo + v hi * pow2 (bits t) == v a * v b + v c + v d) | [] | Hacl.Spec.Bignum.Base.mul_wide_add2 | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Base.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Hacl.Spec.Bignum.Definitions.limb t ->
b: Hacl.Spec.Bignum.Definitions.limb t ->
c: Hacl.Spec.Bignum.Definitions.limb t ->
d: Hacl.Spec.Bignum.Definitions.limb t
-> Prims.Pure (Hacl.Spec.Bignum.Definitions.limb t * Hacl.Spec.Bignum.Definitions.limb t) | {
"end_col": 10,
"end_line": 133,
"start_col": 2,
"start_line": 113
} |
Prims.Pure | val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c) | [
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum.Definitions",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Bignum",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.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
}
] | false | let addcarry #t cin x y =
let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res | val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c)
let addcarry #t cin x y = | false | null | false | let res = x +. cin +. y in
let c = logand (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) in
logand_lemma (eq_mask res x) cin;
logor_lemma (lt_mask res x) (logand (eq_mask res x) cin);
logand_mask (logor (lt_mask res x) (logand (eq_mask res x) cin)) (uint #t 1) 1;
c, res | {
"checked_file": "Hacl.Spec.Bignum.Base.fst.checked",
"dependencies": [
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.RawIntTypes.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Hacl.Spec.Bignum.Definitions.fst.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked",
"FStar.Classical.fsti.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Bignum.Base.fst"
} | [] | [
"Hacl.Spec.Bignum.Definitions.limb_t",
"Hacl.Spec.Bignum.Base.carry",
"Hacl.Spec.Bignum.Definitions.limb",
"FStar.Pervasives.Native.Mktuple2",
"Prims.unit",
"Lib.IntTypes.logand_mask",
"Lib.IntTypes.SEC",
"Lib.IntTypes.logor",
"Lib.IntTypes.lt_mask",
"Lib.IntTypes.logand",
"Lib.IntTypes.eq_mask",
"Lib.IntTypes.uint",
"Lib.IntTypes.logor_lemma",
"Lib.IntTypes.logand_lemma",
"Lib.IntTypes.int_t",
"Lib.IntTypes.op_Plus_Dot",
"FStar.Pervasives.Native.tuple2"
] | [] | module Hacl.Spec.Bignum.Base
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Hacl.Spec.Bignum.Definitions
#reset-options "--z3rlimit 50 --fuel 0 --ifuel 0"
inline_for_extraction noextract
let carry (t:limb_t) = x:limb t{uint_v x == 0 \/ uint_v x == 1}
(**
This is non-stateful version of code/fallback functions
*)
inline_for_extraction noextract
val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c) | false | false | Hacl.Spec.Bignum.Base.fst | {
"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"
} | null | val addcarry: #t:limb_t -> c:carry t -> a:limb t -> b:limb t ->
Pure (carry t & limb t)
(requires True)
(ensures fun (c', r) ->
uint_v r + uint_v c' * pow2 (bits t) == uint_v a + uint_v b + uint_v c) | [] | Hacl.Spec.Bignum.Base.addcarry | {
"file_name": "code/bignum/Hacl.Spec.Bignum.Base.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
c: Hacl.Spec.Bignum.Base.carry t ->
a: Hacl.Spec.Bignum.Definitions.limb t ->
b: Hacl.Spec.Bignum.Definitions.limb t
-> Prims.Pure (Hacl.Spec.Bignum.Base.carry t * Hacl.Spec.Bignum.Definitions.limb t) | {
"end_col": 8,
"end_line": 30,
"start_col": 25,
"start_line": 24
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.BoundedInt",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"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
}
] | false | let parse_bcvli_kind = {
parser_kind_low = 1;
parser_kind_high = Some 5;
parser_kind_subkind = Some ParserStrong;
parser_kind_metadata = None;
} | let parse_bcvli_kind = | false | null | false | {
parser_kind_low = 1;
parser_kind_high = Some 5;
parser_kind_subkind = Some ParserStrong;
parser_kind_metadata = None
} | {
"checked_file": "LowParse.Spec.BCVLI.fsti.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.BoundedInt.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.BCVLI.fsti"
} | [
"total"
] | [
"LowParse.Spec.Base.Mkparser_kind'",
"FStar.Pervasives.Native.Some",
"Prims.nat",
"LowParse.Spec.Base.parser_subkind",
"LowParse.Spec.Base.ParserStrong",
"FStar.Pervasives.Native.None",
"LowParse.Spec.Base.parser_kind_metadata_some"
] | [] | module LowParse.Spec.BCVLI
include LowParse.Spec.BoundedInt // for bounded_integer
module U32 = FStar.UInt32
module Seq = FStar.Seq
inline_for_extraction | false | true | LowParse.Spec.BCVLI.fsti | {
"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"
} | null | val parse_bcvli_kind : LowParse.Spec.Base.parser_kind' | [] | LowParse.Spec.BCVLI.parse_bcvli_kind | {
"file_name": "src/lowparse/LowParse.Spec.BCVLI.fsti",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | LowParse.Spec.Base.parser_kind' | {
"end_col": 30,
"end_line": 12,
"start_col": 2,
"start_line": 9
} |
|
Prims.Tot | val parse_bounded_bcvli_size (max: nat) : Tot nat | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.BoundedInt",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"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
}
] | false | let parse_bounded_bcvli_size
(max: nat)
: Tot nat
= if max <= 252
then 1
else if max <= 65535
then 3
else 5 | val parse_bounded_bcvli_size (max: nat) : Tot nat
let parse_bounded_bcvli_size (max: nat) : Tot nat = | false | null | false | if max <= 252 then 1 else if max <= 65535 then 3 else 5 | {
"checked_file": "LowParse.Spec.BCVLI.fsti.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.BoundedInt.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.BCVLI.fsti"
} | [
"total"
] | [
"Prims.nat",
"Prims.op_LessThanOrEqual",
"Prims.bool"
] | [] | module LowParse.Spec.BCVLI
include LowParse.Spec.BoundedInt // for bounded_integer
module U32 = FStar.UInt32
module Seq = FStar.Seq
inline_for_extraction
let parse_bcvli_kind = {
parser_kind_low = 1;
parser_kind_high = Some 5;
parser_kind_subkind = Some ParserStrong;
parser_kind_metadata = None;
}
val parse_bcvli : parser parse_bcvli_kind U32.t
val parse_bcvli_eq (b: bytes) : Lemma
(parse parse_bcvli b == (match parse (parse_bounded_integer_le 1) b with
| None -> None
| Some (x32, consumed_x) ->
let x = U32.v x32 in
if x <= 252 then Some (x32, consumed_x) else
let b' = Seq.slice b consumed_x (Seq.length b) in
if x = 253 then
match parse (parse_bounded_integer_le 2) b' with
| None -> None
| Some (y, consumed_y) ->
if U32.v y < 253 then None (* redundant representations not supported, non-malleability *) else Some (y, consumed_x + consumed_y)
else if x = 254 then
match parse (parse_bounded_integer_le 4) b' with
| None -> None
| Some (y, consumed_y) ->
if U32.v y < 65536 then None (* redundant representations not supported, non-malleability *) else Some (y, consumed_x + consumed_y)
else None (* 64-bit integers not supported *)
))
val serialize_bcvli : serializer parse_bcvli
val serialize_bcvli_eq (x: U32.t) : Lemma
(serialize serialize_bcvli x == (
let c1 : bounded_integer 1 =
if U32.v x <= 252 then
x
else if U32.v x <= 65535 then
253ul
else
254ul
in
Seq.append
(serialize (serialize_bounded_integer_le 1) c1)
(
if U32.v c1 <= 252 then Seq.empty else
if U32.v c1 = 253 then serialize (serialize_bounded_integer_le 2) x else
serialize (serialize_bounded_integer_le 4) x
)
))
inline_for_extraction
let parse_bounded_bcvli_size
(max: nat) | false | true | LowParse.Spec.BCVLI.fsti | {
"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"
} | null | val parse_bounded_bcvli_size (max: nat) : Tot nat | [] | LowParse.Spec.BCVLI.parse_bounded_bcvli_size | {
"file_name": "src/lowparse/LowParse.Spec.BCVLI.fsti",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | max: Prims.nat -> Prims.nat | {
"end_col": 8,
"end_line": 66,
"start_col": 2,
"start_line": 62
} |
Prims.Tot | val parse_bounded_bcvli_kind (min: nat) (max: nat{min <= max}) : Tot parser_kind | [
{
"abbrev": true,
"full_module": "FStar.Seq",
"short_module": "Seq"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": false,
"full_module": "LowParse.Spec.BoundedInt",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"short_module": null
},
{
"abbrev": false,
"full_module": "LowParse.Spec",
"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
}
] | false | let parse_bounded_bcvli_kind
(min: nat)
(max: nat { min <= max })
: Tot parser_kind
= {
parser_kind_low = parse_bounded_bcvli_size min;
parser_kind_high = Some (parse_bounded_bcvli_size max);
parser_kind_subkind = Some ParserStrong;
parser_kind_metadata = None;
} | val parse_bounded_bcvli_kind (min: nat) (max: nat{min <= max}) : Tot parser_kind
let parse_bounded_bcvli_kind (min: nat) (max: nat{min <= max}) : Tot parser_kind = | false | null | false | {
parser_kind_low = parse_bounded_bcvli_size min;
parser_kind_high = Some (parse_bounded_bcvli_size max);
parser_kind_subkind = Some ParserStrong;
parser_kind_metadata = None
} | {
"checked_file": "LowParse.Spec.BCVLI.fsti.checked",
"dependencies": [
"prims.fst.checked",
"LowParse.Spec.BoundedInt.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "LowParse.Spec.BCVLI.fsti"
} | [
"total"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"LowParse.Spec.Base.Mkparser_kind'",
"LowParse.Spec.BCVLI.parse_bounded_bcvli_size",
"FStar.Pervasives.Native.Some",
"LowParse.Spec.Base.parser_subkind",
"LowParse.Spec.Base.ParserStrong",
"FStar.Pervasives.Native.None",
"LowParse.Spec.Base.parser_kind_metadata_some",
"LowParse.Spec.Base.parser_kind"
] | [] | module LowParse.Spec.BCVLI
include LowParse.Spec.BoundedInt // for bounded_integer
module U32 = FStar.UInt32
module Seq = FStar.Seq
inline_for_extraction
let parse_bcvli_kind = {
parser_kind_low = 1;
parser_kind_high = Some 5;
parser_kind_subkind = Some ParserStrong;
parser_kind_metadata = None;
}
val parse_bcvli : parser parse_bcvli_kind U32.t
val parse_bcvli_eq (b: bytes) : Lemma
(parse parse_bcvli b == (match parse (parse_bounded_integer_le 1) b with
| None -> None
| Some (x32, consumed_x) ->
let x = U32.v x32 in
if x <= 252 then Some (x32, consumed_x) else
let b' = Seq.slice b consumed_x (Seq.length b) in
if x = 253 then
match parse (parse_bounded_integer_le 2) b' with
| None -> None
| Some (y, consumed_y) ->
if U32.v y < 253 then None (* redundant representations not supported, non-malleability *) else Some (y, consumed_x + consumed_y)
else if x = 254 then
match parse (parse_bounded_integer_le 4) b' with
| None -> None
| Some (y, consumed_y) ->
if U32.v y < 65536 then None (* redundant representations not supported, non-malleability *) else Some (y, consumed_x + consumed_y)
else None (* 64-bit integers not supported *)
))
val serialize_bcvli : serializer parse_bcvli
val serialize_bcvli_eq (x: U32.t) : Lemma
(serialize serialize_bcvli x == (
let c1 : bounded_integer 1 =
if U32.v x <= 252 then
x
else if U32.v x <= 65535 then
253ul
else
254ul
in
Seq.append
(serialize (serialize_bounded_integer_le 1) c1)
(
if U32.v c1 <= 252 then Seq.empty else
if U32.v c1 = 253 then serialize (serialize_bounded_integer_le 2) x else
serialize (serialize_bounded_integer_le 4) x
)
))
inline_for_extraction
let parse_bounded_bcvli_size
(max: nat)
: Tot nat
= if max <= 252
then 1
else if max <= 65535
then 3
else 5
inline_for_extraction
let parse_bounded_bcvli_kind
(min: nat)
(max: nat { min <= max })
: Tot parser_kind | false | false | LowParse.Spec.BCVLI.fsti | {
"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"
} | null | val parse_bounded_bcvli_kind (min: nat) (max: nat{min <= max}) : Tot parser_kind | [] | LowParse.Spec.BCVLI.parse_bounded_bcvli_kind | {
"file_name": "src/lowparse/LowParse.Spec.BCVLI.fsti",
"git_rev": "446a08ce38df905547cf20f28c43776b22b8087a",
"git_url": "https://github.com/project-everest/everparse.git",
"project_name": "everparse"
} | min: Prims.nat -> max: Prims.nat{min <= max} -> LowParse.Spec.Base.parser_kind | {
"end_col": 30,
"end_line": 77,
"start_col": 2,
"start_line": 74
} |
Prims.Tot | val test1_msg:lbytes 0 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l | val test1_msg:lbytes 0
let test1_msg:lbytes 0 = | false | null | false | let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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.Nil"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test1_msg:lbytes 0 | [] | Spec.Ed25519.Test.test1_msg | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 0 | {
"end_col": 11,
"end_line": 41,
"start_col": 26,
"start_line": 38
} |
Prims.Tot | val test2_msg:lbytes 1 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l | val test2_msg:lbytes 1
let test2_msg:lbytes 1 = | false | null | false | let l = List.Tot.map u8_from_UInt8 [0x72uy] in
assert_norm (List.Tot.length l == 1);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test2_msg:lbytes 1 | [] | Spec.Ed25519.Test.test2_msg | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 1 | {
"end_col": 11,
"end_line": 86,
"start_col": 26,
"start_line": 83
} |
Prims.Tot | val test3_msg:lbytes 2 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test3_msg : lbytes 2 =
let l = List.Tot.map u8_from_UInt8 [ 0xafuy; 0x82uy ] in
assert_norm (List.Tot.length l == 2);
of_list l | val test3_msg:lbytes 2
let test3_msg:lbytes 2 = | false | null | false | let l = List.Tot.map u8_from_UInt8 [0xafuy; 0x82uy] in
assert_norm (List.Tot.length l == 2);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l
let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 3
let test3_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy;
0xeduy; 0xb7uy; 0x44uy; 0x2fuy; 0x31uy; 0xdcuy; 0xb7uy; 0xb1uy;
0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xfcuy; 0x51uy; 0xcduy; 0x8euy; 0x62uy; 0x18uy; 0xa1uy; 0xa3uy;
0x8duy; 0xa4uy; 0x7euy; 0xd0uy; 0x02uy; 0x30uy; 0xf0uy; 0x58uy;
0x08uy; 0x16uy; 0xeduy; 0x13uy; 0xbauy; 0x33uy; 0x03uy; 0xacuy;
0x5duy; 0xebuy; 0x91uy; 0x15uy; 0x48uy; 0x90uy; 0x80uy; 0x25uy
] in
assert_norm (List.Tot.length l == 32);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test3_msg:lbytes 2 | [] | Spec.Ed25519.Test.test3_msg | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 2 | {
"end_col": 11,
"end_line": 131,
"start_col": 26,
"start_line": 128
} |
FStar.All.ALL | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test_one (v:vec) =
let Vec sk pk msg expected_sig = v in
let sig = Spec.Ed25519.sign sk msg in
let verify = Spec.Ed25519.verify pk msg sig in
let res = PS.print_compare true 64 expected_sig sig in
if res then IO.print_string "\nTest signature: Success!\n"
else IO.print_string "\nTest signature: Failure :(\n";
if verify then IO.print_string "Test verification: Success!\n"
else IO.print_string "Test verification: Failure :(\n";
res && verify | let test_one (v: vec) = | true | null | false | let Vec sk pk msg expected_sig = v in
let sig = Spec.Ed25519.sign sk msg in
let verify = Spec.Ed25519.verify pk msg sig in
let res = PS.print_compare true 64 expected_sig sig in
if res
then IO.print_string "\nTest signature: Success!\n"
else IO.print_string "\nTest signature: Failure :(\n";
if verify
then IO.print_string "Test verification: Success!\n"
else IO.print_string "Test verification: Failure :(\n";
res && verify | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [] | [
"Spec.Ed25519.Test.vec",
"Lib.ByteSequence.lbytes",
"Lib.ByteSequence.bytes",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Lib.Sequence.length",
"Lib.IntTypes.uint_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Lib.IntTypes.max_size_t",
"Prims.op_AmpAmp",
"Prims.bool",
"Prims.unit",
"FStar.IO.print_string",
"Lib.PrintSequence.print_compare",
"Spec.Ed25519.verify",
"Lib.Sequence.lseq",
"Lib.IntTypes.int_t",
"Spec.Ed25519.sign"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l
let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 3
let test3_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy;
0xeduy; 0xb7uy; 0x44uy; 0x2fuy; 0x31uy; 0xdcuy; 0xb7uy; 0xb1uy;
0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xfcuy; 0x51uy; 0xcduy; 0x8euy; 0x62uy; 0x18uy; 0xa1uy; 0xa3uy;
0x8duy; 0xa4uy; 0x7euy; 0xd0uy; 0x02uy; 0x30uy; 0xf0uy; 0x58uy;
0x08uy; 0x16uy; 0xeduy; 0x13uy; 0xbauy; 0x33uy; 0x03uy; 0xacuy;
0x5duy; 0xebuy; 0x91uy; 0x15uy; 0x48uy; 0x90uy; 0x80uy; 0x25uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_msg : lbytes 2 =
let l = List.Tot.map u8_from_UInt8 [ 0xafuy; 0x82uy ] in
assert_norm (List.Tot.length l == 2);
of_list l
let test3_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x62uy; 0x91uy; 0xd6uy; 0x57uy; 0xdeuy; 0xecuy; 0x24uy; 0x02uy;
0x48uy; 0x27uy; 0xe6uy; 0x9cuy; 0x3auy; 0xbeuy; 0x01uy; 0xa3uy;
0x0cuy; 0xe5uy; 0x48uy; 0xa2uy; 0x84uy; 0x74uy; 0x3auy; 0x44uy;
0x5euy; 0x36uy; 0x80uy; 0xd7uy; 0xdbuy; 0x5auy; 0xc3uy; 0xacuy;
0x18uy; 0xffuy; 0x9buy; 0x53uy; 0x8duy; 0x16uy; 0xf2uy; 0x90uy;
0xaeuy; 0x67uy; 0xf7uy; 0x60uy; 0x98uy; 0x4duy; 0xc6uy; 0x59uy;
0x4auy; 0x7cuy; 0x15uy; 0xe9uy; 0x71uy; 0x6euy; 0xd2uy; 0x8duy;
0xc0uy; 0x27uy; 0xbeuy; 0xceuy; 0xeauy; 0x1euy; 0xc4uy; 0x0auy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 4
let test4_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xf5uy; 0xe5uy; 0x76uy; 0x7cuy; 0xf1uy; 0x53uy; 0x31uy; 0x95uy;
0x17uy; 0x63uy; 0x0fuy; 0x22uy; 0x68uy; 0x76uy; 0xb8uy; 0x6cuy;
0x81uy; 0x60uy; 0xccuy; 0x58uy; 0x3buy; 0xc0uy; 0x13uy; 0x74uy;
0x4cuy; 0x6buy; 0xf2uy; 0x55uy; 0xf5uy; 0xccuy; 0x0euy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test4_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x27uy; 0x81uy; 0x17uy; 0xfcuy; 0x14uy; 0x4cuy; 0x72uy; 0x34uy;
0x0fuy; 0x67uy; 0xd0uy; 0xf2uy; 0x31uy; 0x6euy; 0x83uy; 0x86uy;
0xceuy; 0xffuy; 0xbfuy; 0x2buy; 0x24uy; 0x28uy; 0xc9uy; 0xc5uy;
0x1fuy; 0xefuy; 0x7cuy; 0x59uy; 0x7fuy; 0x1duy; 0x42uy; 0x6euy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test4_msg : lbytes 1023 =
let l = List.Tot.map u8_from_UInt8 [
0x08uy; 0xb8uy; 0xb2uy; 0xb7uy; 0x33uy; 0x42uy; 0x42uy; 0x43uy;
0x76uy; 0x0fuy; 0xe4uy; 0x26uy; 0xa4uy; 0xb5uy; 0x49uy; 0x08uy;
0x63uy; 0x21uy; 0x10uy; 0xa6uy; 0x6cuy; 0x2fuy; 0x65uy; 0x91uy;
0xeauy; 0xbduy; 0x33uy; 0x45uy; 0xe3uy; 0xe4uy; 0xebuy; 0x98uy;
0xfauy; 0x6euy; 0x26uy; 0x4buy; 0xf0uy; 0x9euy; 0xfeuy; 0x12uy;
0xeeuy; 0x50uy; 0xf8uy; 0xf5uy; 0x4euy; 0x9fuy; 0x77uy; 0xb1uy;
0xe3uy; 0x55uy; 0xf6uy; 0xc5uy; 0x05uy; 0x44uy; 0xe2uy; 0x3fuy;
0xb1uy; 0x43uy; 0x3duy; 0xdfuy; 0x73uy; 0xbeuy; 0x84uy; 0xd8uy;
0x79uy; 0xdeuy; 0x7cuy; 0x00uy; 0x46uy; 0xdcuy; 0x49uy; 0x96uy;
0xd9uy; 0xe7uy; 0x73uy; 0xf4uy; 0xbcuy; 0x9euy; 0xfeuy; 0x57uy;
0x38uy; 0x82uy; 0x9auy; 0xdbuy; 0x26uy; 0xc8uy; 0x1buy; 0x37uy;
0xc9uy; 0x3auy; 0x1buy; 0x27uy; 0x0buy; 0x20uy; 0x32uy; 0x9duy;
0x65uy; 0x86uy; 0x75uy; 0xfcuy; 0x6euy; 0xa5uy; 0x34uy; 0xe0uy;
0x81uy; 0x0auy; 0x44uy; 0x32uy; 0x82uy; 0x6buy; 0xf5uy; 0x8cuy;
0x94uy; 0x1euy; 0xfbuy; 0x65uy; 0xd5uy; 0x7auy; 0x33uy; 0x8buy;
0xbduy; 0x2euy; 0x26uy; 0x64uy; 0x0fuy; 0x89uy; 0xffuy; 0xbcuy;
0x1auy; 0x85uy; 0x8euy; 0xfcuy; 0xb8uy; 0x55uy; 0x0euy; 0xe3uy;
0xa5uy; 0xe1uy; 0x99uy; 0x8buy; 0xd1uy; 0x77uy; 0xe9uy; 0x3auy;
0x73uy; 0x63uy; 0xc3uy; 0x44uy; 0xfeuy; 0x6buy; 0x19uy; 0x9euy;
0xe5uy; 0xd0uy; 0x2euy; 0x82uy; 0xd5uy; 0x22uy; 0xc4uy; 0xfeuy;
0xbauy; 0x15uy; 0x45uy; 0x2fuy; 0x80uy; 0x28uy; 0x8auy; 0x82uy;
0x1auy; 0x57uy; 0x91uy; 0x16uy; 0xecuy; 0x6duy; 0xaduy; 0x2buy;
0x3buy; 0x31uy; 0x0duy; 0xa9uy; 0x03uy; 0x40uy; 0x1auy; 0xa6uy;
0x21uy; 0x00uy; 0xabuy; 0x5duy; 0x1auy; 0x36uy; 0x55uy; 0x3euy;
0x06uy; 0x20uy; 0x3buy; 0x33uy; 0x89uy; 0x0cuy; 0xc9uy; 0xb8uy;
0x32uy; 0xf7uy; 0x9euy; 0xf8uy; 0x05uy; 0x60uy; 0xccuy; 0xb9uy;
0xa3uy; 0x9cuy; 0xe7uy; 0x67uy; 0x96uy; 0x7euy; 0xd6uy; 0x28uy;
0xc6uy; 0xaduy; 0x57uy; 0x3cuy; 0xb1uy; 0x16uy; 0xdbuy; 0xefuy;
0xefuy; 0xd7uy; 0x54uy; 0x99uy; 0xdauy; 0x96uy; 0xbduy; 0x68uy;
0xa8uy; 0xa9uy; 0x7buy; 0x92uy; 0x8auy; 0x8buy; 0xbcuy; 0x10uy;
0x3buy; 0x66uy; 0x21uy; 0xfcuy; 0xdeuy; 0x2buy; 0xecuy; 0xa1uy;
0x23uy; 0x1duy; 0x20uy; 0x6buy; 0xe6uy; 0xcduy; 0x9euy; 0xc7uy;
0xafuy; 0xf6uy; 0xf6uy; 0xc9uy; 0x4fuy; 0xcduy; 0x72uy; 0x04uy;
0xeduy; 0x34uy; 0x55uy; 0xc6uy; 0x8cuy; 0x83uy; 0xf4uy; 0xa4uy;
0x1duy; 0xa4uy; 0xafuy; 0x2buy; 0x74uy; 0xefuy; 0x5cuy; 0x53uy;
0xf1uy; 0xd8uy; 0xacuy; 0x70uy; 0xbduy; 0xcbuy; 0x7euy; 0xd1uy;
0x85uy; 0xceuy; 0x81uy; 0xbduy; 0x84uy; 0x35uy; 0x9duy; 0x44uy;
0x25uy; 0x4duy; 0x95uy; 0x62uy; 0x9euy; 0x98uy; 0x55uy; 0xa9uy;
0x4auy; 0x7cuy; 0x19uy; 0x58uy; 0xd1uy; 0xf8uy; 0xaduy; 0xa5uy;
0xd0uy; 0x53uy; 0x2euy; 0xd8uy; 0xa5uy; 0xaauy; 0x3fuy; 0xb2uy;
0xd1uy; 0x7buy; 0xa7uy; 0x0euy; 0xb6uy; 0x24uy; 0x8euy; 0x59uy;
0x4euy; 0x1auy; 0x22uy; 0x97uy; 0xacuy; 0xbbuy; 0xb3uy; 0x9duy;
0x50uy; 0x2fuy; 0x1auy; 0x8cuy; 0x6euy; 0xb6uy; 0xf1uy; 0xceuy;
0x22uy; 0xb3uy; 0xdeuy; 0x1auy; 0x1fuy; 0x40uy; 0xccuy; 0x24uy;
0x55uy; 0x41uy; 0x19uy; 0xa8uy; 0x31uy; 0xa9uy; 0xaauy; 0xd6uy;
0x07uy; 0x9cuy; 0xaduy; 0x88uy; 0x42uy; 0x5duy; 0xe6uy; 0xbduy;
0xe1uy; 0xa9uy; 0x18uy; 0x7euy; 0xbbuy; 0x60uy; 0x92uy; 0xcfuy;
0x67uy; 0xbfuy; 0x2buy; 0x13uy; 0xfduy; 0x65uy; 0xf2uy; 0x70uy;
0x88uy; 0xd7uy; 0x8buy; 0x7euy; 0x88uy; 0x3cuy; 0x87uy; 0x59uy;
0xd2uy; 0xc4uy; 0xf5uy; 0xc6uy; 0x5auy; 0xdbuy; 0x75uy; 0x53uy;
0x87uy; 0x8auy; 0xd5uy; 0x75uy; 0xf9uy; 0xfauy; 0xd8uy; 0x78uy;
0xe8uy; 0x0auy; 0x0cuy; 0x9buy; 0xa6uy; 0x3buy; 0xcbuy; 0xccuy;
0x27uy; 0x32uy; 0xe6uy; 0x94uy; 0x85uy; 0xbbuy; 0xc9uy; 0xc9uy;
0x0buy; 0xfbuy; 0xd6uy; 0x24uy; 0x81uy; 0xd9uy; 0x08uy; 0x9buy;
0xecuy; 0xcfuy; 0x80uy; 0xcfuy; 0xe2uy; 0xdfuy; 0x16uy; 0xa2uy;
0xcfuy; 0x65uy; 0xbduy; 0x92uy; 0xdduy; 0x59uy; 0x7buy; 0x07uy;
0x07uy; 0xe0uy; 0x91uy; 0x7auy; 0xf4uy; 0x8buy; 0xbbuy; 0x75uy;
0xfeuy; 0xd4uy; 0x13uy; 0xd2uy; 0x38uy; 0xf5uy; 0x55uy; 0x5auy;
0x7auy; 0x56uy; 0x9duy; 0x80uy; 0xc3uy; 0x41uy; 0x4auy; 0x8duy;
0x08uy; 0x59uy; 0xdcuy; 0x65uy; 0xa4uy; 0x61uy; 0x28uy; 0xbauy;
0xb2uy; 0x7auy; 0xf8uy; 0x7auy; 0x71uy; 0x31uy; 0x4fuy; 0x31uy;
0x8cuy; 0x78uy; 0x2buy; 0x23uy; 0xebuy; 0xfeuy; 0x80uy; 0x8buy;
0x82uy; 0xb0uy; 0xceuy; 0x26uy; 0x40uy; 0x1duy; 0x2euy; 0x22uy;
0xf0uy; 0x4duy; 0x83uy; 0xd1uy; 0x25uy; 0x5duy; 0xc5uy; 0x1auy;
0xdduy; 0xd3uy; 0xb7uy; 0x5auy; 0x2buy; 0x1auy; 0xe0uy; 0x78uy;
0x45uy; 0x04uy; 0xdfuy; 0x54uy; 0x3auy; 0xf8uy; 0x96uy; 0x9buy;
0xe3uy; 0xeauy; 0x70uy; 0x82uy; 0xffuy; 0x7fuy; 0xc9uy; 0x88uy;
0x8cuy; 0x14uy; 0x4duy; 0xa2uy; 0xafuy; 0x58uy; 0x42uy; 0x9euy;
0xc9uy; 0x60uy; 0x31uy; 0xdbuy; 0xcauy; 0xd3uy; 0xdauy; 0xd9uy;
0xafuy; 0x0duy; 0xcbuy; 0xaauy; 0xafuy; 0x26uy; 0x8cuy; 0xb8uy;
0xfcuy; 0xffuy; 0xeauy; 0xd9uy; 0x4fuy; 0x3cuy; 0x7cuy; 0xa4uy;
0x95uy; 0xe0uy; 0x56uy; 0xa9uy; 0xb4uy; 0x7auy; 0xcduy; 0xb7uy;
0x51uy; 0xfbuy; 0x73uy; 0xe6uy; 0x66uy; 0xc6uy; 0xc6uy; 0x55uy;
0xaduy; 0xe8uy; 0x29uy; 0x72uy; 0x97uy; 0xd0uy; 0x7auy; 0xd1uy;
0xbauy; 0x5euy; 0x43uy; 0xf1uy; 0xbcuy; 0xa3uy; 0x23uy; 0x01uy;
0x65uy; 0x13uy; 0x39uy; 0xe2uy; 0x29uy; 0x04uy; 0xccuy; 0x8cuy;
0x42uy; 0xf5uy; 0x8cuy; 0x30uy; 0xc0uy; 0x4auy; 0xafuy; 0xdbuy;
0x03uy; 0x8duy; 0xdauy; 0x08uy; 0x47uy; 0xdduy; 0x98uy; 0x8duy;
0xcduy; 0xa6uy; 0xf3uy; 0xbfuy; 0xd1uy; 0x5cuy; 0x4buy; 0x4cuy;
0x45uy; 0x25uy; 0x00uy; 0x4auy; 0xa0uy; 0x6euy; 0xefuy; 0xf8uy;
0xcauy; 0x61uy; 0x78uy; 0x3auy; 0xacuy; 0xecuy; 0x57uy; 0xfbuy;
0x3duy; 0x1fuy; 0x92uy; 0xb0uy; 0xfeuy; 0x2fuy; 0xd1uy; 0xa8uy;
0x5fuy; 0x67uy; 0x24uy; 0x51uy; 0x7buy; 0x65uy; 0xe6uy; 0x14uy;
0xaduy; 0x68uy; 0x08uy; 0xd6uy; 0xf6uy; 0xeeuy; 0x34uy; 0xdfuy;
0xf7uy; 0x31uy; 0x0fuy; 0xdcuy; 0x82uy; 0xaeuy; 0xbfuy; 0xd9uy;
0x04uy; 0xb0uy; 0x1euy; 0x1duy; 0xc5uy; 0x4buy; 0x29uy; 0x27uy;
0x09uy; 0x4buy; 0x2duy; 0xb6uy; 0x8duy; 0x6fuy; 0x90uy; 0x3buy;
0x68uy; 0x40uy; 0x1auy; 0xdeuy; 0xbfuy; 0x5auy; 0x7euy; 0x08uy;
0xd7uy; 0x8fuy; 0xf4uy; 0xefuy; 0x5duy; 0x63uy; 0x65uy; 0x3auy;
0x65uy; 0x04uy; 0x0cuy; 0xf9uy; 0xbfuy; 0xd4uy; 0xacuy; 0xa7uy;
0x98uy; 0x4auy; 0x74uy; 0xd3uy; 0x71uy; 0x45uy; 0x98uy; 0x67uy;
0x80uy; 0xfcuy; 0x0buy; 0x16uy; 0xacuy; 0x45uy; 0x16uy; 0x49uy;
0xdeuy; 0x61uy; 0x88uy; 0xa7uy; 0xdbuy; 0xdfuy; 0x19uy; 0x1fuy;
0x64uy; 0xb5uy; 0xfcuy; 0x5euy; 0x2auy; 0xb4uy; 0x7buy; 0x57uy;
0xf7uy; 0xf7uy; 0x27uy; 0x6cuy; 0xd4uy; 0x19uy; 0xc1uy; 0x7auy;
0x3cuy; 0xa8uy; 0xe1uy; 0xb9uy; 0x39uy; 0xaeuy; 0x49uy; 0xe4uy;
0x88uy; 0xacuy; 0xbauy; 0x6buy; 0x96uy; 0x56uy; 0x10uy; 0xb5uy;
0x48uy; 0x01uy; 0x09uy; 0xc8uy; 0xb1uy; 0x7buy; 0x80uy; 0xe1uy;
0xb7uy; 0xb7uy; 0x50uy; 0xdfuy; 0xc7uy; 0x59uy; 0x8duy; 0x5duy;
0x50uy; 0x11uy; 0xfduy; 0x2duy; 0xccuy; 0x56uy; 0x00uy; 0xa3uy;
0x2euy; 0xf5uy; 0xb5uy; 0x2auy; 0x1euy; 0xccuy; 0x82uy; 0x0euy;
0x30uy; 0x8auy; 0xa3uy; 0x42uy; 0x72uy; 0x1auy; 0xacuy; 0x09uy;
0x43uy; 0xbfuy; 0x66uy; 0x86uy; 0xb6uy; 0x4buy; 0x25uy; 0x79uy;
0x37uy; 0x65uy; 0x04uy; 0xccuy; 0xc4uy; 0x93uy; 0xd9uy; 0x7euy;
0x6auy; 0xeduy; 0x3fuy; 0xb0uy; 0xf9uy; 0xcduy; 0x71uy; 0xa4uy;
0x3duy; 0xd4uy; 0x97uy; 0xf0uy; 0x1fuy; 0x17uy; 0xc0uy; 0xe2uy;
0xcbuy; 0x37uy; 0x97uy; 0xaauy; 0x2auy; 0x2fuy; 0x25uy; 0x66uy;
0x56uy; 0x16uy; 0x8euy; 0x6cuy; 0x49uy; 0x6auy; 0xfcuy; 0x5fuy;
0xb9uy; 0x32uy; 0x46uy; 0xf6uy; 0xb1uy; 0x11uy; 0x63uy; 0x98uy;
0xa3uy; 0x46uy; 0xf1uy; 0xa6uy; 0x41uy; 0xf3uy; 0xb0uy; 0x41uy;
0xe9uy; 0x89uy; 0xf7uy; 0x91uy; 0x4fuy; 0x90uy; 0xccuy; 0x2cuy;
0x7fuy; 0xffuy; 0x35uy; 0x78uy; 0x76uy; 0xe5uy; 0x06uy; 0xb5uy;
0x0duy; 0x33uy; 0x4buy; 0xa7uy; 0x7cuy; 0x22uy; 0x5buy; 0xc3uy;
0x07uy; 0xbauy; 0x53uy; 0x71uy; 0x52uy; 0xf3uy; 0xf1uy; 0x61uy;
0x0euy; 0x4euy; 0xafuy; 0xe5uy; 0x95uy; 0xf6uy; 0xd9uy; 0xd9uy;
0x0duy; 0x11uy; 0xfauy; 0xa9uy; 0x33uy; 0xa1uy; 0x5euy; 0xf1uy;
0x36uy; 0x95uy; 0x46uy; 0x86uy; 0x8auy; 0x7fuy; 0x3auy; 0x45uy;
0xa9uy; 0x67uy; 0x68uy; 0xd4uy; 0x0fuy; 0xd9uy; 0xd0uy; 0x34uy;
0x12uy; 0xc0uy; 0x91uy; 0xc6uy; 0x31uy; 0x5cuy; 0xf4uy; 0xfduy;
0xe7uy; 0xcbuy; 0x68uy; 0x60uy; 0x69uy; 0x37uy; 0x38uy; 0x0duy;
0xb2uy; 0xeauy; 0xaauy; 0x70uy; 0x7buy; 0x4cuy; 0x41uy; 0x85uy;
0xc3uy; 0x2euy; 0xdduy; 0xcduy; 0xd3uy; 0x06uy; 0x70uy; 0x5euy;
0x4duy; 0xc1uy; 0xffuy; 0xc8uy; 0x72uy; 0xeeuy; 0xeeuy; 0x47uy;
0x5auy; 0x64uy; 0xdfuy; 0xacuy; 0x86uy; 0xabuy; 0xa4uy; 0x1cuy;
0x06uy; 0x18uy; 0x98uy; 0x3fuy; 0x87uy; 0x41uy; 0xc5uy; 0xefuy;
0x68uy; 0xd3uy; 0xa1uy; 0x01uy; 0xe8uy; 0xa3uy; 0xb8uy; 0xcauy;
0xc6uy; 0x0cuy; 0x90uy; 0x5cuy; 0x15uy; 0xfcuy; 0x91uy; 0x08uy;
0x40uy; 0xb9uy; 0x4cuy; 0x00uy; 0xa0uy; 0xb9uy; 0xd0uy
] in
assert_norm (List.Tot.length l == 1023);
of_list l
let test4_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x0auy; 0xabuy; 0x4cuy; 0x90uy; 0x05uy; 0x01uy; 0xb3uy; 0xe2uy;
0x4duy; 0x7cuy; 0xdfuy; 0x46uy; 0x63uy; 0x32uy; 0x6auy; 0x3auy;
0x87uy; 0xdfuy; 0x5euy; 0x48uy; 0x43uy; 0xb2uy; 0xcbuy; 0xdbuy;
0x67uy; 0xcbuy; 0xf6uy; 0xe4uy; 0x60uy; 0xfeuy; 0xc3uy; 0x50uy;
0xaauy; 0x53uy; 0x71uy; 0xb1uy; 0x50uy; 0x8fuy; 0x9fuy; 0x45uy;
0x28uy; 0xecuy; 0xeauy; 0x23uy; 0xc4uy; 0x36uy; 0xd9uy; 0x4buy;
0x5euy; 0x8fuy; 0xcduy; 0x4fuy; 0x68uy; 0x1euy; 0x30uy; 0xa6uy;
0xacuy; 0x00uy; 0xa9uy; 0x70uy; 0x4auy; 0x18uy; 0x8auy; 0x03uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
noeq type vec =
| Vec :
sk:lbytes 32
-> pk:lbytes 32
-> msg:bytes{length msg <= max_size_t}
-> expected_sig:lbytes 64 -> vec
let test_vectors : list vec = [
Vec test1_sk test1_pk test1_msg test1_expected_sig;
Vec test2_sk test2_pk test2_msg test2_expected_sig;
Vec test3_sk test3_pk test3_msg test3_expected_sig;
Vec test4_sk test4_pk test4_msg test4_expected_sig ] | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test_one : v: Spec.Ed25519.Test.vec -> FStar.All.ALL Prims.bool | [] | Spec.Ed25519.Test.test_one | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | v: Spec.Ed25519.Test.vec -> FStar.All.ALL Prims.bool | {
"end_col": 15,
"end_line": 348,
"start_col": 22,
"start_line": 336
} |
|
FStar.All.ML | val test: unit -> FStar.All.ML bool | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test () =
let res = List.for_all test_one test_vectors in
if res then begin IO.print_string "\n\nEd25519 : Success!\n"; true end
else begin IO.print_string "\n\nEd25519: Failure :(\n"; false end | val test: unit -> FStar.All.ML bool
let test () = | true | null | false | let res = List.for_all test_one test_vectors in
if res
then
(IO.print_string "\n\nEd25519 : Success!\n";
true)
else
(IO.print_string "\n\nEd25519: Failure :(\n";
false) | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"ml"
] | [
"Prims.unit",
"Prims.bool",
"FStar.IO.print_string",
"FStar.List.for_all",
"Spec.Ed25519.Test.vec",
"Spec.Ed25519.Test.test_one",
"Spec.Ed25519.Test.test_vectors"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l
let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 3
let test3_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy;
0xeduy; 0xb7uy; 0x44uy; 0x2fuy; 0x31uy; 0xdcuy; 0xb7uy; 0xb1uy;
0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xfcuy; 0x51uy; 0xcduy; 0x8euy; 0x62uy; 0x18uy; 0xa1uy; 0xa3uy;
0x8duy; 0xa4uy; 0x7euy; 0xd0uy; 0x02uy; 0x30uy; 0xf0uy; 0x58uy;
0x08uy; 0x16uy; 0xeduy; 0x13uy; 0xbauy; 0x33uy; 0x03uy; 0xacuy;
0x5duy; 0xebuy; 0x91uy; 0x15uy; 0x48uy; 0x90uy; 0x80uy; 0x25uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_msg : lbytes 2 =
let l = List.Tot.map u8_from_UInt8 [ 0xafuy; 0x82uy ] in
assert_norm (List.Tot.length l == 2);
of_list l
let test3_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x62uy; 0x91uy; 0xd6uy; 0x57uy; 0xdeuy; 0xecuy; 0x24uy; 0x02uy;
0x48uy; 0x27uy; 0xe6uy; 0x9cuy; 0x3auy; 0xbeuy; 0x01uy; 0xa3uy;
0x0cuy; 0xe5uy; 0x48uy; 0xa2uy; 0x84uy; 0x74uy; 0x3auy; 0x44uy;
0x5euy; 0x36uy; 0x80uy; 0xd7uy; 0xdbuy; 0x5auy; 0xc3uy; 0xacuy;
0x18uy; 0xffuy; 0x9buy; 0x53uy; 0x8duy; 0x16uy; 0xf2uy; 0x90uy;
0xaeuy; 0x67uy; 0xf7uy; 0x60uy; 0x98uy; 0x4duy; 0xc6uy; 0x59uy;
0x4auy; 0x7cuy; 0x15uy; 0xe9uy; 0x71uy; 0x6euy; 0xd2uy; 0x8duy;
0xc0uy; 0x27uy; 0xbeuy; 0xceuy; 0xeauy; 0x1euy; 0xc4uy; 0x0auy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 4
let test4_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xf5uy; 0xe5uy; 0x76uy; 0x7cuy; 0xf1uy; 0x53uy; 0x31uy; 0x95uy;
0x17uy; 0x63uy; 0x0fuy; 0x22uy; 0x68uy; 0x76uy; 0xb8uy; 0x6cuy;
0x81uy; 0x60uy; 0xccuy; 0x58uy; 0x3buy; 0xc0uy; 0x13uy; 0x74uy;
0x4cuy; 0x6buy; 0xf2uy; 0x55uy; 0xf5uy; 0xccuy; 0x0euy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test4_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x27uy; 0x81uy; 0x17uy; 0xfcuy; 0x14uy; 0x4cuy; 0x72uy; 0x34uy;
0x0fuy; 0x67uy; 0xd0uy; 0xf2uy; 0x31uy; 0x6euy; 0x83uy; 0x86uy;
0xceuy; 0xffuy; 0xbfuy; 0x2buy; 0x24uy; 0x28uy; 0xc9uy; 0xc5uy;
0x1fuy; 0xefuy; 0x7cuy; 0x59uy; 0x7fuy; 0x1duy; 0x42uy; 0x6euy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test4_msg : lbytes 1023 =
let l = List.Tot.map u8_from_UInt8 [
0x08uy; 0xb8uy; 0xb2uy; 0xb7uy; 0x33uy; 0x42uy; 0x42uy; 0x43uy;
0x76uy; 0x0fuy; 0xe4uy; 0x26uy; 0xa4uy; 0xb5uy; 0x49uy; 0x08uy;
0x63uy; 0x21uy; 0x10uy; 0xa6uy; 0x6cuy; 0x2fuy; 0x65uy; 0x91uy;
0xeauy; 0xbduy; 0x33uy; 0x45uy; 0xe3uy; 0xe4uy; 0xebuy; 0x98uy;
0xfauy; 0x6euy; 0x26uy; 0x4buy; 0xf0uy; 0x9euy; 0xfeuy; 0x12uy;
0xeeuy; 0x50uy; 0xf8uy; 0xf5uy; 0x4euy; 0x9fuy; 0x77uy; 0xb1uy;
0xe3uy; 0x55uy; 0xf6uy; 0xc5uy; 0x05uy; 0x44uy; 0xe2uy; 0x3fuy;
0xb1uy; 0x43uy; 0x3duy; 0xdfuy; 0x73uy; 0xbeuy; 0x84uy; 0xd8uy;
0x79uy; 0xdeuy; 0x7cuy; 0x00uy; 0x46uy; 0xdcuy; 0x49uy; 0x96uy;
0xd9uy; 0xe7uy; 0x73uy; 0xf4uy; 0xbcuy; 0x9euy; 0xfeuy; 0x57uy;
0x38uy; 0x82uy; 0x9auy; 0xdbuy; 0x26uy; 0xc8uy; 0x1buy; 0x37uy;
0xc9uy; 0x3auy; 0x1buy; 0x27uy; 0x0buy; 0x20uy; 0x32uy; 0x9duy;
0x65uy; 0x86uy; 0x75uy; 0xfcuy; 0x6euy; 0xa5uy; 0x34uy; 0xe0uy;
0x81uy; 0x0auy; 0x44uy; 0x32uy; 0x82uy; 0x6buy; 0xf5uy; 0x8cuy;
0x94uy; 0x1euy; 0xfbuy; 0x65uy; 0xd5uy; 0x7auy; 0x33uy; 0x8buy;
0xbduy; 0x2euy; 0x26uy; 0x64uy; 0x0fuy; 0x89uy; 0xffuy; 0xbcuy;
0x1auy; 0x85uy; 0x8euy; 0xfcuy; 0xb8uy; 0x55uy; 0x0euy; 0xe3uy;
0xa5uy; 0xe1uy; 0x99uy; 0x8buy; 0xd1uy; 0x77uy; 0xe9uy; 0x3auy;
0x73uy; 0x63uy; 0xc3uy; 0x44uy; 0xfeuy; 0x6buy; 0x19uy; 0x9euy;
0xe5uy; 0xd0uy; 0x2euy; 0x82uy; 0xd5uy; 0x22uy; 0xc4uy; 0xfeuy;
0xbauy; 0x15uy; 0x45uy; 0x2fuy; 0x80uy; 0x28uy; 0x8auy; 0x82uy;
0x1auy; 0x57uy; 0x91uy; 0x16uy; 0xecuy; 0x6duy; 0xaduy; 0x2buy;
0x3buy; 0x31uy; 0x0duy; 0xa9uy; 0x03uy; 0x40uy; 0x1auy; 0xa6uy;
0x21uy; 0x00uy; 0xabuy; 0x5duy; 0x1auy; 0x36uy; 0x55uy; 0x3euy;
0x06uy; 0x20uy; 0x3buy; 0x33uy; 0x89uy; 0x0cuy; 0xc9uy; 0xb8uy;
0x32uy; 0xf7uy; 0x9euy; 0xf8uy; 0x05uy; 0x60uy; 0xccuy; 0xb9uy;
0xa3uy; 0x9cuy; 0xe7uy; 0x67uy; 0x96uy; 0x7euy; 0xd6uy; 0x28uy;
0xc6uy; 0xaduy; 0x57uy; 0x3cuy; 0xb1uy; 0x16uy; 0xdbuy; 0xefuy;
0xefuy; 0xd7uy; 0x54uy; 0x99uy; 0xdauy; 0x96uy; 0xbduy; 0x68uy;
0xa8uy; 0xa9uy; 0x7buy; 0x92uy; 0x8auy; 0x8buy; 0xbcuy; 0x10uy;
0x3buy; 0x66uy; 0x21uy; 0xfcuy; 0xdeuy; 0x2buy; 0xecuy; 0xa1uy;
0x23uy; 0x1duy; 0x20uy; 0x6buy; 0xe6uy; 0xcduy; 0x9euy; 0xc7uy;
0xafuy; 0xf6uy; 0xf6uy; 0xc9uy; 0x4fuy; 0xcduy; 0x72uy; 0x04uy;
0xeduy; 0x34uy; 0x55uy; 0xc6uy; 0x8cuy; 0x83uy; 0xf4uy; 0xa4uy;
0x1duy; 0xa4uy; 0xafuy; 0x2buy; 0x74uy; 0xefuy; 0x5cuy; 0x53uy;
0xf1uy; 0xd8uy; 0xacuy; 0x70uy; 0xbduy; 0xcbuy; 0x7euy; 0xd1uy;
0x85uy; 0xceuy; 0x81uy; 0xbduy; 0x84uy; 0x35uy; 0x9duy; 0x44uy;
0x25uy; 0x4duy; 0x95uy; 0x62uy; 0x9euy; 0x98uy; 0x55uy; 0xa9uy;
0x4auy; 0x7cuy; 0x19uy; 0x58uy; 0xd1uy; 0xf8uy; 0xaduy; 0xa5uy;
0xd0uy; 0x53uy; 0x2euy; 0xd8uy; 0xa5uy; 0xaauy; 0x3fuy; 0xb2uy;
0xd1uy; 0x7buy; 0xa7uy; 0x0euy; 0xb6uy; 0x24uy; 0x8euy; 0x59uy;
0x4euy; 0x1auy; 0x22uy; 0x97uy; 0xacuy; 0xbbuy; 0xb3uy; 0x9duy;
0x50uy; 0x2fuy; 0x1auy; 0x8cuy; 0x6euy; 0xb6uy; 0xf1uy; 0xceuy;
0x22uy; 0xb3uy; 0xdeuy; 0x1auy; 0x1fuy; 0x40uy; 0xccuy; 0x24uy;
0x55uy; 0x41uy; 0x19uy; 0xa8uy; 0x31uy; 0xa9uy; 0xaauy; 0xd6uy;
0x07uy; 0x9cuy; 0xaduy; 0x88uy; 0x42uy; 0x5duy; 0xe6uy; 0xbduy;
0xe1uy; 0xa9uy; 0x18uy; 0x7euy; 0xbbuy; 0x60uy; 0x92uy; 0xcfuy;
0x67uy; 0xbfuy; 0x2buy; 0x13uy; 0xfduy; 0x65uy; 0xf2uy; 0x70uy;
0x88uy; 0xd7uy; 0x8buy; 0x7euy; 0x88uy; 0x3cuy; 0x87uy; 0x59uy;
0xd2uy; 0xc4uy; 0xf5uy; 0xc6uy; 0x5auy; 0xdbuy; 0x75uy; 0x53uy;
0x87uy; 0x8auy; 0xd5uy; 0x75uy; 0xf9uy; 0xfauy; 0xd8uy; 0x78uy;
0xe8uy; 0x0auy; 0x0cuy; 0x9buy; 0xa6uy; 0x3buy; 0xcbuy; 0xccuy;
0x27uy; 0x32uy; 0xe6uy; 0x94uy; 0x85uy; 0xbbuy; 0xc9uy; 0xc9uy;
0x0buy; 0xfbuy; 0xd6uy; 0x24uy; 0x81uy; 0xd9uy; 0x08uy; 0x9buy;
0xecuy; 0xcfuy; 0x80uy; 0xcfuy; 0xe2uy; 0xdfuy; 0x16uy; 0xa2uy;
0xcfuy; 0x65uy; 0xbduy; 0x92uy; 0xdduy; 0x59uy; 0x7buy; 0x07uy;
0x07uy; 0xe0uy; 0x91uy; 0x7auy; 0xf4uy; 0x8buy; 0xbbuy; 0x75uy;
0xfeuy; 0xd4uy; 0x13uy; 0xd2uy; 0x38uy; 0xf5uy; 0x55uy; 0x5auy;
0x7auy; 0x56uy; 0x9duy; 0x80uy; 0xc3uy; 0x41uy; 0x4auy; 0x8duy;
0x08uy; 0x59uy; 0xdcuy; 0x65uy; 0xa4uy; 0x61uy; 0x28uy; 0xbauy;
0xb2uy; 0x7auy; 0xf8uy; 0x7auy; 0x71uy; 0x31uy; 0x4fuy; 0x31uy;
0x8cuy; 0x78uy; 0x2buy; 0x23uy; 0xebuy; 0xfeuy; 0x80uy; 0x8buy;
0x82uy; 0xb0uy; 0xceuy; 0x26uy; 0x40uy; 0x1duy; 0x2euy; 0x22uy;
0xf0uy; 0x4duy; 0x83uy; 0xd1uy; 0x25uy; 0x5duy; 0xc5uy; 0x1auy;
0xdduy; 0xd3uy; 0xb7uy; 0x5auy; 0x2buy; 0x1auy; 0xe0uy; 0x78uy;
0x45uy; 0x04uy; 0xdfuy; 0x54uy; 0x3auy; 0xf8uy; 0x96uy; 0x9buy;
0xe3uy; 0xeauy; 0x70uy; 0x82uy; 0xffuy; 0x7fuy; 0xc9uy; 0x88uy;
0x8cuy; 0x14uy; 0x4duy; 0xa2uy; 0xafuy; 0x58uy; 0x42uy; 0x9euy;
0xc9uy; 0x60uy; 0x31uy; 0xdbuy; 0xcauy; 0xd3uy; 0xdauy; 0xd9uy;
0xafuy; 0x0duy; 0xcbuy; 0xaauy; 0xafuy; 0x26uy; 0x8cuy; 0xb8uy;
0xfcuy; 0xffuy; 0xeauy; 0xd9uy; 0x4fuy; 0x3cuy; 0x7cuy; 0xa4uy;
0x95uy; 0xe0uy; 0x56uy; 0xa9uy; 0xb4uy; 0x7auy; 0xcduy; 0xb7uy;
0x51uy; 0xfbuy; 0x73uy; 0xe6uy; 0x66uy; 0xc6uy; 0xc6uy; 0x55uy;
0xaduy; 0xe8uy; 0x29uy; 0x72uy; 0x97uy; 0xd0uy; 0x7auy; 0xd1uy;
0xbauy; 0x5euy; 0x43uy; 0xf1uy; 0xbcuy; 0xa3uy; 0x23uy; 0x01uy;
0x65uy; 0x13uy; 0x39uy; 0xe2uy; 0x29uy; 0x04uy; 0xccuy; 0x8cuy;
0x42uy; 0xf5uy; 0x8cuy; 0x30uy; 0xc0uy; 0x4auy; 0xafuy; 0xdbuy;
0x03uy; 0x8duy; 0xdauy; 0x08uy; 0x47uy; 0xdduy; 0x98uy; 0x8duy;
0xcduy; 0xa6uy; 0xf3uy; 0xbfuy; 0xd1uy; 0x5cuy; 0x4buy; 0x4cuy;
0x45uy; 0x25uy; 0x00uy; 0x4auy; 0xa0uy; 0x6euy; 0xefuy; 0xf8uy;
0xcauy; 0x61uy; 0x78uy; 0x3auy; 0xacuy; 0xecuy; 0x57uy; 0xfbuy;
0x3duy; 0x1fuy; 0x92uy; 0xb0uy; 0xfeuy; 0x2fuy; 0xd1uy; 0xa8uy;
0x5fuy; 0x67uy; 0x24uy; 0x51uy; 0x7buy; 0x65uy; 0xe6uy; 0x14uy;
0xaduy; 0x68uy; 0x08uy; 0xd6uy; 0xf6uy; 0xeeuy; 0x34uy; 0xdfuy;
0xf7uy; 0x31uy; 0x0fuy; 0xdcuy; 0x82uy; 0xaeuy; 0xbfuy; 0xd9uy;
0x04uy; 0xb0uy; 0x1euy; 0x1duy; 0xc5uy; 0x4buy; 0x29uy; 0x27uy;
0x09uy; 0x4buy; 0x2duy; 0xb6uy; 0x8duy; 0x6fuy; 0x90uy; 0x3buy;
0x68uy; 0x40uy; 0x1auy; 0xdeuy; 0xbfuy; 0x5auy; 0x7euy; 0x08uy;
0xd7uy; 0x8fuy; 0xf4uy; 0xefuy; 0x5duy; 0x63uy; 0x65uy; 0x3auy;
0x65uy; 0x04uy; 0x0cuy; 0xf9uy; 0xbfuy; 0xd4uy; 0xacuy; 0xa7uy;
0x98uy; 0x4auy; 0x74uy; 0xd3uy; 0x71uy; 0x45uy; 0x98uy; 0x67uy;
0x80uy; 0xfcuy; 0x0buy; 0x16uy; 0xacuy; 0x45uy; 0x16uy; 0x49uy;
0xdeuy; 0x61uy; 0x88uy; 0xa7uy; 0xdbuy; 0xdfuy; 0x19uy; 0x1fuy;
0x64uy; 0xb5uy; 0xfcuy; 0x5euy; 0x2auy; 0xb4uy; 0x7buy; 0x57uy;
0xf7uy; 0xf7uy; 0x27uy; 0x6cuy; 0xd4uy; 0x19uy; 0xc1uy; 0x7auy;
0x3cuy; 0xa8uy; 0xe1uy; 0xb9uy; 0x39uy; 0xaeuy; 0x49uy; 0xe4uy;
0x88uy; 0xacuy; 0xbauy; 0x6buy; 0x96uy; 0x56uy; 0x10uy; 0xb5uy;
0x48uy; 0x01uy; 0x09uy; 0xc8uy; 0xb1uy; 0x7buy; 0x80uy; 0xe1uy;
0xb7uy; 0xb7uy; 0x50uy; 0xdfuy; 0xc7uy; 0x59uy; 0x8duy; 0x5duy;
0x50uy; 0x11uy; 0xfduy; 0x2duy; 0xccuy; 0x56uy; 0x00uy; 0xa3uy;
0x2euy; 0xf5uy; 0xb5uy; 0x2auy; 0x1euy; 0xccuy; 0x82uy; 0x0euy;
0x30uy; 0x8auy; 0xa3uy; 0x42uy; 0x72uy; 0x1auy; 0xacuy; 0x09uy;
0x43uy; 0xbfuy; 0x66uy; 0x86uy; 0xb6uy; 0x4buy; 0x25uy; 0x79uy;
0x37uy; 0x65uy; 0x04uy; 0xccuy; 0xc4uy; 0x93uy; 0xd9uy; 0x7euy;
0x6auy; 0xeduy; 0x3fuy; 0xb0uy; 0xf9uy; 0xcduy; 0x71uy; 0xa4uy;
0x3duy; 0xd4uy; 0x97uy; 0xf0uy; 0x1fuy; 0x17uy; 0xc0uy; 0xe2uy;
0xcbuy; 0x37uy; 0x97uy; 0xaauy; 0x2auy; 0x2fuy; 0x25uy; 0x66uy;
0x56uy; 0x16uy; 0x8euy; 0x6cuy; 0x49uy; 0x6auy; 0xfcuy; 0x5fuy;
0xb9uy; 0x32uy; 0x46uy; 0xf6uy; 0xb1uy; 0x11uy; 0x63uy; 0x98uy;
0xa3uy; 0x46uy; 0xf1uy; 0xa6uy; 0x41uy; 0xf3uy; 0xb0uy; 0x41uy;
0xe9uy; 0x89uy; 0xf7uy; 0x91uy; 0x4fuy; 0x90uy; 0xccuy; 0x2cuy;
0x7fuy; 0xffuy; 0x35uy; 0x78uy; 0x76uy; 0xe5uy; 0x06uy; 0xb5uy;
0x0duy; 0x33uy; 0x4buy; 0xa7uy; 0x7cuy; 0x22uy; 0x5buy; 0xc3uy;
0x07uy; 0xbauy; 0x53uy; 0x71uy; 0x52uy; 0xf3uy; 0xf1uy; 0x61uy;
0x0euy; 0x4euy; 0xafuy; 0xe5uy; 0x95uy; 0xf6uy; 0xd9uy; 0xd9uy;
0x0duy; 0x11uy; 0xfauy; 0xa9uy; 0x33uy; 0xa1uy; 0x5euy; 0xf1uy;
0x36uy; 0x95uy; 0x46uy; 0x86uy; 0x8auy; 0x7fuy; 0x3auy; 0x45uy;
0xa9uy; 0x67uy; 0x68uy; 0xd4uy; 0x0fuy; 0xd9uy; 0xd0uy; 0x34uy;
0x12uy; 0xc0uy; 0x91uy; 0xc6uy; 0x31uy; 0x5cuy; 0xf4uy; 0xfduy;
0xe7uy; 0xcbuy; 0x68uy; 0x60uy; 0x69uy; 0x37uy; 0x38uy; 0x0duy;
0xb2uy; 0xeauy; 0xaauy; 0x70uy; 0x7buy; 0x4cuy; 0x41uy; 0x85uy;
0xc3uy; 0x2euy; 0xdduy; 0xcduy; 0xd3uy; 0x06uy; 0x70uy; 0x5euy;
0x4duy; 0xc1uy; 0xffuy; 0xc8uy; 0x72uy; 0xeeuy; 0xeeuy; 0x47uy;
0x5auy; 0x64uy; 0xdfuy; 0xacuy; 0x86uy; 0xabuy; 0xa4uy; 0x1cuy;
0x06uy; 0x18uy; 0x98uy; 0x3fuy; 0x87uy; 0x41uy; 0xc5uy; 0xefuy;
0x68uy; 0xd3uy; 0xa1uy; 0x01uy; 0xe8uy; 0xa3uy; 0xb8uy; 0xcauy;
0xc6uy; 0x0cuy; 0x90uy; 0x5cuy; 0x15uy; 0xfcuy; 0x91uy; 0x08uy;
0x40uy; 0xb9uy; 0x4cuy; 0x00uy; 0xa0uy; 0xb9uy; 0xd0uy
] in
assert_norm (List.Tot.length l == 1023);
of_list l
let test4_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x0auy; 0xabuy; 0x4cuy; 0x90uy; 0x05uy; 0x01uy; 0xb3uy; 0xe2uy;
0x4duy; 0x7cuy; 0xdfuy; 0x46uy; 0x63uy; 0x32uy; 0x6auy; 0x3auy;
0x87uy; 0xdfuy; 0x5euy; 0x48uy; 0x43uy; 0xb2uy; 0xcbuy; 0xdbuy;
0x67uy; 0xcbuy; 0xf6uy; 0xe4uy; 0x60uy; 0xfeuy; 0xc3uy; 0x50uy;
0xaauy; 0x53uy; 0x71uy; 0xb1uy; 0x50uy; 0x8fuy; 0x9fuy; 0x45uy;
0x28uy; 0xecuy; 0xeauy; 0x23uy; 0xc4uy; 0x36uy; 0xd9uy; 0x4buy;
0x5euy; 0x8fuy; 0xcduy; 0x4fuy; 0x68uy; 0x1euy; 0x30uy; 0xa6uy;
0xacuy; 0x00uy; 0xa9uy; 0x70uy; 0x4auy; 0x18uy; 0x8auy; 0x03uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
noeq type vec =
| Vec :
sk:lbytes 32
-> pk:lbytes 32
-> msg:bytes{length msg <= max_size_t}
-> expected_sig:lbytes 64 -> vec
let test_vectors : list vec = [
Vec test1_sk test1_pk test1_msg test1_expected_sig;
Vec test2_sk test2_pk test2_msg test2_expected_sig;
Vec test3_sk test3_pk test3_msg test3_expected_sig;
Vec test4_sk test4_pk test4_msg test4_expected_sig ]
let test_one (v:vec) =
let Vec sk pk msg expected_sig = v in
let sig = Spec.Ed25519.sign sk msg in
let verify = Spec.Ed25519.verify pk msg sig in
let res = PS.print_compare true 64 expected_sig sig in
if res then IO.print_string "\nTest signature: Success!\n"
else IO.print_string "\nTest signature: Failure :(\n";
if verify then IO.print_string "Test verification: Success!\n"
else IO.print_string "Test verification: Failure :(\n";
res && verify | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test: unit -> FStar.All.ML bool | [] | Spec.Ed25519.Test.test | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.unit -> FStar.All.ML Prims.bool | {
"end_col": 67,
"end_line": 355,
"start_col": 13,
"start_line": 352
} |
Prims.Tot | val test1_sk:lbytes 32 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l | val test1_sk:lbytes 32
let test1_sk:lbytes 32 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy; 0xbauy; 0x84uy; 0x4auy; 0xf4uy;
0x92uy; 0xecuy; 0x2cuy; 0xc4uy; 0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
]
in
assert_norm (List.Tot.length l == 32);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1 | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test1_sk:lbytes 32 | [] | Spec.Ed25519.Test.test1_sk | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 32 | {
"end_col": 11,
"end_line": 24,
"start_col": 26,
"start_line": 16
} |
Prims.Tot | val test3_sk:lbytes 32 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test3_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy;
0xeduy; 0xb7uy; 0x44uy; 0x2fuy; 0x31uy; 0xdcuy; 0xb7uy; 0xb1uy;
0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
] in
assert_norm (List.Tot.length l == 32);
of_list l | val test3_sk:lbytes 32
let test3_sk:lbytes 32 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy; 0xeduy; 0xb7uy; 0x44uy; 0x2fuy;
0x31uy; 0xdcuy; 0xb7uy; 0xb1uy; 0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
]
in
assert_norm (List.Tot.length l == 32);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l
let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 3 | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test3_sk:lbytes 32 | [] | Spec.Ed25519.Test.test3_sk | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 32 | {
"end_col": 11,
"end_line": 114,
"start_col": 26,
"start_line": 106
} |
Prims.Tot | val test4_sk:lbytes 32 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test4_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xf5uy; 0xe5uy; 0x76uy; 0x7cuy; 0xf1uy; 0x53uy; 0x31uy; 0x95uy;
0x17uy; 0x63uy; 0x0fuy; 0x22uy; 0x68uy; 0x76uy; 0xb8uy; 0x6cuy;
0x81uy; 0x60uy; 0xccuy; 0x58uy; 0x3buy; 0xc0uy; 0x13uy; 0x74uy;
0x4cuy; 0x6buy; 0xf2uy; 0x55uy; 0xf5uy; 0xccuy; 0x0euy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l | val test4_sk:lbytes 32
let test4_sk:lbytes 32 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0xf5uy; 0xe5uy; 0x76uy; 0x7cuy; 0xf1uy; 0x53uy; 0x31uy; 0x95uy; 0x17uy; 0x63uy; 0x0fuy; 0x22uy;
0x68uy; 0x76uy; 0xb8uy; 0x6cuy; 0x81uy; 0x60uy; 0xccuy; 0x58uy; 0x3buy; 0xc0uy; 0x13uy; 0x74uy;
0x4cuy; 0x6buy; 0xf2uy; 0x55uy; 0xf5uy; 0xccuy; 0x0euy; 0xe5uy
]
in
assert_norm (List.Tot.length l == 32);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l
let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 3
let test3_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy;
0xeduy; 0xb7uy; 0x44uy; 0x2fuy; 0x31uy; 0xdcuy; 0xb7uy; 0xb1uy;
0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xfcuy; 0x51uy; 0xcduy; 0x8euy; 0x62uy; 0x18uy; 0xa1uy; 0xa3uy;
0x8duy; 0xa4uy; 0x7euy; 0xd0uy; 0x02uy; 0x30uy; 0xf0uy; 0x58uy;
0x08uy; 0x16uy; 0xeduy; 0x13uy; 0xbauy; 0x33uy; 0x03uy; 0xacuy;
0x5duy; 0xebuy; 0x91uy; 0x15uy; 0x48uy; 0x90uy; 0x80uy; 0x25uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_msg : lbytes 2 =
let l = List.Tot.map u8_from_UInt8 [ 0xafuy; 0x82uy ] in
assert_norm (List.Tot.length l == 2);
of_list l
let test3_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x62uy; 0x91uy; 0xd6uy; 0x57uy; 0xdeuy; 0xecuy; 0x24uy; 0x02uy;
0x48uy; 0x27uy; 0xe6uy; 0x9cuy; 0x3auy; 0xbeuy; 0x01uy; 0xa3uy;
0x0cuy; 0xe5uy; 0x48uy; 0xa2uy; 0x84uy; 0x74uy; 0x3auy; 0x44uy;
0x5euy; 0x36uy; 0x80uy; 0xd7uy; 0xdbuy; 0x5auy; 0xc3uy; 0xacuy;
0x18uy; 0xffuy; 0x9buy; 0x53uy; 0x8duy; 0x16uy; 0xf2uy; 0x90uy;
0xaeuy; 0x67uy; 0xf7uy; 0x60uy; 0x98uy; 0x4duy; 0xc6uy; 0x59uy;
0x4auy; 0x7cuy; 0x15uy; 0xe9uy; 0x71uy; 0x6euy; 0xd2uy; 0x8duy;
0xc0uy; 0x27uy; 0xbeuy; 0xceuy; 0xeauy; 0x1euy; 0xc4uy; 0x0auy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 4 | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test4_sk:lbytes 32 | [] | Spec.Ed25519.Test.test4_sk | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 32 | {
"end_col": 11,
"end_line": 159,
"start_col": 26,
"start_line": 151
} |
Prims.Tot | val test2_sk:lbytes 32 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l | val test2_sk:lbytes 32
let test2_sk:lbytes 32 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy; 0x9duy; 0xb6uy; 0xc3uy; 0x46uy;
0xecuy; 0x11uy; 0x4euy; 0x0fuy; 0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
]
in
assert_norm (List.Tot.length l == 32);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2 | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test2_sk:lbytes 32 | [] | Spec.Ed25519.Test.test2_sk | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 32 | {
"end_col": 11,
"end_line": 69,
"start_col": 26,
"start_line": 61
} |
Prims.Tot | val test1_pk:lbytes 32 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l | val test1_pk:lbytes 32
let test1_pk:lbytes 32 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy; 0xd5uy; 0x4buy; 0xfeuy; 0xd3uy;
0xc9uy; 0x64uy; 0x07uy; 0x3auy; 0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
]
in
assert_norm (List.Tot.length l == 32);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test1_pk:lbytes 32 | [] | Spec.Ed25519.Test.test1_pk | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 32 | {
"end_col": 11,
"end_line": 35,
"start_col": 26,
"start_line": 27
} |
Prims.Tot | val test4_pk:lbytes 32 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test4_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x27uy; 0x81uy; 0x17uy; 0xfcuy; 0x14uy; 0x4cuy; 0x72uy; 0x34uy;
0x0fuy; 0x67uy; 0xd0uy; 0xf2uy; 0x31uy; 0x6euy; 0x83uy; 0x86uy;
0xceuy; 0xffuy; 0xbfuy; 0x2buy; 0x24uy; 0x28uy; 0xc9uy; 0xc5uy;
0x1fuy; 0xefuy; 0x7cuy; 0x59uy; 0x7fuy; 0x1duy; 0x42uy; 0x6euy
] in
assert_norm (List.Tot.length l == 32);
of_list l | val test4_pk:lbytes 32
let test4_pk:lbytes 32 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0x27uy; 0x81uy; 0x17uy; 0xfcuy; 0x14uy; 0x4cuy; 0x72uy; 0x34uy; 0x0fuy; 0x67uy; 0xd0uy; 0xf2uy;
0x31uy; 0x6euy; 0x83uy; 0x86uy; 0xceuy; 0xffuy; 0xbfuy; 0x2buy; 0x24uy; 0x28uy; 0xc9uy; 0xc5uy;
0x1fuy; 0xefuy; 0x7cuy; 0x59uy; 0x7fuy; 0x1duy; 0x42uy; 0x6euy
]
in
assert_norm (List.Tot.length l == 32);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l
let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 3
let test3_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy;
0xeduy; 0xb7uy; 0x44uy; 0x2fuy; 0x31uy; 0xdcuy; 0xb7uy; 0xb1uy;
0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xfcuy; 0x51uy; 0xcduy; 0x8euy; 0x62uy; 0x18uy; 0xa1uy; 0xa3uy;
0x8duy; 0xa4uy; 0x7euy; 0xd0uy; 0x02uy; 0x30uy; 0xf0uy; 0x58uy;
0x08uy; 0x16uy; 0xeduy; 0x13uy; 0xbauy; 0x33uy; 0x03uy; 0xacuy;
0x5duy; 0xebuy; 0x91uy; 0x15uy; 0x48uy; 0x90uy; 0x80uy; 0x25uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_msg : lbytes 2 =
let l = List.Tot.map u8_from_UInt8 [ 0xafuy; 0x82uy ] in
assert_norm (List.Tot.length l == 2);
of_list l
let test3_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x62uy; 0x91uy; 0xd6uy; 0x57uy; 0xdeuy; 0xecuy; 0x24uy; 0x02uy;
0x48uy; 0x27uy; 0xe6uy; 0x9cuy; 0x3auy; 0xbeuy; 0x01uy; 0xa3uy;
0x0cuy; 0xe5uy; 0x48uy; 0xa2uy; 0x84uy; 0x74uy; 0x3auy; 0x44uy;
0x5euy; 0x36uy; 0x80uy; 0xd7uy; 0xdbuy; 0x5auy; 0xc3uy; 0xacuy;
0x18uy; 0xffuy; 0x9buy; 0x53uy; 0x8duy; 0x16uy; 0xf2uy; 0x90uy;
0xaeuy; 0x67uy; 0xf7uy; 0x60uy; 0x98uy; 0x4duy; 0xc6uy; 0x59uy;
0x4auy; 0x7cuy; 0x15uy; 0xe9uy; 0x71uy; 0x6euy; 0xd2uy; 0x8duy;
0xc0uy; 0x27uy; 0xbeuy; 0xceuy; 0xeauy; 0x1euy; 0xc4uy; 0x0auy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 4
let test4_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xf5uy; 0xe5uy; 0x76uy; 0x7cuy; 0xf1uy; 0x53uy; 0x31uy; 0x95uy;
0x17uy; 0x63uy; 0x0fuy; 0x22uy; 0x68uy; 0x76uy; 0xb8uy; 0x6cuy;
0x81uy; 0x60uy; 0xccuy; 0x58uy; 0x3buy; 0xc0uy; 0x13uy; 0x74uy;
0x4cuy; 0x6buy; 0xf2uy; 0x55uy; 0xf5uy; 0xccuy; 0x0euy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test4_pk:lbytes 32 | [] | Spec.Ed25519.Test.test4_pk | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 32 | {
"end_col": 11,
"end_line": 170,
"start_col": 26,
"start_line": 162
} |
Prims.Tot | val test2_pk:lbytes 32 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l | val test2_pk:lbytes 32
let test2_pk:lbytes 32 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy; 0x92uy; 0xb7uy; 0x0auy; 0xa7uy;
0x4duy; 0x1buy; 0x7euy; 0xbcuy; 0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
]
in
assert_norm (List.Tot.length l == 32);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test2_pk:lbytes 32 | [] | Spec.Ed25519.Test.test2_pk | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 32 | {
"end_col": 11,
"end_line": 80,
"start_col": 26,
"start_line": 72
} |
Prims.Tot | val test3_pk:lbytes 32 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test3_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xfcuy; 0x51uy; 0xcduy; 0x8euy; 0x62uy; 0x18uy; 0xa1uy; 0xa3uy;
0x8duy; 0xa4uy; 0x7euy; 0xd0uy; 0x02uy; 0x30uy; 0xf0uy; 0x58uy;
0x08uy; 0x16uy; 0xeduy; 0x13uy; 0xbauy; 0x33uy; 0x03uy; 0xacuy;
0x5duy; 0xebuy; 0x91uy; 0x15uy; 0x48uy; 0x90uy; 0x80uy; 0x25uy
] in
assert_norm (List.Tot.length l == 32);
of_list l | val test3_pk:lbytes 32
let test3_pk:lbytes 32 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0xfcuy; 0x51uy; 0xcduy; 0x8euy; 0x62uy; 0x18uy; 0xa1uy; 0xa3uy; 0x8duy; 0xa4uy; 0x7euy; 0xd0uy;
0x02uy; 0x30uy; 0xf0uy; 0x58uy; 0x08uy; 0x16uy; 0xeduy; 0x13uy; 0xbauy; 0x33uy; 0x03uy; 0xacuy;
0x5duy; 0xebuy; 0x91uy; 0x15uy; 0x48uy; 0x90uy; 0x80uy; 0x25uy
]
in
assert_norm (List.Tot.length l == 32);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l
let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 3
let test3_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy;
0xeduy; 0xb7uy; 0x44uy; 0x2fuy; 0x31uy; 0xdcuy; 0xb7uy; 0xb1uy;
0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
] in
assert_norm (List.Tot.length l == 32);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test3_pk:lbytes 32 | [] | Spec.Ed25519.Test.test3_pk | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 32 | {
"end_col": 11,
"end_line": 125,
"start_col": 26,
"start_line": 117
} |
Prims.Tot | val test1_expected_sig:lbytes 64 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l | val test1_expected_sig:lbytes 64
let test1_expected_sig:lbytes 64 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy; 0x90uy; 0x86uy; 0xe2uy; 0xccuy;
0x80uy; 0x6euy; 0x82uy; 0x8auy; 0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy; 0x5fuy; 0xb8uy; 0x82uy; 0x15uy;
0x90uy; 0xa3uy; 0x3buy; 0xacuy; 0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy; 0x65uy; 0x51uy; 0x41uy; 0x43uy;
0x8euy; 0x7auy; 0x10uy; 0x0buy
]
in
assert_norm (List.Tot.length l == 64);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test1_expected_sig:lbytes 64 | [] | Spec.Ed25519.Test.test1_expected_sig | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 64 | {
"end_col": 11,
"end_line": 56,
"start_col": 36,
"start_line": 44
} |
Prims.Tot | val test2_expected_sig:lbytes 64 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l | val test2_expected_sig:lbytes 64
let test2_expected_sig:lbytes 64 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy; 0x72uy; 0x0euy; 0x82uy; 0x0buy;
0x5fuy; 0x64uy; 0x25uy; 0x40uy; 0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy; 0x08uy; 0x5auy; 0xc1uy; 0xe4uy;
0x3euy; 0x15uy; 0x99uy; 0x6euy; 0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy; 0xb0uy; 0x0duy; 0x29uy; 0x16uy;
0x12uy; 0xbbuy; 0x0cuy; 0x00uy
]
in
assert_norm (List.Tot.length l == 64);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test2_expected_sig:lbytes 64 | [] | Spec.Ed25519.Test.test2_expected_sig | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 64 | {
"end_col": 11,
"end_line": 101,
"start_col": 36,
"start_line": 89
} |
Prims.Tot | val test3_expected_sig:lbytes 64 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test3_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x62uy; 0x91uy; 0xd6uy; 0x57uy; 0xdeuy; 0xecuy; 0x24uy; 0x02uy;
0x48uy; 0x27uy; 0xe6uy; 0x9cuy; 0x3auy; 0xbeuy; 0x01uy; 0xa3uy;
0x0cuy; 0xe5uy; 0x48uy; 0xa2uy; 0x84uy; 0x74uy; 0x3auy; 0x44uy;
0x5euy; 0x36uy; 0x80uy; 0xd7uy; 0xdbuy; 0x5auy; 0xc3uy; 0xacuy;
0x18uy; 0xffuy; 0x9buy; 0x53uy; 0x8duy; 0x16uy; 0xf2uy; 0x90uy;
0xaeuy; 0x67uy; 0xf7uy; 0x60uy; 0x98uy; 0x4duy; 0xc6uy; 0x59uy;
0x4auy; 0x7cuy; 0x15uy; 0xe9uy; 0x71uy; 0x6euy; 0xd2uy; 0x8duy;
0xc0uy; 0x27uy; 0xbeuy; 0xceuy; 0xeauy; 0x1euy; 0xc4uy; 0x0auy
] in
assert_norm (List.Tot.length l == 64);
of_list l | val test3_expected_sig:lbytes 64
let test3_expected_sig:lbytes 64 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0x62uy; 0x91uy; 0xd6uy; 0x57uy; 0xdeuy; 0xecuy; 0x24uy; 0x02uy; 0x48uy; 0x27uy; 0xe6uy; 0x9cuy;
0x3auy; 0xbeuy; 0x01uy; 0xa3uy; 0x0cuy; 0xe5uy; 0x48uy; 0xa2uy; 0x84uy; 0x74uy; 0x3auy; 0x44uy;
0x5euy; 0x36uy; 0x80uy; 0xd7uy; 0xdbuy; 0x5auy; 0xc3uy; 0xacuy; 0x18uy; 0xffuy; 0x9buy; 0x53uy;
0x8duy; 0x16uy; 0xf2uy; 0x90uy; 0xaeuy; 0x67uy; 0xf7uy; 0x60uy; 0x98uy; 0x4duy; 0xc6uy; 0x59uy;
0x4auy; 0x7cuy; 0x15uy; 0xe9uy; 0x71uy; 0x6euy; 0xd2uy; 0x8duy; 0xc0uy; 0x27uy; 0xbeuy; 0xceuy;
0xeauy; 0x1euy; 0xc4uy; 0x0auy
]
in
assert_norm (List.Tot.length l == 64);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l
let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 3
let test3_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy;
0xeduy; 0xb7uy; 0x44uy; 0x2fuy; 0x31uy; 0xdcuy; 0xb7uy; 0xb1uy;
0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xfcuy; 0x51uy; 0xcduy; 0x8euy; 0x62uy; 0x18uy; 0xa1uy; 0xa3uy;
0x8duy; 0xa4uy; 0x7euy; 0xd0uy; 0x02uy; 0x30uy; 0xf0uy; 0x58uy;
0x08uy; 0x16uy; 0xeduy; 0x13uy; 0xbauy; 0x33uy; 0x03uy; 0xacuy;
0x5duy; 0xebuy; 0x91uy; 0x15uy; 0x48uy; 0x90uy; 0x80uy; 0x25uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_msg : lbytes 2 =
let l = List.Tot.map u8_from_UInt8 [ 0xafuy; 0x82uy ] in
assert_norm (List.Tot.length l == 2);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test3_expected_sig:lbytes 64 | [] | Spec.Ed25519.Test.test3_expected_sig | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 64 | {
"end_col": 11,
"end_line": 146,
"start_col": 36,
"start_line": 134
} |
Prims.Tot | val test_vectors:list vec | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test_vectors : list vec = [
Vec test1_sk test1_pk test1_msg test1_expected_sig;
Vec test2_sk test2_pk test2_msg test2_expected_sig;
Vec test3_sk test3_pk test3_msg test3_expected_sig;
Vec test4_sk test4_pk test4_msg test4_expected_sig ] | val test_vectors:list vec
let test_vectors:list vec = | false | null | false | [
Vec test1_sk test1_pk test1_msg test1_expected_sig;
Vec test2_sk test2_pk test2_msg test2_expected_sig;
Vec test3_sk test3_pk test3_msg test3_expected_sig;
Vec test4_sk test4_pk test4_msg test4_expected_sig
] | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"total"
] | [
"Prims.Cons",
"Spec.Ed25519.Test.vec",
"Spec.Ed25519.Test.Vec",
"Spec.Ed25519.Test.test1_sk",
"Spec.Ed25519.Test.test1_pk",
"Spec.Ed25519.Test.test1_msg",
"Spec.Ed25519.Test.test1_expected_sig",
"Spec.Ed25519.Test.test2_sk",
"Spec.Ed25519.Test.test2_pk",
"Spec.Ed25519.Test.test2_msg",
"Spec.Ed25519.Test.test2_expected_sig",
"Spec.Ed25519.Test.test3_sk",
"Spec.Ed25519.Test.test3_pk",
"Spec.Ed25519.Test.test3_msg",
"Spec.Ed25519.Test.test3_expected_sig",
"Spec.Ed25519.Test.test4_sk",
"Spec.Ed25519.Test.test4_pk",
"Spec.Ed25519.Test.test4_msg",
"Spec.Ed25519.Test.test4_expected_sig",
"Prims.Nil"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l
let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 3
let test3_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy;
0xeduy; 0xb7uy; 0x44uy; 0x2fuy; 0x31uy; 0xdcuy; 0xb7uy; 0xb1uy;
0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xfcuy; 0x51uy; 0xcduy; 0x8euy; 0x62uy; 0x18uy; 0xa1uy; 0xa3uy;
0x8duy; 0xa4uy; 0x7euy; 0xd0uy; 0x02uy; 0x30uy; 0xf0uy; 0x58uy;
0x08uy; 0x16uy; 0xeduy; 0x13uy; 0xbauy; 0x33uy; 0x03uy; 0xacuy;
0x5duy; 0xebuy; 0x91uy; 0x15uy; 0x48uy; 0x90uy; 0x80uy; 0x25uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_msg : lbytes 2 =
let l = List.Tot.map u8_from_UInt8 [ 0xafuy; 0x82uy ] in
assert_norm (List.Tot.length l == 2);
of_list l
let test3_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x62uy; 0x91uy; 0xd6uy; 0x57uy; 0xdeuy; 0xecuy; 0x24uy; 0x02uy;
0x48uy; 0x27uy; 0xe6uy; 0x9cuy; 0x3auy; 0xbeuy; 0x01uy; 0xa3uy;
0x0cuy; 0xe5uy; 0x48uy; 0xa2uy; 0x84uy; 0x74uy; 0x3auy; 0x44uy;
0x5euy; 0x36uy; 0x80uy; 0xd7uy; 0xdbuy; 0x5auy; 0xc3uy; 0xacuy;
0x18uy; 0xffuy; 0x9buy; 0x53uy; 0x8duy; 0x16uy; 0xf2uy; 0x90uy;
0xaeuy; 0x67uy; 0xf7uy; 0x60uy; 0x98uy; 0x4duy; 0xc6uy; 0x59uy;
0x4auy; 0x7cuy; 0x15uy; 0xe9uy; 0x71uy; 0x6euy; 0xd2uy; 0x8duy;
0xc0uy; 0x27uy; 0xbeuy; 0xceuy; 0xeauy; 0x1euy; 0xc4uy; 0x0auy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 4
let test4_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xf5uy; 0xe5uy; 0x76uy; 0x7cuy; 0xf1uy; 0x53uy; 0x31uy; 0x95uy;
0x17uy; 0x63uy; 0x0fuy; 0x22uy; 0x68uy; 0x76uy; 0xb8uy; 0x6cuy;
0x81uy; 0x60uy; 0xccuy; 0x58uy; 0x3buy; 0xc0uy; 0x13uy; 0x74uy;
0x4cuy; 0x6buy; 0xf2uy; 0x55uy; 0xf5uy; 0xccuy; 0x0euy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test4_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x27uy; 0x81uy; 0x17uy; 0xfcuy; 0x14uy; 0x4cuy; 0x72uy; 0x34uy;
0x0fuy; 0x67uy; 0xd0uy; 0xf2uy; 0x31uy; 0x6euy; 0x83uy; 0x86uy;
0xceuy; 0xffuy; 0xbfuy; 0x2buy; 0x24uy; 0x28uy; 0xc9uy; 0xc5uy;
0x1fuy; 0xefuy; 0x7cuy; 0x59uy; 0x7fuy; 0x1duy; 0x42uy; 0x6euy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test4_msg : lbytes 1023 =
let l = List.Tot.map u8_from_UInt8 [
0x08uy; 0xb8uy; 0xb2uy; 0xb7uy; 0x33uy; 0x42uy; 0x42uy; 0x43uy;
0x76uy; 0x0fuy; 0xe4uy; 0x26uy; 0xa4uy; 0xb5uy; 0x49uy; 0x08uy;
0x63uy; 0x21uy; 0x10uy; 0xa6uy; 0x6cuy; 0x2fuy; 0x65uy; 0x91uy;
0xeauy; 0xbduy; 0x33uy; 0x45uy; 0xe3uy; 0xe4uy; 0xebuy; 0x98uy;
0xfauy; 0x6euy; 0x26uy; 0x4buy; 0xf0uy; 0x9euy; 0xfeuy; 0x12uy;
0xeeuy; 0x50uy; 0xf8uy; 0xf5uy; 0x4euy; 0x9fuy; 0x77uy; 0xb1uy;
0xe3uy; 0x55uy; 0xf6uy; 0xc5uy; 0x05uy; 0x44uy; 0xe2uy; 0x3fuy;
0xb1uy; 0x43uy; 0x3duy; 0xdfuy; 0x73uy; 0xbeuy; 0x84uy; 0xd8uy;
0x79uy; 0xdeuy; 0x7cuy; 0x00uy; 0x46uy; 0xdcuy; 0x49uy; 0x96uy;
0xd9uy; 0xe7uy; 0x73uy; 0xf4uy; 0xbcuy; 0x9euy; 0xfeuy; 0x57uy;
0x38uy; 0x82uy; 0x9auy; 0xdbuy; 0x26uy; 0xc8uy; 0x1buy; 0x37uy;
0xc9uy; 0x3auy; 0x1buy; 0x27uy; 0x0buy; 0x20uy; 0x32uy; 0x9duy;
0x65uy; 0x86uy; 0x75uy; 0xfcuy; 0x6euy; 0xa5uy; 0x34uy; 0xe0uy;
0x81uy; 0x0auy; 0x44uy; 0x32uy; 0x82uy; 0x6buy; 0xf5uy; 0x8cuy;
0x94uy; 0x1euy; 0xfbuy; 0x65uy; 0xd5uy; 0x7auy; 0x33uy; 0x8buy;
0xbduy; 0x2euy; 0x26uy; 0x64uy; 0x0fuy; 0x89uy; 0xffuy; 0xbcuy;
0x1auy; 0x85uy; 0x8euy; 0xfcuy; 0xb8uy; 0x55uy; 0x0euy; 0xe3uy;
0xa5uy; 0xe1uy; 0x99uy; 0x8buy; 0xd1uy; 0x77uy; 0xe9uy; 0x3auy;
0x73uy; 0x63uy; 0xc3uy; 0x44uy; 0xfeuy; 0x6buy; 0x19uy; 0x9euy;
0xe5uy; 0xd0uy; 0x2euy; 0x82uy; 0xd5uy; 0x22uy; 0xc4uy; 0xfeuy;
0xbauy; 0x15uy; 0x45uy; 0x2fuy; 0x80uy; 0x28uy; 0x8auy; 0x82uy;
0x1auy; 0x57uy; 0x91uy; 0x16uy; 0xecuy; 0x6duy; 0xaduy; 0x2buy;
0x3buy; 0x31uy; 0x0duy; 0xa9uy; 0x03uy; 0x40uy; 0x1auy; 0xa6uy;
0x21uy; 0x00uy; 0xabuy; 0x5duy; 0x1auy; 0x36uy; 0x55uy; 0x3euy;
0x06uy; 0x20uy; 0x3buy; 0x33uy; 0x89uy; 0x0cuy; 0xc9uy; 0xb8uy;
0x32uy; 0xf7uy; 0x9euy; 0xf8uy; 0x05uy; 0x60uy; 0xccuy; 0xb9uy;
0xa3uy; 0x9cuy; 0xe7uy; 0x67uy; 0x96uy; 0x7euy; 0xd6uy; 0x28uy;
0xc6uy; 0xaduy; 0x57uy; 0x3cuy; 0xb1uy; 0x16uy; 0xdbuy; 0xefuy;
0xefuy; 0xd7uy; 0x54uy; 0x99uy; 0xdauy; 0x96uy; 0xbduy; 0x68uy;
0xa8uy; 0xa9uy; 0x7buy; 0x92uy; 0x8auy; 0x8buy; 0xbcuy; 0x10uy;
0x3buy; 0x66uy; 0x21uy; 0xfcuy; 0xdeuy; 0x2buy; 0xecuy; 0xa1uy;
0x23uy; 0x1duy; 0x20uy; 0x6buy; 0xe6uy; 0xcduy; 0x9euy; 0xc7uy;
0xafuy; 0xf6uy; 0xf6uy; 0xc9uy; 0x4fuy; 0xcduy; 0x72uy; 0x04uy;
0xeduy; 0x34uy; 0x55uy; 0xc6uy; 0x8cuy; 0x83uy; 0xf4uy; 0xa4uy;
0x1duy; 0xa4uy; 0xafuy; 0x2buy; 0x74uy; 0xefuy; 0x5cuy; 0x53uy;
0xf1uy; 0xd8uy; 0xacuy; 0x70uy; 0xbduy; 0xcbuy; 0x7euy; 0xd1uy;
0x85uy; 0xceuy; 0x81uy; 0xbduy; 0x84uy; 0x35uy; 0x9duy; 0x44uy;
0x25uy; 0x4duy; 0x95uy; 0x62uy; 0x9euy; 0x98uy; 0x55uy; 0xa9uy;
0x4auy; 0x7cuy; 0x19uy; 0x58uy; 0xd1uy; 0xf8uy; 0xaduy; 0xa5uy;
0xd0uy; 0x53uy; 0x2euy; 0xd8uy; 0xa5uy; 0xaauy; 0x3fuy; 0xb2uy;
0xd1uy; 0x7buy; 0xa7uy; 0x0euy; 0xb6uy; 0x24uy; 0x8euy; 0x59uy;
0x4euy; 0x1auy; 0x22uy; 0x97uy; 0xacuy; 0xbbuy; 0xb3uy; 0x9duy;
0x50uy; 0x2fuy; 0x1auy; 0x8cuy; 0x6euy; 0xb6uy; 0xf1uy; 0xceuy;
0x22uy; 0xb3uy; 0xdeuy; 0x1auy; 0x1fuy; 0x40uy; 0xccuy; 0x24uy;
0x55uy; 0x41uy; 0x19uy; 0xa8uy; 0x31uy; 0xa9uy; 0xaauy; 0xd6uy;
0x07uy; 0x9cuy; 0xaduy; 0x88uy; 0x42uy; 0x5duy; 0xe6uy; 0xbduy;
0xe1uy; 0xa9uy; 0x18uy; 0x7euy; 0xbbuy; 0x60uy; 0x92uy; 0xcfuy;
0x67uy; 0xbfuy; 0x2buy; 0x13uy; 0xfduy; 0x65uy; 0xf2uy; 0x70uy;
0x88uy; 0xd7uy; 0x8buy; 0x7euy; 0x88uy; 0x3cuy; 0x87uy; 0x59uy;
0xd2uy; 0xc4uy; 0xf5uy; 0xc6uy; 0x5auy; 0xdbuy; 0x75uy; 0x53uy;
0x87uy; 0x8auy; 0xd5uy; 0x75uy; 0xf9uy; 0xfauy; 0xd8uy; 0x78uy;
0xe8uy; 0x0auy; 0x0cuy; 0x9buy; 0xa6uy; 0x3buy; 0xcbuy; 0xccuy;
0x27uy; 0x32uy; 0xe6uy; 0x94uy; 0x85uy; 0xbbuy; 0xc9uy; 0xc9uy;
0x0buy; 0xfbuy; 0xd6uy; 0x24uy; 0x81uy; 0xd9uy; 0x08uy; 0x9buy;
0xecuy; 0xcfuy; 0x80uy; 0xcfuy; 0xe2uy; 0xdfuy; 0x16uy; 0xa2uy;
0xcfuy; 0x65uy; 0xbduy; 0x92uy; 0xdduy; 0x59uy; 0x7buy; 0x07uy;
0x07uy; 0xe0uy; 0x91uy; 0x7auy; 0xf4uy; 0x8buy; 0xbbuy; 0x75uy;
0xfeuy; 0xd4uy; 0x13uy; 0xd2uy; 0x38uy; 0xf5uy; 0x55uy; 0x5auy;
0x7auy; 0x56uy; 0x9duy; 0x80uy; 0xc3uy; 0x41uy; 0x4auy; 0x8duy;
0x08uy; 0x59uy; 0xdcuy; 0x65uy; 0xa4uy; 0x61uy; 0x28uy; 0xbauy;
0xb2uy; 0x7auy; 0xf8uy; 0x7auy; 0x71uy; 0x31uy; 0x4fuy; 0x31uy;
0x8cuy; 0x78uy; 0x2buy; 0x23uy; 0xebuy; 0xfeuy; 0x80uy; 0x8buy;
0x82uy; 0xb0uy; 0xceuy; 0x26uy; 0x40uy; 0x1duy; 0x2euy; 0x22uy;
0xf0uy; 0x4duy; 0x83uy; 0xd1uy; 0x25uy; 0x5duy; 0xc5uy; 0x1auy;
0xdduy; 0xd3uy; 0xb7uy; 0x5auy; 0x2buy; 0x1auy; 0xe0uy; 0x78uy;
0x45uy; 0x04uy; 0xdfuy; 0x54uy; 0x3auy; 0xf8uy; 0x96uy; 0x9buy;
0xe3uy; 0xeauy; 0x70uy; 0x82uy; 0xffuy; 0x7fuy; 0xc9uy; 0x88uy;
0x8cuy; 0x14uy; 0x4duy; 0xa2uy; 0xafuy; 0x58uy; 0x42uy; 0x9euy;
0xc9uy; 0x60uy; 0x31uy; 0xdbuy; 0xcauy; 0xd3uy; 0xdauy; 0xd9uy;
0xafuy; 0x0duy; 0xcbuy; 0xaauy; 0xafuy; 0x26uy; 0x8cuy; 0xb8uy;
0xfcuy; 0xffuy; 0xeauy; 0xd9uy; 0x4fuy; 0x3cuy; 0x7cuy; 0xa4uy;
0x95uy; 0xe0uy; 0x56uy; 0xa9uy; 0xb4uy; 0x7auy; 0xcduy; 0xb7uy;
0x51uy; 0xfbuy; 0x73uy; 0xe6uy; 0x66uy; 0xc6uy; 0xc6uy; 0x55uy;
0xaduy; 0xe8uy; 0x29uy; 0x72uy; 0x97uy; 0xd0uy; 0x7auy; 0xd1uy;
0xbauy; 0x5euy; 0x43uy; 0xf1uy; 0xbcuy; 0xa3uy; 0x23uy; 0x01uy;
0x65uy; 0x13uy; 0x39uy; 0xe2uy; 0x29uy; 0x04uy; 0xccuy; 0x8cuy;
0x42uy; 0xf5uy; 0x8cuy; 0x30uy; 0xc0uy; 0x4auy; 0xafuy; 0xdbuy;
0x03uy; 0x8duy; 0xdauy; 0x08uy; 0x47uy; 0xdduy; 0x98uy; 0x8duy;
0xcduy; 0xa6uy; 0xf3uy; 0xbfuy; 0xd1uy; 0x5cuy; 0x4buy; 0x4cuy;
0x45uy; 0x25uy; 0x00uy; 0x4auy; 0xa0uy; 0x6euy; 0xefuy; 0xf8uy;
0xcauy; 0x61uy; 0x78uy; 0x3auy; 0xacuy; 0xecuy; 0x57uy; 0xfbuy;
0x3duy; 0x1fuy; 0x92uy; 0xb0uy; 0xfeuy; 0x2fuy; 0xd1uy; 0xa8uy;
0x5fuy; 0x67uy; 0x24uy; 0x51uy; 0x7buy; 0x65uy; 0xe6uy; 0x14uy;
0xaduy; 0x68uy; 0x08uy; 0xd6uy; 0xf6uy; 0xeeuy; 0x34uy; 0xdfuy;
0xf7uy; 0x31uy; 0x0fuy; 0xdcuy; 0x82uy; 0xaeuy; 0xbfuy; 0xd9uy;
0x04uy; 0xb0uy; 0x1euy; 0x1duy; 0xc5uy; 0x4buy; 0x29uy; 0x27uy;
0x09uy; 0x4buy; 0x2duy; 0xb6uy; 0x8duy; 0x6fuy; 0x90uy; 0x3buy;
0x68uy; 0x40uy; 0x1auy; 0xdeuy; 0xbfuy; 0x5auy; 0x7euy; 0x08uy;
0xd7uy; 0x8fuy; 0xf4uy; 0xefuy; 0x5duy; 0x63uy; 0x65uy; 0x3auy;
0x65uy; 0x04uy; 0x0cuy; 0xf9uy; 0xbfuy; 0xd4uy; 0xacuy; 0xa7uy;
0x98uy; 0x4auy; 0x74uy; 0xd3uy; 0x71uy; 0x45uy; 0x98uy; 0x67uy;
0x80uy; 0xfcuy; 0x0buy; 0x16uy; 0xacuy; 0x45uy; 0x16uy; 0x49uy;
0xdeuy; 0x61uy; 0x88uy; 0xa7uy; 0xdbuy; 0xdfuy; 0x19uy; 0x1fuy;
0x64uy; 0xb5uy; 0xfcuy; 0x5euy; 0x2auy; 0xb4uy; 0x7buy; 0x57uy;
0xf7uy; 0xf7uy; 0x27uy; 0x6cuy; 0xd4uy; 0x19uy; 0xc1uy; 0x7auy;
0x3cuy; 0xa8uy; 0xe1uy; 0xb9uy; 0x39uy; 0xaeuy; 0x49uy; 0xe4uy;
0x88uy; 0xacuy; 0xbauy; 0x6buy; 0x96uy; 0x56uy; 0x10uy; 0xb5uy;
0x48uy; 0x01uy; 0x09uy; 0xc8uy; 0xb1uy; 0x7buy; 0x80uy; 0xe1uy;
0xb7uy; 0xb7uy; 0x50uy; 0xdfuy; 0xc7uy; 0x59uy; 0x8duy; 0x5duy;
0x50uy; 0x11uy; 0xfduy; 0x2duy; 0xccuy; 0x56uy; 0x00uy; 0xa3uy;
0x2euy; 0xf5uy; 0xb5uy; 0x2auy; 0x1euy; 0xccuy; 0x82uy; 0x0euy;
0x30uy; 0x8auy; 0xa3uy; 0x42uy; 0x72uy; 0x1auy; 0xacuy; 0x09uy;
0x43uy; 0xbfuy; 0x66uy; 0x86uy; 0xb6uy; 0x4buy; 0x25uy; 0x79uy;
0x37uy; 0x65uy; 0x04uy; 0xccuy; 0xc4uy; 0x93uy; 0xd9uy; 0x7euy;
0x6auy; 0xeduy; 0x3fuy; 0xb0uy; 0xf9uy; 0xcduy; 0x71uy; 0xa4uy;
0x3duy; 0xd4uy; 0x97uy; 0xf0uy; 0x1fuy; 0x17uy; 0xc0uy; 0xe2uy;
0xcbuy; 0x37uy; 0x97uy; 0xaauy; 0x2auy; 0x2fuy; 0x25uy; 0x66uy;
0x56uy; 0x16uy; 0x8euy; 0x6cuy; 0x49uy; 0x6auy; 0xfcuy; 0x5fuy;
0xb9uy; 0x32uy; 0x46uy; 0xf6uy; 0xb1uy; 0x11uy; 0x63uy; 0x98uy;
0xa3uy; 0x46uy; 0xf1uy; 0xa6uy; 0x41uy; 0xf3uy; 0xb0uy; 0x41uy;
0xe9uy; 0x89uy; 0xf7uy; 0x91uy; 0x4fuy; 0x90uy; 0xccuy; 0x2cuy;
0x7fuy; 0xffuy; 0x35uy; 0x78uy; 0x76uy; 0xe5uy; 0x06uy; 0xb5uy;
0x0duy; 0x33uy; 0x4buy; 0xa7uy; 0x7cuy; 0x22uy; 0x5buy; 0xc3uy;
0x07uy; 0xbauy; 0x53uy; 0x71uy; 0x52uy; 0xf3uy; 0xf1uy; 0x61uy;
0x0euy; 0x4euy; 0xafuy; 0xe5uy; 0x95uy; 0xf6uy; 0xd9uy; 0xd9uy;
0x0duy; 0x11uy; 0xfauy; 0xa9uy; 0x33uy; 0xa1uy; 0x5euy; 0xf1uy;
0x36uy; 0x95uy; 0x46uy; 0x86uy; 0x8auy; 0x7fuy; 0x3auy; 0x45uy;
0xa9uy; 0x67uy; 0x68uy; 0xd4uy; 0x0fuy; 0xd9uy; 0xd0uy; 0x34uy;
0x12uy; 0xc0uy; 0x91uy; 0xc6uy; 0x31uy; 0x5cuy; 0xf4uy; 0xfduy;
0xe7uy; 0xcbuy; 0x68uy; 0x60uy; 0x69uy; 0x37uy; 0x38uy; 0x0duy;
0xb2uy; 0xeauy; 0xaauy; 0x70uy; 0x7buy; 0x4cuy; 0x41uy; 0x85uy;
0xc3uy; 0x2euy; 0xdduy; 0xcduy; 0xd3uy; 0x06uy; 0x70uy; 0x5euy;
0x4duy; 0xc1uy; 0xffuy; 0xc8uy; 0x72uy; 0xeeuy; 0xeeuy; 0x47uy;
0x5auy; 0x64uy; 0xdfuy; 0xacuy; 0x86uy; 0xabuy; 0xa4uy; 0x1cuy;
0x06uy; 0x18uy; 0x98uy; 0x3fuy; 0x87uy; 0x41uy; 0xc5uy; 0xefuy;
0x68uy; 0xd3uy; 0xa1uy; 0x01uy; 0xe8uy; 0xa3uy; 0xb8uy; 0xcauy;
0xc6uy; 0x0cuy; 0x90uy; 0x5cuy; 0x15uy; 0xfcuy; 0x91uy; 0x08uy;
0x40uy; 0xb9uy; 0x4cuy; 0x00uy; 0xa0uy; 0xb9uy; 0xd0uy
] in
assert_norm (List.Tot.length l == 1023);
of_list l
let test4_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x0auy; 0xabuy; 0x4cuy; 0x90uy; 0x05uy; 0x01uy; 0xb3uy; 0xe2uy;
0x4duy; 0x7cuy; 0xdfuy; 0x46uy; 0x63uy; 0x32uy; 0x6auy; 0x3auy;
0x87uy; 0xdfuy; 0x5euy; 0x48uy; 0x43uy; 0xb2uy; 0xcbuy; 0xdbuy;
0x67uy; 0xcbuy; 0xf6uy; 0xe4uy; 0x60uy; 0xfeuy; 0xc3uy; 0x50uy;
0xaauy; 0x53uy; 0x71uy; 0xb1uy; 0x50uy; 0x8fuy; 0x9fuy; 0x45uy;
0x28uy; 0xecuy; 0xeauy; 0x23uy; 0xc4uy; 0x36uy; 0xd9uy; 0x4buy;
0x5euy; 0x8fuy; 0xcduy; 0x4fuy; 0x68uy; 0x1euy; 0x30uy; 0xa6uy;
0xacuy; 0x00uy; 0xa9uy; 0x70uy; 0x4auy; 0x18uy; 0x8auy; 0x03uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
noeq type vec =
| Vec :
sk:lbytes 32
-> pk:lbytes 32
-> msg:bytes{length msg <= max_size_t}
-> expected_sig:lbytes 64 -> vec | false | true | Spec.Ed25519.Test.fst | {
"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"
} | null | val test_vectors:list vec | [] | Spec.Ed25519.Test.test_vectors | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Prims.list Spec.Ed25519.Test.vec | {
"end_col": 54,
"end_line": 334,
"start_col": 30,
"start_line": 330
} |
Prims.Tot | val test4_expected_sig:lbytes 64 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test4_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x0auy; 0xabuy; 0x4cuy; 0x90uy; 0x05uy; 0x01uy; 0xb3uy; 0xe2uy;
0x4duy; 0x7cuy; 0xdfuy; 0x46uy; 0x63uy; 0x32uy; 0x6auy; 0x3auy;
0x87uy; 0xdfuy; 0x5euy; 0x48uy; 0x43uy; 0xb2uy; 0xcbuy; 0xdbuy;
0x67uy; 0xcbuy; 0xf6uy; 0xe4uy; 0x60uy; 0xfeuy; 0xc3uy; 0x50uy;
0xaauy; 0x53uy; 0x71uy; 0xb1uy; 0x50uy; 0x8fuy; 0x9fuy; 0x45uy;
0x28uy; 0xecuy; 0xeauy; 0x23uy; 0xc4uy; 0x36uy; 0xd9uy; 0x4buy;
0x5euy; 0x8fuy; 0xcduy; 0x4fuy; 0x68uy; 0x1euy; 0x30uy; 0xa6uy;
0xacuy; 0x00uy; 0xa9uy; 0x70uy; 0x4auy; 0x18uy; 0x8auy; 0x03uy
] in
assert_norm (List.Tot.length l == 64);
of_list l | val test4_expected_sig:lbytes 64
let test4_expected_sig:lbytes 64 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0x0auy; 0xabuy; 0x4cuy; 0x90uy; 0x05uy; 0x01uy; 0xb3uy; 0xe2uy; 0x4duy; 0x7cuy; 0xdfuy; 0x46uy;
0x63uy; 0x32uy; 0x6auy; 0x3auy; 0x87uy; 0xdfuy; 0x5euy; 0x48uy; 0x43uy; 0xb2uy; 0xcbuy; 0xdbuy;
0x67uy; 0xcbuy; 0xf6uy; 0xe4uy; 0x60uy; 0xfeuy; 0xc3uy; 0x50uy; 0xaauy; 0x53uy; 0x71uy; 0xb1uy;
0x50uy; 0x8fuy; 0x9fuy; 0x45uy; 0x28uy; 0xecuy; 0xeauy; 0x23uy; 0xc4uy; 0x36uy; 0xd9uy; 0x4buy;
0x5euy; 0x8fuy; 0xcduy; 0x4fuy; 0x68uy; 0x1euy; 0x30uy; 0xa6uy; 0xacuy; 0x00uy; 0xa9uy; 0x70uy;
0x4auy; 0x18uy; 0x8auy; 0x03uy
]
in
assert_norm (List.Tot.length l == 64);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l
let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 3
let test3_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy;
0xeduy; 0xb7uy; 0x44uy; 0x2fuy; 0x31uy; 0xdcuy; 0xb7uy; 0xb1uy;
0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xfcuy; 0x51uy; 0xcduy; 0x8euy; 0x62uy; 0x18uy; 0xa1uy; 0xa3uy;
0x8duy; 0xa4uy; 0x7euy; 0xd0uy; 0x02uy; 0x30uy; 0xf0uy; 0x58uy;
0x08uy; 0x16uy; 0xeduy; 0x13uy; 0xbauy; 0x33uy; 0x03uy; 0xacuy;
0x5duy; 0xebuy; 0x91uy; 0x15uy; 0x48uy; 0x90uy; 0x80uy; 0x25uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_msg : lbytes 2 =
let l = List.Tot.map u8_from_UInt8 [ 0xafuy; 0x82uy ] in
assert_norm (List.Tot.length l == 2);
of_list l
let test3_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x62uy; 0x91uy; 0xd6uy; 0x57uy; 0xdeuy; 0xecuy; 0x24uy; 0x02uy;
0x48uy; 0x27uy; 0xe6uy; 0x9cuy; 0x3auy; 0xbeuy; 0x01uy; 0xa3uy;
0x0cuy; 0xe5uy; 0x48uy; 0xa2uy; 0x84uy; 0x74uy; 0x3auy; 0x44uy;
0x5euy; 0x36uy; 0x80uy; 0xd7uy; 0xdbuy; 0x5auy; 0xc3uy; 0xacuy;
0x18uy; 0xffuy; 0x9buy; 0x53uy; 0x8duy; 0x16uy; 0xf2uy; 0x90uy;
0xaeuy; 0x67uy; 0xf7uy; 0x60uy; 0x98uy; 0x4duy; 0xc6uy; 0x59uy;
0x4auy; 0x7cuy; 0x15uy; 0xe9uy; 0x71uy; 0x6euy; 0xd2uy; 0x8duy;
0xc0uy; 0x27uy; 0xbeuy; 0xceuy; 0xeauy; 0x1euy; 0xc4uy; 0x0auy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 4
let test4_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xf5uy; 0xe5uy; 0x76uy; 0x7cuy; 0xf1uy; 0x53uy; 0x31uy; 0x95uy;
0x17uy; 0x63uy; 0x0fuy; 0x22uy; 0x68uy; 0x76uy; 0xb8uy; 0x6cuy;
0x81uy; 0x60uy; 0xccuy; 0x58uy; 0x3buy; 0xc0uy; 0x13uy; 0x74uy;
0x4cuy; 0x6buy; 0xf2uy; 0x55uy; 0xf5uy; 0xccuy; 0x0euy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test4_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x27uy; 0x81uy; 0x17uy; 0xfcuy; 0x14uy; 0x4cuy; 0x72uy; 0x34uy;
0x0fuy; 0x67uy; 0xd0uy; 0xf2uy; 0x31uy; 0x6euy; 0x83uy; 0x86uy;
0xceuy; 0xffuy; 0xbfuy; 0x2buy; 0x24uy; 0x28uy; 0xc9uy; 0xc5uy;
0x1fuy; 0xefuy; 0x7cuy; 0x59uy; 0x7fuy; 0x1duy; 0x42uy; 0x6euy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test4_msg : lbytes 1023 =
let l = List.Tot.map u8_from_UInt8 [
0x08uy; 0xb8uy; 0xb2uy; 0xb7uy; 0x33uy; 0x42uy; 0x42uy; 0x43uy;
0x76uy; 0x0fuy; 0xe4uy; 0x26uy; 0xa4uy; 0xb5uy; 0x49uy; 0x08uy;
0x63uy; 0x21uy; 0x10uy; 0xa6uy; 0x6cuy; 0x2fuy; 0x65uy; 0x91uy;
0xeauy; 0xbduy; 0x33uy; 0x45uy; 0xe3uy; 0xe4uy; 0xebuy; 0x98uy;
0xfauy; 0x6euy; 0x26uy; 0x4buy; 0xf0uy; 0x9euy; 0xfeuy; 0x12uy;
0xeeuy; 0x50uy; 0xf8uy; 0xf5uy; 0x4euy; 0x9fuy; 0x77uy; 0xb1uy;
0xe3uy; 0x55uy; 0xf6uy; 0xc5uy; 0x05uy; 0x44uy; 0xe2uy; 0x3fuy;
0xb1uy; 0x43uy; 0x3duy; 0xdfuy; 0x73uy; 0xbeuy; 0x84uy; 0xd8uy;
0x79uy; 0xdeuy; 0x7cuy; 0x00uy; 0x46uy; 0xdcuy; 0x49uy; 0x96uy;
0xd9uy; 0xe7uy; 0x73uy; 0xf4uy; 0xbcuy; 0x9euy; 0xfeuy; 0x57uy;
0x38uy; 0x82uy; 0x9auy; 0xdbuy; 0x26uy; 0xc8uy; 0x1buy; 0x37uy;
0xc9uy; 0x3auy; 0x1buy; 0x27uy; 0x0buy; 0x20uy; 0x32uy; 0x9duy;
0x65uy; 0x86uy; 0x75uy; 0xfcuy; 0x6euy; 0xa5uy; 0x34uy; 0xe0uy;
0x81uy; 0x0auy; 0x44uy; 0x32uy; 0x82uy; 0x6buy; 0xf5uy; 0x8cuy;
0x94uy; 0x1euy; 0xfbuy; 0x65uy; 0xd5uy; 0x7auy; 0x33uy; 0x8buy;
0xbduy; 0x2euy; 0x26uy; 0x64uy; 0x0fuy; 0x89uy; 0xffuy; 0xbcuy;
0x1auy; 0x85uy; 0x8euy; 0xfcuy; 0xb8uy; 0x55uy; 0x0euy; 0xe3uy;
0xa5uy; 0xe1uy; 0x99uy; 0x8buy; 0xd1uy; 0x77uy; 0xe9uy; 0x3auy;
0x73uy; 0x63uy; 0xc3uy; 0x44uy; 0xfeuy; 0x6buy; 0x19uy; 0x9euy;
0xe5uy; 0xd0uy; 0x2euy; 0x82uy; 0xd5uy; 0x22uy; 0xc4uy; 0xfeuy;
0xbauy; 0x15uy; 0x45uy; 0x2fuy; 0x80uy; 0x28uy; 0x8auy; 0x82uy;
0x1auy; 0x57uy; 0x91uy; 0x16uy; 0xecuy; 0x6duy; 0xaduy; 0x2buy;
0x3buy; 0x31uy; 0x0duy; 0xa9uy; 0x03uy; 0x40uy; 0x1auy; 0xa6uy;
0x21uy; 0x00uy; 0xabuy; 0x5duy; 0x1auy; 0x36uy; 0x55uy; 0x3euy;
0x06uy; 0x20uy; 0x3buy; 0x33uy; 0x89uy; 0x0cuy; 0xc9uy; 0xb8uy;
0x32uy; 0xf7uy; 0x9euy; 0xf8uy; 0x05uy; 0x60uy; 0xccuy; 0xb9uy;
0xa3uy; 0x9cuy; 0xe7uy; 0x67uy; 0x96uy; 0x7euy; 0xd6uy; 0x28uy;
0xc6uy; 0xaduy; 0x57uy; 0x3cuy; 0xb1uy; 0x16uy; 0xdbuy; 0xefuy;
0xefuy; 0xd7uy; 0x54uy; 0x99uy; 0xdauy; 0x96uy; 0xbduy; 0x68uy;
0xa8uy; 0xa9uy; 0x7buy; 0x92uy; 0x8auy; 0x8buy; 0xbcuy; 0x10uy;
0x3buy; 0x66uy; 0x21uy; 0xfcuy; 0xdeuy; 0x2buy; 0xecuy; 0xa1uy;
0x23uy; 0x1duy; 0x20uy; 0x6buy; 0xe6uy; 0xcduy; 0x9euy; 0xc7uy;
0xafuy; 0xf6uy; 0xf6uy; 0xc9uy; 0x4fuy; 0xcduy; 0x72uy; 0x04uy;
0xeduy; 0x34uy; 0x55uy; 0xc6uy; 0x8cuy; 0x83uy; 0xf4uy; 0xa4uy;
0x1duy; 0xa4uy; 0xafuy; 0x2buy; 0x74uy; 0xefuy; 0x5cuy; 0x53uy;
0xf1uy; 0xd8uy; 0xacuy; 0x70uy; 0xbduy; 0xcbuy; 0x7euy; 0xd1uy;
0x85uy; 0xceuy; 0x81uy; 0xbduy; 0x84uy; 0x35uy; 0x9duy; 0x44uy;
0x25uy; 0x4duy; 0x95uy; 0x62uy; 0x9euy; 0x98uy; 0x55uy; 0xa9uy;
0x4auy; 0x7cuy; 0x19uy; 0x58uy; 0xd1uy; 0xf8uy; 0xaduy; 0xa5uy;
0xd0uy; 0x53uy; 0x2euy; 0xd8uy; 0xa5uy; 0xaauy; 0x3fuy; 0xb2uy;
0xd1uy; 0x7buy; 0xa7uy; 0x0euy; 0xb6uy; 0x24uy; 0x8euy; 0x59uy;
0x4euy; 0x1auy; 0x22uy; 0x97uy; 0xacuy; 0xbbuy; 0xb3uy; 0x9duy;
0x50uy; 0x2fuy; 0x1auy; 0x8cuy; 0x6euy; 0xb6uy; 0xf1uy; 0xceuy;
0x22uy; 0xb3uy; 0xdeuy; 0x1auy; 0x1fuy; 0x40uy; 0xccuy; 0x24uy;
0x55uy; 0x41uy; 0x19uy; 0xa8uy; 0x31uy; 0xa9uy; 0xaauy; 0xd6uy;
0x07uy; 0x9cuy; 0xaduy; 0x88uy; 0x42uy; 0x5duy; 0xe6uy; 0xbduy;
0xe1uy; 0xa9uy; 0x18uy; 0x7euy; 0xbbuy; 0x60uy; 0x92uy; 0xcfuy;
0x67uy; 0xbfuy; 0x2buy; 0x13uy; 0xfduy; 0x65uy; 0xf2uy; 0x70uy;
0x88uy; 0xd7uy; 0x8buy; 0x7euy; 0x88uy; 0x3cuy; 0x87uy; 0x59uy;
0xd2uy; 0xc4uy; 0xf5uy; 0xc6uy; 0x5auy; 0xdbuy; 0x75uy; 0x53uy;
0x87uy; 0x8auy; 0xd5uy; 0x75uy; 0xf9uy; 0xfauy; 0xd8uy; 0x78uy;
0xe8uy; 0x0auy; 0x0cuy; 0x9buy; 0xa6uy; 0x3buy; 0xcbuy; 0xccuy;
0x27uy; 0x32uy; 0xe6uy; 0x94uy; 0x85uy; 0xbbuy; 0xc9uy; 0xc9uy;
0x0buy; 0xfbuy; 0xd6uy; 0x24uy; 0x81uy; 0xd9uy; 0x08uy; 0x9buy;
0xecuy; 0xcfuy; 0x80uy; 0xcfuy; 0xe2uy; 0xdfuy; 0x16uy; 0xa2uy;
0xcfuy; 0x65uy; 0xbduy; 0x92uy; 0xdduy; 0x59uy; 0x7buy; 0x07uy;
0x07uy; 0xe0uy; 0x91uy; 0x7auy; 0xf4uy; 0x8buy; 0xbbuy; 0x75uy;
0xfeuy; 0xd4uy; 0x13uy; 0xd2uy; 0x38uy; 0xf5uy; 0x55uy; 0x5auy;
0x7auy; 0x56uy; 0x9duy; 0x80uy; 0xc3uy; 0x41uy; 0x4auy; 0x8duy;
0x08uy; 0x59uy; 0xdcuy; 0x65uy; 0xa4uy; 0x61uy; 0x28uy; 0xbauy;
0xb2uy; 0x7auy; 0xf8uy; 0x7auy; 0x71uy; 0x31uy; 0x4fuy; 0x31uy;
0x8cuy; 0x78uy; 0x2buy; 0x23uy; 0xebuy; 0xfeuy; 0x80uy; 0x8buy;
0x82uy; 0xb0uy; 0xceuy; 0x26uy; 0x40uy; 0x1duy; 0x2euy; 0x22uy;
0xf0uy; 0x4duy; 0x83uy; 0xd1uy; 0x25uy; 0x5duy; 0xc5uy; 0x1auy;
0xdduy; 0xd3uy; 0xb7uy; 0x5auy; 0x2buy; 0x1auy; 0xe0uy; 0x78uy;
0x45uy; 0x04uy; 0xdfuy; 0x54uy; 0x3auy; 0xf8uy; 0x96uy; 0x9buy;
0xe3uy; 0xeauy; 0x70uy; 0x82uy; 0xffuy; 0x7fuy; 0xc9uy; 0x88uy;
0x8cuy; 0x14uy; 0x4duy; 0xa2uy; 0xafuy; 0x58uy; 0x42uy; 0x9euy;
0xc9uy; 0x60uy; 0x31uy; 0xdbuy; 0xcauy; 0xd3uy; 0xdauy; 0xd9uy;
0xafuy; 0x0duy; 0xcbuy; 0xaauy; 0xafuy; 0x26uy; 0x8cuy; 0xb8uy;
0xfcuy; 0xffuy; 0xeauy; 0xd9uy; 0x4fuy; 0x3cuy; 0x7cuy; 0xa4uy;
0x95uy; 0xe0uy; 0x56uy; 0xa9uy; 0xb4uy; 0x7auy; 0xcduy; 0xb7uy;
0x51uy; 0xfbuy; 0x73uy; 0xe6uy; 0x66uy; 0xc6uy; 0xc6uy; 0x55uy;
0xaduy; 0xe8uy; 0x29uy; 0x72uy; 0x97uy; 0xd0uy; 0x7auy; 0xd1uy;
0xbauy; 0x5euy; 0x43uy; 0xf1uy; 0xbcuy; 0xa3uy; 0x23uy; 0x01uy;
0x65uy; 0x13uy; 0x39uy; 0xe2uy; 0x29uy; 0x04uy; 0xccuy; 0x8cuy;
0x42uy; 0xf5uy; 0x8cuy; 0x30uy; 0xc0uy; 0x4auy; 0xafuy; 0xdbuy;
0x03uy; 0x8duy; 0xdauy; 0x08uy; 0x47uy; 0xdduy; 0x98uy; 0x8duy;
0xcduy; 0xa6uy; 0xf3uy; 0xbfuy; 0xd1uy; 0x5cuy; 0x4buy; 0x4cuy;
0x45uy; 0x25uy; 0x00uy; 0x4auy; 0xa0uy; 0x6euy; 0xefuy; 0xf8uy;
0xcauy; 0x61uy; 0x78uy; 0x3auy; 0xacuy; 0xecuy; 0x57uy; 0xfbuy;
0x3duy; 0x1fuy; 0x92uy; 0xb0uy; 0xfeuy; 0x2fuy; 0xd1uy; 0xa8uy;
0x5fuy; 0x67uy; 0x24uy; 0x51uy; 0x7buy; 0x65uy; 0xe6uy; 0x14uy;
0xaduy; 0x68uy; 0x08uy; 0xd6uy; 0xf6uy; 0xeeuy; 0x34uy; 0xdfuy;
0xf7uy; 0x31uy; 0x0fuy; 0xdcuy; 0x82uy; 0xaeuy; 0xbfuy; 0xd9uy;
0x04uy; 0xb0uy; 0x1euy; 0x1duy; 0xc5uy; 0x4buy; 0x29uy; 0x27uy;
0x09uy; 0x4buy; 0x2duy; 0xb6uy; 0x8duy; 0x6fuy; 0x90uy; 0x3buy;
0x68uy; 0x40uy; 0x1auy; 0xdeuy; 0xbfuy; 0x5auy; 0x7euy; 0x08uy;
0xd7uy; 0x8fuy; 0xf4uy; 0xefuy; 0x5duy; 0x63uy; 0x65uy; 0x3auy;
0x65uy; 0x04uy; 0x0cuy; 0xf9uy; 0xbfuy; 0xd4uy; 0xacuy; 0xa7uy;
0x98uy; 0x4auy; 0x74uy; 0xd3uy; 0x71uy; 0x45uy; 0x98uy; 0x67uy;
0x80uy; 0xfcuy; 0x0buy; 0x16uy; 0xacuy; 0x45uy; 0x16uy; 0x49uy;
0xdeuy; 0x61uy; 0x88uy; 0xa7uy; 0xdbuy; 0xdfuy; 0x19uy; 0x1fuy;
0x64uy; 0xb5uy; 0xfcuy; 0x5euy; 0x2auy; 0xb4uy; 0x7buy; 0x57uy;
0xf7uy; 0xf7uy; 0x27uy; 0x6cuy; 0xd4uy; 0x19uy; 0xc1uy; 0x7auy;
0x3cuy; 0xa8uy; 0xe1uy; 0xb9uy; 0x39uy; 0xaeuy; 0x49uy; 0xe4uy;
0x88uy; 0xacuy; 0xbauy; 0x6buy; 0x96uy; 0x56uy; 0x10uy; 0xb5uy;
0x48uy; 0x01uy; 0x09uy; 0xc8uy; 0xb1uy; 0x7buy; 0x80uy; 0xe1uy;
0xb7uy; 0xb7uy; 0x50uy; 0xdfuy; 0xc7uy; 0x59uy; 0x8duy; 0x5duy;
0x50uy; 0x11uy; 0xfduy; 0x2duy; 0xccuy; 0x56uy; 0x00uy; 0xa3uy;
0x2euy; 0xf5uy; 0xb5uy; 0x2auy; 0x1euy; 0xccuy; 0x82uy; 0x0euy;
0x30uy; 0x8auy; 0xa3uy; 0x42uy; 0x72uy; 0x1auy; 0xacuy; 0x09uy;
0x43uy; 0xbfuy; 0x66uy; 0x86uy; 0xb6uy; 0x4buy; 0x25uy; 0x79uy;
0x37uy; 0x65uy; 0x04uy; 0xccuy; 0xc4uy; 0x93uy; 0xd9uy; 0x7euy;
0x6auy; 0xeduy; 0x3fuy; 0xb0uy; 0xf9uy; 0xcduy; 0x71uy; 0xa4uy;
0x3duy; 0xd4uy; 0x97uy; 0xf0uy; 0x1fuy; 0x17uy; 0xc0uy; 0xe2uy;
0xcbuy; 0x37uy; 0x97uy; 0xaauy; 0x2auy; 0x2fuy; 0x25uy; 0x66uy;
0x56uy; 0x16uy; 0x8euy; 0x6cuy; 0x49uy; 0x6auy; 0xfcuy; 0x5fuy;
0xb9uy; 0x32uy; 0x46uy; 0xf6uy; 0xb1uy; 0x11uy; 0x63uy; 0x98uy;
0xa3uy; 0x46uy; 0xf1uy; 0xa6uy; 0x41uy; 0xf3uy; 0xb0uy; 0x41uy;
0xe9uy; 0x89uy; 0xf7uy; 0x91uy; 0x4fuy; 0x90uy; 0xccuy; 0x2cuy;
0x7fuy; 0xffuy; 0x35uy; 0x78uy; 0x76uy; 0xe5uy; 0x06uy; 0xb5uy;
0x0duy; 0x33uy; 0x4buy; 0xa7uy; 0x7cuy; 0x22uy; 0x5buy; 0xc3uy;
0x07uy; 0xbauy; 0x53uy; 0x71uy; 0x52uy; 0xf3uy; 0xf1uy; 0x61uy;
0x0euy; 0x4euy; 0xafuy; 0xe5uy; 0x95uy; 0xf6uy; 0xd9uy; 0xd9uy;
0x0duy; 0x11uy; 0xfauy; 0xa9uy; 0x33uy; 0xa1uy; 0x5euy; 0xf1uy;
0x36uy; 0x95uy; 0x46uy; 0x86uy; 0x8auy; 0x7fuy; 0x3auy; 0x45uy;
0xa9uy; 0x67uy; 0x68uy; 0xd4uy; 0x0fuy; 0xd9uy; 0xd0uy; 0x34uy;
0x12uy; 0xc0uy; 0x91uy; 0xc6uy; 0x31uy; 0x5cuy; 0xf4uy; 0xfduy;
0xe7uy; 0xcbuy; 0x68uy; 0x60uy; 0x69uy; 0x37uy; 0x38uy; 0x0duy;
0xb2uy; 0xeauy; 0xaauy; 0x70uy; 0x7buy; 0x4cuy; 0x41uy; 0x85uy;
0xc3uy; 0x2euy; 0xdduy; 0xcduy; 0xd3uy; 0x06uy; 0x70uy; 0x5euy;
0x4duy; 0xc1uy; 0xffuy; 0xc8uy; 0x72uy; 0xeeuy; 0xeeuy; 0x47uy;
0x5auy; 0x64uy; 0xdfuy; 0xacuy; 0x86uy; 0xabuy; 0xa4uy; 0x1cuy;
0x06uy; 0x18uy; 0x98uy; 0x3fuy; 0x87uy; 0x41uy; 0xc5uy; 0xefuy;
0x68uy; 0xd3uy; 0xa1uy; 0x01uy; 0xe8uy; 0xa3uy; 0xb8uy; 0xcauy;
0xc6uy; 0x0cuy; 0x90uy; 0x5cuy; 0x15uy; 0xfcuy; 0x91uy; 0x08uy;
0x40uy; 0xb9uy; 0x4cuy; 0x00uy; 0xa0uy; 0xb9uy; 0xd0uy
] in
assert_norm (List.Tot.length l == 1023);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test4_expected_sig:lbytes 64 | [] | Spec.Ed25519.Test.test4_expected_sig | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 64 | {
"end_col": 11,
"end_line": 320,
"start_col": 36,
"start_line": 308
} |
Prims.Tot | val test4_msg:lbytes 1023 | [
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"short_module": null
},
{
"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.Ed25519",
"short_module": null
},
{
"abbrev": false,
"full_module": "Spec.Ed25519",
"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
}
] | false | let test4_msg : lbytes 1023 =
let l = List.Tot.map u8_from_UInt8 [
0x08uy; 0xb8uy; 0xb2uy; 0xb7uy; 0x33uy; 0x42uy; 0x42uy; 0x43uy;
0x76uy; 0x0fuy; 0xe4uy; 0x26uy; 0xa4uy; 0xb5uy; 0x49uy; 0x08uy;
0x63uy; 0x21uy; 0x10uy; 0xa6uy; 0x6cuy; 0x2fuy; 0x65uy; 0x91uy;
0xeauy; 0xbduy; 0x33uy; 0x45uy; 0xe3uy; 0xe4uy; 0xebuy; 0x98uy;
0xfauy; 0x6euy; 0x26uy; 0x4buy; 0xf0uy; 0x9euy; 0xfeuy; 0x12uy;
0xeeuy; 0x50uy; 0xf8uy; 0xf5uy; 0x4euy; 0x9fuy; 0x77uy; 0xb1uy;
0xe3uy; 0x55uy; 0xf6uy; 0xc5uy; 0x05uy; 0x44uy; 0xe2uy; 0x3fuy;
0xb1uy; 0x43uy; 0x3duy; 0xdfuy; 0x73uy; 0xbeuy; 0x84uy; 0xd8uy;
0x79uy; 0xdeuy; 0x7cuy; 0x00uy; 0x46uy; 0xdcuy; 0x49uy; 0x96uy;
0xd9uy; 0xe7uy; 0x73uy; 0xf4uy; 0xbcuy; 0x9euy; 0xfeuy; 0x57uy;
0x38uy; 0x82uy; 0x9auy; 0xdbuy; 0x26uy; 0xc8uy; 0x1buy; 0x37uy;
0xc9uy; 0x3auy; 0x1buy; 0x27uy; 0x0buy; 0x20uy; 0x32uy; 0x9duy;
0x65uy; 0x86uy; 0x75uy; 0xfcuy; 0x6euy; 0xa5uy; 0x34uy; 0xe0uy;
0x81uy; 0x0auy; 0x44uy; 0x32uy; 0x82uy; 0x6buy; 0xf5uy; 0x8cuy;
0x94uy; 0x1euy; 0xfbuy; 0x65uy; 0xd5uy; 0x7auy; 0x33uy; 0x8buy;
0xbduy; 0x2euy; 0x26uy; 0x64uy; 0x0fuy; 0x89uy; 0xffuy; 0xbcuy;
0x1auy; 0x85uy; 0x8euy; 0xfcuy; 0xb8uy; 0x55uy; 0x0euy; 0xe3uy;
0xa5uy; 0xe1uy; 0x99uy; 0x8buy; 0xd1uy; 0x77uy; 0xe9uy; 0x3auy;
0x73uy; 0x63uy; 0xc3uy; 0x44uy; 0xfeuy; 0x6buy; 0x19uy; 0x9euy;
0xe5uy; 0xd0uy; 0x2euy; 0x82uy; 0xd5uy; 0x22uy; 0xc4uy; 0xfeuy;
0xbauy; 0x15uy; 0x45uy; 0x2fuy; 0x80uy; 0x28uy; 0x8auy; 0x82uy;
0x1auy; 0x57uy; 0x91uy; 0x16uy; 0xecuy; 0x6duy; 0xaduy; 0x2buy;
0x3buy; 0x31uy; 0x0duy; 0xa9uy; 0x03uy; 0x40uy; 0x1auy; 0xa6uy;
0x21uy; 0x00uy; 0xabuy; 0x5duy; 0x1auy; 0x36uy; 0x55uy; 0x3euy;
0x06uy; 0x20uy; 0x3buy; 0x33uy; 0x89uy; 0x0cuy; 0xc9uy; 0xb8uy;
0x32uy; 0xf7uy; 0x9euy; 0xf8uy; 0x05uy; 0x60uy; 0xccuy; 0xb9uy;
0xa3uy; 0x9cuy; 0xe7uy; 0x67uy; 0x96uy; 0x7euy; 0xd6uy; 0x28uy;
0xc6uy; 0xaduy; 0x57uy; 0x3cuy; 0xb1uy; 0x16uy; 0xdbuy; 0xefuy;
0xefuy; 0xd7uy; 0x54uy; 0x99uy; 0xdauy; 0x96uy; 0xbduy; 0x68uy;
0xa8uy; 0xa9uy; 0x7buy; 0x92uy; 0x8auy; 0x8buy; 0xbcuy; 0x10uy;
0x3buy; 0x66uy; 0x21uy; 0xfcuy; 0xdeuy; 0x2buy; 0xecuy; 0xa1uy;
0x23uy; 0x1duy; 0x20uy; 0x6buy; 0xe6uy; 0xcduy; 0x9euy; 0xc7uy;
0xafuy; 0xf6uy; 0xf6uy; 0xc9uy; 0x4fuy; 0xcduy; 0x72uy; 0x04uy;
0xeduy; 0x34uy; 0x55uy; 0xc6uy; 0x8cuy; 0x83uy; 0xf4uy; 0xa4uy;
0x1duy; 0xa4uy; 0xafuy; 0x2buy; 0x74uy; 0xefuy; 0x5cuy; 0x53uy;
0xf1uy; 0xd8uy; 0xacuy; 0x70uy; 0xbduy; 0xcbuy; 0x7euy; 0xd1uy;
0x85uy; 0xceuy; 0x81uy; 0xbduy; 0x84uy; 0x35uy; 0x9duy; 0x44uy;
0x25uy; 0x4duy; 0x95uy; 0x62uy; 0x9euy; 0x98uy; 0x55uy; 0xa9uy;
0x4auy; 0x7cuy; 0x19uy; 0x58uy; 0xd1uy; 0xf8uy; 0xaduy; 0xa5uy;
0xd0uy; 0x53uy; 0x2euy; 0xd8uy; 0xa5uy; 0xaauy; 0x3fuy; 0xb2uy;
0xd1uy; 0x7buy; 0xa7uy; 0x0euy; 0xb6uy; 0x24uy; 0x8euy; 0x59uy;
0x4euy; 0x1auy; 0x22uy; 0x97uy; 0xacuy; 0xbbuy; 0xb3uy; 0x9duy;
0x50uy; 0x2fuy; 0x1auy; 0x8cuy; 0x6euy; 0xb6uy; 0xf1uy; 0xceuy;
0x22uy; 0xb3uy; 0xdeuy; 0x1auy; 0x1fuy; 0x40uy; 0xccuy; 0x24uy;
0x55uy; 0x41uy; 0x19uy; 0xa8uy; 0x31uy; 0xa9uy; 0xaauy; 0xd6uy;
0x07uy; 0x9cuy; 0xaduy; 0x88uy; 0x42uy; 0x5duy; 0xe6uy; 0xbduy;
0xe1uy; 0xa9uy; 0x18uy; 0x7euy; 0xbbuy; 0x60uy; 0x92uy; 0xcfuy;
0x67uy; 0xbfuy; 0x2buy; 0x13uy; 0xfduy; 0x65uy; 0xf2uy; 0x70uy;
0x88uy; 0xd7uy; 0x8buy; 0x7euy; 0x88uy; 0x3cuy; 0x87uy; 0x59uy;
0xd2uy; 0xc4uy; 0xf5uy; 0xc6uy; 0x5auy; 0xdbuy; 0x75uy; 0x53uy;
0x87uy; 0x8auy; 0xd5uy; 0x75uy; 0xf9uy; 0xfauy; 0xd8uy; 0x78uy;
0xe8uy; 0x0auy; 0x0cuy; 0x9buy; 0xa6uy; 0x3buy; 0xcbuy; 0xccuy;
0x27uy; 0x32uy; 0xe6uy; 0x94uy; 0x85uy; 0xbbuy; 0xc9uy; 0xc9uy;
0x0buy; 0xfbuy; 0xd6uy; 0x24uy; 0x81uy; 0xd9uy; 0x08uy; 0x9buy;
0xecuy; 0xcfuy; 0x80uy; 0xcfuy; 0xe2uy; 0xdfuy; 0x16uy; 0xa2uy;
0xcfuy; 0x65uy; 0xbduy; 0x92uy; 0xdduy; 0x59uy; 0x7buy; 0x07uy;
0x07uy; 0xe0uy; 0x91uy; 0x7auy; 0xf4uy; 0x8buy; 0xbbuy; 0x75uy;
0xfeuy; 0xd4uy; 0x13uy; 0xd2uy; 0x38uy; 0xf5uy; 0x55uy; 0x5auy;
0x7auy; 0x56uy; 0x9duy; 0x80uy; 0xc3uy; 0x41uy; 0x4auy; 0x8duy;
0x08uy; 0x59uy; 0xdcuy; 0x65uy; 0xa4uy; 0x61uy; 0x28uy; 0xbauy;
0xb2uy; 0x7auy; 0xf8uy; 0x7auy; 0x71uy; 0x31uy; 0x4fuy; 0x31uy;
0x8cuy; 0x78uy; 0x2buy; 0x23uy; 0xebuy; 0xfeuy; 0x80uy; 0x8buy;
0x82uy; 0xb0uy; 0xceuy; 0x26uy; 0x40uy; 0x1duy; 0x2euy; 0x22uy;
0xf0uy; 0x4duy; 0x83uy; 0xd1uy; 0x25uy; 0x5duy; 0xc5uy; 0x1auy;
0xdduy; 0xd3uy; 0xb7uy; 0x5auy; 0x2buy; 0x1auy; 0xe0uy; 0x78uy;
0x45uy; 0x04uy; 0xdfuy; 0x54uy; 0x3auy; 0xf8uy; 0x96uy; 0x9buy;
0xe3uy; 0xeauy; 0x70uy; 0x82uy; 0xffuy; 0x7fuy; 0xc9uy; 0x88uy;
0x8cuy; 0x14uy; 0x4duy; 0xa2uy; 0xafuy; 0x58uy; 0x42uy; 0x9euy;
0xc9uy; 0x60uy; 0x31uy; 0xdbuy; 0xcauy; 0xd3uy; 0xdauy; 0xd9uy;
0xafuy; 0x0duy; 0xcbuy; 0xaauy; 0xafuy; 0x26uy; 0x8cuy; 0xb8uy;
0xfcuy; 0xffuy; 0xeauy; 0xd9uy; 0x4fuy; 0x3cuy; 0x7cuy; 0xa4uy;
0x95uy; 0xe0uy; 0x56uy; 0xa9uy; 0xb4uy; 0x7auy; 0xcduy; 0xb7uy;
0x51uy; 0xfbuy; 0x73uy; 0xe6uy; 0x66uy; 0xc6uy; 0xc6uy; 0x55uy;
0xaduy; 0xe8uy; 0x29uy; 0x72uy; 0x97uy; 0xd0uy; 0x7auy; 0xd1uy;
0xbauy; 0x5euy; 0x43uy; 0xf1uy; 0xbcuy; 0xa3uy; 0x23uy; 0x01uy;
0x65uy; 0x13uy; 0x39uy; 0xe2uy; 0x29uy; 0x04uy; 0xccuy; 0x8cuy;
0x42uy; 0xf5uy; 0x8cuy; 0x30uy; 0xc0uy; 0x4auy; 0xafuy; 0xdbuy;
0x03uy; 0x8duy; 0xdauy; 0x08uy; 0x47uy; 0xdduy; 0x98uy; 0x8duy;
0xcduy; 0xa6uy; 0xf3uy; 0xbfuy; 0xd1uy; 0x5cuy; 0x4buy; 0x4cuy;
0x45uy; 0x25uy; 0x00uy; 0x4auy; 0xa0uy; 0x6euy; 0xefuy; 0xf8uy;
0xcauy; 0x61uy; 0x78uy; 0x3auy; 0xacuy; 0xecuy; 0x57uy; 0xfbuy;
0x3duy; 0x1fuy; 0x92uy; 0xb0uy; 0xfeuy; 0x2fuy; 0xd1uy; 0xa8uy;
0x5fuy; 0x67uy; 0x24uy; 0x51uy; 0x7buy; 0x65uy; 0xe6uy; 0x14uy;
0xaduy; 0x68uy; 0x08uy; 0xd6uy; 0xf6uy; 0xeeuy; 0x34uy; 0xdfuy;
0xf7uy; 0x31uy; 0x0fuy; 0xdcuy; 0x82uy; 0xaeuy; 0xbfuy; 0xd9uy;
0x04uy; 0xb0uy; 0x1euy; 0x1duy; 0xc5uy; 0x4buy; 0x29uy; 0x27uy;
0x09uy; 0x4buy; 0x2duy; 0xb6uy; 0x8duy; 0x6fuy; 0x90uy; 0x3buy;
0x68uy; 0x40uy; 0x1auy; 0xdeuy; 0xbfuy; 0x5auy; 0x7euy; 0x08uy;
0xd7uy; 0x8fuy; 0xf4uy; 0xefuy; 0x5duy; 0x63uy; 0x65uy; 0x3auy;
0x65uy; 0x04uy; 0x0cuy; 0xf9uy; 0xbfuy; 0xd4uy; 0xacuy; 0xa7uy;
0x98uy; 0x4auy; 0x74uy; 0xd3uy; 0x71uy; 0x45uy; 0x98uy; 0x67uy;
0x80uy; 0xfcuy; 0x0buy; 0x16uy; 0xacuy; 0x45uy; 0x16uy; 0x49uy;
0xdeuy; 0x61uy; 0x88uy; 0xa7uy; 0xdbuy; 0xdfuy; 0x19uy; 0x1fuy;
0x64uy; 0xb5uy; 0xfcuy; 0x5euy; 0x2auy; 0xb4uy; 0x7buy; 0x57uy;
0xf7uy; 0xf7uy; 0x27uy; 0x6cuy; 0xd4uy; 0x19uy; 0xc1uy; 0x7auy;
0x3cuy; 0xa8uy; 0xe1uy; 0xb9uy; 0x39uy; 0xaeuy; 0x49uy; 0xe4uy;
0x88uy; 0xacuy; 0xbauy; 0x6buy; 0x96uy; 0x56uy; 0x10uy; 0xb5uy;
0x48uy; 0x01uy; 0x09uy; 0xc8uy; 0xb1uy; 0x7buy; 0x80uy; 0xe1uy;
0xb7uy; 0xb7uy; 0x50uy; 0xdfuy; 0xc7uy; 0x59uy; 0x8duy; 0x5duy;
0x50uy; 0x11uy; 0xfduy; 0x2duy; 0xccuy; 0x56uy; 0x00uy; 0xa3uy;
0x2euy; 0xf5uy; 0xb5uy; 0x2auy; 0x1euy; 0xccuy; 0x82uy; 0x0euy;
0x30uy; 0x8auy; 0xa3uy; 0x42uy; 0x72uy; 0x1auy; 0xacuy; 0x09uy;
0x43uy; 0xbfuy; 0x66uy; 0x86uy; 0xb6uy; 0x4buy; 0x25uy; 0x79uy;
0x37uy; 0x65uy; 0x04uy; 0xccuy; 0xc4uy; 0x93uy; 0xd9uy; 0x7euy;
0x6auy; 0xeduy; 0x3fuy; 0xb0uy; 0xf9uy; 0xcduy; 0x71uy; 0xa4uy;
0x3duy; 0xd4uy; 0x97uy; 0xf0uy; 0x1fuy; 0x17uy; 0xc0uy; 0xe2uy;
0xcbuy; 0x37uy; 0x97uy; 0xaauy; 0x2auy; 0x2fuy; 0x25uy; 0x66uy;
0x56uy; 0x16uy; 0x8euy; 0x6cuy; 0x49uy; 0x6auy; 0xfcuy; 0x5fuy;
0xb9uy; 0x32uy; 0x46uy; 0xf6uy; 0xb1uy; 0x11uy; 0x63uy; 0x98uy;
0xa3uy; 0x46uy; 0xf1uy; 0xa6uy; 0x41uy; 0xf3uy; 0xb0uy; 0x41uy;
0xe9uy; 0x89uy; 0xf7uy; 0x91uy; 0x4fuy; 0x90uy; 0xccuy; 0x2cuy;
0x7fuy; 0xffuy; 0x35uy; 0x78uy; 0x76uy; 0xe5uy; 0x06uy; 0xb5uy;
0x0duy; 0x33uy; 0x4buy; 0xa7uy; 0x7cuy; 0x22uy; 0x5buy; 0xc3uy;
0x07uy; 0xbauy; 0x53uy; 0x71uy; 0x52uy; 0xf3uy; 0xf1uy; 0x61uy;
0x0euy; 0x4euy; 0xafuy; 0xe5uy; 0x95uy; 0xf6uy; 0xd9uy; 0xd9uy;
0x0duy; 0x11uy; 0xfauy; 0xa9uy; 0x33uy; 0xa1uy; 0x5euy; 0xf1uy;
0x36uy; 0x95uy; 0x46uy; 0x86uy; 0x8auy; 0x7fuy; 0x3auy; 0x45uy;
0xa9uy; 0x67uy; 0x68uy; 0xd4uy; 0x0fuy; 0xd9uy; 0xd0uy; 0x34uy;
0x12uy; 0xc0uy; 0x91uy; 0xc6uy; 0x31uy; 0x5cuy; 0xf4uy; 0xfduy;
0xe7uy; 0xcbuy; 0x68uy; 0x60uy; 0x69uy; 0x37uy; 0x38uy; 0x0duy;
0xb2uy; 0xeauy; 0xaauy; 0x70uy; 0x7buy; 0x4cuy; 0x41uy; 0x85uy;
0xc3uy; 0x2euy; 0xdduy; 0xcduy; 0xd3uy; 0x06uy; 0x70uy; 0x5euy;
0x4duy; 0xc1uy; 0xffuy; 0xc8uy; 0x72uy; 0xeeuy; 0xeeuy; 0x47uy;
0x5auy; 0x64uy; 0xdfuy; 0xacuy; 0x86uy; 0xabuy; 0xa4uy; 0x1cuy;
0x06uy; 0x18uy; 0x98uy; 0x3fuy; 0x87uy; 0x41uy; 0xc5uy; 0xefuy;
0x68uy; 0xd3uy; 0xa1uy; 0x01uy; 0xe8uy; 0xa3uy; 0xb8uy; 0xcauy;
0xc6uy; 0x0cuy; 0x90uy; 0x5cuy; 0x15uy; 0xfcuy; 0x91uy; 0x08uy;
0x40uy; 0xb9uy; 0x4cuy; 0x00uy; 0xa0uy; 0xb9uy; 0xd0uy
] in
assert_norm (List.Tot.length l == 1023);
of_list l | val test4_msg:lbytes 1023
let test4_msg:lbytes 1023 = | false | null | false | let l =
List.Tot.map u8_from_UInt8
[
0x08uy; 0xb8uy; 0xb2uy; 0xb7uy; 0x33uy; 0x42uy; 0x42uy; 0x43uy; 0x76uy; 0x0fuy; 0xe4uy; 0x26uy;
0xa4uy; 0xb5uy; 0x49uy; 0x08uy; 0x63uy; 0x21uy; 0x10uy; 0xa6uy; 0x6cuy; 0x2fuy; 0x65uy; 0x91uy;
0xeauy; 0xbduy; 0x33uy; 0x45uy; 0xe3uy; 0xe4uy; 0xebuy; 0x98uy; 0xfauy; 0x6euy; 0x26uy; 0x4buy;
0xf0uy; 0x9euy; 0xfeuy; 0x12uy; 0xeeuy; 0x50uy; 0xf8uy; 0xf5uy; 0x4euy; 0x9fuy; 0x77uy; 0xb1uy;
0xe3uy; 0x55uy; 0xf6uy; 0xc5uy; 0x05uy; 0x44uy; 0xe2uy; 0x3fuy; 0xb1uy; 0x43uy; 0x3duy; 0xdfuy;
0x73uy; 0xbeuy; 0x84uy; 0xd8uy; 0x79uy; 0xdeuy; 0x7cuy; 0x00uy; 0x46uy; 0xdcuy; 0x49uy; 0x96uy;
0xd9uy; 0xe7uy; 0x73uy; 0xf4uy; 0xbcuy; 0x9euy; 0xfeuy; 0x57uy; 0x38uy; 0x82uy; 0x9auy; 0xdbuy;
0x26uy; 0xc8uy; 0x1buy; 0x37uy; 0xc9uy; 0x3auy; 0x1buy; 0x27uy; 0x0buy; 0x20uy; 0x32uy; 0x9duy;
0x65uy; 0x86uy; 0x75uy; 0xfcuy; 0x6euy; 0xa5uy; 0x34uy; 0xe0uy; 0x81uy; 0x0auy; 0x44uy; 0x32uy;
0x82uy; 0x6buy; 0xf5uy; 0x8cuy; 0x94uy; 0x1euy; 0xfbuy; 0x65uy; 0xd5uy; 0x7auy; 0x33uy; 0x8buy;
0xbduy; 0x2euy; 0x26uy; 0x64uy; 0x0fuy; 0x89uy; 0xffuy; 0xbcuy; 0x1auy; 0x85uy; 0x8euy; 0xfcuy;
0xb8uy; 0x55uy; 0x0euy; 0xe3uy; 0xa5uy; 0xe1uy; 0x99uy; 0x8buy; 0xd1uy; 0x77uy; 0xe9uy; 0x3auy;
0x73uy; 0x63uy; 0xc3uy; 0x44uy; 0xfeuy; 0x6buy; 0x19uy; 0x9euy; 0xe5uy; 0xd0uy; 0x2euy; 0x82uy;
0xd5uy; 0x22uy; 0xc4uy; 0xfeuy; 0xbauy; 0x15uy; 0x45uy; 0x2fuy; 0x80uy; 0x28uy; 0x8auy; 0x82uy;
0x1auy; 0x57uy; 0x91uy; 0x16uy; 0xecuy; 0x6duy; 0xaduy; 0x2buy; 0x3buy; 0x31uy; 0x0duy; 0xa9uy;
0x03uy; 0x40uy; 0x1auy; 0xa6uy; 0x21uy; 0x00uy; 0xabuy; 0x5duy; 0x1auy; 0x36uy; 0x55uy; 0x3euy;
0x06uy; 0x20uy; 0x3buy; 0x33uy; 0x89uy; 0x0cuy; 0xc9uy; 0xb8uy; 0x32uy; 0xf7uy; 0x9euy; 0xf8uy;
0x05uy; 0x60uy; 0xccuy; 0xb9uy; 0xa3uy; 0x9cuy; 0xe7uy; 0x67uy; 0x96uy; 0x7euy; 0xd6uy; 0x28uy;
0xc6uy; 0xaduy; 0x57uy; 0x3cuy; 0xb1uy; 0x16uy; 0xdbuy; 0xefuy; 0xefuy; 0xd7uy; 0x54uy; 0x99uy;
0xdauy; 0x96uy; 0xbduy; 0x68uy; 0xa8uy; 0xa9uy; 0x7buy; 0x92uy; 0x8auy; 0x8buy; 0xbcuy; 0x10uy;
0x3buy; 0x66uy; 0x21uy; 0xfcuy; 0xdeuy; 0x2buy; 0xecuy; 0xa1uy; 0x23uy; 0x1duy; 0x20uy; 0x6buy;
0xe6uy; 0xcduy; 0x9euy; 0xc7uy; 0xafuy; 0xf6uy; 0xf6uy; 0xc9uy; 0x4fuy; 0xcduy; 0x72uy; 0x04uy;
0xeduy; 0x34uy; 0x55uy; 0xc6uy; 0x8cuy; 0x83uy; 0xf4uy; 0xa4uy; 0x1duy; 0xa4uy; 0xafuy; 0x2buy;
0x74uy; 0xefuy; 0x5cuy; 0x53uy; 0xf1uy; 0xd8uy; 0xacuy; 0x70uy; 0xbduy; 0xcbuy; 0x7euy; 0xd1uy;
0x85uy; 0xceuy; 0x81uy; 0xbduy; 0x84uy; 0x35uy; 0x9duy; 0x44uy; 0x25uy; 0x4duy; 0x95uy; 0x62uy;
0x9euy; 0x98uy; 0x55uy; 0xa9uy; 0x4auy; 0x7cuy; 0x19uy; 0x58uy; 0xd1uy; 0xf8uy; 0xaduy; 0xa5uy;
0xd0uy; 0x53uy; 0x2euy; 0xd8uy; 0xa5uy; 0xaauy; 0x3fuy; 0xb2uy; 0xd1uy; 0x7buy; 0xa7uy; 0x0euy;
0xb6uy; 0x24uy; 0x8euy; 0x59uy; 0x4euy; 0x1auy; 0x22uy; 0x97uy; 0xacuy; 0xbbuy; 0xb3uy; 0x9duy;
0x50uy; 0x2fuy; 0x1auy; 0x8cuy; 0x6euy; 0xb6uy; 0xf1uy; 0xceuy; 0x22uy; 0xb3uy; 0xdeuy; 0x1auy;
0x1fuy; 0x40uy; 0xccuy; 0x24uy; 0x55uy; 0x41uy; 0x19uy; 0xa8uy; 0x31uy; 0xa9uy; 0xaauy; 0xd6uy;
0x07uy; 0x9cuy; 0xaduy; 0x88uy; 0x42uy; 0x5duy; 0xe6uy; 0xbduy; 0xe1uy; 0xa9uy; 0x18uy; 0x7euy;
0xbbuy; 0x60uy; 0x92uy; 0xcfuy; 0x67uy; 0xbfuy; 0x2buy; 0x13uy; 0xfduy; 0x65uy; 0xf2uy; 0x70uy;
0x88uy; 0xd7uy; 0x8buy; 0x7euy; 0x88uy; 0x3cuy; 0x87uy; 0x59uy; 0xd2uy; 0xc4uy; 0xf5uy; 0xc6uy;
0x5auy; 0xdbuy; 0x75uy; 0x53uy; 0x87uy; 0x8auy; 0xd5uy; 0x75uy; 0xf9uy; 0xfauy; 0xd8uy; 0x78uy;
0xe8uy; 0x0auy; 0x0cuy; 0x9buy; 0xa6uy; 0x3buy; 0xcbuy; 0xccuy; 0x27uy; 0x32uy; 0xe6uy; 0x94uy;
0x85uy; 0xbbuy; 0xc9uy; 0xc9uy; 0x0buy; 0xfbuy; 0xd6uy; 0x24uy; 0x81uy; 0xd9uy; 0x08uy; 0x9buy;
0xecuy; 0xcfuy; 0x80uy; 0xcfuy; 0xe2uy; 0xdfuy; 0x16uy; 0xa2uy; 0xcfuy; 0x65uy; 0xbduy; 0x92uy;
0xdduy; 0x59uy; 0x7buy; 0x07uy; 0x07uy; 0xe0uy; 0x91uy; 0x7auy; 0xf4uy; 0x8buy; 0xbbuy; 0x75uy;
0xfeuy; 0xd4uy; 0x13uy; 0xd2uy; 0x38uy; 0xf5uy; 0x55uy; 0x5auy; 0x7auy; 0x56uy; 0x9duy; 0x80uy;
0xc3uy; 0x41uy; 0x4auy; 0x8duy; 0x08uy; 0x59uy; 0xdcuy; 0x65uy; 0xa4uy; 0x61uy; 0x28uy; 0xbauy;
0xb2uy; 0x7auy; 0xf8uy; 0x7auy; 0x71uy; 0x31uy; 0x4fuy; 0x31uy; 0x8cuy; 0x78uy; 0x2buy; 0x23uy;
0xebuy; 0xfeuy; 0x80uy; 0x8buy; 0x82uy; 0xb0uy; 0xceuy; 0x26uy; 0x40uy; 0x1duy; 0x2euy; 0x22uy;
0xf0uy; 0x4duy; 0x83uy; 0xd1uy; 0x25uy; 0x5duy; 0xc5uy; 0x1auy; 0xdduy; 0xd3uy; 0xb7uy; 0x5auy;
0x2buy; 0x1auy; 0xe0uy; 0x78uy; 0x45uy; 0x04uy; 0xdfuy; 0x54uy; 0x3auy; 0xf8uy; 0x96uy; 0x9buy;
0xe3uy; 0xeauy; 0x70uy; 0x82uy; 0xffuy; 0x7fuy; 0xc9uy; 0x88uy; 0x8cuy; 0x14uy; 0x4duy; 0xa2uy;
0xafuy; 0x58uy; 0x42uy; 0x9euy; 0xc9uy; 0x60uy; 0x31uy; 0xdbuy; 0xcauy; 0xd3uy; 0xdauy; 0xd9uy;
0xafuy; 0x0duy; 0xcbuy; 0xaauy; 0xafuy; 0x26uy; 0x8cuy; 0xb8uy; 0xfcuy; 0xffuy; 0xeauy; 0xd9uy;
0x4fuy; 0x3cuy; 0x7cuy; 0xa4uy; 0x95uy; 0xe0uy; 0x56uy; 0xa9uy; 0xb4uy; 0x7auy; 0xcduy; 0xb7uy;
0x51uy; 0xfbuy; 0x73uy; 0xe6uy; 0x66uy; 0xc6uy; 0xc6uy; 0x55uy; 0xaduy; 0xe8uy; 0x29uy; 0x72uy;
0x97uy; 0xd0uy; 0x7auy; 0xd1uy; 0xbauy; 0x5euy; 0x43uy; 0xf1uy; 0xbcuy; 0xa3uy; 0x23uy; 0x01uy;
0x65uy; 0x13uy; 0x39uy; 0xe2uy; 0x29uy; 0x04uy; 0xccuy; 0x8cuy; 0x42uy; 0xf5uy; 0x8cuy; 0x30uy;
0xc0uy; 0x4auy; 0xafuy; 0xdbuy; 0x03uy; 0x8duy; 0xdauy; 0x08uy; 0x47uy; 0xdduy; 0x98uy; 0x8duy;
0xcduy; 0xa6uy; 0xf3uy; 0xbfuy; 0xd1uy; 0x5cuy; 0x4buy; 0x4cuy; 0x45uy; 0x25uy; 0x00uy; 0x4auy;
0xa0uy; 0x6euy; 0xefuy; 0xf8uy; 0xcauy; 0x61uy; 0x78uy; 0x3auy; 0xacuy; 0xecuy; 0x57uy; 0xfbuy;
0x3duy; 0x1fuy; 0x92uy; 0xb0uy; 0xfeuy; 0x2fuy; 0xd1uy; 0xa8uy; 0x5fuy; 0x67uy; 0x24uy; 0x51uy;
0x7buy; 0x65uy; 0xe6uy; 0x14uy; 0xaduy; 0x68uy; 0x08uy; 0xd6uy; 0xf6uy; 0xeeuy; 0x34uy; 0xdfuy;
0xf7uy; 0x31uy; 0x0fuy; 0xdcuy; 0x82uy; 0xaeuy; 0xbfuy; 0xd9uy; 0x04uy; 0xb0uy; 0x1euy; 0x1duy;
0xc5uy; 0x4buy; 0x29uy; 0x27uy; 0x09uy; 0x4buy; 0x2duy; 0xb6uy; 0x8duy; 0x6fuy; 0x90uy; 0x3buy;
0x68uy; 0x40uy; 0x1auy; 0xdeuy; 0xbfuy; 0x5auy; 0x7euy; 0x08uy; 0xd7uy; 0x8fuy; 0xf4uy; 0xefuy;
0x5duy; 0x63uy; 0x65uy; 0x3auy; 0x65uy; 0x04uy; 0x0cuy; 0xf9uy; 0xbfuy; 0xd4uy; 0xacuy; 0xa7uy;
0x98uy; 0x4auy; 0x74uy; 0xd3uy; 0x71uy; 0x45uy; 0x98uy; 0x67uy; 0x80uy; 0xfcuy; 0x0buy; 0x16uy;
0xacuy; 0x45uy; 0x16uy; 0x49uy; 0xdeuy; 0x61uy; 0x88uy; 0xa7uy; 0xdbuy; 0xdfuy; 0x19uy; 0x1fuy;
0x64uy; 0xb5uy; 0xfcuy; 0x5euy; 0x2auy; 0xb4uy; 0x7buy; 0x57uy; 0xf7uy; 0xf7uy; 0x27uy; 0x6cuy;
0xd4uy; 0x19uy; 0xc1uy; 0x7auy; 0x3cuy; 0xa8uy; 0xe1uy; 0xb9uy; 0x39uy; 0xaeuy; 0x49uy; 0xe4uy;
0x88uy; 0xacuy; 0xbauy; 0x6buy; 0x96uy; 0x56uy; 0x10uy; 0xb5uy; 0x48uy; 0x01uy; 0x09uy; 0xc8uy;
0xb1uy; 0x7buy; 0x80uy; 0xe1uy; 0xb7uy; 0xb7uy; 0x50uy; 0xdfuy; 0xc7uy; 0x59uy; 0x8duy; 0x5duy;
0x50uy; 0x11uy; 0xfduy; 0x2duy; 0xccuy; 0x56uy; 0x00uy; 0xa3uy; 0x2euy; 0xf5uy; 0xb5uy; 0x2auy;
0x1euy; 0xccuy; 0x82uy; 0x0euy; 0x30uy; 0x8auy; 0xa3uy; 0x42uy; 0x72uy; 0x1auy; 0xacuy; 0x09uy;
0x43uy; 0xbfuy; 0x66uy; 0x86uy; 0xb6uy; 0x4buy; 0x25uy; 0x79uy; 0x37uy; 0x65uy; 0x04uy; 0xccuy;
0xc4uy; 0x93uy; 0xd9uy; 0x7euy; 0x6auy; 0xeduy; 0x3fuy; 0xb0uy; 0xf9uy; 0xcduy; 0x71uy; 0xa4uy;
0x3duy; 0xd4uy; 0x97uy; 0xf0uy; 0x1fuy; 0x17uy; 0xc0uy; 0xe2uy; 0xcbuy; 0x37uy; 0x97uy; 0xaauy;
0x2auy; 0x2fuy; 0x25uy; 0x66uy; 0x56uy; 0x16uy; 0x8euy; 0x6cuy; 0x49uy; 0x6auy; 0xfcuy; 0x5fuy;
0xb9uy; 0x32uy; 0x46uy; 0xf6uy; 0xb1uy; 0x11uy; 0x63uy; 0x98uy; 0xa3uy; 0x46uy; 0xf1uy; 0xa6uy;
0x41uy; 0xf3uy; 0xb0uy; 0x41uy; 0xe9uy; 0x89uy; 0xf7uy; 0x91uy; 0x4fuy; 0x90uy; 0xccuy; 0x2cuy;
0x7fuy; 0xffuy; 0x35uy; 0x78uy; 0x76uy; 0xe5uy; 0x06uy; 0xb5uy; 0x0duy; 0x33uy; 0x4buy; 0xa7uy;
0x7cuy; 0x22uy; 0x5buy; 0xc3uy; 0x07uy; 0xbauy; 0x53uy; 0x71uy; 0x52uy; 0xf3uy; 0xf1uy; 0x61uy;
0x0euy; 0x4euy; 0xafuy; 0xe5uy; 0x95uy; 0xf6uy; 0xd9uy; 0xd9uy; 0x0duy; 0x11uy; 0xfauy; 0xa9uy;
0x33uy; 0xa1uy; 0x5euy; 0xf1uy; 0x36uy; 0x95uy; 0x46uy; 0x86uy; 0x8auy; 0x7fuy; 0x3auy; 0x45uy;
0xa9uy; 0x67uy; 0x68uy; 0xd4uy; 0x0fuy; 0xd9uy; 0xd0uy; 0x34uy; 0x12uy; 0xc0uy; 0x91uy; 0xc6uy;
0x31uy; 0x5cuy; 0xf4uy; 0xfduy; 0xe7uy; 0xcbuy; 0x68uy; 0x60uy; 0x69uy; 0x37uy; 0x38uy; 0x0duy;
0xb2uy; 0xeauy; 0xaauy; 0x70uy; 0x7buy; 0x4cuy; 0x41uy; 0x85uy; 0xc3uy; 0x2euy; 0xdduy; 0xcduy;
0xd3uy; 0x06uy; 0x70uy; 0x5euy; 0x4duy; 0xc1uy; 0xffuy; 0xc8uy; 0x72uy; 0xeeuy; 0xeeuy; 0x47uy;
0x5auy; 0x64uy; 0xdfuy; 0xacuy; 0x86uy; 0xabuy; 0xa4uy; 0x1cuy; 0x06uy; 0x18uy; 0x98uy; 0x3fuy;
0x87uy; 0x41uy; 0xc5uy; 0xefuy; 0x68uy; 0xd3uy; 0xa1uy; 0x01uy; 0xe8uy; 0xa3uy; 0xb8uy; 0xcauy;
0xc6uy; 0x0cuy; 0x90uy; 0x5cuy; 0x15uy; 0xfcuy; 0x91uy; 0x08uy; 0x40uy; 0xb9uy; 0x4cuy; 0x00uy;
0xa0uy; 0xb9uy; 0xd0uy
]
in
assert_norm (List.Tot.length l == 1023);
of_list l | {
"checked_file": "Spec.Ed25519.Test.fst.checked",
"dependencies": [
"Spec.Ed25519.fst.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.List.Tot.fst.checked",
"FStar.List.fst.checked",
"FStar.IO.fst.checked",
"FStar.All.fst.checked"
],
"interface_file": false,
"source_file": "Spec.Ed25519.Test.fst"
} | [
"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"
] | [] | module Spec.Ed25519.Test
open FStar.Mul
open Lib.IntTypes
open Lib.RawIntTypes
open Lib.Sequence
open Lib.ByteSequence
module PS = Lib.PrintSequence
open Spec.Ed25519
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
/// Test 1
let test1_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x9duy; 0x61uy; 0xb1uy; 0x9duy; 0xefuy; 0xfduy; 0x5auy; 0x60uy;
0xbauy; 0x84uy; 0x4auy; 0xf4uy; 0x92uy; 0xecuy; 0x2cuy; 0xc4uy;
0x44uy; 0x49uy; 0xc5uy; 0x69uy; 0x7buy; 0x32uy; 0x69uy; 0x19uy;
0x70uy; 0x3buy; 0xacuy; 0x03uy; 0x1cuy; 0xaeuy; 0x7fuy; 0x60uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xd7uy; 0x5auy; 0x98uy; 0x01uy; 0x82uy; 0xb1uy; 0x0auy; 0xb7uy;
0xd5uy; 0x4buy; 0xfeuy; 0xd3uy; 0xc9uy; 0x64uy; 0x07uy; 0x3auy;
0x0euy; 0xe1uy; 0x72uy; 0xf3uy; 0xdauy; 0xa6uy; 0x23uy; 0x25uy;
0xafuy; 0x02uy; 0x1auy; 0x68uy; 0xf7uy; 0x07uy; 0x51uy; 0x1auy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test1_msg : lbytes 0 =
let l = List.Tot.map u8_from_UInt8 [] in
assert_norm (List.Tot.length l == 0);
of_list l
let test1_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0xe5uy; 0x56uy; 0x43uy; 0x00uy; 0xc3uy; 0x60uy; 0xacuy; 0x72uy;
0x90uy; 0x86uy; 0xe2uy; 0xccuy; 0x80uy; 0x6euy; 0x82uy; 0x8auy;
0x84uy; 0x87uy; 0x7fuy; 0x1euy; 0xb8uy; 0xe5uy; 0xd9uy; 0x74uy;
0xd8uy; 0x73uy; 0xe0uy; 0x65uy; 0x22uy; 0x49uy; 0x01uy; 0x55uy;
0x5fuy; 0xb8uy; 0x82uy; 0x15uy; 0x90uy; 0xa3uy; 0x3buy; 0xacuy;
0xc6uy; 0x1euy; 0x39uy; 0x70uy; 0x1cuy; 0xf9uy; 0xb4uy; 0x6buy;
0xd2uy; 0x5buy; 0xf5uy; 0xf0uy; 0x59uy; 0x5buy; 0xbeuy; 0x24uy;
0x65uy; 0x51uy; 0x41uy; 0x43uy; 0x8euy; 0x7auy; 0x10uy; 0x0buy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 2
let test2_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x4cuy; 0xcduy; 0x08uy; 0x9buy; 0x28uy; 0xffuy; 0x96uy; 0xdauy;
0x9duy; 0xb6uy; 0xc3uy; 0x46uy; 0xecuy; 0x11uy; 0x4euy; 0x0fuy;
0x5buy; 0x8auy; 0x31uy; 0x9fuy; 0x35uy; 0xabuy; 0xa6uy; 0x24uy;
0xdauy; 0x8cuy; 0xf6uy; 0xeduy; 0x4fuy; 0xb8uy; 0xa6uy; 0xfbuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x3duy; 0x40uy; 0x17uy; 0xc3uy; 0xe8uy; 0x43uy; 0x89uy; 0x5auy;
0x92uy; 0xb7uy; 0x0auy; 0xa7uy; 0x4duy; 0x1buy; 0x7euy; 0xbcuy;
0x9cuy; 0x98uy; 0x2cuy; 0xcfuy; 0x2euy; 0xc4uy; 0x96uy; 0x8cuy;
0xc0uy; 0xcduy; 0x55uy; 0xf1uy; 0x2auy; 0xf4uy; 0x66uy; 0x0cuy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test2_msg : lbytes 1 =
let l = List.Tot.map u8_from_UInt8 [ 0x72uy ] in
assert_norm (List.Tot.length l == 1);
of_list l
let test2_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x92uy; 0xa0uy; 0x09uy; 0xa9uy; 0xf0uy; 0xd4uy; 0xcauy; 0xb8uy;
0x72uy; 0x0euy; 0x82uy; 0x0buy; 0x5fuy; 0x64uy; 0x25uy; 0x40uy;
0xa2uy; 0xb2uy; 0x7buy; 0x54uy; 0x16uy; 0x50uy; 0x3fuy; 0x8fuy;
0xb3uy; 0x76uy; 0x22uy; 0x23uy; 0xebuy; 0xdbuy; 0x69uy; 0xdauy;
0x08uy; 0x5auy; 0xc1uy; 0xe4uy; 0x3euy; 0x15uy; 0x99uy; 0x6euy;
0x45uy; 0x8fuy; 0x36uy; 0x13uy; 0xd0uy; 0xf1uy; 0x1duy; 0x8cuy;
0x38uy; 0x7buy; 0x2euy; 0xaeuy; 0xb4uy; 0x30uy; 0x2auy; 0xeeuy;
0xb0uy; 0x0duy; 0x29uy; 0x16uy; 0x12uy; 0xbbuy; 0x0cuy; 0x00uy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 3
let test3_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xc5uy; 0xaauy; 0x8duy; 0xf4uy; 0x3fuy; 0x9fuy; 0x83uy; 0x7buy;
0xeduy; 0xb7uy; 0x44uy; 0x2fuy; 0x31uy; 0xdcuy; 0xb7uy; 0xb1uy;
0x66uy; 0xd3uy; 0x85uy; 0x35uy; 0x07uy; 0x6fuy; 0x09uy; 0x4buy;
0x85uy; 0xceuy; 0x3auy; 0x2euy; 0x0buy; 0x44uy; 0x58uy; 0xf7uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xfcuy; 0x51uy; 0xcduy; 0x8euy; 0x62uy; 0x18uy; 0xa1uy; 0xa3uy;
0x8duy; 0xa4uy; 0x7euy; 0xd0uy; 0x02uy; 0x30uy; 0xf0uy; 0x58uy;
0x08uy; 0x16uy; 0xeduy; 0x13uy; 0xbauy; 0x33uy; 0x03uy; 0xacuy;
0x5duy; 0xebuy; 0x91uy; 0x15uy; 0x48uy; 0x90uy; 0x80uy; 0x25uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test3_msg : lbytes 2 =
let l = List.Tot.map u8_from_UInt8 [ 0xafuy; 0x82uy ] in
assert_norm (List.Tot.length l == 2);
of_list l
let test3_expected_sig : lbytes 64 =
let l = List.Tot.map u8_from_UInt8 [
0x62uy; 0x91uy; 0xd6uy; 0x57uy; 0xdeuy; 0xecuy; 0x24uy; 0x02uy;
0x48uy; 0x27uy; 0xe6uy; 0x9cuy; 0x3auy; 0xbeuy; 0x01uy; 0xa3uy;
0x0cuy; 0xe5uy; 0x48uy; 0xa2uy; 0x84uy; 0x74uy; 0x3auy; 0x44uy;
0x5euy; 0x36uy; 0x80uy; 0xd7uy; 0xdbuy; 0x5auy; 0xc3uy; 0xacuy;
0x18uy; 0xffuy; 0x9buy; 0x53uy; 0x8duy; 0x16uy; 0xf2uy; 0x90uy;
0xaeuy; 0x67uy; 0xf7uy; 0x60uy; 0x98uy; 0x4duy; 0xc6uy; 0x59uy;
0x4auy; 0x7cuy; 0x15uy; 0xe9uy; 0x71uy; 0x6euy; 0xd2uy; 0x8duy;
0xc0uy; 0x27uy; 0xbeuy; 0xceuy; 0xeauy; 0x1euy; 0xc4uy; 0x0auy
] in
assert_norm (List.Tot.length l == 64);
of_list l
/// Test 4
let test4_sk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0xf5uy; 0xe5uy; 0x76uy; 0x7cuy; 0xf1uy; 0x53uy; 0x31uy; 0x95uy;
0x17uy; 0x63uy; 0x0fuy; 0x22uy; 0x68uy; 0x76uy; 0xb8uy; 0x6cuy;
0x81uy; 0x60uy; 0xccuy; 0x58uy; 0x3buy; 0xc0uy; 0x13uy; 0x74uy;
0x4cuy; 0x6buy; 0xf2uy; 0x55uy; 0xf5uy; 0xccuy; 0x0euy; 0xe5uy
] in
assert_norm (List.Tot.length l == 32);
of_list l
let test4_pk : lbytes 32 =
let l = List.Tot.map u8_from_UInt8 [
0x27uy; 0x81uy; 0x17uy; 0xfcuy; 0x14uy; 0x4cuy; 0x72uy; 0x34uy;
0x0fuy; 0x67uy; 0xd0uy; 0xf2uy; 0x31uy; 0x6euy; 0x83uy; 0x86uy;
0xceuy; 0xffuy; 0xbfuy; 0x2buy; 0x24uy; 0x28uy; 0xc9uy; 0xc5uy;
0x1fuy; 0xefuy; 0x7cuy; 0x59uy; 0x7fuy; 0x1duy; 0x42uy; 0x6euy
] in
assert_norm (List.Tot.length l == 32);
of_list l | false | false | Spec.Ed25519.Test.fst | {
"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"
} | null | val test4_msg:lbytes 1023 | [] | Spec.Ed25519.Test.test4_msg | {
"file_name": "specs/tests/Spec.Ed25519.Test.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Lib.Sequence.lseq (Lib.IntTypes.int_t Lib.IntTypes.U8 Lib.IntTypes.SEC) 1023 | {
"end_col": 11,
"end_line": 305,
"start_col": 29,
"start_line": 173
} |
Prims.Tot | val sel (f:flag) (m:t) : flag_val_t | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Map16",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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
}
] | false | let sel (r:flag) (m:t) : flag_val_t =
Map.sel m r | val sel (f:flag) (m:t) : flag_val_t
let sel (r: flag) (m: t) : flag_val_t = | false | null | false | Map.sel m r | {
"checked_file": "Vale.X64.Flags.fst.checked",
"dependencies": [
"Vale.X64.Machine_s.fst.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.X64.Flags.fst"
} | [
"total"
] | [
"Vale.X64.Machine_s.flag",
"Vale.X64.Flags.t",
"FStar.Map.sel",
"Vale.X64.Flags.flag_val_t"
] | [] | module Vale.X64.Flags
open FStar.Mul
open Vale.X64.Machine_s
type t = (m:Map.t flag flag_val_t{Set.equal (Map.domain m) (Set.complement Set.empty)})
[@va_qattr "opaque_to_smt"] | false | true | Vale.X64.Flags.fst | {
"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"
} | null | val sel (f:flag) (m:t) : flag_val_t | [] | Vale.X64.Flags.sel | {
"file_name": "vale/code/arch/x64/Vale.X64.Flags.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Vale.X64.Machine_s.flag -> m: Vale.X64.Flags.t -> Vale.X64.Flags.flag_val_t | {
"end_col": 13,
"end_line": 9,
"start_col": 2,
"start_line": 9
} |
Prims.Tot | val equal (flags1:t) (flags2:t) : prop0 | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Map16",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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
}
] | false | let equal m1 m2 = m1 == m2 | val equal (flags1:t) (flags2:t) : prop0
let equal m1 m2 = | false | null | false | m1 == m2 | {
"checked_file": "Vale.X64.Flags.fst.checked",
"dependencies": [
"Vale.X64.Machine_s.fst.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.X64.Flags.fst"
} | [
"total"
] | [
"Vale.X64.Flags.t",
"Prims.eq2",
"Vale.Def.Prop_s.prop0"
] | [] | module Vale.X64.Flags
open FStar.Mul
open Vale.X64.Machine_s
type t = (m:Map.t flag flag_val_t{Set.equal (Map.domain m) (Set.complement Set.empty)})
[@va_qattr "opaque_to_smt"]
let sel (r:flag) (m:t) : flag_val_t =
Map.sel m r
[@va_qattr "opaque_to_smt"]
let upd (r:flag) (v:flag_val_t) (m:t) : t =
reveal_opaque (`%t) t;
Map.upd m r v
let of_fun m =
let m' = Map.const None in
let m' = Map.upd m' 0 (m 0) in
let m' = Map.upd m' 1 (m 1) in
let m' = Map.upd m' 2 (m 2) in
let m' = Map.upd m' 3 (m 3) in
let m' = Map.upd m' 4 (m 4) in
let m' = Map.upd m' 5 (m 5) in
let m' = Map.upd m' 6 (m 6) in
let m' = Map.upd m' 7 (m 7) in
let m' = Map.upd m' 8 (m 8) in
let m' = Map.upd m' 9 (m 9) in
let m' = Map.upd m' 10 (m 10) in
let m' = Map.upd m' 11 (m 11) in
let m' = Map.upd m' 12 (m 12) in
let m' = Map.upd m' 13 (m 13) in
let m' = Map.upd m' 14 (m 14) in
let m' = Map.upd m' 15 (m 15) in
assert_norm (m 0 == sel 0 m');
assert_norm (m 1 == sel 1 m');
assert_norm (m 2 == sel 2 m');
assert_norm (m 3 == sel 3 m');
assert_norm (m 4 == sel 4 m');
assert_norm (m 5 == sel 5 m');
assert_norm (m 6 == sel 6 m');
assert_norm (m 7 == sel 7 m');
assert_norm (m 8 == sel 8 m');
assert_norm (m 9 == sel 9 m');
assert_norm (m 10 == sel 10 m');
assert_norm (m 11 == sel 11 m');
assert_norm (m 12 == sel 12 m');
assert_norm (m 13 == sel 13 m');
assert_norm (m 14 == sel 14 m');
assert_norm (m 15 == sel 15 m');
m'
let lemma_upd_eq r v m =
reveal_opaque (`%sel) sel;
reveal_opaque (`%upd) upd;
Map.lemma_SelUpd1 m r v
let lemma_upd_ne r r' v m =
reveal_opaque (`%sel) sel;
reveal_opaque (`%upd) upd;
Map.lemma_SelUpd2 m r r' v | false | true | Vale.X64.Flags.fst | {
"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"
} | null | val equal (flags1:t) (flags2:t) : prop0 | [] | Vale.X64.Flags.equal | {
"file_name": "vale/code/arch/x64/Vale.X64.Flags.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | flags1: Vale.X64.Flags.t -> flags2: Vale.X64.Flags.t -> Vale.Def.Prop_s.prop0 | {
"end_col": 26,
"end_line": 62,
"start_col": 18,
"start_line": 62
} |
Prims.Tot | val upd (f:flag) (v:flag_val_t) (m:t) : t | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Map16",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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
}
] | false | let upd (r:flag) (v:flag_val_t) (m:t) : t =
reveal_opaque (`%t) t;
Map.upd m r v | val upd (f:flag) (v:flag_val_t) (m:t) : t
let upd (r: flag) (v: flag_val_t) (m: t) : t = | false | null | false | reveal_opaque (`%t) t;
Map.upd m r v | {
"checked_file": "Vale.X64.Flags.fst.checked",
"dependencies": [
"Vale.X64.Machine_s.fst.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.X64.Flags.fst"
} | [
"total"
] | [
"Vale.X64.Machine_s.flag",
"Vale.X64.Flags.flag_val_t",
"Vale.X64.Flags.t",
"FStar.Map.upd",
"Prims.unit",
"FStar.Pervasives.reveal_opaque"
] | [] | module Vale.X64.Flags
open FStar.Mul
open Vale.X64.Machine_s
type t = (m:Map.t flag flag_val_t{Set.equal (Map.domain m) (Set.complement Set.empty)})
[@va_qattr "opaque_to_smt"]
let sel (r:flag) (m:t) : flag_val_t =
Map.sel m r
[@va_qattr "opaque_to_smt"] | false | true | Vale.X64.Flags.fst | {
"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"
} | null | val upd (f:flag) (v:flag_val_t) (m:t) : t | [] | Vale.X64.Flags.upd | {
"file_name": "vale/code/arch/x64/Vale.X64.Flags.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | f: Vale.X64.Machine_s.flag -> v: Vale.X64.Flags.flag_val_t -> m: Vale.X64.Flags.t
-> Vale.X64.Flags.t | {
"end_col": 15,
"end_line": 14,
"start_col": 2,
"start_line": 13
} |
FStar.Pervasives.Lemma | val lemma_upd_ne (r r':flag) (v:flag_val_t) (m:t) : Lemma
(requires r =!= r')
(ensures sel r (upd r' v m) == sel r m)
[SMTPat (sel r (upd r' v m))] | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Map16",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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
}
] | false | let lemma_upd_ne r r' v m =
reveal_opaque (`%sel) sel;
reveal_opaque (`%upd) upd;
Map.lemma_SelUpd2 m r r' v | val lemma_upd_ne (r r':flag) (v:flag_val_t) (m:t) : Lemma
(requires r =!= r')
(ensures sel r (upd r' v m) == sel r m)
[SMTPat (sel r (upd r' v m))]
let lemma_upd_ne r r' v m = | false | null | true | reveal_opaque (`%sel) sel;
reveal_opaque (`%upd) upd;
Map.lemma_SelUpd2 m r r' v | {
"checked_file": "Vale.X64.Flags.fst.checked",
"dependencies": [
"Vale.X64.Machine_s.fst.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.X64.Flags.fst"
} | [
"lemma"
] | [
"Vale.X64.Machine_s.flag",
"Vale.X64.Flags.flag_val_t",
"Vale.X64.Flags.t",
"FStar.Map.lemma_SelUpd2",
"Prims.unit",
"FStar.Pervasives.reveal_opaque",
"Vale.X64.Flags.upd",
"Vale.X64.Flags.sel"
] | [] | module Vale.X64.Flags
open FStar.Mul
open Vale.X64.Machine_s
type t = (m:Map.t flag flag_val_t{Set.equal (Map.domain m) (Set.complement Set.empty)})
[@va_qattr "opaque_to_smt"]
let sel (r:flag) (m:t) : flag_val_t =
Map.sel m r
[@va_qattr "opaque_to_smt"]
let upd (r:flag) (v:flag_val_t) (m:t) : t =
reveal_opaque (`%t) t;
Map.upd m r v
let of_fun m =
let m' = Map.const None in
let m' = Map.upd m' 0 (m 0) in
let m' = Map.upd m' 1 (m 1) in
let m' = Map.upd m' 2 (m 2) in
let m' = Map.upd m' 3 (m 3) in
let m' = Map.upd m' 4 (m 4) in
let m' = Map.upd m' 5 (m 5) in
let m' = Map.upd m' 6 (m 6) in
let m' = Map.upd m' 7 (m 7) in
let m' = Map.upd m' 8 (m 8) in
let m' = Map.upd m' 9 (m 9) in
let m' = Map.upd m' 10 (m 10) in
let m' = Map.upd m' 11 (m 11) in
let m' = Map.upd m' 12 (m 12) in
let m' = Map.upd m' 13 (m 13) in
let m' = Map.upd m' 14 (m 14) in
let m' = Map.upd m' 15 (m 15) in
assert_norm (m 0 == sel 0 m');
assert_norm (m 1 == sel 1 m');
assert_norm (m 2 == sel 2 m');
assert_norm (m 3 == sel 3 m');
assert_norm (m 4 == sel 4 m');
assert_norm (m 5 == sel 5 m');
assert_norm (m 6 == sel 6 m');
assert_norm (m 7 == sel 7 m');
assert_norm (m 8 == sel 8 m');
assert_norm (m 9 == sel 9 m');
assert_norm (m 10 == sel 10 m');
assert_norm (m 11 == sel 11 m');
assert_norm (m 12 == sel 12 m');
assert_norm (m 13 == sel 13 m');
assert_norm (m 14 == sel 14 m');
assert_norm (m 15 == sel 15 m');
m'
let lemma_upd_eq r v m =
reveal_opaque (`%sel) sel;
reveal_opaque (`%upd) upd;
Map.lemma_SelUpd1 m r v | false | false | Vale.X64.Flags.fst | {
"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"
} | null | val lemma_upd_ne (r r':flag) (v:flag_val_t) (m:t) : Lemma
(requires r =!= r')
(ensures sel r (upd r' v m) == sel r m)
[SMTPat (sel r (upd r' v m))] | [] | Vale.X64.Flags.lemma_upd_ne | {
"file_name": "vale/code/arch/x64/Vale.X64.Flags.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
r: Vale.X64.Machine_s.flag ->
r': Vale.X64.Machine_s.flag ->
v: Vale.X64.Flags.flag_val_t ->
m: Vale.X64.Flags.t
-> FStar.Pervasives.Lemma (requires ~(r == r'))
(ensures Vale.X64.Flags.sel r (Vale.X64.Flags.upd r' v m) == Vale.X64.Flags.sel r m)
[SMTPat (Vale.X64.Flags.sel r (Vale.X64.Flags.upd r' v m))] | {
"end_col": 28,
"end_line": 60,
"start_col": 2,
"start_line": 58
} |
FStar.Pervasives.Lemma | val lemma_upd_eq (r:flag) (v:flag_val_t) (m:t) : Lemma
(requires True)
(ensures sel r (upd r v m) == v)
[SMTPat (sel r (upd r v m))] | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Map16",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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
}
] | false | let lemma_upd_eq r v m =
reveal_opaque (`%sel) sel;
reveal_opaque (`%upd) upd;
Map.lemma_SelUpd1 m r v | val lemma_upd_eq (r:flag) (v:flag_val_t) (m:t) : Lemma
(requires True)
(ensures sel r (upd r v m) == v)
[SMTPat (sel r (upd r v m))]
let lemma_upd_eq r v m = | false | null | true | reveal_opaque (`%sel) sel;
reveal_opaque (`%upd) upd;
Map.lemma_SelUpd1 m r v | {
"checked_file": "Vale.X64.Flags.fst.checked",
"dependencies": [
"Vale.X64.Machine_s.fst.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.X64.Flags.fst"
} | [
"lemma"
] | [
"Vale.X64.Machine_s.flag",
"Vale.X64.Flags.flag_val_t",
"Vale.X64.Flags.t",
"FStar.Map.lemma_SelUpd1",
"Prims.unit",
"FStar.Pervasives.reveal_opaque",
"Vale.X64.Flags.upd",
"Vale.X64.Flags.sel"
] | [] | module Vale.X64.Flags
open FStar.Mul
open Vale.X64.Machine_s
type t = (m:Map.t flag flag_val_t{Set.equal (Map.domain m) (Set.complement Set.empty)})
[@va_qattr "opaque_to_smt"]
let sel (r:flag) (m:t) : flag_val_t =
Map.sel m r
[@va_qattr "opaque_to_smt"]
let upd (r:flag) (v:flag_val_t) (m:t) : t =
reveal_opaque (`%t) t;
Map.upd m r v
let of_fun m =
let m' = Map.const None in
let m' = Map.upd m' 0 (m 0) in
let m' = Map.upd m' 1 (m 1) in
let m' = Map.upd m' 2 (m 2) in
let m' = Map.upd m' 3 (m 3) in
let m' = Map.upd m' 4 (m 4) in
let m' = Map.upd m' 5 (m 5) in
let m' = Map.upd m' 6 (m 6) in
let m' = Map.upd m' 7 (m 7) in
let m' = Map.upd m' 8 (m 8) in
let m' = Map.upd m' 9 (m 9) in
let m' = Map.upd m' 10 (m 10) in
let m' = Map.upd m' 11 (m 11) in
let m' = Map.upd m' 12 (m 12) in
let m' = Map.upd m' 13 (m 13) in
let m' = Map.upd m' 14 (m 14) in
let m' = Map.upd m' 15 (m 15) in
assert_norm (m 0 == sel 0 m');
assert_norm (m 1 == sel 1 m');
assert_norm (m 2 == sel 2 m');
assert_norm (m 3 == sel 3 m');
assert_norm (m 4 == sel 4 m');
assert_norm (m 5 == sel 5 m');
assert_norm (m 6 == sel 6 m');
assert_norm (m 7 == sel 7 m');
assert_norm (m 8 == sel 8 m');
assert_norm (m 9 == sel 9 m');
assert_norm (m 10 == sel 10 m');
assert_norm (m 11 == sel 11 m');
assert_norm (m 12 == sel 12 m');
assert_norm (m 13 == sel 13 m');
assert_norm (m 14 == sel 14 m');
assert_norm (m 15 == sel 15 m');
m' | false | false | Vale.X64.Flags.fst | {
"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"
} | null | val lemma_upd_eq (r:flag) (v:flag_val_t) (m:t) : Lemma
(requires True)
(ensures sel r (upd r v m) == v)
[SMTPat (sel r (upd r v m))] | [] | Vale.X64.Flags.lemma_upd_eq | {
"file_name": "vale/code/arch/x64/Vale.X64.Flags.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | r: Vale.X64.Machine_s.flag -> v: Vale.X64.Flags.flag_val_t -> m: Vale.X64.Flags.t
-> FStar.Pervasives.Lemma (ensures Vale.X64.Flags.sel r (Vale.X64.Flags.upd r v m) == v)
[SMTPat (Vale.X64.Flags.sel r (Vale.X64.Flags.upd r v m))] | {
"end_col": 25,
"end_line": 55,
"start_col": 2,
"start_line": 53
} |
FStar.Pervasives.Lemma | val lemma_equal_intro (flags1:t) (flags2:t) : Lemma
(requires forall (r:flag). sel r flags1 == sel r flags2)
(ensures equal flags1 flags2)
[SMTPat (equal flags1 flags2)] | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Map16",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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
}
] | false | let lemma_equal_intro m1 m2 =
assert_norm (forall (r:flag). sel r m1 == Map.sel m1 r);
assert_norm (forall (r:flag). sel r m2 == Map.sel m2 r);
reveal_opaque (`%t) t;
Map.lemma_equal_intro m1 m2 | val lemma_equal_intro (flags1:t) (flags2:t) : Lemma
(requires forall (r:flag). sel r flags1 == sel r flags2)
(ensures equal flags1 flags2)
[SMTPat (equal flags1 flags2)]
let lemma_equal_intro m1 m2 = | false | null | true | assert_norm (forall (r: flag). sel r m1 == Map.sel m1 r);
assert_norm (forall (r: flag). sel r m2 == Map.sel m2 r);
reveal_opaque (`%t) t;
Map.lemma_equal_intro m1 m2 | {
"checked_file": "Vale.X64.Flags.fst.checked",
"dependencies": [
"Vale.X64.Machine_s.fst.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.X64.Flags.fst"
} | [
"lemma"
] | [
"Vale.X64.Flags.t",
"FStar.Map.lemma_equal_intro",
"Vale.X64.Machine_s.flag",
"Vale.X64.Flags.flag_val_t",
"Prims.unit",
"FStar.Pervasives.reveal_opaque",
"FStar.Pervasives.assert_norm",
"Prims.l_Forall",
"Prims.eq2",
"Vale.X64.Flags.sel",
"FStar.Map.sel"
] | [] | module Vale.X64.Flags
open FStar.Mul
open Vale.X64.Machine_s
type t = (m:Map.t flag flag_val_t{Set.equal (Map.domain m) (Set.complement Set.empty)})
[@va_qattr "opaque_to_smt"]
let sel (r:flag) (m:t) : flag_val_t =
Map.sel m r
[@va_qattr "opaque_to_smt"]
let upd (r:flag) (v:flag_val_t) (m:t) : t =
reveal_opaque (`%t) t;
Map.upd m r v
let of_fun m =
let m' = Map.const None in
let m' = Map.upd m' 0 (m 0) in
let m' = Map.upd m' 1 (m 1) in
let m' = Map.upd m' 2 (m 2) in
let m' = Map.upd m' 3 (m 3) in
let m' = Map.upd m' 4 (m 4) in
let m' = Map.upd m' 5 (m 5) in
let m' = Map.upd m' 6 (m 6) in
let m' = Map.upd m' 7 (m 7) in
let m' = Map.upd m' 8 (m 8) in
let m' = Map.upd m' 9 (m 9) in
let m' = Map.upd m' 10 (m 10) in
let m' = Map.upd m' 11 (m 11) in
let m' = Map.upd m' 12 (m 12) in
let m' = Map.upd m' 13 (m 13) in
let m' = Map.upd m' 14 (m 14) in
let m' = Map.upd m' 15 (m 15) in
assert_norm (m 0 == sel 0 m');
assert_norm (m 1 == sel 1 m');
assert_norm (m 2 == sel 2 m');
assert_norm (m 3 == sel 3 m');
assert_norm (m 4 == sel 4 m');
assert_norm (m 5 == sel 5 m');
assert_norm (m 6 == sel 6 m');
assert_norm (m 7 == sel 7 m');
assert_norm (m 8 == sel 8 m');
assert_norm (m 9 == sel 9 m');
assert_norm (m 10 == sel 10 m');
assert_norm (m 11 == sel 11 m');
assert_norm (m 12 == sel 12 m');
assert_norm (m 13 == sel 13 m');
assert_norm (m 14 == sel 14 m');
assert_norm (m 15 == sel 15 m');
m'
let lemma_upd_eq r v m =
reveal_opaque (`%sel) sel;
reveal_opaque (`%upd) upd;
Map.lemma_SelUpd1 m r v
let lemma_upd_ne r r' v m =
reveal_opaque (`%sel) sel;
reveal_opaque (`%upd) upd;
Map.lemma_SelUpd2 m r r' v
let equal m1 m2 = m1 == m2 | false | false | Vale.X64.Flags.fst | {
"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"
} | null | val lemma_equal_intro (flags1:t) (flags2:t) : Lemma
(requires forall (r:flag). sel r flags1 == sel r flags2)
(ensures equal flags1 flags2)
[SMTPat (equal flags1 flags2)] | [] | Vale.X64.Flags.lemma_equal_intro | {
"file_name": "vale/code/arch/x64/Vale.X64.Flags.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | flags1: Vale.X64.Flags.t -> flags2: Vale.X64.Flags.t
-> FStar.Pervasives.Lemma
(requires
forall (r: Vale.X64.Machine_s.flag).
Vale.X64.Flags.sel r flags1 == Vale.X64.Flags.sel r flags2)
(ensures Vale.X64.Flags.equal flags1 flags2)
[SMTPat (Vale.X64.Flags.equal flags1 flags2)] | {
"end_col": 29,
"end_line": 68,
"start_col": 2,
"start_line": 65
} |
Prims.Pure | val of_fun (m:flag -> flag_val_t) : Pure t
(requires True)
(ensures fun m' -> (forall (r:flag).{:pattern (m r) \/ (sel r m')} m r == sel r m')) | [
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Lib.Map16",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.X64.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Prop_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.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
}
] | false | let of_fun m =
let m' = Map.const None in
let m' = Map.upd m' 0 (m 0) in
let m' = Map.upd m' 1 (m 1) in
let m' = Map.upd m' 2 (m 2) in
let m' = Map.upd m' 3 (m 3) in
let m' = Map.upd m' 4 (m 4) in
let m' = Map.upd m' 5 (m 5) in
let m' = Map.upd m' 6 (m 6) in
let m' = Map.upd m' 7 (m 7) in
let m' = Map.upd m' 8 (m 8) in
let m' = Map.upd m' 9 (m 9) in
let m' = Map.upd m' 10 (m 10) in
let m' = Map.upd m' 11 (m 11) in
let m' = Map.upd m' 12 (m 12) in
let m' = Map.upd m' 13 (m 13) in
let m' = Map.upd m' 14 (m 14) in
let m' = Map.upd m' 15 (m 15) in
assert_norm (m 0 == sel 0 m');
assert_norm (m 1 == sel 1 m');
assert_norm (m 2 == sel 2 m');
assert_norm (m 3 == sel 3 m');
assert_norm (m 4 == sel 4 m');
assert_norm (m 5 == sel 5 m');
assert_norm (m 6 == sel 6 m');
assert_norm (m 7 == sel 7 m');
assert_norm (m 8 == sel 8 m');
assert_norm (m 9 == sel 9 m');
assert_norm (m 10 == sel 10 m');
assert_norm (m 11 == sel 11 m');
assert_norm (m 12 == sel 12 m');
assert_norm (m 13 == sel 13 m');
assert_norm (m 14 == sel 14 m');
assert_norm (m 15 == sel 15 m');
m' | val of_fun (m:flag -> flag_val_t) : Pure t
(requires True)
(ensures fun m' -> (forall (r:flag).{:pattern (m r) \/ (sel r m')} m r == sel r m'))
let of_fun m = | false | null | false | let m' = Map.const None in
let m' = Map.upd m' 0 (m 0) in
let m' = Map.upd m' 1 (m 1) in
let m' = Map.upd m' 2 (m 2) in
let m' = Map.upd m' 3 (m 3) in
let m' = Map.upd m' 4 (m 4) in
let m' = Map.upd m' 5 (m 5) in
let m' = Map.upd m' 6 (m 6) in
let m' = Map.upd m' 7 (m 7) in
let m' = Map.upd m' 8 (m 8) in
let m' = Map.upd m' 9 (m 9) in
let m' = Map.upd m' 10 (m 10) in
let m' = Map.upd m' 11 (m 11) in
let m' = Map.upd m' 12 (m 12) in
let m' = Map.upd m' 13 (m 13) in
let m' = Map.upd m' 14 (m 14) in
let m' = Map.upd m' 15 (m 15) in
assert_norm (m 0 == sel 0 m');
assert_norm (m 1 == sel 1 m');
assert_norm (m 2 == sel 2 m');
assert_norm (m 3 == sel 3 m');
assert_norm (m 4 == sel 4 m');
assert_norm (m 5 == sel 5 m');
assert_norm (m 6 == sel 6 m');
assert_norm (m 7 == sel 7 m');
assert_norm (m 8 == sel 8 m');
assert_norm (m 9 == sel 9 m');
assert_norm (m 10 == sel 10 m');
assert_norm (m 11 == sel 11 m');
assert_norm (m 12 == sel 12 m');
assert_norm (m 13 == sel 13 m');
assert_norm (m 14 == sel 14 m');
assert_norm (m 15 == sel 15 m');
m' | {
"checked_file": "Vale.X64.Flags.fst.checked",
"dependencies": [
"Vale.X64.Machine_s.fst.checked",
"prims.fst.checked",
"FStar.Set.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Map.fsti.checked"
],
"interface_file": true,
"source_file": "Vale.X64.Flags.fst"
} | [] | [
"Vale.X64.Machine_s.flag",
"Vale.X64.Flags.flag_val_t",
"Prims.unit",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Vale.X64.Flags.sel",
"FStar.Map.t",
"FStar.Pervasives.Native.option",
"Prims.bool",
"FStar.Map.upd",
"FStar.Map.const",
"FStar.Pervasives.Native.None",
"Vale.X64.Flags.t"
] | [] | module Vale.X64.Flags
open FStar.Mul
open Vale.X64.Machine_s
type t = (m:Map.t flag flag_val_t{Set.equal (Map.domain m) (Set.complement Set.empty)})
[@va_qattr "opaque_to_smt"]
let sel (r:flag) (m:t) : flag_val_t =
Map.sel m r
[@va_qattr "opaque_to_smt"]
let upd (r:flag) (v:flag_val_t) (m:t) : t =
reveal_opaque (`%t) t;
Map.upd m r v | false | false | Vale.X64.Flags.fst | {
"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"
} | null | val of_fun (m:flag -> flag_val_t) : Pure t
(requires True)
(ensures fun m' -> (forall (r:flag).{:pattern (m r) \/ (sel r m')} m r == sel r m')) | [] | Vale.X64.Flags.of_fun | {
"file_name": "vale/code/arch/x64/Vale.X64.Flags.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | m: (_: Vale.X64.Machine_s.flag -> Vale.X64.Flags.flag_val_t) -> Prims.Pure Vale.X64.Flags.t | {
"end_col": 4,
"end_line": 50,
"start_col": 14,
"start_line": 16
} |
Prims.Tot | val repeat:
#a:Type
-> n:nat
-> f:(a -> a)
-> acc0:a
-> a | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeat #a n f acc0 =
repeati n (fixed_i f) acc0 | val repeat:
#a:Type
-> n:nat
-> f:(a -> a)
-> acc0:a
-> a
let repeat #a n f acc0 = | false | null | false | repeati n (fixed_i f) acc0 | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"total"
] | [
"Prims.nat",
"Lib.LoopCombinators.repeati",
"Lib.LoopCombinators.fixed_i"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = () | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat:
#a:Type
-> n:nat
-> f:(a -> a)
-> acc0:a
-> a | [] | Lib.LoopCombinators.repeat | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Prims.nat -> f: (_: a -> a) -> acc0: a -> a | {
"end_col": 28,
"end_line": 65,
"start_col": 2,
"start_line": 65
} |
Prims.Tot | val repeati:
#a:Type
-> n:nat
-> f:(i:nat{i < n} -> a -> a)
-> acc0:a
-> a | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0 | val repeati:
#a:Type
-> n:nat
-> f:(i:nat{i < n} -> a -> a)
-> acc0:a
-> a
let repeati #a n f acc0 = | false | null | false | repeat_gen n (fixed_a a) f acc0 | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Lib.LoopCombinators.repeat_gen",
"Lib.LoopCombinators.fixed_a"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = () | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeati:
#a:Type
-> n:nat
-> f:(i:nat{i < n} -> a -> a)
-> acc0:a
-> a | [] | Lib.LoopCombinators.repeati | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Prims.nat -> f: (i: Prims.nat{i < n} -> _: a -> a) -> acc0: a -> a | {
"end_col": 33,
"end_line": 52,
"start_col": 2,
"start_line": 52
} |
FStar.All.ML | val repeati_all_ml:
#a:Type
-> n:nat
-> f:(i:nat{i < n} -> a -> FStar.All.ML a)
-> acc0:a
-> FStar.All.ML a | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0 | val repeati_all_ml:
#a:Type
-> n:nat
-> f:(i:nat{i < n} -> a -> FStar.All.ML a)
-> acc0:a
-> FStar.All.ML a
let repeati_all_ml #a n f acc0 = | true | null | false | repeat_gen_all_ml n (fixed_a a) f acc0 | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"ml"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Lib.LoopCombinators.repeat_gen_all_ml",
"Lib.LoopCombinators.fixed_a"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0 | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeati_all_ml:
#a:Type
-> n:nat
-> f:(i:nat{i < n} -> a -> FStar.All.ML a)
-> acc0:a
-> FStar.All.ML a | [] | Lib.LoopCombinators.repeati_all_ml | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Prims.nat -> f: (i: Prims.nat{i < n} -> _: a -> FStar.All.ML a) -> acc0: a -> FStar.All.ML a | {
"end_col": 40,
"end_line": 55,
"start_col": 2,
"start_line": 55
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.Tactics",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let a' (#a:Type) (n:nat) (pred:(i:nat{i <= n} -> a -> Type)) = fun (i:nat{i<=n}) -> x:a{pred i x} | let a' (#a: Type) (n: nat) (pred: (i: nat{i <= n} -> a -> Type)) = | false | null | false | fun (i: nat{i <= n}) -> x: a{pred i x} | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = ()
let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i
let repeat_range #a min max f x =
repeat_left min max (fun _ -> a) f x
let repeat_range_all_ml #a min max f x =
repeat_left_all_ml min max (fun _ -> a) f x
let repeat_range_inductive #a min max pred f x =
repeat_left min max (fun i -> x:a{pred i x}) f x
let repeati_inductive #a n pred f x0 =
repeat_range_inductive #a 0 n pred f x0
let unfold_repeat_right_once
(lo:nat)
(hi:nat{lo < hi})
(a:(i:nat{lo <= i /\ i <= hi} -> Type))
(f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1)))
(acc:a lo)
: Lemma (repeat_right lo hi a f acc ==
f (hi - 1) (repeat_right lo (hi - 1) a f acc))
= ()
module T = FStar.Tactics
let refine_eq (a:Type) (p q:a -> prop) (x:squash (forall (i:a). p i <==> q i))
: Lemma ((i:a{p i} == i:a{q i}))
= let pext (a:Type) (p q: a -> prop) (_:squash (forall (x:a). p x <==> q x)) (x:a) : Lemma (p x == q x)
= FStar.PropositionalExtensionality.apply (p x) (q x)
in
assert (i:a{p i} == i:a{q i})
by (T.l_to_r [quote (pext a p q x)]; T.trefl())
let nat_refine_equiv (n:nat)
: Lemma ((i:nat{i <= n}) == (i:nat{0<=i /\ i<=n}))
= let b2t_prop (b:bool)
: Lemma ((b2t b) `subtype_of` unit)
= assert_norm (b2t b == squash (equals b true))
in
refine_eq nat (fun (i:nat) -> b2t_prop (i <= n); b2t (i <= n)) (fun (i:nat) -> 0 <= i /\ i <= n) () | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val a' : n: Prims.nat -> pred: (i: Prims.nat{i <= n} -> _: a -> Type) -> i: Prims.nat{i <= n} -> Type | [] | Lib.LoopCombinators.a' | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Prims.nat -> pred: (i: Prims.nat{i <= n} -> _: a -> Type) -> i: Prims.nat{i <= n} -> Type | {
"end_col": 97,
"end_line": 113,
"start_col": 63,
"start_line": 113
} |
|
Prims.Tot | val repeat_range:
#a:Type
-> min:nat
-> max:nat{min <= max}
-> (s:nat{s >= min /\ s < max} -> a -> Tot a)
-> a
-> Tot a (decreases (max - min)) | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeat_range #a min max f x =
repeat_left min max (fun _ -> a) f x | val repeat_range:
#a:Type
-> min:nat
-> max:nat{min <= max}
-> (s:nat{s >= min /\ s < max} -> a -> Tot a)
-> a
-> Tot a (decreases (max - min))
let repeat_range #a min max f x = | false | null | false | repeat_left min max (fun _ -> a) f x | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"total",
""
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.l_and",
"Prims.op_GreaterThanOrEqual",
"Prims.op_LessThan",
"Lib.LoopCombinators.repeat_left"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = ()
let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_range:
#a:Type
-> min:nat
-> max:nat{min <= max}
-> (s:nat{s >= min /\ s < max} -> a -> Tot a)
-> a
-> Tot a (decreases (max - min)) | [] | Lib.LoopCombinators.repeat_range | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
min: Prims.nat ->
max: Prims.nat{min <= max} ->
f: (s: Prims.nat{s >= min /\ s < max} -> _: a -> a) ->
x: a
-> Prims.Tot a | {
"end_col": 38,
"end_line": 74,
"start_col": 2,
"start_line": 74
} |
FStar.All.ML | val repeat_range_all_ml:
#a:Type
-> min:nat
-> max:nat{min <= max}
-> (s:nat{s >= min /\ s < max} -> a -> FStar.All.ML a)
-> a
-> FStar.All.ML a | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeat_range_all_ml #a min max f x =
repeat_left_all_ml min max (fun _ -> a) f x | val repeat_range_all_ml:
#a:Type
-> min:nat
-> max:nat{min <= max}
-> (s:nat{s >= min /\ s < max} -> a -> FStar.All.ML a)
-> a
-> FStar.All.ML a
let repeat_range_all_ml #a min max f x = | true | null | false | repeat_left_all_ml min max (fun _ -> a) f x | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"ml"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.l_and",
"Prims.op_GreaterThanOrEqual",
"Prims.op_LessThan",
"Lib.LoopCombinators.repeat_left_all_ml"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = ()
let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i
let repeat_range #a min max f x =
repeat_left min max (fun _ -> a) f x | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_range_all_ml:
#a:Type
-> min:nat
-> max:nat{min <= max}
-> (s:nat{s >= min /\ s < max} -> a -> FStar.All.ML a)
-> a
-> FStar.All.ML a | [] | Lib.LoopCombinators.repeat_range_all_ml | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
min: Prims.nat ->
max: Prims.nat{min <= max} ->
f: (s: Prims.nat{s >= min /\ s < max} -> _: a -> FStar.All.ML a) ->
x: a
-> FStar.All.ML a | {
"end_col": 45,
"end_line": 77,
"start_col": 2,
"start_line": 77
} |
FStar.Pervasives.Lemma | val nat_refine_equiv (n: nat) : Lemma ((i: nat{i <= n}) == (i: nat{0 <= i /\ i <= n})) | [
{
"abbrev": true,
"full_module": "FStar.Tactics",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let nat_refine_equiv (n:nat)
: Lemma ((i:nat{i <= n}) == (i:nat{0<=i /\ i<=n}))
= let b2t_prop (b:bool)
: Lemma ((b2t b) `subtype_of` unit)
= assert_norm (b2t b == squash (equals b true))
in
refine_eq nat (fun (i:nat) -> b2t_prop (i <= n); b2t (i <= n)) (fun (i:nat) -> 0 <= i /\ i <= n) () | val nat_refine_equiv (n: nat) : Lemma ((i: nat{i <= n}) == (i: nat{0 <= i /\ i <= n}))
let nat_refine_equiv (n: nat) : Lemma ((i: nat{i <= n}) == (i: nat{0 <= i /\ i <= n})) = | false | null | true | let b2t_prop (b: bool) : Lemma ((b2t b) `subtype_of` unit) =
assert_norm (b2t b == squash (equals b true))
in
refine_eq nat
(fun (i: nat) ->
b2t_prop (i <= n);
b2t (i <= n))
(fun (i: nat) -> 0 <= i /\ i <= n)
() | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Lib.LoopCombinators.refine_eq",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.unit",
"Prims.prop",
"Prims.l_and",
"Prims.bool",
"Prims.l_True",
"Prims.squash",
"Prims.subtype_of",
"Prims.Nil",
"FStar.Pervasives.pattern",
"FStar.Pervasives.assert_norm",
"Prims.eq2",
"Prims.equals"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = ()
let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i
let repeat_range #a min max f x =
repeat_left min max (fun _ -> a) f x
let repeat_range_all_ml #a min max f x =
repeat_left_all_ml min max (fun _ -> a) f x
let repeat_range_inductive #a min max pred f x =
repeat_left min max (fun i -> x:a{pred i x}) f x
let repeati_inductive #a n pred f x0 =
repeat_range_inductive #a 0 n pred f x0
let unfold_repeat_right_once
(lo:nat)
(hi:nat{lo < hi})
(a:(i:nat{lo <= i /\ i <= hi} -> Type))
(f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1)))
(acc:a lo)
: Lemma (repeat_right lo hi a f acc ==
f (hi - 1) (repeat_right lo (hi - 1) a f acc))
= ()
module T = FStar.Tactics
let refine_eq (a:Type) (p q:a -> prop) (x:squash (forall (i:a). p i <==> q i))
: Lemma ((i:a{p i} == i:a{q i}))
= let pext (a:Type) (p q: a -> prop) (_:squash (forall (x:a). p x <==> q x)) (x:a) : Lemma (p x == q x)
= FStar.PropositionalExtensionality.apply (p x) (q x)
in
assert (i:a{p i} == i:a{q i})
by (T.l_to_r [quote (pext a p q x)]; T.trefl())
let nat_refine_equiv (n:nat) | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val nat_refine_equiv (n: nat) : Lemma ((i: nat{i <= n}) == (i: nat{0 <= i /\ i <= n})) | [] | Lib.LoopCombinators.nat_refine_equiv | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Prims.nat
-> FStar.Pervasives.Lemma (ensures i: Prims.nat{i <= n} == i: Prims.nat{0 <= i /\ i <= n}) | {
"end_col": 103,
"end_line": 111,
"start_col": 3,
"start_line": 107
} |
FStar.Pervasives.Lemma | val refine_eq (a: Type) (p q: (a -> prop)) (x: squash (forall (i: a). p i <==> q i))
: Lemma ((i: a{p i} == i: a{q i})) | [
{
"abbrev": true,
"full_module": "FStar.Tactics",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let refine_eq (a:Type) (p q:a -> prop) (x:squash (forall (i:a). p i <==> q i))
: Lemma ((i:a{p i} == i:a{q i}))
= let pext (a:Type) (p q: a -> prop) (_:squash (forall (x:a). p x <==> q x)) (x:a) : Lemma (p x == q x)
= FStar.PropositionalExtensionality.apply (p x) (q x)
in
assert (i:a{p i} == i:a{q i})
by (T.l_to_r [quote (pext a p q x)]; T.trefl()) | val refine_eq (a: Type) (p q: (a -> prop)) (x: squash (forall (i: a). p i <==> q i))
: Lemma ((i: a{p i} == i: a{q i}))
let refine_eq (a: Type) (p q: (a -> prop)) (x: squash (forall (i: a). p i <==> q i))
: Lemma ((i: a{p i} == i: a{q i})) = | false | null | true | let pext
(a: Type)
(p: (a -> prop))
(q: (a -> prop))
(_: squash (forall (x: a). p x <==> q x))
(x: a)
: Lemma (p x == q x) =
FStar.PropositionalExtensionality.apply (p x) (q x)
in
FStar.Tactics.Effect.assert_by_tactic (i: a{p i} == i: a{q i})
(fun _ ->
();
(T.l_to_r [quote (pext a p q x)];
T.trefl ())) | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"lemma"
] | [
"Prims.prop",
"Prims.squash",
"Prims.l_Forall",
"Prims.l_iff",
"FStar.Tactics.Effect.assert_by_tactic",
"Prims.eq2",
"Prims.unit",
"FStar.Tactics.V1.Derived.trefl",
"FStar.Tactics.V1.Derived.l_to_r",
"Prims.list",
"FStar.Reflection.Types.term",
"Prims.Cons",
"Prims.Nil",
"Prims.l_True",
"FStar.Pervasives.pattern",
"FStar.PropositionalExtensionality.apply"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = ()
let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i
let repeat_range #a min max f x =
repeat_left min max (fun _ -> a) f x
let repeat_range_all_ml #a min max f x =
repeat_left_all_ml min max (fun _ -> a) f x
let repeat_range_inductive #a min max pred f x =
repeat_left min max (fun i -> x:a{pred i x}) f x
let repeati_inductive #a n pred f x0 =
repeat_range_inductive #a 0 n pred f x0
let unfold_repeat_right_once
(lo:nat)
(hi:nat{lo < hi})
(a:(i:nat{lo <= i /\ i <= hi} -> Type))
(f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1)))
(acc:a lo)
: Lemma (repeat_right lo hi a f acc ==
f (hi - 1) (repeat_right lo (hi - 1) a f acc))
= ()
module T = FStar.Tactics
let refine_eq (a:Type) (p q:a -> prop) (x:squash (forall (i:a). p i <==> q i)) | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val refine_eq (a: Type) (p q: (a -> prop)) (x: squash (forall (i: a). p i <==> q i))
: Lemma ((i: a{p i} == i: a{q i})) | [] | Lib.LoopCombinators.refine_eq | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Type ->
p: (_: a -> Prims.prop) ->
q: (_: a -> Prims.prop) ->
x: Prims.squash (forall (i: a). p i <==> q i)
-> FStar.Pervasives.Lemma (ensures i: a{p i} == i: a{q i}) | {
"end_col": 55,
"end_line": 103,
"start_col": 3,
"start_line": 99
} |
FStar.Pervasives.Lemma | val unfold_repeat:
#a:Type
-> n:nat
-> f:(a -> a)
-> acc0:a
-> i:nat{i < n}
-> Lemma (repeat #a (i + 1) f acc0 == f (repeat #a i f acc0)) | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i | val unfold_repeat:
#a:Type
-> n:nat
-> f:(a -> a)
-> acc0:a
-> i:nat{i < n}
-> Lemma (repeat #a (i + 1) f acc0 == f (repeat #a i f acc0))
let unfold_repeat #a n f acc0 i = | false | null | true | unfold_repeati #a n (fixed_i f) acc0 i | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Lib.LoopCombinators.unfold_repeati",
"Lib.LoopCombinators.fixed_i",
"Prims.unit"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = () | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val unfold_repeat:
#a:Type
-> n:nat
-> f:(a -> a)
-> acc0:a
-> i:nat{i < n}
-> Lemma (repeat #a (i + 1) f acc0 == f (repeat #a i f acc0)) | [] | Lib.LoopCombinators.unfold_repeat | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Prims.nat -> f: (_: a -> a) -> acc0: a -> i: Prims.nat{i < n}
-> FStar.Pervasives.Lemma
(ensures Lib.LoopCombinators.repeat (i + 1) f acc0 == f (Lib.LoopCombinators.repeat i f acc0)) | {
"end_col": 40,
"end_line": 70,
"start_col": 2,
"start_line": 70
} |
Prims.Tot | val repeat_range_inductive:
#a:Type
-> min:nat
-> max:nat{min <= max}
-> pred:(i:nat{i <= max} -> a -> Type)
-> f:repeatable #a #max pred
-> x0:a{pred min x0}
-> Tot (res:a{pred max res}) (decreases (max - min)) | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeat_range_inductive #a min max pred f x =
repeat_left min max (fun i -> x:a{pred i x}) f x | val repeat_range_inductive:
#a:Type
-> min:nat
-> max:nat{min <= max}
-> pred:(i:nat{i <= max} -> a -> Type)
-> f:repeatable #a #max pred
-> x0:a{pred min x0}
-> Tot (res:a{pred max res}) (decreases (max - min))
let repeat_range_inductive #a min max pred f x = | false | null | false | repeat_left min max (fun i -> x: a{pred i x}) f x | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"total",
""
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Lib.LoopCombinators.repeatable",
"Lib.LoopCombinators.repeat_left",
"Prims.l_and"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = ()
let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i
let repeat_range #a min max f x =
repeat_left min max (fun _ -> a) f x
let repeat_range_all_ml #a min max f x =
repeat_left_all_ml min max (fun _ -> a) f x | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_range_inductive:
#a:Type
-> min:nat
-> max:nat{min <= max}
-> pred:(i:nat{i <= max} -> a -> Type)
-> f:repeatable #a #max pred
-> x0:a{pred min x0}
-> Tot (res:a{pred max res}) (decreases (max - min)) | [] | Lib.LoopCombinators.repeat_range_inductive | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
min: Prims.nat ->
max: Prims.nat{min <= max} ->
pred: (i: Prims.nat{i <= max} -> _: a -> Type) ->
f: Lib.LoopCombinators.repeatable pred ->
x0: a{pred min x0}
-> Prims.Tot (res: a{pred max res}) | {
"end_col": 50,
"end_line": 80,
"start_col": 2,
"start_line": 80
} |
FStar.Pervasives.Lemma | val unfold_repeati:
#a:Type
-> n:nat
-> f:(i:nat{i < n} -> a -> a)
-> acc0:a
-> i:nat{i < n}
-> Lemma (repeati #a (i + 1) f acc0 == f i (repeati #a i f acc0)) | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i | val unfold_repeati:
#a:Type
-> n:nat
-> f:(i:nat{i < n} -> a -> a)
-> acc0:a
-> i:nat{i < n}
-> Lemma (repeati #a (i + 1) f acc0 == f i (repeati #a i f acc0))
let unfold_repeati #a n f acc0 i = | false | null | true | unfold_repeat_gen n (fixed_a a) f acc0 i | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Lib.LoopCombinators.unfold_repeat_gen",
"Lib.LoopCombinators.fixed_a",
"Prims.unit"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = () | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val unfold_repeati:
#a:Type
-> n:nat
-> f:(i:nat{i < n} -> a -> a)
-> acc0:a
-> i:nat{i < n}
-> Lemma (repeati #a (i + 1) f acc0 == f i (repeati #a i f acc0)) | [] | Lib.LoopCombinators.unfold_repeati | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Prims.nat -> f: (i: Prims.nat{i < n} -> _: a -> a) -> acc0: a -> i: Prims.nat{i < n}
-> FStar.Pervasives.Lemma
(ensures
Lib.LoopCombinators.repeati (i + 1) f acc0 == f i (Lib.LoopCombinators.repeati i f acc0)) | {
"end_col": 42,
"end_line": 60,
"start_col": 2,
"start_line": 60
} |
Prims.Tot | val repeat_gen:
n:nat
-> a:(i:nat{i <= n} -> Type)
-> f:(i:nat{i < n} -> a i -> a (i + 1))
-> acc0:a 0
-> a n | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0 | val repeat_gen:
n:nat
-> a:(i:nat{i <= n} -> Type)
-> f:(i:nat{i < n} -> a i -> a (i + 1))
-> acc0:a 0
-> a n
let repeat_gen n a f acc0 = | false | null | false | repeat_right 0 n a f acc0 | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"Prims.op_Addition",
"Lib.LoopCombinators.repeat_right"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_gen:
n:nat
-> a:(i:nat{i <= n} -> Type)
-> f:(i:nat{i < n} -> a i -> a (i + 1))
-> acc0:a 0
-> a n | [] | Lib.LoopCombinators.repeat_gen | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
n: Prims.nat ->
a: (i: Prims.nat{i <= n} -> Type) ->
f: (i: Prims.nat{i < n} -> _: a i -> a (i + 1)) ->
acc0: a 0
-> a n | {
"end_col": 27,
"end_line": 36,
"start_col": 2,
"start_line": 36
} |
Prims.Tot | val repeati_inductive:
#a:Type
-> n:nat
-> pred:(i:nat{i <= n} -> a -> Type)
-> f:repeatable #a #n pred
-> x0:a{pred 0 x0}
-> res:a{pred n res} | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeati_inductive #a n pred f x0 =
repeat_range_inductive #a 0 n pred f x0 | val repeati_inductive:
#a:Type
-> n:nat
-> pred:(i:nat{i <= n} -> a -> Type)
-> f:repeatable #a #n pred
-> x0:a{pred 0 x0}
-> res:a{pred n res}
let repeati_inductive #a n pred f x0 = | false | null | false | repeat_range_inductive #a 0 n pred f x0 | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"total"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Lib.LoopCombinators.repeatable",
"Lib.LoopCombinators.repeat_range_inductive"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = ()
let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i
let repeat_range #a min max f x =
repeat_left min max (fun _ -> a) f x
let repeat_range_all_ml #a min max f x =
repeat_left_all_ml min max (fun _ -> a) f x
let repeat_range_inductive #a min max pred f x =
repeat_left min max (fun i -> x:a{pred i x}) f x | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeati_inductive:
#a:Type
-> n:nat
-> pred:(i:nat{i <= n} -> a -> Type)
-> f:repeatable #a #n pred
-> x0:a{pred 0 x0}
-> res:a{pred n res} | [] | Lib.LoopCombinators.repeati_inductive | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
n: Prims.nat ->
pred: (i: Prims.nat{i <= n} -> _: a -> Type) ->
f: Lib.LoopCombinators.repeatable pred ->
x0: a{pred 0 x0}
-> res: a{pred n res} | {
"end_col": 41,
"end_line": 83,
"start_col": 2,
"start_line": 83
} |
FStar.All.ML | val repeat_gen_all_ml:
n:nat
-> a:(i:nat{i <= n} -> Type)
-> f:(i:nat{i < n} -> a i -> FStar.All.ML (a (i + 1)))
-> acc0:a 0
-> FStar.All.ML (a n) | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0 | val repeat_gen_all_ml:
n:nat
-> a:(i:nat{i <= n} -> Type)
-> f:(i:nat{i < n} -> a i -> FStar.All.ML (a (i + 1)))
-> acc0:a 0
-> FStar.All.ML (a n)
let repeat_gen_all_ml n a f acc0 = | true | null | false | repeat_right_all_ml 0 n a f acc0 | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"ml"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"Prims.op_Addition",
"Lib.LoopCombinators.repeat_right_all_ml"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0 | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_gen_all_ml:
n:nat
-> a:(i:nat{i <= n} -> Type)
-> f:(i:nat{i < n} -> a i -> FStar.All.ML (a (i + 1)))
-> acc0:a 0
-> FStar.All.ML (a n) | [] | Lib.LoopCombinators.repeat_gen_all_ml | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
n: Prims.nat ->
a: (i: Prims.nat{i <= n} -> Type) ->
f: (i: Prims.nat{i < n} -> _: a i -> FStar.All.ML (a (i + 1))) ->
acc0: a 0
-> FStar.All.ML (a n) | {
"end_col": 34,
"end_line": 39,
"start_col": 2,
"start_line": 39
} |
FStar.All.ML | val repeat_left_all_ml:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> FStar.All.ML (a (i + 1)))
-> acc:a lo
-> FStar.All.ML (a hi) | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc) | val repeat_left_all_ml:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> FStar.All.ML (a (i + 1)))
-> acc:a lo
-> FStar.All.ML (a hi)
let rec repeat_left_all_ml lo hi a f acc = | true | null | false | if lo = hi then acc else repeat_left_all_ml (lo + 1) hi a f (f lo acc) | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"ml"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.l_and",
"Prims.op_LessThan",
"Prims.op_Addition",
"Prims.op_Equality",
"Prims.bool",
"Lib.LoopCombinators.repeat_left_all_ml"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc) | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_left_all_ml:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> FStar.All.ML (a (i + 1)))
-> acc:a lo
-> FStar.All.ML (a hi) | [
"recursion"
] | Lib.LoopCombinators.repeat_left_all_ml | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
lo: Prims.nat ->
hi: Prims.nat{lo <= hi} ->
a: (i: Prims.nat{lo <= i /\ i <= hi} -> Type) ->
f: (i: Prims.nat{lo <= i /\ i < hi} -> _: a i -> FStar.All.ML (a (i + 1))) ->
acc: a lo
-> FStar.All.ML (a hi) | {
"end_col": 52,
"end_line": 9,
"start_col": 2,
"start_line": 8
} |
FStar.All.ML | val repeat_right_all_ml:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> FStar.All.ML (a (i + 1)))
-> acc:a lo
-> FStar.All.ML (a hi) (decreases (hi - lo)) | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc) | val repeat_right_all_ml:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> FStar.All.ML (a (i + 1)))
-> acc:a lo
-> FStar.All.ML (a hi) (decreases (hi - lo))
let rec repeat_right_all_ml lo hi a f acc = | true | null | false | if lo = hi then acc else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc) | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"ml",
""
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.l_and",
"Prims.op_LessThan",
"Prims.op_Addition",
"Prims.op_Equality",
"Prims.bool",
"Prims.op_Subtraction",
"Lib.LoopCombinators.repeat_right_all_ml"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc) | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_right_all_ml:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> FStar.All.ML (a (i + 1)))
-> acc:a lo
-> FStar.All.ML (a hi) (decreases (hi - lo)) | [
"recursion"
] | Lib.LoopCombinators.repeat_right_all_ml | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
lo: Prims.nat ->
hi: Prims.nat{lo <= hi} ->
a: (i: Prims.nat{lo <= i /\ i <= hi} -> Type) ->
f: (i: Prims.nat{lo <= i /\ i < hi} -> _: a i -> FStar.All.ML (a (i + 1))) ->
acc: a lo
-> FStar.All.ML (a hi) | {
"end_col": 59,
"end_line": 17,
"start_col": 2,
"start_line": 16
} |
Prims.Tot | val repeat_left:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Tot (a hi) (decreases (hi - lo)) | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc) | val repeat_left:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Tot (a hi) (decreases (hi - lo))
let rec repeat_left lo hi a f acc = | false | null | false | if lo = hi then acc else repeat_left (lo + 1) hi a f (f lo acc) | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"total",
""
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.l_and",
"Prims.op_LessThan",
"Prims.op_Addition",
"Prims.op_Equality",
"Prims.bool",
"Lib.LoopCombinators.repeat_left"
] | [] | module Lib.LoopCombinators | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_left:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Tot (a hi) (decreases (hi - lo)) | [
"recursion"
] | Lib.LoopCombinators.repeat_left | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
lo: Prims.nat ->
hi: Prims.nat{lo <= hi} ->
a: (i: Prims.nat{lo <= i /\ i <= hi} -> Type) ->
f: (i: Prims.nat{lo <= i /\ i < hi} -> _: a i -> a (i + 1)) ->
acc: a lo
-> Prims.Tot (a hi) | {
"end_col": 45,
"end_line": 5,
"start_col": 2,
"start_line": 4
} |
Prims.Tot | val repeat_right:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Tot (a hi) (decreases (hi - lo)) | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc) | val repeat_right:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Tot (a hi) (decreases (hi - lo))
let rec repeat_right lo hi a f acc = | false | null | false | if lo = hi then acc else f (hi - 1) (repeat_right lo (hi - 1) a f acc) | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"total",
""
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.l_and",
"Prims.op_LessThan",
"Prims.op_Addition",
"Prims.op_Equality",
"Prims.bool",
"Prims.op_Subtraction",
"Lib.LoopCombinators.repeat_right"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc) | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_right:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Tot (a hi) (decreases (hi - lo)) | [
"recursion"
] | Lib.LoopCombinators.repeat_right | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
lo: Prims.nat ->
hi: Prims.nat{lo <= hi} ->
a: (i: Prims.nat{lo <= i /\ i <= hi} -> Type) ->
f: (i: Prims.nat{lo <= i /\ i < hi} -> _: a i -> a (i + 1)) ->
acc: a lo
-> Prims.Tot (a hi) | {
"end_col": 52,
"end_line": 13,
"start_col": 2,
"start_line": 12
} |
Prims.Pure | val repeati_inductive':
#a:Type
-> n:nat
-> pred:(i:nat{i <= n} -> a -> Type0)
-> f:(i:nat{i < n} -> a -> a)
-> x0:a
-> Pure a
(requires preserves #a #n f pred /\ pred 0 x0)
(ensures fun res -> pred n res /\ res == repeati n f x0) | [
{
"abbrev": true,
"full_module": "FStar.Tactics",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeati_inductive' #a n pred f x0 =
let f'
(i:nat{i < n})
(x:a{pred i x /\ x == repeati i f x0})
: x':a{pred (i + 1) x' /\ x' == repeati (i + 1) f x0}
= f i x in
repeat_gen n (fun i -> x:a{pred i x /\ x == repeati i f x0}) f' x0 | val repeati_inductive':
#a:Type
-> n:nat
-> pred:(i:nat{i <= n} -> a -> Type0)
-> f:(i:nat{i < n} -> a -> a)
-> x0:a
-> Pure a
(requires preserves #a #n f pred /\ pred 0 x0)
(ensures fun res -> pred n res /\ res == repeati n f x0)
let repeati_inductive' #a n pred f x0 = | false | null | false | let f' (i: nat{i < n}) (x: a{pred i x /\ x == repeati i f x0})
: x': a{pred (i + 1) x' /\ x' == repeati (i + 1) f x0} =
f i x
in
repeat_gen n (fun i -> x: a{pred i x /\ x == repeati i f x0}) f' x0 | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"Lib.LoopCombinators.repeat_gen",
"Prims.l_and",
"Prims.eq2",
"Lib.LoopCombinators.repeati",
"Prims.op_Addition"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = ()
let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i
let repeat_range #a min max f x =
repeat_left min max (fun _ -> a) f x
let repeat_range_all_ml #a min max f x =
repeat_left_all_ml min max (fun _ -> a) f x
let repeat_range_inductive #a min max pred f x =
repeat_left min max (fun i -> x:a{pred i x}) f x
let repeati_inductive #a n pred f x0 =
repeat_range_inductive #a 0 n pred f x0
let unfold_repeat_right_once
(lo:nat)
(hi:nat{lo < hi})
(a:(i:nat{lo <= i /\ i <= hi} -> Type))
(f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1)))
(acc:a lo)
: Lemma (repeat_right lo hi a f acc ==
f (hi - 1) (repeat_right lo (hi - 1) a f acc))
= ()
module T = FStar.Tactics
let refine_eq (a:Type) (p q:a -> prop) (x:squash (forall (i:a). p i <==> q i))
: Lemma ((i:a{p i} == i:a{q i}))
= let pext (a:Type) (p q: a -> prop) (_:squash (forall (x:a). p x <==> q x)) (x:a) : Lemma (p x == q x)
= FStar.PropositionalExtensionality.apply (p x) (q x)
in
assert (i:a{p i} == i:a{q i})
by (T.l_to_r [quote (pext a p q x)]; T.trefl())
let nat_refine_equiv (n:nat)
: Lemma ((i:nat{i <= n}) == (i:nat{0<=i /\ i<=n}))
= let b2t_prop (b:bool)
: Lemma ((b2t b) `subtype_of` unit)
= assert_norm (b2t b == squash (equals b true))
in
refine_eq nat (fun (i:nat) -> b2t_prop (i <= n); b2t (i <= n)) (fun (i:nat) -> 0 <= i /\ i <= n) ()
let a' (#a:Type) (n:nat) (pred:(i:nat{i <= n} -> a -> Type)) = fun (i:nat{i<=n}) -> x:a{pred i x}
let repeati_repeat_left_rewrite_type (#a:Type) (n:nat) (pred:(i:nat{i <= n} -> a -> Type))
(f:repeatable #a #n pred)
(x0:a{pred 0 x0})
: Lemma (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0)
= assert (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0)
by (T.norm [delta_only [`%repeati_inductive;
`%repeat_range_inductive;
`%a']];
T.l_to_r [`nat_refine_equiv];
T.trefl())
(* This proof is technical, for multiple reasons.
1. It requires an extensionality lemma at the level to types to
relate the type of a dependent function and an eta expansion of
that type
2. It requires an extensionality lemma at the level of the
computation, which also introduces an eta expansion on f to
retype it
3. The retyping introduces a function type at a different by
propositional equal domain, so it requires a use of rewriting
based on propositional extensionality to prove that the retyping
is benign
The proof was simpler earlier, when F* had eta
equivalence. But the use of eta reduction in the SMT encoding which
this was relying on was a bit dodgy. In particular, the eta
reduction hid the retyping and so was silently (and
unintentionally) also enabling the use of propositional
extensionality. Now, that has to be explicit.
*)
let repeati_inductive_repeat_gen #a n pred f x0 =
let eta_a n (a:(i:nat{0 <= i /\ i <= n} -> Type)) = fun i -> a i in
let eta_f (f:repeatable #a #n pred) (i:nat{i < n}) (x:a' n pred i) : a' n pred (i + 1) = f i x in
let rec repeat_right_eta
(n:nat)
(hi:nat{hi <= n})
(a:(i:nat{0 <= i /\ i <= n} -> Type))
(f:(i:nat{0 <= i /\ i < n} -> a i -> a (i + 1)))
(acc:a 0)
: Lemma (ensures repeat_right 0 hi a f acc == repeat_right 0 hi (eta_a n a) f acc)
(decreases hi)
= if hi = 0
then ()
else (repeat_right_eta n (hi - 1) a f acc)
in
repeat_right_eta n n (a' n pred) (eta_f f) x0;
assert (repeat_gen n (fun i -> x:a{pred i x}) f x0 ==
repeat_right 0 n (fun (i:nat{i <= n}) -> x:a{pred i x}) f x0)
by (T.norm [delta_only [`%repeat_gen]];
T.trefl());
assert_norm (a' n pred == (fun (i:nat{i <= n}) -> x:a{pred i x}));
assert (repeat_right 0 n (fun (i:nat{i <= n}) -> x:a{pred i x}) f x0 ==
repeat_right 0 n (a' n pred) f x0);
let rec repeat_right_eta_f
(hi:nat{hi <= n})
(acc:a' n pred 0)
: Lemma (ensures repeat_right 0 hi (a' n pred) f acc ==
repeat_right 0 hi (a' n pred) (eta_f f) acc)
(decreases hi)
= if hi = 0
then ()
else (repeat_right_eta_f (hi - 1) acc)
in
repeati_repeat_left_rewrite_type n pred f x0;
assert (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0);
repeat_left_right 0 n (a' n pred) f x0;
assert (repeat_left 0 n (a' n pred) f x0 ==
repeat_right 0 n (a' n pred) f x0);
repeat_right_eta_f n x0
let repeat_gen_inductive n a pred f x0 =
let f' (i:nat{i < n})
(x:a i{pred i x /\ x == repeat_gen i a f x0})
: x':a (i + 1){pred (i + 1) x' /\ x' == repeat_gen (i + 1) a f x0}
= f i x in
repeat_gen n (fun i -> x:a i{pred i x /\ x == repeat_gen i a f x0}) f' x0 | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeati_inductive':
#a:Type
-> n:nat
-> pred:(i:nat{i <= n} -> a -> Type0)
-> f:(i:nat{i < n} -> a -> a)
-> x0:a
-> Pure a
(requires preserves #a #n f pred /\ pred 0 x0)
(ensures fun res -> pred n res /\ res == repeati n f x0) | [] | Lib.LoopCombinators.repeati_inductive' | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
n: Prims.nat ->
pred: (i: Prims.nat{i <= n} -> _: a -> Type0) ->
f: (i: Prims.nat{i < n} -> _: a -> a) ->
x0: a
-> Prims.Pure a | {
"end_col": 68,
"end_line": 205,
"start_col": 39,
"start_line": 199
} |
FStar.Pervasives.Lemma | val repeati_repeat_left_rewrite_type
(#a: Type)
(n: nat)
(pred: (i: nat{i <= n} -> a -> Type))
(f: repeatable #a #n pred)
(x0: a{pred 0 x0})
: Lemma (repeati_inductive n pred f x0 == repeat_left 0 n (a' n pred) f x0) | [
{
"abbrev": true,
"full_module": "FStar.Tactics",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeati_repeat_left_rewrite_type (#a:Type) (n:nat) (pred:(i:nat{i <= n} -> a -> Type))
(f:repeatable #a #n pred)
(x0:a{pred 0 x0})
: Lemma (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0)
= assert (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0)
by (T.norm [delta_only [`%repeati_inductive;
`%repeat_range_inductive;
`%a']];
T.l_to_r [`nat_refine_equiv];
T.trefl()) | val repeati_repeat_left_rewrite_type
(#a: Type)
(n: nat)
(pred: (i: nat{i <= n} -> a -> Type))
(f: repeatable #a #n pred)
(x0: a{pred 0 x0})
: Lemma (repeati_inductive n pred f x0 == repeat_left 0 n (a' n pred) f x0)
let repeati_repeat_left_rewrite_type
(#a: Type)
(n: nat)
(pred: (i: nat{i <= n} -> a -> Type))
(f: repeatable #a #n pred)
(x0: a{pred 0 x0})
: Lemma (repeati_inductive n pred f x0 == repeat_left 0 n (a' n pred) f x0) = | false | null | true | FStar.Tactics.Effect.assert_by_tactic (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0)
(fun _ ->
();
(T.norm [delta_only [`%repeati_inductive; `%repeat_range_inductive; `%a']];
T.l_to_r [`nat_refine_equiv];
T.trefl ())) | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Lib.LoopCombinators.repeatable",
"FStar.Tactics.Effect.assert_by_tactic",
"Prims.eq2",
"Prims.l_or",
"Prims.squash",
"Lib.LoopCombinators.repeati_inductive",
"Lib.LoopCombinators.repeat_left",
"Lib.LoopCombinators.a'",
"Prims.unit",
"FStar.Tactics.V1.Derived.trefl",
"FStar.Tactics.V1.Derived.l_to_r",
"Prims.Cons",
"FStar.Reflection.Types.term",
"Prims.Nil",
"FStar.Tactics.V1.Builtins.norm",
"FStar.Pervasives.norm_step",
"FStar.Pervasives.delta_only",
"Prims.string",
"Prims.l_True",
"FStar.Pervasives.pattern"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = ()
let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i
let repeat_range #a min max f x =
repeat_left min max (fun _ -> a) f x
let repeat_range_all_ml #a min max f x =
repeat_left_all_ml min max (fun _ -> a) f x
let repeat_range_inductive #a min max pred f x =
repeat_left min max (fun i -> x:a{pred i x}) f x
let repeati_inductive #a n pred f x0 =
repeat_range_inductive #a 0 n pred f x0
let unfold_repeat_right_once
(lo:nat)
(hi:nat{lo < hi})
(a:(i:nat{lo <= i /\ i <= hi} -> Type))
(f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1)))
(acc:a lo)
: Lemma (repeat_right lo hi a f acc ==
f (hi - 1) (repeat_right lo (hi - 1) a f acc))
= ()
module T = FStar.Tactics
let refine_eq (a:Type) (p q:a -> prop) (x:squash (forall (i:a). p i <==> q i))
: Lemma ((i:a{p i} == i:a{q i}))
= let pext (a:Type) (p q: a -> prop) (_:squash (forall (x:a). p x <==> q x)) (x:a) : Lemma (p x == q x)
= FStar.PropositionalExtensionality.apply (p x) (q x)
in
assert (i:a{p i} == i:a{q i})
by (T.l_to_r [quote (pext a p q x)]; T.trefl())
let nat_refine_equiv (n:nat)
: Lemma ((i:nat{i <= n}) == (i:nat{0<=i /\ i<=n}))
= let b2t_prop (b:bool)
: Lemma ((b2t b) `subtype_of` unit)
= assert_norm (b2t b == squash (equals b true))
in
refine_eq nat (fun (i:nat) -> b2t_prop (i <= n); b2t (i <= n)) (fun (i:nat) -> 0 <= i /\ i <= n) ()
let a' (#a:Type) (n:nat) (pred:(i:nat{i <= n} -> a -> Type)) = fun (i:nat{i<=n}) -> x:a{pred i x}
let repeati_repeat_left_rewrite_type (#a:Type) (n:nat) (pred:(i:nat{i <= n} -> a -> Type))
(f:repeatable #a #n pred)
(x0:a{pred 0 x0})
: Lemma (repeati_inductive n pred f x0 == | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeati_repeat_left_rewrite_type
(#a: Type)
(n: nat)
(pred: (i: nat{i <= n} -> a -> Type))
(f: repeatable #a #n pred)
(x0: a{pred 0 x0})
: Lemma (repeati_inductive n pred f x0 == repeat_left 0 n (a' n pred) f x0) | [] | Lib.LoopCombinators.repeati_repeat_left_rewrite_type | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
n: Prims.nat ->
pred: (i: Prims.nat{i <= n} -> _: a -> Type) ->
f: Lib.LoopCombinators.repeatable pred ->
x0: a{pred 0 x0}
-> FStar.Pervasives.Lemma
(ensures
Lib.LoopCombinators.repeati_inductive n pred f x0 ==
Lib.LoopCombinators.repeat_left 0 n (Lib.LoopCombinators.a' n pred) f x0) | {
"end_col": 23,
"end_line": 126,
"start_col": 5,
"start_line": 120
} |
FStar.Pervasives.Lemma | val repeat_left_right:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Lemma (ensures repeat_right lo hi a f acc == repeat_left lo hi a f acc)
(decreases (hi - lo)) | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end | val repeat_left_right:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Lemma (ensures repeat_right lo hi a f acc == repeat_left lo hi a f acc)
(decreases (hi - lo))
let rec repeat_left_right lo hi a f acc = | false | null | true | if lo = hi
then ()
else
(repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)) | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"lemma",
""
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.l_and",
"Prims.op_LessThan",
"Prims.op_Addition",
"Prims.op_Equality",
"Prims.bool",
"Lib.LoopCombinators.repeat_left_right",
"Prims.unit",
"Lib.LoopCombinators.repeat_right_plus"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = () | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_left_right:
lo:nat
-> hi:nat{lo <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Lemma (ensures repeat_right lo hi a f acc == repeat_left lo hi a f acc)
(decreases (hi - lo)) | [
"recursion"
] | Lib.LoopCombinators.repeat_left_right | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
lo: Prims.nat ->
hi: Prims.nat{lo <= hi} ->
a: (i: Prims.nat{lo <= i /\ i <= hi} -> Type) ->
f: (i: Prims.nat{lo <= i /\ i < hi} -> _: a i -> a (i + 1)) ->
acc: a lo
-> FStar.Pervasives.Lemma
(ensures
Lib.LoopCombinators.repeat_right lo hi a f acc ==
Lib.LoopCombinators.repeat_left lo hi a f acc) (decreases hi - lo) | {
"end_col": 7,
"end_line": 33,
"start_col": 2,
"start_line": 28
} |
FStar.Pervasives.Lemma | val repeat_right_plus:
lo:nat
-> mi:nat{lo <= mi}
-> hi:nat{mi <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Lemma (ensures
repeat_right lo hi a f acc ==
repeat_right mi hi a f (repeat_right lo mi a f acc))
(decreases hi) | [
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc | val repeat_right_plus:
lo:nat
-> mi:nat{lo <= mi}
-> hi:nat{mi <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Lemma (ensures
repeat_right lo hi a f acc ==
repeat_right mi hi a f (repeat_right lo mi a f acc))
(decreases hi)
let rec repeat_right_plus lo mi hi a f acc = | false | null | true | if hi = mi then () else repeat_right_plus lo mi (hi - 1) a f acc | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"lemma",
""
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.l_and",
"Prims.op_LessThan",
"Prims.op_Addition",
"Prims.op_Equality",
"Prims.l_or",
"Prims.bool",
"Lib.LoopCombinators.repeat_right_plus",
"Prims.op_Subtraction",
"Prims.unit"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc) | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_right_plus:
lo:nat
-> mi:nat{lo <= mi}
-> hi:nat{mi <= hi}
-> a:(i:nat{lo <= i /\ i <= hi} -> Type)
-> f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1))
-> acc:a lo
-> Lemma (ensures
repeat_right lo hi a f acc ==
repeat_right mi hi a f (repeat_right lo mi a f acc))
(decreases hi) | [
"recursion"
] | Lib.LoopCombinators.repeat_right_plus | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
lo: Prims.nat ->
mi: Prims.nat{lo <= mi} ->
hi: Prims.nat{mi <= hi} ->
a: (i: Prims.nat{lo <= i /\ i <= hi} -> Type) ->
f: (i: Prims.nat{lo <= i /\ i < hi} -> _: a i -> a (i + 1)) ->
acc: a lo
-> FStar.Pervasives.Lemma
(ensures
Lib.LoopCombinators.repeat_right lo hi a f acc ==
Lib.LoopCombinators.repeat_right mi hi a f (Lib.LoopCombinators.repeat_right lo mi a f acc))
(decreases hi) | {
"end_col": 47,
"end_line": 21,
"start_col": 2,
"start_line": 20
} |
Prims.Pure | val repeat_gen_inductive:
n:nat
-> a:(i:nat{i <= n} -> Type)
-> pred:(i:nat{i <= n} -> a i -> Type0)
-> f:(i:nat{i < n} -> a i -> a (i + 1))
-> x0:a 0
-> Pure (a n)
(requires preserves_predicate n a f pred /\ pred 0 x0)
(ensures fun res -> pred n res /\ res == repeat_gen n a f x0) | [
{
"abbrev": true,
"full_module": "FStar.Tactics",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeat_gen_inductive n a pred f x0 =
let f' (i:nat{i < n})
(x:a i{pred i x /\ x == repeat_gen i a f x0})
: x':a (i + 1){pred (i + 1) x' /\ x' == repeat_gen (i + 1) a f x0}
= f i x in
repeat_gen n (fun i -> x:a i{pred i x /\ x == repeat_gen i a f x0}) f' x0 | val repeat_gen_inductive:
n:nat
-> a:(i:nat{i <= n} -> Type)
-> pred:(i:nat{i <= n} -> a i -> Type0)
-> f:(i:nat{i < n} -> a i -> a (i + 1))
-> x0:a 0
-> Pure (a n)
(requires preserves_predicate n a f pred /\ pred 0 x0)
(ensures fun res -> pred n res /\ res == repeat_gen n a f x0)
let repeat_gen_inductive n a pred f x0 = | false | null | false | let f' (i: nat{i < n}) (x: a i {pred i x /\ x == repeat_gen i a f x0})
: x': a (i + 1) {pred (i + 1) x' /\ x' == repeat_gen (i + 1) a f x0} =
f i x
in
repeat_gen n (fun i -> x: a i {pred i x /\ x == repeat_gen i a f x0}) f' x0 | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Prims.op_LessThan",
"Prims.op_Addition",
"Lib.LoopCombinators.repeat_gen",
"Prims.l_and",
"Prims.eq2"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = ()
let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i
let repeat_range #a min max f x =
repeat_left min max (fun _ -> a) f x
let repeat_range_all_ml #a min max f x =
repeat_left_all_ml min max (fun _ -> a) f x
let repeat_range_inductive #a min max pred f x =
repeat_left min max (fun i -> x:a{pred i x}) f x
let repeati_inductive #a n pred f x0 =
repeat_range_inductive #a 0 n pred f x0
let unfold_repeat_right_once
(lo:nat)
(hi:nat{lo < hi})
(a:(i:nat{lo <= i /\ i <= hi} -> Type))
(f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1)))
(acc:a lo)
: Lemma (repeat_right lo hi a f acc ==
f (hi - 1) (repeat_right lo (hi - 1) a f acc))
= ()
module T = FStar.Tactics
let refine_eq (a:Type) (p q:a -> prop) (x:squash (forall (i:a). p i <==> q i))
: Lemma ((i:a{p i} == i:a{q i}))
= let pext (a:Type) (p q: a -> prop) (_:squash (forall (x:a). p x <==> q x)) (x:a) : Lemma (p x == q x)
= FStar.PropositionalExtensionality.apply (p x) (q x)
in
assert (i:a{p i} == i:a{q i})
by (T.l_to_r [quote (pext a p q x)]; T.trefl())
let nat_refine_equiv (n:nat)
: Lemma ((i:nat{i <= n}) == (i:nat{0<=i /\ i<=n}))
= let b2t_prop (b:bool)
: Lemma ((b2t b) `subtype_of` unit)
= assert_norm (b2t b == squash (equals b true))
in
refine_eq nat (fun (i:nat) -> b2t_prop (i <= n); b2t (i <= n)) (fun (i:nat) -> 0 <= i /\ i <= n) ()
let a' (#a:Type) (n:nat) (pred:(i:nat{i <= n} -> a -> Type)) = fun (i:nat{i<=n}) -> x:a{pred i x}
let repeati_repeat_left_rewrite_type (#a:Type) (n:nat) (pred:(i:nat{i <= n} -> a -> Type))
(f:repeatable #a #n pred)
(x0:a{pred 0 x0})
: Lemma (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0)
= assert (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0)
by (T.norm [delta_only [`%repeati_inductive;
`%repeat_range_inductive;
`%a']];
T.l_to_r [`nat_refine_equiv];
T.trefl())
(* This proof is technical, for multiple reasons.
1. It requires an extensionality lemma at the level to types to
relate the type of a dependent function and an eta expansion of
that type
2. It requires an extensionality lemma at the level of the
computation, which also introduces an eta expansion on f to
retype it
3. The retyping introduces a function type at a different by
propositional equal domain, so it requires a use of rewriting
based on propositional extensionality to prove that the retyping
is benign
The proof was simpler earlier, when F* had eta
equivalence. But the use of eta reduction in the SMT encoding which
this was relying on was a bit dodgy. In particular, the eta
reduction hid the retyping and so was silently (and
unintentionally) also enabling the use of propositional
extensionality. Now, that has to be explicit.
*)
let repeati_inductive_repeat_gen #a n pred f x0 =
let eta_a n (a:(i:nat{0 <= i /\ i <= n} -> Type)) = fun i -> a i in
let eta_f (f:repeatable #a #n pred) (i:nat{i < n}) (x:a' n pred i) : a' n pred (i + 1) = f i x in
let rec repeat_right_eta
(n:nat)
(hi:nat{hi <= n})
(a:(i:nat{0 <= i /\ i <= n} -> Type))
(f:(i:nat{0 <= i /\ i < n} -> a i -> a (i + 1)))
(acc:a 0)
: Lemma (ensures repeat_right 0 hi a f acc == repeat_right 0 hi (eta_a n a) f acc)
(decreases hi)
= if hi = 0
then ()
else (repeat_right_eta n (hi - 1) a f acc)
in
repeat_right_eta n n (a' n pred) (eta_f f) x0;
assert (repeat_gen n (fun i -> x:a{pred i x}) f x0 ==
repeat_right 0 n (fun (i:nat{i <= n}) -> x:a{pred i x}) f x0)
by (T.norm [delta_only [`%repeat_gen]];
T.trefl());
assert_norm (a' n pred == (fun (i:nat{i <= n}) -> x:a{pred i x}));
assert (repeat_right 0 n (fun (i:nat{i <= n}) -> x:a{pred i x}) f x0 ==
repeat_right 0 n (a' n pred) f x0);
let rec repeat_right_eta_f
(hi:nat{hi <= n})
(acc:a' n pred 0)
: Lemma (ensures repeat_right 0 hi (a' n pred) f acc ==
repeat_right 0 hi (a' n pred) (eta_f f) acc)
(decreases hi)
= if hi = 0
then ()
else (repeat_right_eta_f (hi - 1) acc)
in
repeati_repeat_left_rewrite_type n pred f x0;
assert (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0);
repeat_left_right 0 n (a' n pred) f x0;
assert (repeat_left 0 n (a' n pred) f x0 ==
repeat_right 0 n (a' n pred) f x0);
repeat_right_eta_f n x0 | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeat_gen_inductive:
n:nat
-> a:(i:nat{i <= n} -> Type)
-> pred:(i:nat{i <= n} -> a i -> Type0)
-> f:(i:nat{i < n} -> a i -> a (i + 1))
-> x0:a 0
-> Pure (a n)
(requires preserves_predicate n a f pred /\ pred 0 x0)
(ensures fun res -> pred n res /\ res == repeat_gen n a f x0) | [] | Lib.LoopCombinators.repeat_gen_inductive | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
n: Prims.nat ->
a: (i: Prims.nat{i <= n} -> Type) ->
pred: (i: Prims.nat{i <= n} -> _: a i -> Type0) ->
f: (i: Prims.nat{i < n} -> _: a i -> a (i + 1)) ->
x0: a 0
-> Prims.Pure (a n) | {
"end_col": 75,
"end_line": 197,
"start_col": 40,
"start_line": 192
} |
FStar.Pervasives.Lemma | val repeati_inductive_repeat_gen:
#a:Type
-> n:nat
-> pred:(i:nat{i <= n} -> a -> Type)
-> f:repeatable #a #n pred
-> x0:a{pred 0 x0}
-> Lemma (repeati_inductive n pred f x0 == repeat_gen n (fun i -> x:a{pred i x}) f x0) | [
{
"abbrev": true,
"full_module": "FStar.Tactics",
"short_module": "T"
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let repeati_inductive_repeat_gen #a n pred f x0 =
let eta_a n (a:(i:nat{0 <= i /\ i <= n} -> Type)) = fun i -> a i in
let eta_f (f:repeatable #a #n pred) (i:nat{i < n}) (x:a' n pred i) : a' n pred (i + 1) = f i x in
let rec repeat_right_eta
(n:nat)
(hi:nat{hi <= n})
(a:(i:nat{0 <= i /\ i <= n} -> Type))
(f:(i:nat{0 <= i /\ i < n} -> a i -> a (i + 1)))
(acc:a 0)
: Lemma (ensures repeat_right 0 hi a f acc == repeat_right 0 hi (eta_a n a) f acc)
(decreases hi)
= if hi = 0
then ()
else (repeat_right_eta n (hi - 1) a f acc)
in
repeat_right_eta n n (a' n pred) (eta_f f) x0;
assert (repeat_gen n (fun i -> x:a{pred i x}) f x0 ==
repeat_right 0 n (fun (i:nat{i <= n}) -> x:a{pred i x}) f x0)
by (T.norm [delta_only [`%repeat_gen]];
T.trefl());
assert_norm (a' n pred == (fun (i:nat{i <= n}) -> x:a{pred i x}));
assert (repeat_right 0 n (fun (i:nat{i <= n}) -> x:a{pred i x}) f x0 ==
repeat_right 0 n (a' n pred) f x0);
let rec repeat_right_eta_f
(hi:nat{hi <= n})
(acc:a' n pred 0)
: Lemma (ensures repeat_right 0 hi (a' n pred) f acc ==
repeat_right 0 hi (a' n pred) (eta_f f) acc)
(decreases hi)
= if hi = 0
then ()
else (repeat_right_eta_f (hi - 1) acc)
in
repeati_repeat_left_rewrite_type n pred f x0;
assert (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0);
repeat_left_right 0 n (a' n pred) f x0;
assert (repeat_left 0 n (a' n pred) f x0 ==
repeat_right 0 n (a' n pred) f x0);
repeat_right_eta_f n x0 | val repeati_inductive_repeat_gen:
#a:Type
-> n:nat
-> pred:(i:nat{i <= n} -> a -> Type)
-> f:repeatable #a #n pred
-> x0:a{pred 0 x0}
-> Lemma (repeati_inductive n pred f x0 == repeat_gen n (fun i -> x:a{pred i x}) f x0)
let repeati_inductive_repeat_gen #a n pred f x0 = | false | null | true | let eta_a n (a: (i: nat{0 <= i /\ i <= n} -> Type)) = fun i -> a i in
let eta_f (f: repeatable #a #n pred) (i: nat{i < n}) (x: a' n pred i) : a' n pred (i + 1) = f i x in
let rec repeat_right_eta
(n: nat)
(hi: nat{hi <= n})
(a: (i: nat{0 <= i /\ i <= n} -> Type))
(f: (i: nat{0 <= i /\ i < n} -> a i -> a (i + 1)))
(acc: a 0)
: Lemma (ensures repeat_right 0 hi a f acc == repeat_right 0 hi (eta_a n a) f acc)
(decreases hi) =
if hi = 0 then () else (repeat_right_eta n (hi - 1) a f acc)
in
repeat_right_eta n n (a' n pred) (eta_f f) x0;
FStar.Tactics.Effect.assert_by_tactic (repeat_gen n (fun i -> x: a{pred i x}) f x0 ==
repeat_right 0 n (fun (i: nat{i <= n}) -> x: a{pred i x}) f x0)
(fun _ ->
();
(T.norm [delta_only [`%repeat_gen]];
T.trefl ()));
assert_norm (a' n pred == (fun (i: nat{i <= n}) -> x: a{pred i x}));
assert (repeat_right 0 n (fun (i: nat{i <= n}) -> x: a{pred i x}) f x0 ==
repeat_right 0 n (a' n pred) f x0);
let rec repeat_right_eta_f (hi: nat{hi <= n}) (acc: a' n pred 0)
: Lemma
(ensures repeat_right 0 hi (a' n pred) f acc == repeat_right 0 hi (a' n pred) (eta_f f) acc)
(decreases hi) =
if hi = 0 then () else (repeat_right_eta_f (hi - 1) acc)
in
repeati_repeat_left_rewrite_type n pred f x0;
assert (repeati_inductive n pred f x0 == repeat_left 0 n (a' n pred) f x0);
repeat_left_right 0 n (a' n pred) f x0;
assert (repeat_left 0 n (a' n pred) f x0 == repeat_right 0 n (a' n pred) f x0);
repeat_right_eta_f n x0 | {
"checked_file": "Lib.LoopCombinators.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.Tactics.Effect.fsti.checked",
"FStar.Tactics.fst.checked",
"FStar.PropositionalExtensionality.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": true,
"source_file": "Lib.LoopCombinators.fst"
} | [
"lemma"
] | [
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThanOrEqual",
"Lib.LoopCombinators.repeatable",
"Prims.unit",
"Prims._assert",
"Prims.eq2",
"Lib.LoopCombinators.a'",
"Lib.LoopCombinators.repeat_left",
"Lib.LoopCombinators.repeat_right",
"Lib.LoopCombinators.repeat_left_right",
"Prims.l_or",
"Prims.squash",
"Lib.LoopCombinators.repeati_inductive",
"Lib.LoopCombinators.repeati_repeat_left_rewrite_type",
"Prims.l_True",
"Prims.Nil",
"FStar.Pervasives.pattern",
"Prims.op_Equality",
"Prims.int",
"Prims.bool",
"Prims.op_Subtraction",
"FStar.Pervasives.assert_norm",
"FStar.Tactics.Effect.assert_by_tactic",
"Lib.LoopCombinators.repeat_gen",
"FStar.Tactics.V1.Derived.trefl",
"FStar.Tactics.V1.Builtins.norm",
"Prims.Cons",
"FStar.Pervasives.norm_step",
"FStar.Pervasives.delta_only",
"Prims.string",
"Prims.l_and",
"Prims.op_LessThan",
"Prims.op_Addition"
] | [] | module Lib.LoopCombinators
let rec repeat_left lo hi a f acc =
if lo = hi then acc
else repeat_left (lo + 1) hi a f (f lo acc)
let rec repeat_left_all_ml lo hi a f acc =
if lo = hi then acc
else repeat_left_all_ml (lo + 1) hi a f (f lo acc)
let rec repeat_right lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right lo (hi - 1) a f acc)
let rec repeat_right_all_ml lo hi a f acc =
if lo = hi then acc
else f (hi - 1) (repeat_right_all_ml lo (hi - 1) a f acc)
let rec repeat_right_plus lo mi hi a f acc =
if hi = mi then ()
else repeat_right_plus lo mi (hi - 1) a f acc
let unfold_repeat_right lo hi a f acc0 i = ()
let eq_repeat_right lo hi a f acc0 = ()
let rec repeat_left_right lo hi a f acc =
if lo = hi then ()
else
begin
repeat_right_plus lo (lo + 1) hi a f acc;
repeat_left_right (lo + 1) hi a f (f lo acc)
end
let repeat_gen n a f acc0 =
repeat_right 0 n a f acc0
let repeat_gen_all_ml n a f acc0 =
repeat_right_all_ml 0 n a f acc0
let unfold_repeat_gen n a f acc0 i = ()
(* // Proof when using [repeat_left]:
repeat_left_right 0 (i + 1) a f acc0;
repeat_left_right 0 i a f acc0
*)
let eq_repeat_gen0 n a f acc0 = ()
let repeat_gen_def n a f acc0 = ()
let repeati #a n f acc0 =
repeat_gen n (fixed_a a) f acc0
let repeati_all_ml #a n f acc0 =
repeat_gen_all_ml n (fixed_a a) f acc0
let eq_repeati0 #a n f acc0 = ()
let unfold_repeati #a n f acc0 i =
unfold_repeat_gen n (fixed_a a) f acc0 i
let repeati_def #a n f acc0 = ()
let repeat #a n f acc0 =
repeati n (fixed_i f) acc0
let eq_repeat0 #a f acc0 = ()
let unfold_repeat #a n f acc0 i =
unfold_repeati #a n (fixed_i f) acc0 i
let repeat_range #a min max f x =
repeat_left min max (fun _ -> a) f x
let repeat_range_all_ml #a min max f x =
repeat_left_all_ml min max (fun _ -> a) f x
let repeat_range_inductive #a min max pred f x =
repeat_left min max (fun i -> x:a{pred i x}) f x
let repeati_inductive #a n pred f x0 =
repeat_range_inductive #a 0 n pred f x0
let unfold_repeat_right_once
(lo:nat)
(hi:nat{lo < hi})
(a:(i:nat{lo <= i /\ i <= hi} -> Type))
(f:(i:nat{lo <= i /\ i < hi} -> a i -> a (i + 1)))
(acc:a lo)
: Lemma (repeat_right lo hi a f acc ==
f (hi - 1) (repeat_right lo (hi - 1) a f acc))
= ()
module T = FStar.Tactics
let refine_eq (a:Type) (p q:a -> prop) (x:squash (forall (i:a). p i <==> q i))
: Lemma ((i:a{p i} == i:a{q i}))
= let pext (a:Type) (p q: a -> prop) (_:squash (forall (x:a). p x <==> q x)) (x:a) : Lemma (p x == q x)
= FStar.PropositionalExtensionality.apply (p x) (q x)
in
assert (i:a{p i} == i:a{q i})
by (T.l_to_r [quote (pext a p q x)]; T.trefl())
let nat_refine_equiv (n:nat)
: Lemma ((i:nat{i <= n}) == (i:nat{0<=i /\ i<=n}))
= let b2t_prop (b:bool)
: Lemma ((b2t b) `subtype_of` unit)
= assert_norm (b2t b == squash (equals b true))
in
refine_eq nat (fun (i:nat) -> b2t_prop (i <= n); b2t (i <= n)) (fun (i:nat) -> 0 <= i /\ i <= n) ()
let a' (#a:Type) (n:nat) (pred:(i:nat{i <= n} -> a -> Type)) = fun (i:nat{i<=n}) -> x:a{pred i x}
let repeati_repeat_left_rewrite_type (#a:Type) (n:nat) (pred:(i:nat{i <= n} -> a -> Type))
(f:repeatable #a #n pred)
(x0:a{pred 0 x0})
: Lemma (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0)
= assert (repeati_inductive n pred f x0 ==
repeat_left 0 n (a' n pred) f x0)
by (T.norm [delta_only [`%repeati_inductive;
`%repeat_range_inductive;
`%a']];
T.l_to_r [`nat_refine_equiv];
T.trefl())
(* This proof is technical, for multiple reasons.
1. It requires an extensionality lemma at the level to types to
relate the type of a dependent function and an eta expansion of
that type
2. It requires an extensionality lemma at the level of the
computation, which also introduces an eta expansion on f to
retype it
3. The retyping introduces a function type at a different by
propositional equal domain, so it requires a use of rewriting
based on propositional extensionality to prove that the retyping
is benign
The proof was simpler earlier, when F* had eta
equivalence. But the use of eta reduction in the SMT encoding which
this was relying on was a bit dodgy. In particular, the eta
reduction hid the retyping and so was silently (and
unintentionally) also enabling the use of propositional
extensionality. Now, that has to be explicit. | false | false | Lib.LoopCombinators.fst | {
"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"
} | null | val repeati_inductive_repeat_gen:
#a:Type
-> n:nat
-> pred:(i:nat{i <= n} -> a -> Type)
-> f:repeatable #a #n pred
-> x0:a{pred 0 x0}
-> Lemma (repeati_inductive n pred f x0 == repeat_gen n (fun i -> x:a{pred i x}) f x0) | [] | Lib.LoopCombinators.repeati_inductive_repeat_gen | {
"file_name": "lib/Lib.LoopCombinators.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
n: Prims.nat ->
pred: (i: Prims.nat{i <= n} -> _: a -> Type) ->
f: Lib.LoopCombinators.repeatable pred ->
x0: a{pred 0 x0}
-> FStar.Pervasives.Lemma
(ensures
Lib.LoopCombinators.repeati_inductive n pred f x0 ==
Lib.LoopCombinators.repeat_gen n (fun i -> x: a{pred i x}) f x0) | {
"end_col": 25,
"end_line": 189,
"start_col": 49,
"start_line": 150
} |
Prims.Tot | val add: BN.bn_add_eq_len_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs | val add: BN.bn_add_eq_len_st t_limbs n_limbs
let add:BN.bn_add_eq_len_st t_limbs n_limbs = | false | null | false | BN.bn_add_eq_len n_limbs | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.bn_add_eq_len",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum.bn_add_eq_len_st"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0" | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val add: BN.bn_add_eq_len_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.add | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.bn_add_eq_len_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 26,
"end_line": 15,
"start_col": 2,
"start_line": 15
} |
Prims.Tot | val precompr2:BM.bn_precomp_r2_mod_n_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst | val precompr2:BM.bn_precomp_r2_mod_n_st t_limbs n_limbs
let precompr2:BM.bn_precomp_r2_mod_n_st t_limbs n_limbs = | false | null | false | BM.bn_precomp_r2_mod_n bn_inst | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Montgomery.bn_precomp_r2_mod_n",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.bn_inst"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val precompr2:BM.bn_precomp_r2_mod_n_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.precompr2 | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Montgomery.bn_precomp_r2_mod_n_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 32,
"end_line": 52,
"start_col": 2,
"start_line": 52
} |
Prims.Tot | val sub: BN.bn_sub_eq_len_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs | val sub: BN.bn_sub_eq_len_st t_limbs n_limbs
let sub:BN.bn_sub_eq_len_st t_limbs n_limbs = | false | null | false | BN.bn_sub_eq_len n_limbs | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.bn_sub_eq_len",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum.bn_sub_eq_len_st"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val sub: BN.bn_sub_eq_len_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.sub | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.bn_sub_eq_len_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 26,
"end_line": 18,
"start_col": 2,
"start_line": 18
} |
Prims.Tot | val bn_slow_precomp:BR.bn_mod_slow_precomp_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst | val bn_slow_precomp:BR.bn_mod_slow_precomp_st t_limbs n_limbs
let bn_slow_precomp:BR.bn_mod_slow_precomp_st t_limbs n_limbs = | false | null | false | BR.bn_mod_slow_precomp almost_mont_inst | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.ModReduction.bn_mod_slow_precomp",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.almost_mont_inst"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val bn_slow_precomp:BR.bn_mod_slow_precomp_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.bn_slow_precomp | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.ModReduction.bn_mod_slow_precomp_st Hacl.Bignum4096_32.t_limbs
Hacl.Bignum4096_32.n_limbs | {
"end_col": 41,
"end_line": 112,
"start_col": 2,
"start_line": 112
} |
Prims.Tot | val mont_ctx_init: MA.bn_field_init_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n | val mont_ctx_init: MA.bn_field_init_st t_limbs n_limbs
let mont_ctx_init r n = | false | null | false | MA.bn_field_init n_limbs precompr2 r n | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"FStar.Monotonic.HyperHeap.rid",
"Hacl.Bignum.Definitions.lbignum",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum.MontArithmetic.bn_field_init",
"Hacl.Bignum4096_32.precompr2",
"Hacl.Bignum.MontArithmetic.pbn_mont_ctx"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mont_ctx_init: MA.bn_field_init_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.mont_ctx_init | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.MontArithmetic.bn_field_init_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 40,
"end_line": 147,
"start_col": 2,
"start_line": 147
} |
Prims.Tot | val to:BM.bn_to_mont_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction | val to:BM.bn_to_mont_st t_limbs n_limbs
let to:BM.bn_to_mont_st t_limbs n_limbs = | false | null | false | BM.bn_to_mont bn_inst reduction | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Montgomery.bn_to_mont",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.bn_inst",
"Hacl.Bignum4096_32.reduction"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val to:BM.bn_to_mont_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.to | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Montgomery.bn_to_mont_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 33,
"end_line": 60,
"start_col": 2,
"start_line": 60
} |
Prims.Tot | val exp_consttime:BE.bn_mod_exp_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp | val exp_consttime:BE.bn_mod_exp_st t_limbs n_limbs
let exp_consttime:BE.bn_mod_exp_st t_limbs n_limbs = | false | null | false | BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Exponentiation.mk_bn_mod_exp",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum4096_32.precompr2",
"Hacl.Bignum4096_32.exp_consttime_precomp"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val exp_consttime:BE.bn_mod_exp_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.exp_consttime | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Exponentiation.bn_mod_exp_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 58,
"end_line": 138,
"start_col": 2,
"start_line": 138
} |
Prims.Tot | val mod_inv_prime_vartime: BS.bn_mod_inv_prime_safe_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime | val mod_inv_prime_vartime: BS.bn_mod_inv_prime_safe_st t_limbs n_limbs
let mod_inv_prime_vartime = | false | null | false | BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.SafeAPI.mk_bn_mod_inv_prime_safe",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum4096_32.exp_vartime"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mod_inv_prime_vartime: BS.bn_mod_inv_prime_safe_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.mod_inv_prime_vartime | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.SafeAPI.bn_mod_inv_prime_safe_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 75,
"end_line": 144,
"start_col": 28,
"start_line": 144
} |
Prims.Tot | val amont_sqr:AM.bn_almost_mont_sqr_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction | val amont_sqr:AM.bn_almost_mont_sqr_st t_limbs n_limbs
let amont_sqr:AM.bn_almost_mont_sqr_st t_limbs n_limbs = | false | null | false | AM.bn_almost_mont_sqr bn_inst areduction | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.AlmostMontgomery.bn_almost_mont_sqr",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.bn_inst",
"Hacl.Bignum4096_32.areduction"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val amont_sqr:AM.bn_almost_mont_sqr_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.amont_sqr | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.AlmostMontgomery.bn_almost_mont_sqr_st Hacl.Bignum4096_32.t_limbs
Hacl.Bignum4096_32.n_limbs | {
"end_col": 42,
"end_line": 96,
"start_col": 2,
"start_line": 96
} |
Prims.Tot | val mod_inv_prime_vartime_precomp: BS.bn_mod_inv_prime_ctx_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mod_inv_prime_vartime_precomp k a res =
BS.mk_bn_mod_inv_prime_ctx n_limbs
(BI.mk_bn_mod_inv_prime_precomp n_limbs exp_vartime_precomp) k a res | val mod_inv_prime_vartime_precomp: BS.bn_mod_inv_prime_ctx_st t_limbs n_limbs
let mod_inv_prime_vartime_precomp k a res = | false | null | false | BS.mk_bn_mod_inv_prime_ctx n_limbs
(BI.mk_bn_mod_inv_prime_precomp n_limbs exp_vartime_precomp)
k
a
res | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.MontArithmetic.pbn_mont_ctx",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum.Definitions.lbignum",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum.SafeAPI.mk_bn_mod_inv_prime_ctx",
"FStar.Ghost.hide",
"Hacl.Bignum.meta_len",
"Hacl.Bignum.ModInv.mk_bn_mod_inv_prime_precomp",
"Hacl.Bignum4096_32.exp_vartime_precomp",
"Prims.unit"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime
let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n
let mont_ctx_free k =
MA.bn_field_free k
let mod_precomp k a res =
BS.bn_mod_ctx n_limbs bn_slow_precomp k a res
let mod_exp_vartime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_vartime_precomp k a bBits b res
let mod_exp_consttime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_consttime_precomp k a bBits b res | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mod_inv_prime_vartime_precomp: BS.bn_mod_inv_prime_ctx_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.mod_inv_prime_vartime_precomp | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.SafeAPI.bn_mod_inv_prime_ctx_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 72,
"end_line": 163,
"start_col": 2,
"start_line": 162
} |
Prims.Tot | val mont_check:BM.bn_check_modulus_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus | val mont_check:BM.bn_check_modulus_st t_limbs n_limbs
let mont_check:BM.bn_check_modulus_st t_limbs n_limbs = | false | null | false | BM.bn_check_modulus | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Montgomery.bn_check_modulus",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mont_check:BM.bn_check_modulus_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.mont_check | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Montgomery.bn_check_modulus_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 21,
"end_line": 48,
"start_col": 2,
"start_line": 48
} |
Prims.Tot | val amont_mul:AM.bn_almost_mont_mul_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction | val amont_mul:AM.bn_almost_mont_mul_st t_limbs n_limbs
let amont_mul:AM.bn_almost_mont_mul_st t_limbs n_limbs = | false | null | false | AM.bn_almost_mont_mul bn_inst areduction | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.AlmostMontgomery.bn_almost_mont_mul",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.bn_inst",
"Hacl.Bignum4096_32.areduction"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val amont_mul:AM.bn_almost_mont_mul_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.amont_mul | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.AlmostMontgomery.bn_almost_mont_mul_st Hacl.Bignum4096_32.t_limbs
Hacl.Bignum4096_32.n_limbs | {
"end_col": 42,
"end_line": 92,
"start_col": 2,
"start_line": 92
} |
Prims.Tot | val mod_exp_consttime: BS.bn_mod_exp_safe_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime | val mod_exp_consttime: BS.bn_mod_exp_safe_st t_limbs n_limbs
let mod_exp_consttime = | false | null | false | BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.SafeAPI.mk_bn_mod_exp_safe",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum4096_32.exp_check",
"Hacl.Bignum4096_32.exp_consttime"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mod_exp_consttime: BS.bn_mod_exp_safe_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.mod_exp_consttime | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.SafeAPI.bn_mod_exp_safe_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 77,
"end_line": 142,
"start_col": 24,
"start_line": 142
} |
Prims.Tot | val new_bn_from_bytes_be: BS.new_bn_from_bytes_be_st t_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let new_bn_from_bytes_be = BS.new_bn_from_bytes_be | val new_bn_from_bytes_be: BS.new_bn_from_bytes_be_st t_limbs
let new_bn_from_bytes_be = | false | null | false | BS.new_bn_from_bytes_be | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.SafeAPI.new_bn_from_bytes_be",
"Hacl.Bignum4096_32.t_limbs"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime
let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n
let mont_ctx_free k =
MA.bn_field_free k
let mod_precomp k a res =
BS.bn_mod_ctx n_limbs bn_slow_precomp k a res
let mod_exp_vartime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_vartime_precomp k a bBits b res
let mod_exp_consttime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_consttime_precomp k a bBits b res
let mod_inv_prime_vartime_precomp k a res =
BS.mk_bn_mod_inv_prime_ctx n_limbs
(BI.mk_bn_mod_inv_prime_precomp n_limbs exp_vartime_precomp) k a res | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val new_bn_from_bytes_be: BS.new_bn_from_bytes_be_st t_limbs | [] | Hacl.Bignum4096_32.new_bn_from_bytes_be | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.SafeAPI.new_bn_from_bytes_be_st Hacl.Bignum4096_32.t_limbs | {
"end_col": 50,
"end_line": 165,
"start_col": 27,
"start_line": 165
} |
Prims.Tot | val from:BM.bn_from_mont_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction | val from:BM.bn_from_mont_st t_limbs n_limbs
let from:BM.bn_from_mont_st t_limbs n_limbs = | false | null | false | BM.bn_from_mont bn_inst reduction | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Montgomery.bn_from_mont",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.bn_inst",
"Hacl.Bignum4096_32.reduction"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val from:BM.bn_from_mont_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.from | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Montgomery.bn_from_mont_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 35,
"end_line": 64,
"start_col": 2,
"start_line": 64
} |
Prims.Tot | val mod_exp_vartime: BS.bn_mod_exp_safe_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime | val mod_exp_vartime: BS.bn_mod_exp_safe_st t_limbs n_limbs
let mod_exp_vartime = | false | null | false | BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.SafeAPI.mk_bn_mod_exp_safe",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum4096_32.exp_check",
"Hacl.Bignum4096_32.exp_vartime"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mod_exp_vartime: BS.bn_mod_exp_safe_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.mod_exp_vartime | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.SafeAPI.bn_mod_exp_safe_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 73,
"end_line": 140,
"start_col": 22,
"start_line": 140
} |
Prims.Tot | [@@ FStar.Tactics.Typeclasses.tcinstance]
val bn_inst:BN.bn t_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
} | [@@ FStar.Tactics.Typeclasses.tcinstance]
val bn_inst:BN.bn t_limbs
[@@ FStar.Tactics.Typeclasses.tcinstance]
let bn_inst:BN.bn t_limbs = | false | null | false | {
BN.len = n_limbs;
BN.add = add;
BN.sub = sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul = mul;
BN.sqr = sqr
} | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Mkbn",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum4096_32.add",
"Hacl.Bignum4096_32.sub",
"Hacl.Bignum4096_32.add_mod",
"Hacl.Bignum4096_32.sub_mod",
"Hacl.Bignum4096_32.mul",
"Hacl.Bignum4096_32.sqr"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | [@@ FStar.Tactics.Typeclasses.tcinstance]
val bn_inst:BN.bn t_limbs | [] | Hacl.Bignum4096_32.bn_inst | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.bn Hacl.Bignum4096_32.t_limbs | {
"end_col": 8,
"end_line": 43,
"start_col": 2,
"start_line": 37
} |
Prims.Tot | val eq_mask: BN.bn_eq_mask_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let eq_mask = BN.bn_eq_mask n_limbs | val eq_mask: BN.bn_eq_mask_st t_limbs n_limbs
let eq_mask = | false | null | false | BN.bn_eq_mask n_limbs | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.bn_eq_mask",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime
let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n
let mont_ctx_free k =
MA.bn_field_free k
let mod_precomp k a res =
BS.bn_mod_ctx n_limbs bn_slow_precomp k a res
let mod_exp_vartime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_vartime_precomp k a bBits b res
let mod_exp_consttime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_consttime_precomp k a bBits b res
let mod_inv_prime_vartime_precomp k a res =
BS.mk_bn_mod_inv_prime_ctx n_limbs
(BI.mk_bn_mod_inv_prime_precomp n_limbs exp_vartime_precomp) k a res
let new_bn_from_bytes_be = BS.new_bn_from_bytes_be
let new_bn_from_bytes_le = BS.new_bn_from_bytes_le
let bn_to_bytes_be = Hacl.Bignum.Convert.mk_bn_to_bytes_be true n_bytes
let bn_to_bytes_le = Hacl.Bignum.Convert.mk_bn_to_bytes_le true n_bytes
let lt_mask = BN.bn_lt_mask n_limbs | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val eq_mask: BN.bn_eq_mask_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.eq_mask | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.bn_eq_mask_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 35,
"end_line": 175,
"start_col": 14,
"start_line": 175
} |
Prims.Tot | val mont_ctx_free: MA.bn_field_free_st t_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mont_ctx_free k =
MA.bn_field_free k | val mont_ctx_free: MA.bn_field_free_st t_limbs
let mont_ctx_free k = | false | null | false | MA.bn_field_free k | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.MontArithmetic.pbn_mont_ctx",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum.MontArithmetic.bn_field_free",
"Prims.unit"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime
let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mont_ctx_free: MA.bn_field_free_st t_limbs | [] | Hacl.Bignum4096_32.mont_ctx_free | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.MontArithmetic.bn_field_free_st Hacl.Bignum4096_32.t_limbs | {
"end_col": 20,
"end_line": 150,
"start_col": 2,
"start_line": 150
} |
Prims.Tot | val lt_mask: BN.bn_lt_mask_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lt_mask = BN.bn_lt_mask n_limbs | val lt_mask: BN.bn_lt_mask_st t_limbs n_limbs
let lt_mask = | false | null | false | BN.bn_lt_mask n_limbs | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.bn_lt_mask",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime
let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n
let mont_ctx_free k =
MA.bn_field_free k
let mod_precomp k a res =
BS.bn_mod_ctx n_limbs bn_slow_precomp k a res
let mod_exp_vartime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_vartime_precomp k a bBits b res
let mod_exp_consttime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_consttime_precomp k a bBits b res
let mod_inv_prime_vartime_precomp k a res =
BS.mk_bn_mod_inv_prime_ctx n_limbs
(BI.mk_bn_mod_inv_prime_precomp n_limbs exp_vartime_precomp) k a res
let new_bn_from_bytes_be = BS.new_bn_from_bytes_be
let new_bn_from_bytes_le = BS.new_bn_from_bytes_le
let bn_to_bytes_be = Hacl.Bignum.Convert.mk_bn_to_bytes_be true n_bytes
let bn_to_bytes_le = Hacl.Bignum.Convert.mk_bn_to_bytes_le true n_bytes | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val lt_mask: BN.bn_lt_mask_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.lt_mask | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.bn_lt_mask_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 35,
"end_line": 173,
"start_col": 14,
"start_line": 173
} |
Prims.Tot | [@@ FStar.Tactics.Typeclasses.tcinstance]
val almost_mont_inst:AM.almost_mont t_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
} | [@@ FStar.Tactics.Typeclasses.tcinstance]
val almost_mont_inst:AM.almost_mont t_limbs
[@@ FStar.Tactics.Typeclasses.tcinstance]
let almost_mont_inst:AM.almost_mont t_limbs = | false | null | false | {
AM.bn = bn_inst;
AM.mont_check = mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to = to;
AM.from = from;
AM.mul = amont_mul;
AM.sqr = amont_sqr
} | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.AlmostMontgomery.Mkalmost_mont",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.bn_inst",
"Hacl.Bignum4096_32.mont_check",
"Hacl.Bignum4096_32.precompr2",
"Hacl.Bignum4096_32.areduction",
"Hacl.Bignum4096_32.to",
"Hacl.Bignum4096_32.from",
"Hacl.Bignum4096_32.amont_mul",
"Hacl.Bignum4096_32.amont_sqr"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | [@@ FStar.Tactics.Typeclasses.tcinstance]
val almost_mont_inst:AM.almost_mont t_limbs | [] | Hacl.Bignum4096_32.almost_mont_inst | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.AlmostMontgomery.almost_mont Hacl.Bignum4096_32.t_limbs | {
"end_col": 21,
"end_line": 107,
"start_col": 2,
"start_line": 100
} |
Prims.Tot | val new_bn_from_bytes_le: BS.new_bn_from_bytes_le_st t_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let new_bn_from_bytes_le = BS.new_bn_from_bytes_le | val new_bn_from_bytes_le: BS.new_bn_from_bytes_le_st t_limbs
let new_bn_from_bytes_le = | false | null | false | BS.new_bn_from_bytes_le | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.SafeAPI.new_bn_from_bytes_le",
"Hacl.Bignum4096_32.t_limbs"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime
let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n
let mont_ctx_free k =
MA.bn_field_free k
let mod_precomp k a res =
BS.bn_mod_ctx n_limbs bn_slow_precomp k a res
let mod_exp_vartime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_vartime_precomp k a bBits b res
let mod_exp_consttime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_consttime_precomp k a bBits b res
let mod_inv_prime_vartime_precomp k a res =
BS.mk_bn_mod_inv_prime_ctx n_limbs
(BI.mk_bn_mod_inv_prime_precomp n_limbs exp_vartime_precomp) k a res
let new_bn_from_bytes_be = BS.new_bn_from_bytes_be | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val new_bn_from_bytes_le: BS.new_bn_from_bytes_le_st t_limbs | [] | Hacl.Bignum4096_32.new_bn_from_bytes_le | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.SafeAPI.new_bn_from_bytes_le_st Hacl.Bignum4096_32.t_limbs | {
"end_col": 50,
"end_line": 167,
"start_col": 27,
"start_line": 167
} |
Prims.Tot | val exp_check:BE.bn_check_mod_exp_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs | val exp_check:BE.bn_check_mod_exp_st t_limbs n_limbs
let exp_check:BE.bn_check_mod_exp_st t_limbs n_limbs = | false | null | false | BE.bn_check_mod_exp n_limbs | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Exponentiation.bn_check_mod_exp",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val exp_check:BE.bn_check_mod_exp_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.exp_check | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Exponentiation.bn_check_mod_exp_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 29,
"end_line": 118,
"start_col": 2,
"start_line": 118
} |
Prims.Tot | val exp_vartime:BE.bn_mod_exp_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp | val exp_vartime:BE.bn_mod_exp_st t_limbs n_limbs
let exp_vartime:BE.bn_mod_exp_st t_limbs n_limbs = | false | null | false | BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Exponentiation.mk_bn_mod_exp",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum4096_32.precompr2",
"Hacl.Bignum4096_32.exp_vartime_precomp"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val exp_vartime:BE.bn_mod_exp_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.exp_vartime | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Exponentiation.bn_mod_exp_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 56,
"end_line": 134,
"start_col": 2,
"start_line": 134
} |
Prims.Tot | val add_mod: BN.bn_add_mod_n_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs | val add_mod: BN.bn_add_mod_n_st t_limbs n_limbs
let add_mod:BN.bn_add_mod_n_st t_limbs n_limbs = | false | null | false | BN.bn_add_mod_n n_limbs | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.bn_add_mod_n",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum.bn_add_mod_n_st"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val add_mod: BN.bn_add_mod_n_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.add_mod | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.bn_add_mod_n_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 25,
"end_line": 21,
"start_col": 2,
"start_line": 21
} |
Prims.Tot | val sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs | val sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs
let sub_mod:BN.bn_sub_mod_n_st t_limbs n_limbs = | false | null | false | BN.bn_sub_mod_n n_limbs | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.bn_sub_mod_n",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum.bn_sub_mod_n_st"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.sub_mod | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.bn_sub_mod_n_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 25,
"end_line": 24,
"start_col": 2,
"start_line": 24
} |
Prims.Tot | val mod: BS.bn_mod_slow_safe_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res | val mod: BS.bn_mod_slow_safe_st t_limbs n_limbs
let mod n a res = | false | null | false | BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Definitions.lbignum",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Lib.IntTypes.op_Plus_Bang",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Hacl.Bignum.SafeAPI.mk_bn_mod_slow_safe",
"Hacl.Bignum.ModReduction.mk_bn_mod_slow",
"Hacl.Bignum4096_32.precompr2",
"Hacl.Bignum4096_32.bn_slow_precomp",
"Prims.bool"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mod: BS.bn_mod_slow_safe_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.mod | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.SafeAPI.bn_mod_slow_safe_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 94,
"end_line": 115,
"start_col": 2,
"start_line": 115
} |
Prims.Tot | val mod_precomp: BS.bn_mod_slow_ctx_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mod_precomp k a res =
BS.bn_mod_ctx n_limbs bn_slow_precomp k a res | val mod_precomp: BS.bn_mod_slow_ctx_st t_limbs n_limbs
let mod_precomp k a res = | false | null | false | BS.bn_mod_ctx n_limbs bn_slow_precomp k a res | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.MontArithmetic.pbn_mont_ctx",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum.Definitions.lbignum",
"Lib.IntTypes.op_Plus_Bang",
"Lib.IntTypes.U32",
"Lib.IntTypes.PUB",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum.SafeAPI.bn_mod_ctx",
"FStar.Ghost.hide",
"Hacl.Bignum.meta_len",
"Hacl.Bignum4096_32.bn_slow_precomp",
"Prims.unit"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime
let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n
let mont_ctx_free k =
MA.bn_field_free k | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mod_precomp: BS.bn_mod_slow_ctx_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.mod_precomp | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.SafeAPI.bn_mod_slow_ctx_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 47,
"end_line": 153,
"start_col": 2,
"start_line": 153
} |
Prims.Tot | val exp_vartime_precomp:BE.bn_mod_exp_precomp_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul) | val exp_vartime_precomp:BE.bn_mod_exp_precomp_st t_limbs n_limbs
let exp_vartime_precomp:BE.bn_mod_exp_precomp_st t_limbs n_limbs = | false | null | false | BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul) | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Exponentiation.bn_mod_exp_vartime_precomp",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum.Exponentiation.bn_mod_exp_amm_bm_vartime_precomp",
"Hacl.Bignum4096_32.almost_mont_inst",
"Hacl.Bignum.Exponentiation.bn_mod_exp_amm_fw_vartime_precomp",
"FStar.UInt32.__uint_to_t"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val exp_vartime_precomp:BE.bn_mod_exp_precomp_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.exp_vartime_precomp | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Exponentiation.bn_mod_exp_precomp_st Hacl.Bignum4096_32.t_limbs
Hacl.Bignum4096_32.n_limbs | {
"end_col": 63,
"end_line": 124,
"start_col": 2,
"start_line": 122
} |
Prims.Tot | val mod_exp_vartime_precomp: BS.bn_mod_exp_ctx_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mod_exp_vartime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_vartime_precomp k a bBits b res | val mod_exp_vartime_precomp: BS.bn_mod_exp_ctx_st t_limbs n_limbs
let mod_exp_vartime_precomp k a bBits b res = | false | null | false | BS.mk_bn_mod_exp_ctx n_limbs exp_vartime_precomp k a bBits b res | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.MontArithmetic.pbn_mont_ctx",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum.Definitions.lbignum",
"Hacl.Bignum4096_32.n_limbs",
"Lib.IntTypes.size_t",
"Hacl.Bignum.Definitions.blocks0",
"Lib.IntTypes.size",
"Lib.IntTypes.bits",
"Hacl.Bignum.SafeAPI.mk_bn_mod_exp_ctx",
"FStar.Ghost.hide",
"Hacl.Bignum.meta_len",
"Hacl.Bignum4096_32.exp_vartime_precomp",
"Prims.unit"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime
let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n
let mont_ctx_free k =
MA.bn_field_free k
let mod_precomp k a res =
BS.bn_mod_ctx n_limbs bn_slow_precomp k a res | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mod_exp_vartime_precomp: BS.bn_mod_exp_ctx_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.mod_exp_vartime_precomp | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.SafeAPI.bn_mod_exp_ctx_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 66,
"end_line": 156,
"start_col": 2,
"start_line": 156
} |
Prims.Tot | val mod_exp_consttime_precomp: BS.bn_mod_exp_ctx_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mod_exp_consttime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_consttime_precomp k a bBits b res | val mod_exp_consttime_precomp: BS.bn_mod_exp_ctx_st t_limbs n_limbs
let mod_exp_consttime_precomp k a bBits b res = | false | null | false | BS.mk_bn_mod_exp_ctx n_limbs exp_consttime_precomp k a bBits b res | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.MontArithmetic.pbn_mont_ctx",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum.Definitions.lbignum",
"Hacl.Bignum4096_32.n_limbs",
"Lib.IntTypes.size_t",
"Hacl.Bignum.Definitions.blocks0",
"Lib.IntTypes.size",
"Lib.IntTypes.bits",
"Hacl.Bignum.SafeAPI.mk_bn_mod_exp_ctx",
"FStar.Ghost.hide",
"Hacl.Bignum.meta_len",
"Hacl.Bignum4096_32.exp_consttime_precomp",
"Prims.unit"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul)
[@CInline]
let exp_vartime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_vartime_precomp
[@CInline]
let exp_consttime: BE.bn_mod_exp_st t_limbs n_limbs =
BE.mk_bn_mod_exp n_limbs precompr2 exp_consttime_precomp
let mod_exp_vartime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_vartime
let mod_exp_consttime = BS.mk_bn_mod_exp_safe n_limbs exp_check exp_consttime
let mod_inv_prime_vartime = BS.mk_bn_mod_inv_prime_safe n_limbs exp_vartime
let mont_ctx_init r n =
MA.bn_field_init n_limbs precompr2 r n
let mont_ctx_free k =
MA.bn_field_free k
let mod_precomp k a res =
BS.bn_mod_ctx n_limbs bn_slow_precomp k a res
let mod_exp_vartime_precomp k a bBits b res =
BS.mk_bn_mod_exp_ctx n_limbs exp_vartime_precomp k a bBits b res | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mod_exp_consttime_precomp: BS.bn_mod_exp_ctx_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.mod_exp_consttime_precomp | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.SafeAPI.bn_mod_exp_ctx_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 68,
"end_line": 159,
"start_col": 2,
"start_line": 159
} |
Prims.Tot | val exp_consttime_precomp:BE.bn_mod_exp_precomp_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let exp_consttime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul) | val exp_consttime_precomp:BE.bn_mod_exp_precomp_st t_limbs n_limbs
let exp_consttime_precomp:BE.bn_mod_exp_precomp_st t_limbs n_limbs = | false | null | false | BE.bn_mod_exp_consttime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_consttime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_consttime_precomp almost_mont_inst 4ul) | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Exponentiation.bn_mod_exp_consttime_precomp",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum.Exponentiation.bn_mod_exp_amm_bm_consttime_precomp",
"Hacl.Bignum4096_32.almost_mont_inst",
"Hacl.Bignum.Exponentiation.bn_mod_exp_amm_fw_consttime_precomp",
"FStar.UInt32.__uint_to_t"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline]
let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst
[@CInline]
let amont_mul: AM.bn_almost_mont_mul_st t_limbs n_limbs =
AM.bn_almost_mont_mul bn_inst areduction
[@CInline]
let amont_sqr: AM.bn_almost_mont_sqr_st t_limbs n_limbs =
AM.bn_almost_mont_sqr bn_inst areduction
inline_for_extraction noextract
instance almost_mont_inst: AM.almost_mont t_limbs = {
AM.bn = bn_inst;
AM.mont_check;
AM.precomp = precompr2;
AM.reduction = areduction;
AM.to;
AM.from;
AM.mul = amont_mul;
AM.sqr = amont_sqr;
}
[@CInline]
let bn_slow_precomp : BR.bn_mod_slow_precomp_st t_limbs n_limbs =
BR.bn_mod_slow_precomp almost_mont_inst
let mod n a res =
BS.mk_bn_mod_slow_safe n_limbs (BR.mk_bn_mod_slow n_limbs precompr2 bn_slow_precomp) n a res
let exp_check: BE.bn_check_mod_exp_st t_limbs n_limbs =
BE.bn_check_mod_exp n_limbs
[@CInline]
let exp_vartime_precomp: BE.bn_mod_exp_precomp_st t_limbs n_limbs =
BE.bn_mod_exp_vartime_precomp n_limbs
(BE.bn_mod_exp_amm_bm_vartime_precomp almost_mont_inst)
(BE.bn_mod_exp_amm_fw_vartime_precomp almost_mont_inst 4ul)
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val exp_consttime_precomp:BE.bn_mod_exp_precomp_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.exp_consttime_precomp | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Exponentiation.bn_mod_exp_precomp_st Hacl.Bignum4096_32.t_limbs
Hacl.Bignum4096_32.n_limbs | {
"end_col": 65,
"end_line": 130,
"start_col": 2,
"start_line": 128
} |
Prims.Tot | val reduction:BM.bn_mont_reduction_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst | val reduction:BM.bn_mont_reduction_st t_limbs n_limbs
let reduction:BM.bn_mont_reduction_st t_limbs n_limbs = | false | null | false | BM.bn_mont_reduction bn_inst | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.Montgomery.bn_mont_reduction",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.bn_inst"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val reduction:BM.bn_mont_reduction_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.reduction | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.Montgomery.bn_mont_reduction_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs | {
"end_col": 30,
"end_line": 56,
"start_col": 2,
"start_line": 56
} |
Prims.Tot | val mul: a:lbignum t_limbs n_limbs -> BN.bn_karatsuba_mul_st t_limbs n_limbs a | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a | val mul: a:lbignum t_limbs n_limbs -> BN.bn_karatsuba_mul_st t_limbs n_limbs a
let mul (a: lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a = | false | null | false | BN.bn_karatsuba_mul n_limbs a | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum4096_32.lbignum",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum.bn_karatsuba_mul",
"Hacl.Bignum.bn_karatsuba_mul_st"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs | false | false | Hacl.Bignum4096_32.fst | {
"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"
} | null | val mul: a:lbignum t_limbs n_limbs -> BN.bn_karatsuba_mul_st t_limbs n_limbs a | [] | Hacl.Bignum4096_32.mul | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Hacl.Bignum4096_32.lbignum Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs
-> Hacl.Bignum.bn_karatsuba_mul_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs a | {
"end_col": 31,
"end_line": 27,
"start_col": 2,
"start_line": 27
} |
Prims.Tot | val areduction:AM.bn_almost_mont_reduction_st t_limbs n_limbs | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let areduction: AM.bn_almost_mont_reduction_st t_limbs n_limbs =
AM.bn_almost_mont_reduction bn_inst | val areduction:AM.bn_almost_mont_reduction_st t_limbs n_limbs
let areduction:AM.bn_almost_mont_reduction_st t_limbs n_limbs = | false | null | false | AM.bn_almost_mont_reduction bn_inst | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum.AlmostMontgomery.bn_almost_mont_reduction",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.bn_inst"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a
let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a
//BN.bn_sqr n_limbs a
//BN.bn_mul n_limbs n_limbs a a
inline_for_extraction noextract
instance bn_inst: BN.bn t_limbs = {
BN.len = n_limbs;
BN.add;
BN.sub;
BN.add_mod_n = add_mod;
BN.sub_mod_n = sub_mod;
BN.mul;
BN.sqr
}
[@CInline]
let mont_check: BM.bn_check_modulus_st t_limbs n_limbs =
BM.bn_check_modulus
[@CInline]
let precompr2: BM.bn_precomp_r2_mod_n_st t_limbs n_limbs =
BM.bn_precomp_r2_mod_n bn_inst
[@CInline]
let reduction: BM.bn_mont_reduction_st t_limbs n_limbs =
BM.bn_mont_reduction bn_inst
[@CInline]
let to: BM.bn_to_mont_st t_limbs n_limbs =
BM.bn_to_mont bn_inst reduction
[@CInline]
let from: BM.bn_from_mont_st t_limbs n_limbs =
BM.bn_from_mont bn_inst reduction
// [@CInline]
// let mont_mul: BM.bn_mont_mul_st t_limbs n_limbs =
// BM.bn_mont_mul bn_inst reduction
// [@CInline]
// let mont_sqr: BM.bn_mont_sqr_st t_limbs n_limbs =
// BM.bn_mont_sqr bn_inst reduction
// inline_for_extraction noextract
// instance mont_inst: BM.mont t_limbs = {
// BM.bn = bn_inst;
// BM.mont_check;
// BM.precomp = precompr2;
// BM.reduction;
// BM.to;
// BM.from;
// BM.mul = mont_mul;
// BM.sqr = mont_sqr;
// }
[@CInline] | false | true | Hacl.Bignum4096_32.fst | {
"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"
} | null | val areduction:AM.bn_almost_mont_reduction_st t_limbs n_limbs | [] | Hacl.Bignum4096_32.areduction | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Hacl.Bignum.AlmostMontgomery.bn_almost_mont_reduction_st Hacl.Bignum4096_32.t_limbs
Hacl.Bignum4096_32.n_limbs | {
"end_col": 37,
"end_line": 88,
"start_col": 2,
"start_line": 88
} |
Prims.Tot | val sqr: a:lbignum t_limbs n_limbs -> BN.bn_karatsuba_sqr_st t_limbs n_limbs a | [
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModInv",
"short_module": "BI"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.ModReduction",
"short_module": "BR"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Exponentiation",
"short_module": "BE"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.AlmostMontgomery",
"short_module": "AM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.Montgomery",
"short_module": "BM"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.MontArithmetic",
"short_module": "MA"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum.SafeAPI",
"short_module": "BS"
},
{
"abbrev": true,
"full_module": "Hacl.Bignum",
"short_module": "BN"
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let sqr (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a =
BN.bn_karatsuba_sqr n_limbs a | val sqr: a:lbignum t_limbs n_limbs -> BN.bn_karatsuba_sqr_st t_limbs n_limbs a
let sqr (a: lbignum t_limbs n_limbs) : BN.bn_karatsuba_sqr_st t_limbs n_limbs a = | false | null | false | BN.bn_karatsuba_sqr n_limbs a | {
"checked_file": "Hacl.Bignum4096_32.fst.checked",
"dependencies": [
"prims.fst.checked",
"Hacl.Bignum.Montgomery.fsti.checked",
"Hacl.Bignum.ModReduction.fst.checked",
"Hacl.Bignum.ModInv.fst.checked",
"Hacl.Bignum.Exponentiation.fsti.checked",
"Hacl.Bignum.Convert.fst.checked",
"Hacl.Bignum.AlmostMontgomery.fsti.checked",
"Hacl.Bignum.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.Tactics.Typeclasses.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked"
],
"interface_file": true,
"source_file": "Hacl.Bignum4096_32.fst"
} | [
"total"
] | [
"Hacl.Bignum4096_32.lbignum",
"Hacl.Bignum4096_32.t_limbs",
"Hacl.Bignum4096_32.n_limbs",
"Hacl.Bignum.bn_karatsuba_sqr",
"Hacl.Bignum.bn_karatsuba_sqr_st"
] | [] | module Hacl.Bignum4096_32
open FStar.Mul
module BN = Hacl.Bignum
module BM = Hacl.Bignum.Montgomery
module AM = Hacl.Bignum.AlmostMontgomery
module BE = Hacl.Bignum.Exponentiation
module BR = Hacl.Bignum.ModReduction
module BI = Hacl.Bignum.ModInv
#set-options "--z3rlimit 50 --fuel 0 --ifuel 0"
let add: BN.bn_add_eq_len_st t_limbs n_limbs =
BN.bn_add_eq_len n_limbs
let sub: BN.bn_sub_eq_len_st t_limbs n_limbs =
BN.bn_sub_eq_len n_limbs
let add_mod: BN.bn_add_mod_n_st t_limbs n_limbs =
BN.bn_add_mod_n n_limbs
let sub_mod: BN.bn_sub_mod_n_st t_limbs n_limbs =
BN.bn_sub_mod_n n_limbs
let mul (a:lbignum t_limbs n_limbs) : BN.bn_karatsuba_mul_st t_limbs n_limbs a =
BN.bn_karatsuba_mul n_limbs a
//BN.bn_mul n_limbs n_limbs a | false | false | Hacl.Bignum4096_32.fst | {
"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"
} | null | val sqr: a:lbignum t_limbs n_limbs -> BN.bn_karatsuba_sqr_st t_limbs n_limbs a | [] | Hacl.Bignum4096_32.sqr | {
"file_name": "code/bignum/Hacl.Bignum4096_32.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Hacl.Bignum4096_32.lbignum Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs
-> Hacl.Bignum.bn_karatsuba_sqr_st Hacl.Bignum4096_32.t_limbs Hacl.Bignum4096_32.n_limbs a | {
"end_col": 31,
"end_line": 31,
"start_col": 2,
"start_line": 31
} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.