Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7421332
some fixes for upcoming F* branch nik_smt_univs_2025
nikswamy Jan 16, 2025
67b58f8
merge in master
nikswamy Sep 26, 2025
62e3056
tweaking some proofs for univs branch
nikswamy Sep 26, 2025
e459d0b
Merge remote-tracking branch 'origin/master' into _nik_smt_univs_2025
nikswamy Sep 26, 2025
bc1affe
upgrade to F* universes branch in progress
nikswamy Sep 30, 2025
92766b0
fixup CBOR.Pulse.API.Det.Common
nikswamy Sep 30, 2025
362b6ba
a proof setting tweak
nikswamy Sep 30, 2025
044e922
some admits in CDDL.Pulse.Serialize.MapGroup
nikswamy Sep 30, 2025
1a68d26
fix up proofs in COSE to work again with F* nik_smt_univs_2025
nikswamy Oct 4, 2025
a95da9b
Merge remote-tracking branch 'origin/master' into _nik_smt_univs_2025
nikswamy Oct 4, 2025
ea8104c
Revert "Update hashes"
tahina-pro Nov 18, 2025
7670966
Merge branch '_taramana_244' into _nik_smt_univs_2025
tahina-pro Nov 18, 2025
3642275
use the right Z3 version in VSCode
tahina-pro Nov 18, 2025
a2ad34b
partial F*, Karamel, Pulse upgrade
tahina-pro Nov 20, 2025
c4fbe39
specify some missing universes
tahina-pro Nov 19, 2025
f174fa2
split continuation boolean pure condition in loop invariants
tahina-pro Nov 19, 2025
744a9fa
ADMIT: Cannot properly solve `exists* (x: unit)`
tahina-pro Nov 19, 2025
d12f324
ADMIT: Pulse OOM in impl_serialize_map_zero_or_more_iterator_gen
tahina-pro Nov 19, 2025
b9d339c
WHY WHY WHY do I need to help Pulse with middle Trade.trans arguments?
tahina-pro Nov 19, 2025
3b97d8f
various rewrites and other Pulse unification issues
tahina-pro Nov 19, 2025
c42bf83
LowParse.Pulse rlimit
tahina-pro Nov 20, 2025
2a1a624
Revert "partial F*, Karamel, Pulse upgrade"
tahina-pro Nov 20, 2025
679a11e
full F*, Karamel, Pulse upgrade
tahina-pro Nov 20, 2025
f771f78
WHY WHY WHY do Pulse functions with functional types no longer typech…
tahina-pro Nov 20, 2025
a0893b0
Bump hashes (including Pulse fix)
mtzguido Dec 8, 2025
320a5ed
revert to Z3 4.13.3
tahina-pro Dec 11, 2025
e447f75
VS config for LowParse
tahina-pro Dec 11, 2025
0e66d24
binder -> binding
tahina-pro Dec 11, 2025
c741512
rlimit
tahina-pro Dec 11, 2025
1c3866f
fix VS config for src/cddl
tahina-pro Dec 12, 2025
e7c2092
move some CDDL.Spec.MapGroup definitions from fsti to fst
tahina-pro Dec 15, 2025
035d102
add a few admits in Serialize.ArrayGroup/MapGroup, to be replaced wit…
tahina-pro Dec 15, 2025
d11e604
rlimit
tahina-pro Dec 15, 2025
d5df53e
advance F*, Karamel, Pulse
tahina-pro Dec 15, 2025
7c9ad2a
move LowParse.Spec.VCList.bare_serialize_vclist_correct from the .fst…
tahina-pro Dec 15, 2025
3f8f7d6
rlimit
tahina-pro Dec 15, 2025
3ecbcec
(TEMP) EverCDDL: add an option to disable NBE during extraction
tahina-pro Dec 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,15 @@ Then, whenever you make a change in your clones:
Then, in EverParse, `make` will automatically rebuild F\*, Karamel and
Pulse from your clones with your patches.

## Using a specific branch of F\*, Karamel, Pulse etc.

1. Run `make -C opt FStar pulse karamel` to clone the default branches of those repositories

2. In the cloned directories, switch to your branch, e.g., `git checkout <mybranch>`

3. Then run `make -C opt snapshot` to record the hashes you intend to use


## Using an existing opam root, F\*, etc.

