Skip to content

Commit 86bd297

Browse files
committed
refactor Scalars to use $@
1 parent 0496600 commit 86bd297

5 files changed

Lines changed: 19 additions & 32 deletions

File tree

src/Bedrock/End2End/RupicolaCrypto/Broadcast.v

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ Section with_parameters.
639639
(expr.op bopname.add a_var
640640
(expr.op bopname.mul idx_var sz_word)))
641641
scratch.
642-
Proof using T_Fits_ok locals_ok mem_ok word_ok.
642+
Proof using BW T_Fits_ok locals_ok mem_ok word_ok.
643643
unfold broadcast_expr; intuition idtac.
644644
repeat straightline.
645645
exists a_ptr; intuition idtac.
@@ -703,7 +703,7 @@ Section with_parameters.
703703
(expr.op bopname.add a_var
704704
(expr.op bopname.mul idx_var sz_word)))
705705
a_data.
706-
Proof using T_Fits_ok locals_ok mem_ok word_ok.
706+
Proof using T_Fits_ok locals_ok mem_ok word_ok BW.
707707
unfold broadcast_expr; intuition idtac.
708708
repeat straightline.
709709
exists a_ptr; intuition idtac.
@@ -799,25 +799,11 @@ Section with_parameters.
799799
reflexivity.
800800
}
801801
intros ptr t m.
802-
split.
803-
{
804-
intro H.
805-
unfold truncated_word, truncated_scalar.
806-
cbn.
807-
rewrite word.unsigned_of_Z_nowrap.
808-
rewrite word.byte_of_Z_unsigned.
809-
ecancel_assumption.
810-
apply byte_in_word_bounds.
811-
}
812-
{
813-
intro H.
814-
unfold truncated_word, truncated_scalar in H.
815-
cbn in H.
816-
rewrite word.unsigned_of_Z_nowrap in H.
817-
rewrite word.byte_of_Z_unsigned in H.
818-
ecancel_assumption.
819-
apply byte_in_word_bounds.
820-
}
802+
cbv [truncated_word truncated_scalar].
803+
simpl le_split.
804+
rewrite word.unsigned_of_Z_nowrap, word.byte_of_Z_unsigned by apply byte_in_word_bounds.
805+
rewrite OfListWord.map.of_list_word_singleton.
806+
split; cbv [sepclause_of_map ptsto] in *; auto.
821807
Qed.
822808

823809

src/Bedrock/Field/Common/Util.v

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,10 @@ Section Scalars.
675675
(LittleEndianList.le_split (Z.to_nat bytes_per_word)
676676
(word.unsigned x))).
677677
Proof.
678-
unfold scalar, truncated_word, truncated_scalar, littleendian, ptsto_bytes.ptsto_bytes.
679-
rewrite HList.tuple.to_list_of_list; reflexivity.
678+
unfold scalar, truncated_word, truncated_scalar.
679+
symmetry; eapply array1_iff_eq_of_list_word_at; trivial.
680+
rewrite length_le_split.
681+
case BW as [ [ -> | -> ] ]; cbv; discriminate.
680682
Qed.
681683

682684
Lemma truncated_scalar_one_ptsto_iff1 :
@@ -685,8 +687,12 @@ Section Scalars.
685687
(truncated_scalar access_size.one addr x)
686688
(ptsto addr (Byte.byte.of_Z x)).
687689
Proof. intros.
688-
unfold scalar, truncated_word, truncated_scalar, littleendian, ptsto_bytes.ptsto_bytes.
689-
rewrite HList.tuple.to_list_of_list. unfold Memory.bytes_per, le_split, array.
690+
unfold scalar, truncated_word, truncated_scalar.
691+
etransitivity. {
692+
symmetry; eapply array1_iff_eq_of_list_word_at; trivial.
693+
rewrite length_le_split.
694+
case BW as [ [ -> | -> ] ]; cbv; discriminate. }
695+
unfold Memory.bytes_per, le_split, array.
690696
cancel.
691697
Qed.
692698

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Require Import Crypto.Bedrock.Field.Common.Arrays.ByteBounds.
1818
Local Open Scope Z_scope.
1919

2020
Section Bignum.
21-
Import bedrock2.Memory bedrock2.ptsto_bytes.
21+
Import bedrock2.Memory.
2222
Context {width} {word : Interface.word width} {mem : map.map word Init.Byte.byte}.
2323

2424
Local Notation k := (bytes_per_word width).

src/Bedrock/Group/AdditionChains.v

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,11 +585,6 @@ Section FElems.
585585
586586
instantiate (2 := pout). instantiate (1 := Rr).
587587
588-
About fe25519.
589-
Print UnOp.
590-
Print Build_UnOp.
591-
Search UnOp.
592-
593588
eapply H6.
594589
compile_step.
595590

0 commit comments

Comments
 (0)