forked from hacl-star/hacl-star
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEverCrypt.Helpers.fsti
38 lines (30 loc) · 1.04 KB
/
EverCrypt.Helpers.fsti
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module EverCrypt.Helpers
module B = LowStar.Buffer
open FStar.HyperStack.ST
/// Small helpers
inline_for_extraction noextract
let (!$) = C.String.((!$))
/// For the time being, we do not write any specifications and just try to reach
/// agreement on calling conventions. A series of convenient type abbreviations
/// follows.
effect Stack_ (a: Type) = Stack a (fun _ -> True) (fun _ _ _ -> True)
inline_for_extraction noextract
let uint8_t = UInt8.t
inline_for_extraction noextract
let uint16_t = UInt16.t
inline_for_extraction noextract
let uint32_t = UInt32.t
inline_for_extraction noextract
let uint64_t = UInt64.t
inline_for_extraction noextract
let uint8_p = B.buffer uint8_t
inline_for_extraction noextract
let uint16_p = B.buffer uint16_t
inline_for_extraction noextract
let uint32_p = B.buffer uint32_t
inline_for_extraction noextract
let uint64_p = B.buffer uint64_t
inline_for_extraction noextract
let uint8_pl (l:nat) = p:uint8_p {B.length p = l}
inline_for_extraction noextract
let uint8_l (p:uint8_p) = l:UInt32.t {B.length p = UInt32.v l}