If you want to use existing dependencies instead of letting EverParse
Expand Down
7 changes: 4 additions & 3 deletions deps.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export EVERPARSE_OPT_PATH := $(shell cygpath -m $(EVERPARSE_OPT_PATH))
NO_PULSE := 1
endif

Z3_VERSION := 4.13.3
EVERPARSE_Z3_VERSION ?= 4.13.3

ifeq (1,$(EVERPARSE_USE_MY_DEPS))
export EVERPARSE_USE_OPAMROOT:=1
Expand Down Expand Up @@ -51,7 +51,7 @@ NEED_FSTAR :=
ifneq (1,$(EVERPARSE_USE_FSTAR_EXE))
export FSTAR_EXE := $(EVERPARSE_OPT_PATH)/FStar/out/bin/fstar.exe
NEED_FSTAR := $(EVERPARSE_OPT_PATH)/FStar.done
z3_exe := $(shell $(FSTAR_EXE) --locate_z3 \$(Z3_VERSION) 2>/dev/null)
z3_exe := $(shell $(FSTAR_EXE) --locate_z3 \$(EVERPARSE_Z3_VERSION) 2>/dev/null)
ifneq (0,$(.SHELLSTATUS))
z3_exe :=
endif
Expand All @@ -74,7 +74,7 @@ endif

NEED_Z3 :=
ifeq (,$(z3_exe))
z3_exe := $(shell which z3-$(Z3_VERSION))
z3_exe := $(shell which z3-$(EVERPARSE_Z3_VERSION))
ifneq (0,$(.SHELLSTATUS))
z3_exe :=
endif
Expand Down Expand Up @@ -170,6 +170,7 @@ ifeq ($(OS),Windows_NT)
else
@echo export EVERPARSE_HOME=$(CURDIR)
endif
@echo export EVERPARSE_Z3_VERSION=$(EVERPARSE_Z3_VERSION)
@echo export PATH=\"$(z3_dir):'$$PATH'\"

.PHONY: env
Expand Down
2 changes: 1 addition & 1 deletion fstar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ set -e
unset CDPATH
EVERPARSE_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$EVERPARSE_HOME"/env.sh
exec "$FSTAR_EXE" --include "$KRML_HOME/krmllib" --include "$KRML_HOME/krmllib/obj" --include "$PULSE_HOME/lib/pulse" "$@"
exec "$FSTAR_EXE" --z3version $EVERPARSE_Z3_VERSION --include "$KRML_HOME/krmllib" --include "$KRML_HOME/krmllib/obj" --include "$PULSE_HOME/lib/pulse" "$@"
6 changes: 3 additions & 3 deletions opt/hashes.Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FStar_hash := 1cff8d796deed8834926389a986d015498780041
karamel_hash := fb36fecb552c9fb202beb38a6c5a732c3f2cd49f
pulse_hash := f51670f4c0117c8614e10c421025d77e1e44940e
FStar_hash := f1a55bbbe7dcac6c99033bd22fd73b74a3bea237
karamel_hash := 9c4744acf0d663c6fc079fb318820f4188971652
pulse_hash := afc380e13aeacc0e4f18d605735056ef9789062e
12 changes: 6 additions & 6 deletions src/ASN1/ASN1.X509.fst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module ASN1.X509
#push-options "--split_queries no --fuel 2 --ifuel 0"

module U32 = FStar.UInt32
module List = FStar.List.Tot
Expand Down Expand Up @@ -302,11 +303,12 @@ let id_pe = id_pkix /+ 1
let id_pe_authorityInformationAccess = id_pe /+ 1

//Warning: Partly using the mitls spec which is loosened from rfc5280

