repo
stringclasses
966 values
path
stringlengths
5
283
license
stringclasses
13 values
stars
int64
0
3.47k
default_branch
stringclasses
15 values
commit_sha
stringclasses
966 values
pushed_at
stringdate
2015-04-17 10:56:12
2026-07-22 05:29:38
size_bytes
int64
0
1.91M
sha256
stringlengths
64
64
content
stringlengths
0
1.91M
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/BigNum/BigNumBEAdaptor.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
3,966
5864b97cddb5b3ef63979b385b004f95db0d4712164755ab84eb1f8eeadb5cfb
include "BigNatCore.i.dfy" include "../Util/seqs_transforms.i.dfy" include "../Util/seqs_reverse.i.dfy" //-//////////////////////////////////////////////////////////////////////////// //- Convert between "legacy" little-endian, well-formed-required BigNats //- and new-style BEIsByteSeq static predicate ZeroPr...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/BigNum/BigRat.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
8,702
a114cce72116774e87811f716c3f62c8d01cedcfacec41d3fa9b570e5c524e70
//- <NuBuild AddDafnyFlag /z3opt:NL_ARITH=true/> include "BigNum.i.dfy" include "../Math/mul.i.dfy" datatype BigRat = BigRat_ctor( n : BigNum, d : BigNat); static function WellformedBigRat(Q:BigRat) : bool { WellformedBigNum(Q.n) && WellformedBigNat(Q.d) && !zero(Q.d) } static function RV(Q:...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/BigNum/Word32.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
421
40e35df19645812d08f4b854cd37ae9dda35a7d7e16d4e2870d89a9e1bfbea7a
//-include "../Util/assembly_deprecated.s.dfy" include "../Math/power2.i.dfy" //-static function Word(w:nat, x:nat) : bool //-{ //- 0 <= x < power2(w) //-} static function Width() : int ensures 0 < Width(); { power2(32) } //-static function Word32(x: nat): bool //- ensures Word32(x) <==> (...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/RandomNumberGen.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
2,612
3afeeb4fa70851ce7eb4c08da524013bbac5990d51c70faa87b4a608ebeaaa3e
include "../Math/power2.s.dfy" include "../Math/round.s.dfy" include "../Util/be_sequences.s.dfy" include "RandomTracing.s.dfy" //------------------------------------------------------------// //- Selecting a random number in a range //- Used to select the seeds for MillerRabin tests. datatype SelectRandom...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/RandomTracing.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
258
2518c2f3933498655695ceed201da5afbad742682019350998eb197968dbf5eb
static predicate is_prefix(prefix:seq<int>, super:seq<int>) { |super| >= |prefix| && super[..|prefix|] == prefix } static predicate is_suffix(suffix:seq<int>, super:seq<int>) { |super| >= |suffix| && super[|suffix|..] == suffix }
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/BigNatToFatNatAdaptor.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
2,180
c95c8f98549401b1d594ab45e7659cdb91005b1ec23b6c98f61f60bd18df7f5f
include "FatNatCommon.i.dfy" include "../BigNum/BigNatCore.i.dfy" include "../BigNum/BigNumBEAdaptor.i.dfy" include "CanonicalArrays.i.dfy" include "FatInt.i.dfy" include "../BigNum/BigNum.i.dfy" method BigNatToFatNat(B:BigNat) returns (F:array<int>) requires WellformedBigNat(B); ensures F!=null && ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/Bitwise.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
23,351
2e9661ef21985e3bee8c76c401f0eeb58529201c6e5581d57dbd696617d1efbf
include "FatNatCommon.i.dfy" include "FatNatMul.i.dfy" include "CanonicalArrays.i.dfy" include "../Math/power2methods.i.dfy" include "../Util/seqs_common.i.dfy" include "../Util/seqs_and_ints.i.dfy" method BitShiftRight_Word(x:nat, b:nat) returns (xb:nat) requires IsWord(x); ensures IsWord(xb); ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/CanonicalArrays.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
8,722
a35f423ef955f443e49bc8587dc69f9b8ced28ee97b17c15dde488b2c2789f83
include "../Util/seqs_canonical.i.dfy" include "../Util/seqs_and_ints.i.dfy" include "../Util/seqs_common.i.dfy" method CountTopZeroWords(n:array<int>) returns (i:int) requires n!=null; //- requires IsWordSeq(n[..]); ensures 0<=i<=n.Length; ensures forall j :: 0<=j<i ==> n[j]==0; ensures i<...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatInt.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
15,341
c185c026c22e17121b9b1bc796d5d0703e71fbd9802ce0e3699ea66b1385773c
include "FatNatAddUnrolled.i.dfy" include "FatNatDiv.i.dfy" include "FatNatX86.i.dfy" datatype FatInt = FatInt_ctor( negate : bool, value : array<int>); //-//////////////////////////////////////////////////////////////////////////// function {:heap} WellformedFatInt(A:FatInt) : bool reads A.va...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatAdd.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
19,733
df8b038a3fe8ff0aefaf0d6684c298848c83f47b9021d8bdeed0325c36954d4a
include "FatNatCommon.i.dfy" include "FatNatX86.i.dfy" include "../Util/beseqs_simple.i.dfy" include "FatNatAddLemmas.i.dfy" predicate FNAddRelation_local(pv:int, a:seq<int>, b:seq<int>, c:seq<int>, carryin:seq<int>, i:int) requires 1<pv; requires IsDigitSeq(pv, a); requires IsDigitSeq(pv, b); ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatAddLemmas.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
8,403
b170153646d849d56dcedb6de803c6976accae59ed914795e72578a26a7fa38b
include "FatNatCommon.i.dfy" include "../BigNum/BigNatX86Shim.i.dfy" include "../../Drivers/CPU/assembly.i.dfy" predicate HappyDigit(s:seq<int>, si:int, i:int) requires 0 <= si; requires si+8 <= |s|; requires 0 <= i < 8; { 0 <= s[|s|-1-(si+i)] < 0x100000000 } lemma {:timeLimitMultiplier 2}...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatAddUnrolled.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
960
9264b0ec97b77bbf80efc1c7490ea0799754510f9bde655eb51c9292345e853f
include "FatNatAdd.i.dfy" method {:timeLimitMultiplier 4} FatNatAdd_optimized(a:array<int>, b:array<int>) returns (c:array<int>) requires a!=null; requires b!=null; requires IsDigitSeq(power2(32), a[..]); requires IsDigitSeq(power2(32), b[..]); ensures c!=null; ensures IsDigitSeq(power2...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatCommon.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
6,821
0a0a6f285fcece1d1d08519c3d75ff86c29cdbf28155d829520a6e16f8e14dfc
include "../Util/seqs_and_ints.i.dfy" include "../Util/seqs_common.i.dfy" include "../BigNum/BigNatX86Shim.i.dfy" include "CanonicalArrays.i.dfy" function FatNatAddIndex(L:int, index:int, i:int) : int { L - 1 - (index + i) } //- Treat i as a "little-endian index", so LEDigitAt(0) is the least-valued, //- righ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatCompare.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
10,767
2cd764f233d46391d98831d057e2c13bc466b8c8e50a37df3f348600c10016af
include "../Util/seqs_common.i.dfy" include "FatNatCommon.i.dfy" include "CanonicalArrays.i.dfy" datatype Cmp = CmpLt | CmpEq | CmpGt; predicate DefCmp(a:int, cmp:Cmp, b:int) { (cmp==CmpLt <==> (a < b)) && (cmp==CmpEq <==> (a == b)) && (cmp==CmpGt <==> (a > b)) } lemma lemma_FNCompare_inn...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatDiv.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
12,846
90bf74fb571be8517f83be3cace6cc6d2528e5fc991cf28376e2101c4b0be83c
include "../Util/seqs_canonical.i.dfy" include "FatNatDivDefs.i.dfy" include "FatNatDivEstTrivial.i.dfy" include "FatNatDivEstDiv32.i.dfy" include "FatNatReciprocal.i.dfy" include "../FleetNat/FleetNatMul.i.dfy" include "../FleetNat/FleetNatSub.i.dfy" include "CanonicalArrays.i.dfy" method FNDivision_init(n:a...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatDivDefs.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,463
957ba1c8537d425f7409836b5191672c6a2b84089c25f2a17d74be5fe80b41d3
include "FatNatCommon.i.dfy" include "FatNatMul.i.dfy" include "FatNatSub.i.dfy" include "FatNatCompare.i.dfy" include "../Util/seqs_canonical.i.dfy" datatype FNDivData = FNDivData_c( n:array<int>, dv:array<int>, r:array<int>, q:array<int>); datatype FNDivGhost = FNDivGhost_c( Ns:seq<int>, Ds:s...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatDivEstDiv32.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
14,210
aa0dd4629edfc24013c234ed0673c6556950aece1644a7e63756e7d30b7cd1ef
include "FatNatDivDefs.i.dfy" include "FatNatDivEstTrivial.i.dfy" include "Bitwise.i.dfy" include "WordBoundHack.i.dfy" method FNDivision_Estimate_Q_div32(n:array<int>, dv:array<int>) returns (q:array<int>) requires n!=null; requires IsWordSeq(n[..]); requires dv!=null; requires IsWordSeq(dv[....
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatDivEstTrivial.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,515
0be3255ee327e3f81af49b816a0694ac23887e09177d22583fa122aba7179564
include "FatNatDivDefs.i.dfy" //- The simplest possible estimator: it subtracts q=1 copy of dv at a time. //- Runtime is linear in the value of the final quotient. method FNDivision_Estimate_Q_trivial(n:array<int>, dv:array<int>) returns (q:array<int>) requires n!=null; requires IsWordSeq(n[..]); ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatMod.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
25,064
da754d86150a7c977fecd438eaa0456e19cfc52f4f01ca6942ace0b5c6bdc06f
include "../Util/seqs_canonical.i.dfy" include "FatNatDiv.i.dfy" include "../FleetNat/FleetNatMUl.i.dfy" include "CanonicalArrays.i.dfy" include "WordBoundHack.i.dfy" method FatNatModuloUsingReciprocal(X:array<int>, N:array<int>, Nreciprocal:FNDivReciprocal) returns (R:array<int>) requires X!=null...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatModesty.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
563
897fab9142f5a8e7cdbe4c9d0f30fbbdefafce9d311e672d854909cfc4232389
include "FatNatCommon.i.dfy" include "Bitwise.i.dfy" predicate {:heap} ModestFatNatValue(X:array<int>) reads X; { WellformedFatNat(X) && J(X) < power2(power2(31)) } method IsModestFatNat(X:array<int>) returns (rc:bool) requires WellformedFatNat(X); ensures rc <==> ModestFat...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatMul.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
34,589
26be1fc8462eae43eab91d2b8226bb6f67c729cd8ab6319b2a9171d0dc0bc1cd
include "../Util/seqs_common.i.dfy" include "FatNatCommon.i.dfy" include "FatNatAddUnrolled.i.dfy" include "../FleetNat/FleetNatAdd.i.dfy" include "../Util/ProfileIfc.i.dfy" include "../Util/ProfileIfc.i.dfy" datatype MulRow = MulRow_c( a_fragment:int, a_partial_sum:int, product:int); predicate FNMu...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatRandom.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
14,881
fa3b637baa6f2719e235917388b9271f84aca6ed9ede569f968c935cd1b9e0b2
include "FatNatCompare.i.dfy" include "Bitwise.i.dfy" include "../Crypto/RandomNumberGen.s.dfy" include "../../Drivers/TPM/tpm-wrapper.i.dfy" //-include "../Math/round.i.dfy" //-include "../Math/BitwiseOperations.i.dfy" //-include "../../Drivers/TPM/tpm-wrapper.i.dfy" //-include "../../Drivers/CPU/assembly_premi...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatReciprocal.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
11,374
5b5386a959a9b426fa035fcecf9889a6bcd7462c628cf0a7dd6b3e74ee89afc3
include "FatNatDivDefs.i.dfy" include "../FleetNat/FleetNatMul.i.dfy" include "CanonicalArrays.i.dfy" datatype FNDivReciprocal = FNDivKnownReciprocal(w:int, TwoTo32wDividedByD:array<int>) | FNDivUnknownReciprocal(); predicate FNDivReciprocalValid(reciprocal:FNDivReciprocal, dv:array<...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatSub.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
16,707
340cddba7b73090bef8e703c4f11e01928c770e6508caa3a0677403af3bf70ed
include "FatNatCommon.i.dfy" predicate FNSubRelation_local(pv:int, a:seq<int>, b:seq<int>, c:seq<int>, carryin:seq<int>, i:int) requires 1<pv; requires IsDigitSeq(pv, a); requires IsDigitSeq(pv, b); requires IsDigitSeq(pv, c); requires IsDigitSeq(2, carryin); requires 0 <= i < MaxLen3(a...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatX86.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
2,525
5c39f9b7448359f1984acbc7ed56f67fd6fea5dd93cfcc2cb459536383b93d62
include "FatNatCommon.i.dfy" include "../BigNum/BigNatX86Shim.i.dfy" //-include "FatNatX86big.i.dfy" method {:decl} Add32_unrolled_8( a:array<int>, ai:int, b:array<int>, bi:int, s:array<int>, si:int, c_in:int) returns (c_out:int, ghost carries:seq<int>) requires a!=null; requires...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/FatNatX86big.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,410
21e082723bc3555021f78e3ba1da4fe60a99db2f39c708bbd98c145966f9486c
include "FatNatCommon.i.dfy" include "../BigNum/BigNatX86Shim.i.dfy" /* method {:decl} Add32_unrolled_32( a:array<int>, ai:int, b:array<int>, bi:int, s:array<int>, si:int, c_in:int) returns (c_out:int, ghost carries:seq<int>) requires a!=null; requires IsWordSeq(a[..]); requ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/Transforms.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,269
c5cf9a889695423ddf3fce4c62a20732f22f9f4a46787a8dbb54efdcc12b0285
include "../Util/arrays_and_seqs.i.dfy" include "CanonicalArrays.i.dfy" method BEWordArrayToByteArray(M:array<int>) returns (m:array<int>) requires M!=null; requires IsWordSeq(M[..]); ensures m!=null; ensures IsByteSeq(m[..]); ensures BEByteSeqToInt(m[..]) == BEWordSeqToInt(M[..]); //- ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FatNat/WordBoundHack.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
358
efd93d28c6fae5f1597d7affd54143a0463af4ecaaffaf9c0e425de7bf7443f7
include "../Util/DebugPrint.i.dfy" include "../Util/Halter.i.dfy" method constrain_word_from_overflowing(word:nat) ensures word<power2(32); { //- TakeTopBits must already have failed with an overflow. lemma_2toX(); if (0xffffffff <= word) { ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FleetNat/Bizarre.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
7,662
bbe34b37767f616046e877a92a04f81bf5c64263244746058c372389d698c033
include "../FatNat/FatNatCommon.i.dfy" include "FleetNatCommon.i.dfy" lemma lemma_asm_Sub_properties(x:int, y:int, z:int, c:int) requires word32(x); requires word32(y); requires word32(z); requires 0<=c<2; requires z == mod0x100000000(x - y); ensures z == (x - y) % 0x100000000; en...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FleetNat/FleetNatAdd.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
24,361
5d1a5324148dc6a44dcfb7f0cc004e3d5efd54eb2b7eb37596796c010c1481e1
include "../FatNat/FatNatCommon.i.dfy" include "FleetNatCommon.i.dfy" lemma lemma_FleetNatAddSimple_1(pv:int, bs:seq<int>, bdigits:int, lastcs:seq<int>, oldcs:seq<int>, newcs:seq<int>, j:int, oldj:int, lastcarry:int, prevcarry:int) requires pv==power2(32); requires 0 <= bdigits <= |bs|; requires bdig...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FleetNat/FleetNatCommon.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
15,525
cf0005c81f9ebe6e6fd3c49280453e3643940b0481d406c22a142c974ec256d9
include "../Util/seqs_and_ints.i.dfy" include "../Util/seqs_common.i.dfy" include "../FatNat/FatNatCommon.i.dfy" include "../FatNat/CanonicalArrays.i.dfy" //- dafnycc was having a hard time stringing these together. lemma lemma_FasterCopyArray_helper(dst:array<int>, doff:int, rdi:int, src:array<int>, soff:int, r...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FleetNat/FleetNatMul.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
12,644
f6e420bc2c86eaf8ab919c6e3440862f8b0bdd6cd22247ac0241a037402ec92a
include "FleetNatAdd.i.dfy" include "FleetNatMulLoopOpt.i.dfy" method FleetNatMul_one(c:array<int>, bi:nat, a:array<int>, adigits:int, bv:int) requires c!=null; requires IsDigitSeq(power2(32), c[..]); requires a!=c; requires a!=null; requires IsDigitSeq(power2(32), a[..]); requires 0<=...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FleetNat/FleetNatMulLemmas.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
3,418
10fcb31e6d25a993f3735d84430792a3f059511a79e1ffc789d34c56efa0784d
include "FleetNatAdd.i.dfy" lemma lemma_asm_Mul64(x:int, y:int, hi:int, lo:int) requires word32(x); requires word32(y); requires word32(hi); requires word32(lo); requires lo == mod0x100000000(x * y); requires hi == (x * y) / 0x100000000; ensures hi*power2(32)+lo == x*y; ensure...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FleetNat/FleetNatMulLoopOpt.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
4,127
2f92e9c8a5c4600fd691b04d2a9bbbd765b3fcbe2869457dfd58a70f8b36b380
include "FleetNatMulOpt.i.dfy" include "FleetNatMulLoopOptLemmas.i.dfy" // Bryan, here's the most important loop we run. This is a working // implementation that calls out to your FleetNatMulMathOpt inner-loop // to exploit adc propagation. // Your goal is to optimize the loop, in particular by inlining the // ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FleetNat/FleetNatMulLoopOptLemmas.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
8,356
e96a26a3a91369667dbc49433ac6026e75401eb4c39ccba9ac79071690f4b91a
include "FleetNatAdd.i.dfy" //- mpi_mul_hlp uses 16/8/1 unrolling and muladdc and optionally a special MULADDC_HUIT instruction //- then it propagates the carries out. //- s is the source value, d is the dest value (shifted with pointer math), b is the single //- limb being multiplied in. //- mpi_mul_mpi counts ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FleetNat/FleetNatMulOpt.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,720
b24093dcd7df446d4c8a8b7dbb73eb8232bc66e4134761579da0459d70a3f11c
include "FleetNatMulLemmas.i.dfy" method {:decl} FleetNatMulMathOpt(aj:int, bv:int, lastcj:int, lastcarry:int) returns (newcj:int, newcarry:int) requires 0<=aj<0x100000000; requires 0<=bv<0x100000000; requires 0<=lastcj<0x100000000; requires 0<=lastcarry<0x100000000; ensures 0<=newcj<0x...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FleetNat/FleetNatSub.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
21,773
a9645252ab6d77d81b445550136aa7f0fdfb060b6a2742e32b8a0759acc61e1e
include "../FatNat/FatNatCommon.i.dfy" include "FleetNatCommon.i.dfy" //-include "FleetNatSubOpt.i.dfy" lemma lemma_asm_Sub_properties(x:int, y:int, z:int, c:int) requires word32(x); requires word32(y); requires word32(z); requires 0<=c<2; requires c==1 <==> x < y; requires z == mod0x...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/FleetNat/FleetNatSubOpt.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
937
14967dbe7a8c50faae141b5cd3b4cb06de4f27b7007ae9369dc80e9413328048
method FleetNatSub_local_math_core(lastcj:int, bj:int, lastborrow:int) returns (newcj:int, borrow:int) requires 0<=lastcj<0x100000000; requires 0<=bj<0x100000000; requires 0<=lastborrow<2; ensures 0<=newcj<0x100000000; ensures 0<=borrow<2; ensures lastcj - lastborrow - bj == newcj - ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/BitwiseOperations.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
15,018
d65183452a9bfd1ad1ccd1d27ba4aac7063991dbbe3974c277f01be9e2aa06aa
include "power2.s.dfy" include "power2.i.dfy" include "../Util/be_sequences.s.dfy" //-//////////////////////////////////////////////////////////////////////////// //- Pure bitwise operations -- "pure" in that they're defined over nats, //- not Word32s. static function BitAnd(x:nat, y:nat) : nat requires ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/bit_vector_lemmas.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,163
268ed1985074ccd397df4a44b8a2f22e0f4e4a4aa2909632ec3610ded18bc25e
include "../../Drivers/CPU/assembly.i.dfy" //-/////////////////////////////////////////////////// //- These connect to the underlying lemmas proven //- in Boogie. It is strongly suggested that you //- call the premium versions of these lemmas //- (in bit_vector_lemmas_premium.i.dfy) instead of //- calli...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/bit_vector_lemmas_premium.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
2,296
f86a8a2ae76bdfdbeec3a0c86211c81ee033dac99d9f0dc6aefe4bcedc018a83
include "bit_vector_lemmas.i.dfy" include "../../Drivers/CPU/assembly_premium.i.dfy" static lemma lemma_and_with_ff_premium() ensures Word32(0xFF); ensures forall x :: Word32(x) ==> 0 <= Asm_BitwiseAnd(x, 0xFF) < 256 && IsByte(Asm_BitwiseAnd(x, 0xFF)); { lemma_2toX(); forall x | Word32(x) ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/div.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
48,595
6809778bb6d58529ed039b761cbad383120bdc485521649e683e13a67f2d7273
include "power.i.dfy" include "mul.i.dfy" include "div_def.i.dfy" include "div_boogie.i.dfy" include "div_nonlinear.i.dfy" //-//////////////////////////////////////////////////////////////////////////// //- //- Core div lemmas, with named arguments. //- //-////////////////////////////////////////////////////...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/div_boogie.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
2,286
2c18c36d816a082852629d55d30d480cae8a33c7885d59b1833befcd3e40e72d
include "div_def.i.dfy" include "mul.i.dfy" static lemma lemma_div_is_div_boogie(x:int, d:int) requires d != 0; //- ensures INTERNAL_div(x, d) == INTERNAL_div_boogie(x, d); { } static lemma lemma_mod_is_mod_boogie(x:int, d:int) requires d > 0; //-ensures INTERNAL_mod(x, d) == INTERNAL_mod_b...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/div_def.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
2,310
ecd4768edd8b3da65122a886ee56cf6eebab4fb9c884f4e12b3386c1e00b30cc
//- Specs/implements mathematical div and mod, not the C version. //- This may produce "surprising" results for negative values //- For example, -3 div 5 is -1 and -3 mod 5 is 2. //- Note this is consistent: -3 * -1 + 2 == 5 /* static function mod(x:int, m:int) : int requires m > 0; decreases if x < 0 t...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/div_nonlinear.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,263
2f12fa2c6aa573fb57fa562d2d1d06fe855cfe38f33d30348e0a5351c9516d99
//- <NuBuild AddDafnyFlag /z3opt:NL_ARITH=true/> //- WARNING: In general, you shouldn't need to call these directly. Try //- to use the ones in div.i.dfy instead. They're more full-featured anyway. static lemma lemma_div_of_0(d:int) requires d != 0; ensures 0/d == 0; { } static lemma le...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/evenodd.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
3,135
c4a47dab1635d24b19b7c80c73d1db16a482839ca7ea6a2144dffd6b3ed8308f
include "mul.i.dfy" include "div.i.dfy" static function IsEven(x:int) : bool { exists y:int :: mul(y, 2) == x } static lemma lemma_no_half(i:int) ensures 2*i != 1; { /* if (i==0) { } else if (i>0) { lemma_mul_increases(i,2); assert 2<=mul(i,2); le...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/GCD.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
276
201e3a469b9f510f3ffb70256b122127b26f1a41e94f657bf257b23c6a397805
static function divides(d:nat, n:int) : bool requires d != 0; { (n % d) == 0 } static predicate is_gcd(a:nat, b:nat, gcd:nat) { gcd != 0 && divides(gcd,a) && divides(gcd,b) && forall x:int :: gcd<x ==> !(divides(x,a) && divides(x,b)) }
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/mul.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
15,525
3d1fc6029a5e2e8c1b1a0fe06b2cfd344a1cc9ec1dca8c326cfaea5344c5dbf3
include "mul_nonlinear.i.dfy" static function mul(x:int, y:int) : int { x*y } //-//////////////////////////////////////////////////////////// //- Recursive definitions that can be handy for proving //- properties we can't or don't want to rely on nonlinear for //-//////////////////////////////////////////////...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/mul_nonlinear.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
930
6996eb2ceb89397c00ad8957bd18125c1899f5bcab359b9799c978f39cfce0a2
//- <NuBuild AddDafnyFlag /z3opt:NL_ARITH=true/> //- WARNING: In general, you shouldn't need to call these directly. Try //- to use the ones in mul.i.dfy instead. They're more full-featured anyway. static lemma lemma_mul_strictly_positive(x:int, y:int) ensures (0 < x && 0 < y) ==> (0 < x*y); {}...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/power.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
5,519
f16385f3c0bf42f2858546f4a5a2afdd712457d30b02a19a8764f3da817b027b
include "power.s.dfy" include "mul.i.dfy" //-lemma lemma_mul_passes_harmlessly_through_mod( //- ensures mul(x,y) % m == mul(x static lemma lemma_power_0(b:int) ensures power(b,0) == 1; { reveal_power(); } static lemma lemma_power_1(b:int) ensures power(b,1) == b; { calc { p...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/power.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
142
405a6dfe63935287646203292b1e0876f5094fae36c045d197a3dc3d162543e6
static function {:opaque} power(b:int, e:nat) : int decreases e; { if (e==0) then 1 else b*power(b,e-1) }
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/power2.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
14,234
1dd89a3ceb587aff8447c44eade4b113b5514256c139445242a6e0f8ec87f3f3
include "power2.s.dfy" include "power.s.dfy" include "power.i.dfy" include "div.i.dfy" //-include "../../Drivers/CPU/assembly_premium.i.dfy" include "../../Drivers/CPU/assembly.s.dfy" include "../Util/repeat_digit.i.dfy" /* * Real definition in spec directory (included above); * but here's a commented copy...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/power2.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,053
de06e12a20695ccebbc35bbdfc5b806acd03abb7912bc558aa9fb90cca4a2632
include "../base.s.dfy" static function {:opaque} power2(exp: nat) : nat ensures power2(exp) > 0; { if (exp==0) then 1 else 2*power2(exp-1) } static lemma lemma_power2_32() ensures power2(8) == 0x100; ensures power2(16) == 0x10000; ensures power2(24) == 0x100000...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/power2methods.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
5,604
64374cab01317e43fba288701401d76c216cf296ea251a897af7985e443b0452
include "power2.i.dfy" method MakePower2(e:nat) returns (x:nat) requires e < 32; ensures x==power2(e); { lemma_2toX32(); if (e<16) { if (e<8) { if (e<4) { if (e<2) { if (e<1) { x := 1; } else { x := 2; ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/round.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
9,362
741cb506d2c092b246acfa992f0c4b2d7ef4e51b9ca682eb67a3210061b073fa
include "round.s.dfy" include "mul.i.dfy" include "div.i.dfy" include "../../Drivers/CPU/assembly_premium.i.dfy" //-////////////////////////////////////// //- RoundUpToMultiple //-////////////////////////////////////// static function method{:CompiledSpec} CompiledSpec_RoundUpToMultiple (x:int, m:int) : int ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Math/round.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
295
6947d55cba57e5cf43ae0b3cee3b83800f937d477e8239541a5bb67bb302fa53
static function method RoundUpToMultiple (x:int, m:int) : int requires m > 0; requires x >= 0; { ((x + m - 1) / m) * m } static function method DivideRoundingUp (x:int, m:int) : int requires x >= 0; requires m > 0; { (x/m) + (if x % m == 0 then 0 else 1) }
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Net/ethernet.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
3,315
af71322af528d0e0f8ed5dcfc7ac5d904870aa9f979cf7e4296762bd54673d96
//-<NuBuild BasmEnableSymdiff true /> include "../Util/integer_sequences.i.dfy" include "../../Drivers/Network/Intel/driver.i.dfy" //- //- Ethernet-level interface to the network. //- //- //- Send the given Headers and Data to the given ethernet destination address. //- method EtherSend(state:network_state...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Net/InternetChecksum.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
2,960
4eab362bed1400bfe6fa30e5dc114b49595f7f9ffe47a00ecabb0b9461fd6f6f
//-<NuBuild BasmEnableSymdiff true /> include "../Math/power2.s.dfy" include "../Math/bit_vector_lemmas_premium.i.dfy" include "../../Drivers/CPU/assembly.s.dfy" include "../../Drivers/CPU/assembly_premium.i.dfy" include "../Util/word_bits.i.dfy" include "../Util/relational.s.dfy" //- //- The "Internet Checks...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Net/IPv4.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
9,068
a48ad884f4b8f2ae3e06dda15d163688707a548ac2966d95146a5ffbcf60af34
//-<NuBuild BasmEnableSymdiff true /> include "../Util/bytes_and_words.s.dfy" include "../Util/integer_sequences.i.dfy" include "../Math/power2.i.dfy" include "../../Drivers/Network/Intel/driver.i.dfy" include "ethernet.i.dfy" include "InternetChecksum.i.dfy" // // function method {:opaque} Serialize16(V...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Net/Udp.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
5,490
4c5ae66ac561007b1b328f4a2c05da411242f8dcd2aa0205aea58b10206f215f
//-<NuBuild BasmEnableSymdiff true /> include "../Util/bytes_and_words.s.dfy" include "../Util/integer_sequences.i.dfy" include "../Math/power2.i.dfy" include "IPv4.i.dfy" //- //- UDP Header Format: //- //- Byte 0 Byte 1 Byte 2 Byte 3 //- --------------------------...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/arrays.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
2,952
9b11f7e8d50ffdcdfcf53694a51e041e2913bd7f50db9a09e694de05408a4340
include "bytes_and_words.s.dfy" static method ArrayCpy(dst:array<int>, dst_offset:nat, src:array<int>, src_offset:nat, count:nat) requires dst != null; requires src != null; requires dst_offset+count <= dst.Length; requires src_offset+count <= src.Length; requires src != dst; modifies d...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/arrays_2.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
11,228
a6b6e369e3fc754c18810ad19031d88e0a43e3c16f0685b253b8be32e91723b3
include "../../Drivers/CPU/assembly_premium.i.dfy" include "../Math/BitwiseOperations.i.dfy" static lemma lemma_SelectBit_is_IntBit_spec(b:nat, x:nat) requires b<32; requires x<power2(32); ensures SelectBit(b,x) == IntBit_spec(31-b, x); { lemma_power2_1_is_2(); var bitseq := BEIntToDigit...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/arrays_and_seqs.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
7,703
209000002fc8632f4ed912b64f58e8dd7865b6d8e0f411f70fcf7147055d6dbb
include "be_sequences.s.dfy" include "seqs_and_ints.i.dfy" include "integer_sequences_premium.i.dfy" include "word_bits.i.dfy" include "seqs_transforms.i.dfy" include "../Math/div.i.dfy" include "../Math/power2.i.dfy" include "../Math/power.i.dfy" include "../base.s.dfy" //-include "../assembly.s.dfy" stati...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/beseqs_simple.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
251
c01fd6b09bcb569e80e651cf67faa823283a6d0d105209fb3f74ac78d7180f38
include "be_sequences.s.dfy" static lemma lemma_selection_preserves_digit_seq(pv:int, a:seq<int>, i:int) requires IsDigitSeq(pv, a); requires 0 <= i <= |a|; ensures IsDigitSeq(pv, a[i..]); ensures IsDigitSeq(pv, a[..i]); { }
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/be_sequences.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
5,708
51d4982304f00a6cced1104e1d20e422199095d5de94e486dd93f79c45ae7da9
include "../Math/power2.s.dfy" include "bytes_and_words.s.dfy" //-//////////////////////////////////////////////////////////////////////////// //- Sequence types //-//////////////////////////////////////////////////////////////////////////// static predicate IsDigitSeq(place_value:int, digits:seq<int>) { ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/bytes_and_words.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
353
a63ecd04181af30eb04c5576c67d74f4838d9eb74ae5d9942faa82593c9f0157
include "../Math/power2.s.dfy" static predicate IsBit(b:int) { 0 <= b < 2 } static predicate IsByte(b:int) { 0 <= b < 256 } // // static predicate Word16(x:int) { 0 <= x < 0x10000 } static predicate Word32(x: int) { 0 <= x < power2(32) } // // static predicate IsWo...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/DebugPrint.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
574
82a176a798bb2432f7c53820fbc56a519561c9fa93d6624a424e4be43e5b1864
include "../../Drivers/IO/pci.i.dfy" include "../../Drivers/CPU/assembly.i.dfy" include "seqs_and_ints.i.dfy" static method debug_print_seq(marker:int, seqn:seq<int>) requires 0<=marker<256; requires IsByteSeq(seqn); { var i := 0; var shifted_marker := marker * 256 * 256; debug_print(0x90...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/Halter.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
339
4bc9e5361208da8d718ae6f6c040142d8c9df1e9a86a075eb3c16a9344640ff2
include "../../Libraries/Math/power2.i.dfy" include "DebugPrint.i.dfy" //-include "../../Libraries/Net/Udp.i.dfy" method HaltMachine(error_code:int) requires 0 <= error_code < 0x10000; ensures false; { lemma_2toX(); debug_print(0, 0x44440000 + error_code); while true decreases *;...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/insecure_prng.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,814
73b92af5093e08d4492ce74e67d407259e2010bc0a759e773172533bd0f28a03
include "../../Drivers/CPU/assembly_premium.i.dfy" include "../Math/bit_vector_lemmas_premium.i.dfy" //- Implements an Xorshift random number generator based on the example from: //- http://en.wikipedia.org/wiki/Xorshift method update_state(w:int, x:int, y:int, z:int) returns (w':int, x':int, y':int, z':int) ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/integer_sequences.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
332
204009f0bd160cbd36b9b3d5b52325460a5dd1a3349fd1c75af65ac818636d38
include "integer_sequences.s.dfy" include "seqs_simple.i.dfy" include "seqs_and_ints.i.dfy" include "seqs_transforms.i.dfy" include "seqs_reverse.i.dfy" ////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/integer_sequences.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
30
9c95bf96e5c6f83d58d81a33b1bccb5d103f6160d684b93589beb9f4b82811c0
include "be_sequences.s.dfy"
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/integer_sequences_premium.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
15,468
03c3634d9a099fe12c658224101f0ff68be210cef7fef4beff951b65a3cddb1c
include "../Math/power.i.dfy" include "integer_sequences.i.dfy" //- "Premium" versions of {:autoReq} spec functions, which include //- explicit requires and appropriate ensures for composition with //- other functions. static function BEDigitSeqToInt_premium(place_value:int, digits:seq<int>) : int require...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/ProfileIfc.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
823
23c8c52a02ad28579234b14fe283ffeb5911617187e01394a507142538c186a1
static function method Tally_TestDigits() : int { 1 } static function method Tally_BigNatSub() : int { 2 } static function method Tally_BigNatModExpCalls() : int { 3 } static function method Tally_BigNatModExpWhileLoops() : int { 4 } static function method Tally_BigNatDivCalls() : int { 5 } static function method ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/relational.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,664
5701fe9fbcfcfe0d4efa302afc43946a21468264a8198901319bd5c8af1d2133
//-<NuBuild BasmEnableSymdiff true /> include "relational.s.dfy" include "be_sequences.s.dfy" include "../Math/power2.i.dfy" include "../../Drivers/CPU/assembly_premium.i.dfy" method UseDeclassifiedByteSequence(computed:seq<int>, ghost declassed:seq<int>) returns (usable:seq<int>) requires |declassed| == |c...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/relational.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
471
0810462fa7793189a6999dab596b85d099ea0c77cbc634aab5b7999bc82889ca
//-////////////////////////////////////////// //- Relational interface used by SymDiff //-////////////////////////////////////////// //- Dummy functions that are translated into BoogieAsm keywords: static function left<t>(x:t) : t { x } static function right<t>(x:t) : t { x } static predicate relation<t>(x:t) ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/repeat_digit.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
5,463
38a558cdf4fb0e0df2eddf09f312ae73899dc7fe9efbab505ad51fb085d3a0fd
include "be_sequences.s.dfy" include "../Math/div.i.dfy" include "seqs_simple.i.dfy" static lemma Lemma_RepeatDigitProperties(digit:int, count:int) decreases count; ensures |RepeatDigit(digit, count)| == if count < 0 then 0 else count; ensures forall i :: 0 <= i < count ==> RepeatDigit(digit, count)...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/seqs_and_ints.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
48,776
66972fd7bbc01b754c92f15cde5771b64b542a68666396dfac14606a44276529
include "integer_sequences.s.dfy" include "seqs_simple.i.dfy" include "repeat_digit.i.dfy" include "../Math/div.i.dfy" include "../Math/power.i.dfy" include "../Math/power2.i.dfy" //-//////////////////////////////////////////////////////////////////////////// //- This file establishes properties that relate BE...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/seqs_canonical.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,630
e41cb98c508a7677a3a454ebadbf769412b6ac72ee6877fded1d01331a56a430
include "seqs_and_ints.i.dfy" //- Reason about the lengths of sequences with no preceding zeros static predicate IsCanonicalDigitSeq(pv:nat, inseq:seq<int>) { IsDigitSeq(pv, inseq) && (|inseq|>0 ==> inseq[0]!=0) } static lemma lemma_CanonicalLengthBound(pv:nat, inseq:seq<int>, l:nat) requires ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/seqs_common.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
3,657
045d80e0e4169a797036f3bde87a96a83ab457c38f274275f4d307b6a3cdaaef
include "../Math/power.i.dfy" include "../Math/div.i.dfy" include "be_sequences.s.dfy" lemma lemma_BEInterpretation(pv:int, A:seq<int>, i:int) requires 1<pv; requires IsDigitSeq(pv, A); requires 0<=i<=|A|; ensures BEDigitSeqToInt(pv, A) == BEDigitSeqToInt(pv, A[..|A|-i]) * ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/seqs_reverse.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
5,542
15f430f8660698da9ff05a2560ce40fdf5b95791d4bb9be1d02f87e6af3eee6f
include "integer_sequences.s.dfy" //-//////////////////////////////////////////////////////////////////////////// //- This file relates Big Endian (BE) seqs to LE seqs via the reverse operation. //-//////////////////////////////////////////////////////////////////////////// //- Little-endian //-/////////////...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/seqs_simple.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,848
211d6dd3fc4350921ed411948fe2a8822788d4ad7d0bac52bf11eb3152a296c9
static lemma lemma_vacuous_statement_about_a_sequence(intseq:seq<int>, j:int) requires 0<=j<|intseq|; ensures intseq[0..j]==intseq[..j]; { } static lemma lemma_painful_statement_about_a_sequence(intseq:seq<int>) ensures intseq==intseq[..|intseq|]; { } static lemma lemma_obvious_statement_about_...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/seqs_transforms.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
113,958
c5ac0d0182719b6e1cd8ed8fb069b75a792b5da66d48241420f7fb99a4df4189
include "integer_sequences.s.dfy" include "../Math/div.i.dfy" include "../Math/power.i.dfy" include "../Math/power2.i.dfy" include "seqs_simple.i.dfy" include "seqs_and_ints.i.dfy" include "repeat_digit.i.dfy" include "../../Drivers/CPU/assembly.i.dfy" include "arrays.i.dfy" //-//////////////////////////////...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/seq_blocking.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
25,726
084942591480d80c7582704d8c596c755eec639bfe7030f5afeb3d1525e67e6e
include "seq_blocking.s.dfy" include "seqs_simple.i.dfy" include "arrays_and_seqs.i.dfy" include "../Math/round.i.dfy" include "../Math/div.i.dfy" include "../Math/mul.i.dfy" static lemma Lemma_SubtractOneBlock(block_num:int, block_size:int, block_index:int) ensures (block_num-1)*block_size + block_index =...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/seq_blocking.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
320
762ecf8a328202c3b3c06e7bd2af674147583358f4f70dfe2b3738c982c2e7be
include "be_sequences.s.dfy" static function{:opaque} BreakIntoBlocks(os:seq<int>, block_size:int) : seq<seq<int>> requires 0 < block_size; decreases |os|; { if |os| == 0 then [] else if |os| < block_size then [os] else [os[..block_size]] + BreakIntoBlocks(os[block_size..], block_size) }
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Util/word_bits.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
12,371
add6fd8f0bc9222a9bd0bdf6fa99de06156a8edb85661bd84b6eb0307ae56c0e
include "integer_sequences_premium.i.dfy" include "../../Drivers/CPU/assembly_premium.i.dfy" include "../Math/bit_vector_lemmas_premium.i.dfy" //------------------------------------------------------------------------- static lemma lemma_LeftShiftOfOneProperties(e: int) requires 0 <= e < 32; ensures...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/Digest.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
4,574
e63e14da6eb9bd79e460ff66e1bbaba0c976b397c0b60dea1b03d7f3ff9f80f3
include "Digest.s.dfy" include "sha256.i.dfy" static function method{:CompiledSpec} CompiledSpec_SHA256_DigestInfo() : seq<int> static lemma lemma_SHA256_DigestInfo_properties() ensures IsByteSeq(SHA256_DigestInfo()); ensures |SHA256_DigestInfo()|==19; { lemma_2toX(); } static function SHA256...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/Digest.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
686
c5125db91d7496eb83dbe50c466c109276d95ef3a0d625507c1ffea2de41632f
include "../../Util/integer_sequences.s.dfy" include "../Hash/sha256.s.dfy" static function {:autoReq} SHA256_Bytes(msg_bytes:seq<int>) : seq<int> { BEWordSeqToByteSeq(SHA256(BEByteSeqToBitSeq(msg_bytes))) } //- http://www.ietf.org/rfc/rfc3447.txt //- (Note that https://tools.ietf.org/html/rfc5754 is a d...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/hmac_common.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
17,125
d7e82f9700a43233aa9a5909e9dd62e467896d756edf22545d5de0e6782e2de6
include "hmac_common.s.dfy" include "../../../Drivers/CPU/assembly_premium.i.dfy" include "../../Util/integer_sequences_premium.i.dfy" include "sha_padding.i.dfy" //-/////////////////////////////////////////////////// //- ConstPad lemmas //-/////////////////////////////////////////////////// static lemma lem...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/hmac_common.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
1,061
e402af0c3c88fb8d34f0d7fb572e0461083e6b377768e7ba89b94f0ee19eb77f
include "../../Util/be_sequences.s.dfy" //-//////////////////////////////////////////////////////////////////////////// //- HMAC specification based on: //- http://csrc.nist.gov/publications/fips/fips198-1/FIPS-198-1_final.pdf //-//////////////////////////////////////////////////////////////////////////// stat...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/sha1.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
49,640
6a58e7539813144b3a0945fbc318281e5ef82dde60362dbccc75f4fbf9f66288
include "sha1.s.dfy" include "../../Util/seq_blocking.i.dfy" include "../../Util/arrays_and_seqs.i.dfy" include "../../Util/integer_sequences_premium.i.dfy" include "sha_padding.i.dfy" include "sha_common.i.dfy" static function method{:CompiledSpec} CompiledSpec_K_SHA1(n: int) : int static function method{:Com...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/sha1.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
5,324
c45d6a7782422531698cac9507e0cc576c0de79440077d4e14a4a9192afe926c
include "sha_common.s.dfy" include "hmac_common.s.dfy" //-/////////////////////////////////////////////////// //- Constants //-/////////////////////////////////////////////////// static function method{:opaque} K_SHA1(n: int) : int requires 0 <= n <= 79; ensures Word32(K_SHA1(n)); { /*call_lemm...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/sha1_hmac.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
8,705
2c58139e876f02f5a2ccdd5e1ffb01fa9181f34c27dc1967ba3c66aa9f146105
include "sha_common.s.dfy" include "hmac_common.s.dfy" include "sha1.i.dfy" include "hmac_common.i.dfy" include "../../Util/arrays_and_seqs.i.dfy" method HMAC_SHA1_inner_hash(key: array<int>, data: array<int>, len: int) returns (hash: array<int>) requires Word32(len); requires IsWordArray(key); re...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/sha256.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
46,251
8d1f5aa09eecd295f71a9b818ba8b456237c15cee0dd1729dbb3a68488540df4
include "sha256.s.dfy" include "../../Util/seq_blocking.i.dfy" include "../../Util/arrays_and_seqs.i.dfy" include "../../Util/integer_sequences_premium.i.dfy" include "sha_padding.i.dfy" include "sha_common.i.dfy" include "sha256opt.i.dfy" include "sha256opt2.i.dfy" include "sha256common.i.dfy" include ".....
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/sha256.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
7,109
f5c481203110c5f4e38f6135a4436b68178363a1ed73af4f94fdf92b0b9a58ff
include "sha_common.s.dfy" include "hmac_common.s.dfy" static function method{:opaque} K_SHA256(t: int) : int requires 0 <= t <= 63; ensures Word32(K_SHA256(t)); { /*call_lemma:*/lemma_power2_32(); if t < 8 then OneOf8(t - 0 , 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/sha256common.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
16,751
96cf8908b2fd9ebe2b6a66bdc0ff894bef549a1b9f8ca85ff7e58df986a10467
//- Stuff shared by sha256.i.dfy and sha256opt.i.dfy include "sha256.s.dfy" include "../../Util/seq_blocking.i.dfy" include "../../Util/arrays_and_seqs.i.dfy" include "../../Util/integer_sequences_premium.i.dfy" include "sha_padding.i.dfy" include "sha_common.i.dfy" include "../../../Drivers/CPU/assembly_premi...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/sha256opt.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
2,518
ca05e36d140c0b20800c1fc2c344f9ae5f7c6b253e8d0fd22111495524ac2ab3
//- HAND-OPTIMIZED PIECES of SHA 256 include "sha256.s.dfy" include "../../Util/seq_blocking.i.dfy" include "../../Util/arrays_and_seqs.i.dfy" include "../../Util/integer_sequences_premium.i.dfy" include "sha_padding.i.dfy" include "sha_common.i.dfy" include "sha256common.i.dfy" include "../../../Drivers/CPU/...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/sha256opt2.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
7,332
df1c40961853994e55f37555ef4bf35a1c84f575514a05d2c043508ee54cce4b
//- OPTIMIZED VERSION include "sha256.s.dfy" include "../../Util/seq_blocking.i.dfy" include "../../Util/arrays_and_seqs.i.dfy" include "../../Util/integer_sequences_premium.i.dfy" include "sha_padding.i.dfy" include "sha_common.i.dfy" include "sha256opt.i.dfy" include "sha256common.i.dfy" include "../../.....
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/sha256_hmac.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
8,686
064b2a90ae7ddcdd3b2f323bdb6a0fae0c44ac00e8f002d7c6edb2b068e22915
include "sha_common.s.dfy" include "hmac_common.s.dfy" include "sha256.i.dfy" include "hmac_common.i.dfy" include "../../Util/arrays_and_seqs.i.dfy" method HMAC_SHA256_inner_hash(key: array<int>, data: array<int>, len: int) returns (hash: array<int>) requires Word32(len); requires IsWordArray(key); ...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/sha_common.i.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
5,090
704a16267eaa5e128a2c708cd729d0b81ae2aeab0588534171fe049831408d3b
include "../../base.s.dfy" include "../../../Drivers/CPU/assembly.s.dfy" include "../../../Drivers/CPU/assembly_premium.i.dfy" include "../../Util/integer_sequences.s.dfy" include "../../Util/seq_blocking.s.dfy" include "sha_common.s.dfy" static function method{:CompiledSpec} CompiledSpec_NumPaddingZeroes(messa...
microsoft/Ironclad
ironclad-apps/src/Dafny/Libraries/Crypto/Hash/sha_common.s.dfy
NOASSERTION
268
main
2fe4dcdc323b92e93f759cc3e373521366b7f691
2023-06-03T02:12:27Z
3,887
1272e13bcb45ede57f01ed14db1452f17462696d702675e15a41e697028bdc79
include "../../base.s.dfy" include "../../../Drivers/CPU/assembly.s.dfy" include "../../Util/integer_sequences.s.dfy" include "../../Util/seq_blocking.s.dfy" //-/////////////////////////////////////////////////// //- Ch, Maj, BSIG0, BSIG1, SSIG0, SSIG1 //-/////////////////////////////////////////////////// s...