Skip to content

Commit a204ed3

Browse files
committed
Don't ask for needless 32 <= Semantics.width
As Jade pointed out in #929 (comment), it's not needed.
1 parent 7b6e733 commit a204ed3

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Bedrock/Field/Interface/Representation.v

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ Require Import Crypto.Util.ZUtil.Tactics.ZeroBounds.
1818

1919
Section Representation.
2020
Context {p : Types.parameters} {field_parameters : FieldParameters}
21-
{p_ok : Types.ok}
22-
(width_ge_32 : 32 <= Semantics.width).
21+
{p_ok : Types.ok}.
2322
Context (n : nat) (weight : nat -> Z)
2423
(loose_bounds tight_bounds : list (option zrange))
2524
(relax_bounds :
@@ -74,7 +73,7 @@ Section Representation.
7473
{ match goal with
7574
| H : Array.array _ _ _ _ _ |- _ =>
7675
eapply Bignum_of_bytes with (n0:=n) in H;
77-
[ destruct H | nia.. ]
76+
[ destruct H | (idtac + destruct Semantics.width_cases); nia.. ]
7877
end.
7978
eexists; eauto. }
8079
{

src/Bedrock/Field/Synthesis/Generic/Bignum.v

+6-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ Section Bignum.
3030
sep (emp (length x = n_bytes)) (array ptsto (word.of_Z 1) px x).
3131

3232
Section Proofs.
33-
Context {ok : Types.ok}
34-
(width_ge_32 : 32 <= Semantics.width).
33+
Context {ok : Types.ok}.
3534
Existing Instance semantics_ok.
3635

3736
(* TODO: factor this proof into a more general form that says if subarrays
@@ -51,7 +50,11 @@ Section Bignum.
5150
cbn [array length] in *. sepsimpl; eauto. }
5251
{ rewrite <-(firstn_skipn (Z.to_nat word_size_in_bytes) bs).
5352
rewrite array_append.
54-
rewrite Scalars.scalar_of_bytes with (l:=List.firstn _ _); try assumption.
53+
rewrite Scalars.scalar_of_bytes with (l:=List.firstn _ _);
54+
lazymatch goal with
55+
| [ |- _ <= Semantics.width ] => destruct Semantics.width_cases; lia
56+
| _ => idtac
57+
end.
5558
2:{
5659
rewrite word_size_in_bytes_eq in *.
5760
etransitivity;

0 commit comments

Comments
 (0)