#push-options "--fuel 3 --ifuel 1"
let mk_expansion (critical : asn1_gen_item_k) (#s : _) (value : asn1_k s)
(pf : squash (asn1_sequence_k_wf [proj2_of_3 critical; (Set.singleton octetstring_id, PLAIN)]))
= let items = [critical; "extnValue" *^ (PLAIN ^: (ASN1_ILC octetstring_id (ASN1_PREFIXED value)))] in
mk_gen_items items pf
#pop-options

let critical_field
= mk_default_field asn1_boolean false
Expand Down Expand Up @@ -562,8 +564,7 @@ let extension
let extensions
= asn1_sequence_of extension

#push-options "--z3rlimit 16"

#push-options "--fuel 0 --z3rlimit_factor 2"
let x509_TBSCertificate
= asn1_sequence [
"version" *^ (PLAIN ^: (mk_prefixed (mk_custom_id CONTEXT_SPECIFIC CONSTRUCTED 0) version));
Expand All @@ -578,14 +579,13 @@ let x509_TBSCertificate
"extensions" *^ (OPTION ^: (mk_prefixed (mk_custom_id CONTEXT_SPECIFIC CONSTRUCTED 3) extensions))]
(_ by (seq_tac ()))

#pop-options

let x509_certificate
= asn1_sequence [
"tbsCertificate" *^ (PLAIN ^: x509_TBSCertificate);
"signatureAlgorithm" *^ (PLAIN ^: algorithmIdentifier);
"signatureValue" *^ (PLAIN ^: asn1_bitstring)]
(_ by (seq_tac ()))
#pop-options

// let's go boom!

Expand All @@ -605,4 +605,4 @@ let parse_cert (b:bytes) = x509_certificate_parser b
iota;
primops]]
let dparse_cert (b:bytes) = dasn1_as_parser x509_certificate b

