@@ -30,7 +30,7 @@ import WArray512 WArray256.
30
30
31
31
(* shake assumptions *)
32
32
33
-
33
+ (*
34
34
op SHAKE256_ABSORB4x_33 : W8.t Array33.t -> W8.t Array33.t -> W8.t Array33.t -> W8.t Array33.t -> W256.t Array25.t.
35
35
op SHAKE256_SQUEEZENBLOCKS4x : W256.t Array25.t -> W256.t Array25.t * W8.t Array136.t * W8.t Array136.t * W8.t Array136.t * W8.t Array136.t.
36
36
@@ -1266,7 +1266,7 @@ by smt(unpackvK).
1266
1266
qed.
1267
1267
1268
1268
(***************************************************)
1269
-
1269
+ *)
1270
1270
1271
1271
import WArray960 WArray1536 Array4.
1272
1272
@@ -1562,7 +1562,7 @@ proc __poly_reduce(rp : W16.t Array256.t) : W16.t Array256.t = {
1562
1562
1563
1563
1564
1564
}.
1565
-
1565
+ (*
1566
1566
lemma compress10_equiv_avx2mem _ctp _mem :
1567
1567
equiv [ AuxPolyVecCompress10.avx2_orig ~ AuxPolyVecCompress10.avx2 :
1568
1568
={bp} /\ ctp{1 } = _ctp /\ Glob.mem{1 } = _mem /\ valid_ptr (to_uint ctp{1 }) (128 + 3 * 320 ) ==>
@@ -1746,7 +1746,7 @@ qed.
1746
1746
1747
1747
(*****************************************************************)
1748
1748
1749
-
1749
+ *)
1750
1750
require import Bindings.
1751
1751
(* BINDINGS *)
1752
1752
@@ -1836,9 +1836,50 @@ op sliceset960_8_32 (arr: W8.t Array960.t) (i: int) (bv: W32.t) : W8.t Array960.
1836
1836
bind op [W8.t & W32.t & Array960.t] sliceset960_8_32 "asliceset".
1837
1837
realize bvaslicesetP by admit.
1838
1838
1839
- op lane (w: W16.t) = w.
1839
+ (*
1840
+
1841
+ op compress_alt_large (c : coeff) : int =
1842
+ (asint c * 2 ^ 10 + (q + 1 ) %/ 2) * (W32.modulus %/ q) %/ W32.modulus %% 2 ^ 10.
1843
+
1844
+ op BREDC(a bits : int ) =
1845
+ let t = smod (a * (2 ^bits %/ q + 1 )) (R^2 ) %/ 2^bits * q in
1846
+ smod (a %% R + (-t) %% R) R. *)
1847
+
1848
+ theory W10.
1849
+ abbrev [-printing] size = 10.
1850
+ clone include BitWordSH with op size <- size
1851
+ rename "_XX" as "_10"
1852
+ proof gt0_size by done,
1853
+ size_le_256 by done.
1854
+
1855
+ end W10. export W10 W10.ALU W10.SHIFT.
1856
+
1857
+ bind bitstring W10.w2bits W10.bits2w W10.to_uint W10.to_sint W10.of_int W10.t 10.
1858
+ realize size_tolist by auto.
1859
+ realize tolistP by auto.
1860
+ realize oflistP by admit.
1861
+ realize ofintP by admit.
1862
+ realize touintP by admit.
1863
+ realize tosintP by admit.
1864
+
1865
+ op sliceget_10_64 (bw: W64.t) (i: int ) : W10.t = W10.bits2w (W64.w2bits bw).
1866
+
1867
+ op lane_func_compress10(x : W16.t) : W10.t = sliceget_10_64 (
1868
+ (((W4u16.zeroextu64 x) `<<` W8.of_int 10) + W64.of_int 1665) * (W64.of_int 1290167 ) `>>` W8.of_int 32) 0.
1869
+
1870
+ op lane_func_reduce(c : W16.t) : W16.t =
1871
+ let c32 = sigextu32 c in
1872
+ let u = c32 * W32.of_int 4076929024 (* (62209 `<<` 16 ) *) in
1873
+ let u = u `|>>` W8.of_int 16 in
1874
+ let t = u * W32.of_int 4294963967 (* (-3329 ) *) in
1875
+ let t = t + c32 in
1876
+ let t = t `|>>` W8.of_int 16 in
1877
+ truncateu16 t.
1878
+
1879
+ op lane_polyvec_redcomp10(w : W16.t) : W10.t = lane_func_compress10 (lane_func_reduce w).
1840
1880
op pcond (w: W16.t) = true.
1841
1881
1882
+
1842
1883
lemma blah (_bp : W16.t Array768.t) : hoare [ AuxPolyVecCompress10.avx2 : true ==> false].
1843
1884
proof.
1844
1885
proc.
@@ -1874,8 +1915,7 @@ cfold 38.
1874
1915
unroll for 39.
1875
1916
cfold 38. unroll for 24. cfold 23.
1876
1917
unroll for 16. cfold 15. unroll for 8. cfold 7.
1877
- admit. (*
1878
- bdep 16 16 [_bp] [bp] [ap] lane pcond.
1918
+ bdep 16 10 [_bp] [bp] [ap] lane_polyvec_redcomp10 pcond.
1879
1919
1880
1920
print get256_direct.
1881
1921
*)
0 commit comments