#show-options
7 changes: 6 additions & 1 deletion src/cbor/pulse/CBOR.Pulse.API.Base.fst
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ let mk_array_from_array_t
inline_for_extraction
noextract [@@noextract_to "krml"]
fn mk_array_from_array'
(#t: Type)
(#t: Type0)
(#vmatch: perm -> t -> cbor -> slprop)
(mk_array_from_array: mk_array_from_array_t vmatch)
(a: A.array t)
Expand Down Expand Up @@ -1154,8 +1154,10 @@ fn mk_map_gen
let bres = mk_map_gen_by_ref a dest;
if bres {
let res = !dest;
with res' . rewrite mk_map_gen_post vmatch1 vmatch2 a va pv vv res' as mk_map_gen_post vmatch1 vmatch2 a va pv vv (Some res);
Some res
} else {
with res' . rewrite mk_map_gen_post vmatch1 vmatch2 a va pv vv res' as mk_map_gen_post vmatch1 vmatch2 a va pv vv None;
None #t1
}
}
Expand Down Expand Up @@ -1411,6 +1413,7 @@ fn mk_map_from_ref
PM.seq_list_match_length (vmatch2 pv) va vv;
let _ = mk_map_gen a dest;
let res = !dest;
with res' . rewrite (mk_map_gen_post vmatch1 vmatch2 a va pv vv res') as (mk_map_gen_post vmatch1 vmatch2 a va pv vv (Some res));
unfold (mk_map_gen_post vmatch1 vmatch2 a va pv vv (Some res));
res
}
Expand Down Expand Up @@ -1514,8 +1517,10 @@ fn map_get_as_option
let bres = m x k dest;
if bres {
let res = !dest;
with res' . rewrite map_get_post vmatch x px vx vk res' as map_get_post vmatch x px vx vk (Some res);
Some res
} else {
with res' . rewrite map_get_post vmatch x px vx vk res' as map_get_post vmatch x px vx vk None;
None #t
}
}
Expand Down
28 changes: 21 additions & 7 deletions src/cbor/pulse/CBOR.Pulse.API.Det.Rust.Macros.fst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ fn cbor_det_mk_int64'
(v: _)
{
let mty = (if ty = cbor_major_type_uint64 then UInt64 else NegInt64);
cbor_det_mk_int64 mty v
let res = cbor_det_mk_int64 mty v;
with ty' . rewrite cbor_det_match 1.0R
res
(CBOR.Spec.API.Type.pack (CBOR.Spec.API.Type.CInt64 ty' v)) as cbor_det_match 1.0R
res
(CBOR.Spec.API.Type.pack (CBOR.Spec.API.Type.CInt64 ty v));
res
}

inline_for_extraction
Expand All @@ -32,6 +38,11 @@ fn cbor_det_mk_simple'
{
let Some res = cbor_det_mk_simple_value v;
unfold (cbor_det_mk_simple_value_post v (Some res));
with res' . rewrite cbor_det_match 1.0R
res
res' as cbor_det_match 1.0R
res
(CBOR.Spec.API.Type.pack (CBOR.Spec.API.Type.CSimple v));
res
}

Expand All @@ -49,6 +60,7 @@ fn cbor_det_mk_string0
let mty = (if ty = cbor_major_type_byte_string then ByteString else TextString);
let res = cbor_det_mk_string mty s;
let Some c = res;
with ty' res' . rewrite (cbor_det_mk_string_post ty' s p v res') as (cbor_det_mk_string_post ty s p v (Some c));
unfold (cbor_det_mk_string_post ty s p v (Some c));
c
}
Expand Down Expand Up @@ -230,7 +242,7 @@ fn cbor_det_array_iterator_start'
with p' . assert (cbor_det_view_match p' v y);
let Array a = v;
Trade.rewrite_with_trade
(cbor_det_view_match p' v y)
(cbor_det_view_match p' _ y)
(cbor_det_array_match p' a y);
Trade.trans _ _ (cbor_det_match p x y);
let res = cbor_det_array_iterator_start a;
Expand All @@ -252,7 +264,7 @@ fn cbor_det_get_array_item'
with p' . assert (cbor_det_view_match p' v y);
let Array a = v;
Trade.rewrite_with_trade
(cbor_det_view_match p' v y)
(cbor_det_view_match p' _ y)
(cbor_det_array_match p' a y);
Trade.trans _ _ (cbor_det_match p x y);
let ores = cbor_det_get_array_item a i;
Expand Down Expand Up @@ -295,7 +307,7 @@ fn cbor_det_map_iterator_start'
with p' . assert (cbor_det_view_match p' v y);
let Map a = v;
Trade.rewrite_with_trade
(cbor_det_view_match p' v y)
(cbor_det_view_match p' _ y)
(cbor_det_map_match p' a y);
Trade.trans _ _ (cbor_det_match p x y);
let res = cbor_det_map_iterator_start a;
Expand Down Expand Up @@ -326,13 +338,15 @@ ensures
unfold (safe_map_get_post m p' vx vk None);
Trade.elim _ _;
fold (Base.map_get_post_none cbor_det_match x px vx vk);
fold (Base.map_get_post cbor_det_match x px vx vk None)
fold (Base.map_get_post cbor_det_match x px vx vk None);
rewrite (Base.map_get_post cbor_det_match x px vx vk None) as (Base.map_get_post cbor_det_match x px vx vk res)
}
Some x' -> {
unfold (safe_map_get_post m p' vx vk (Some x'));
Trade.trans _ _ (cbor_det_match px x vx);
fold (Base.map_get_post_some cbor_det_match x px vx vk x');
fold (Base.map_get_post cbor_det_match x px vx vk (Some x'))
fold (Base.map_get_post cbor_det_match x px vx vk (Some x'));
rewrite (Base.map_get_post cbor_det_match x px vx vk (Some x')) as (Base.map_get_post cbor_det_match x px vx vk res);
}
}
}
Expand All @@ -353,7 +367,7 @@ fn cbor_det_map_get'
with p' . assert (cbor_det_view_match p' x' vx);
let Map m = x';
Trade.rewrite_with_trade
(cbor_det_view_match p' x' vx)
(cbor_det_view_match p' _ vx)
(cbor_det_map_match p' m vx);
Trade.trans _ _ (cbor_det_match px x vx);
let res = cbor_det_map_get m k;
Expand Down
4 changes: 4 additions & 0 deletions src/cbor/pulse/raw/CBOR.Pulse.API.Det.C.fst
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ ensures
unfold (mk_map_gen_post vmatch1 vmatch2 s va pv vv None);
S.to_array s;
fold (mk_map_from_array_safe_post vmatch1 vmatch2 a va pv vv vdest false);
rewrite (mk_map_from_array_safe_post vmatch1 vmatch2 a va pv vv vdest false)
as (mk_map_from_array_safe_post vmatch1 vmatch2 a va pv vv vdest bres);
}
Some vres -> {
unfold (mk_map_gen_post vmatch1 vmatch2 s va pv vv (Some vres));
Expand All @@ -233,6 +235,8 @@ ensures
Trade.trans_concl_l _ _ _ _;
rewrite each vres as vdest;
fold (mk_map_from_array_safe_post vmatch1 vmatch2 a va pv vv vdest true);
rewrite (mk_map_from_array_safe_post vmatch1 vmatch2 a va pv vv vdest true)
as (mk_map_from_array_safe_post vmatch1 vmatch2 a va pv vv vdest bres);
}
}
}
Expand Down
Loading