Dataset Viewer
Auto-converted to Parquet Duplicate
fact
stringlengths
7
19.6k
statement
stringlengths
3
19.5k
proof
stringlengths
0
19.3k
type
stringclasses
1 value
symbolic_name
stringlengths
1
30
library
stringclasses
13 values
filename
stringclasses
71 values
imports
listlengths
0
23
deps
listlengths
0
17
docstring
stringclasses
0 values
line_start
int64
1
1.24k
line_end
int64
1
1.24k
has_proof
bool
2 classes
source_url
stringclasses
1 value
commit
stringclasses
1 value
parameter type A : * // State type type K : * // Key type type n : # // Block size type p : # // Number of blocks to process at once type tagAmount : # type constraint (fin p, fin n, n >= tagAmount) // Process a single block using this key and tweak tweak_cipher : K...
parameter type A : * // State type type K : * // Key type type n : # // Block size type p : # // Number of blocks to process at once type tagAmount : # type constraint (fin p, fin n, n >= tagAmount) // Process a single block using this key and tweak tweak_cipher : K...
function
parameter
examples
examples/AE.cry
[]
[ ":", "K", "and", "type" ]
null
10
33
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
encrypt : {m} fin m => K -> Nonce -> A -> [m * (p * n)] -> [m * (p * n) + tagAmount] encrypt key nonce state inputMsg = encMsg # tag where encMsg = join rest.0.message tag = take (Tag key (tweak (1 - final.1)) final.0.state) final = steps ! 0 steps = [ ({ message = undefined, state = zero }, 1) ] # rest...
encrypt : {m} fin m => K -> Nonce -> A -> [m * (p * n)] -> [m * (p * n) + tagAmount]
encrypt key nonce state inputMsg = encMsg # tag where encMsg = join rest.0.message tag = take (Tag key (tweak (1 - final.1)) final.0.state) final = steps ! 0 steps = [ ({ message = undefined, state = zero }, 1) ] # rest rest = [ (Enc key (tweak v) { message = m, state = prev.state }, v + Cost) ...
function
encrypt
examples
examples/AE.cry
[]
[ ":", "K", "join", "split", "take", "zero" ]
null
61
62
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
type Node = { message : WorkBlock, state : State } // Some encryption schemes process multiple blocks at once type WorkBlock = [p*n] type State = [p*n] // The state for `p` blocks type Tweak = { nonce : Nonce, state : A, z : Int } type Nonce = [n] /* property // The tweak in the `i`th query ...
type Node = { message : WorkBlock, state : State }
type WorkBlock = [p*n] type State = [p*n] // The state for `p` blocks type Tweak = { nonce : Nonce, state : A, z : Int } type Nonce = [n] /* property // The tweak in the `i`th query to the tweak_cipher tweak_prop i { nonce = n, state = a, z = v } = { nonce = n, state = a, z = v + i...
function
type
examples
examples/AE.cry
[]
[ ":", "decrypt", "property" ]
null
34
36
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
gf28Add : {n} (fin n) => [n]GF28 -> GF28 gf28Add ps = sums ! 0 where sums = [zero] # [ p ^ s | p <- ps | s <- sums ]
gf28Add : {n} (fin n) => [n]GF28 -> GF28
gf28Add ps = sums ! 0 where sums = [zero] # [ p ^ s | p <- ps | s <- sums ]
function
gf28Add
examples
examples/AES.cry
[]
[ ":", "sums", "zero" ]
null
37
37
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
gf28Mult : (GF28, GF28) -> GF28 gf28Mult (x, y) = pmod(pmult x y) irreducible
gf28Mult : (GF28, GF28) -> GF28
gf28Mult (x, y) = pmod(pmult x y) irreducible
function
gf28Mult
examples
examples/AES.cry
[]
[ ":", "irreducible", "pmod", "pmult" ]
null
43
43
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
gf28Pow : (GF28, [8]) -> GF28 gf28Pow (n, k) = pow k where sq x = gf28Mult (x, x) odd x = x ! 0 pow i = if i == 0 then 1 else if odd i then gf28Mult(n, sq (pow (i >> 1))) else sq (pow (i >> 1))
gf28Pow : (GF28, [8]) -> GF28
gf28Pow (n, k) = pow k where sq x = gf28Mult (x, x) odd x = x ! 0 pow i = if i == 0 then 1 else if odd i then gf28Mult(n, sq (pow (i >> 1))) else sq (pow (i >> 1))
function
gf28Pow
examples
examples/AES.cry
[]
[ ":", "gf28Mult" ]
null
46
46
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
gf28Inverse : GF28 -> GF28 gf28Inverse x = gf28Pow (x, 254)
gf28Inverse : GF28 -> GF28
gf28Inverse x = gf28Pow (x, 254)
function
gf28Inverse
examples
examples/AES.cry
[]
[ ":", "gf28Pow" ]
null
55
55
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
gf28DotProduct : {n} (fin n) => ([n]GF28, [n]GF28) -> GF28 gf28DotProduct (xs, ys) = gf28Add [ gf28Mult (x, y) | x <- xs | y <- ys ]
gf28DotProduct : {n} (fin n) => ([n]GF28, [n]GF28) -> GF28
gf28DotProduct (xs, ys) = gf28Add [ gf28Mult (x, y) | x <- xs | y <- ys ]
function
gf28DotProduct
examples
examples/AES.cry
[]
[ ":", "gf28Add", "gf28Mult", "xs" ]
null
58
58
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
gf28VectorMult : {n, m} (fin n) => ([n]GF28, [m][n]GF28) -> [m]GF28 gf28VectorMult (v, ms) = [ gf28DotProduct(v, m) | m <- ms ]
gf28VectorMult : {n, m} (fin n) => ([n]GF28, [m][n]GF28) -> [m]GF28
gf28VectorMult (v, ms) = [ gf28DotProduct(v, m) | m <- ms ]
function
gf28VectorMult
examples
examples/AES.cry
[]
[ ":", "gf28DotProduct" ]
null
62
62
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
gf28MatrixMult : {n, m, k} (fin m) => ([n][m]GF28, [m][k]GF28) -> [n][k]GF28 gf28MatrixMult (xss, yss) = [ gf28VectorMult(xs, yss') | xs <- xss ] where yss' = transpose yss
gf28MatrixMult : {n, m, k} (fin m) => ([n][m]GF28, [m][k]GF28) -> [n][k]GF28
gf28MatrixMult (xss, yss) = [ gf28VectorMult(xs, yss') | xs <- xss ] where yss' = transpose yss
function
gf28MatrixMult
examples
examples/AES.cry
[]
[ ":", "and", "gf28VectorMult", "transpose", "xs" ]
null
65
65
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
xformByte : GF28 -> GF28 xformByte b = gf28Add [b, (b >>> 4), (b >>> 5), (b >>> 6), (b >>> 7), c] where c = 0x63
xformByte : GF28 -> GF28
xformByte b = gf28Add [b, (b >>> 4), (b >>> 5), (b >>> 6), (b >>> 7), c] where c = 0x63
function
xformByte
examples
examples/AES.cry
[]
[ ":", "gf28Add" ]
null
70
70
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
xformByte' : GF28 -> GF28 xformByte' b = gf28Add [(b >>> 2), (b >>> 5), (b >>> 7), d] where d = 0x05
xformByte' : GF28 -> GF28
xformByte' b = gf28Add [(b >>> 2), (b >>> 5), (b >>> 7), d] where d = 0x05
function
xformByte'
examples
examples/AES.cry
[]
[ ":", "SubBytes", "and", "gf28Add" ]
null
74
74
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
SubByte : GF28 -> GF28 SubByte b = xformByte (gf28Inverse b)
SubByte : GF28 -> GF28
SubByte b = xformByte (gf28Inverse b)
function
SubByte
examples
examples/AES.cry
[]
[ ":", "gf28Inverse", "xformByte" ]
null
77
77
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
SubByte' : GF28 -> GF28 SubByte' b = sbox@b
SubByte' : GF28 -> GF28
SubByte' b = sbox@b
function
SubByte'
examples
examples/AES.cry
[]
[ ":", "sbox" ]
null
80
80
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
SubBytes : State -> State SubBytes state = [ [ SubByte' b | b <- row ] | row <- state ]
SubBytes : State -> State
SubBytes state = [ [ SubByte' b | b <- row ] | row <- state ]
function
SubBytes
examples
examples/AES.cry
[]
[ ":", "SubByte'" ]
null
83
83
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
InvSubByte : GF28 -> GF28 InvSubByte b = gf28Inverse (xformByte' b)
InvSubByte : GF28 -> GF28
InvSubByte b = gf28Inverse (xformByte' b)
function
InvSubByte
examples
examples/AES.cry
[]
[ ":", "gf28Inverse", "xformByte'" ]
null
87
87
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
InvSubBytes : State -> State InvSubBytes state = [ [ InvSubByte b | b <- row ] | row <- state ]
InvSubBytes : State -> State
InvSubBytes state = [ [ InvSubByte b | b <- row ] | row <- state ]
function
InvSubBytes
examples
examples/AES.cry
[]
[ ":", "InvSubByte", "ShiftRows", "and" ]
null
90
90
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
ShiftRows : State -> State ShiftRows state = [ row <<< shiftAmount | row <- state | shiftAmount <- [0 .. 3] ]
ShiftRows : State -> State
ShiftRows state = [ row <<< shiftAmount | row <- state | shiftAmount <- [0 .. 3] ]
function
ShiftRows
examples
examples/AES.cry
[]
[ ":" ]
null
94
94
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
InvShiftRows : State -> State InvShiftRows state = [ row >>> shiftAmount | row <- state | shiftAmount <- [0 .. 3] ]
InvShiftRows : State -> State
InvShiftRows state = [ row >>> shiftAmount | row <- state | shiftAmount <- [0 .. 3] ]
function
InvShiftRows
examples
examples/AES.cry
[]
[ ":", "MixColumns", "and" ]
null
99
99
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
MixColumns : State -> State MixColumns state = gf28MatrixMult (m, state) where m = [[2, 3, 1, 1], [1, 2, 3, 1], [1, 1, 2, 3], [3, 1, 1, 2]]
MixColumns : State -> State
MixColumns state = gf28MatrixMult (m, state) where m = [[2, 3, 1, 1], [1, 2, 3, 1], [1, 1, 2, 3], [3, 1, 1, 2]]
function
MixColumns
examples
examples/AES.cry
[]
[ ":", "gf28MatrixMult" ]
null
105
105
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
InvMixColumns : State -> State InvMixColumns state = gf28MatrixMult (m, state) where m = [[0x0e, 0x0b, 0x0d, 0x09], [0x09, 0x0e, 0x0b, 0x0d], [0x0d, 0x09, 0x0e, 0x0b], [0x0b, 0x0d, 0x09, 0x0e]]
InvMixColumns : State -> State
InvMixColumns state = gf28MatrixMult (m, state) where m = [[0x0e, 0x0b, 0x0d, 0x09], [0x09, 0x0e, 0x0b, 0x0d], [0x0d, 0x09, 0x0e, 0x0b], [0x0b, 0x0d, 0x09, 0x0e]]
function
InvMixColumns
examples
examples/AES.cry
[]
[ ":", "AddRoundKey", "gf28MatrixMult" ]
null
112
112
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
AddRoundKey : (RoundKey, State) -> State AddRoundKey (rk, s) = rk ^ s
AddRoundKey : (RoundKey, State) -> State
AddRoundKey (rk, s) = rk ^ s
function
AddRoundKey
examples
examples/AES.cry
[]
[ ":" ]
null
120
120
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
Rcon : [8] -> [4]GF28 Rcon i = [(gf28Pow (<| x |>, i-1)), 0, 0, 0]
Rcon : [8] -> [4]GF28
Rcon i = [(gf28Pow (<| x |>, i-1)), 0, 0, 0]
function
Rcon
examples
examples/AES.cry
[]
[ ":", "gf28Pow" ]
null
123
123
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
SubWord : [4]GF28 -> [4]GF28 SubWord bs = [ SubByte' b | b <- bs ]
SubWord : [4]GF28 -> [4]GF28
SubWord bs = [ SubByte' b | b <- bs ]
function
SubWord
examples
examples/AES.cry
[]
[ ":", "SubByte'" ]
null
126
126
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
RotWord : [4]GF28 -> [4]GF28 RotWord [a0, a1, a2, a3] = [a1, a2, a3, a0]
RotWord : [4]GF28 -> [4]GF28
RotWord [a0, a1, a2, a3] = [a1, a2, a3, a0]
function
RotWord
examples
examples/AES.cry
[]
[ ":" ]
null
129
129
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
NextWord : ([8],[4][8],[4][8]) -> [4][8] NextWord(i, prev, old) = old ^ mask where mask = if i % `Nk == 0 then SubWord(RotWord(prev)) ^ Rcon (i / `Nk) else if (`Nk > 6) && (i % `Nk == 4) then SubWord(prev) else prev
NextWord : ([8],[4][8],[4][8]) -> [4][8]
NextWord(i, prev, old) = old ^ mask where mask = if i % `Nk == 0 then SubWord(RotWord(prev)) ^ Rcon (i / `Nk) else if (`Nk > 6) && (i % `Nk == 4) then SubWord(prev) else prev
function
NextWord
examples
examples/AES.cry
[]
[ ":", "Rcon", "RotWord", "SubWord" ]
null
132
132
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
ExpandKeyForever : [Nk][4][8] -> [inf]RoundKey ExpandKeyForever seed = [ transpose g | g <- groupBy`{4} (keyWS seed) ]
ExpandKeyForever : [Nk][4][8] -> [inf]RoundKey
ExpandKeyForever seed = [ transpose g | g <- groupBy`{4} (keyWS seed) ]
function
ExpandKeyForever
examples
examples/AES.cry
[]
[ ":", "keyWS", "transpose" ]
null
141
141
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
keyWS : [Nk][4][8] -> [inf][4][8] keyWS seed = xs where xs = seed # [ NextWord(i, prev, old) | i <- [ `Nk ... ] | prev <- drop`{Nk-1} xs | old <- xs ]
keyWS : [Nk][4][8] -> [inf][4][8]
keyWS seed = xs where xs = seed # [ NextWord(i, prev, old) | i <- [ `Nk ... ] | prev <- drop`{Nk-1} xs | old <- xs ]
function
keyWS
examples
examples/AES.cry
[]
[ ":", "NextWord", "xs" ]
null
144
144
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
ExpandKey : [AESKeySize] -> KeySchedule ExpandKey key = (keys @ 0, keys @@ [1 .. (Nr - 1)], keys @ `Nr) where seed : [Nk][4][8] seed = split (split key) keys = ExpandKeyForever seed
ExpandKey : [AESKeySize] -> KeySchedule
ExpandKey key = (keys @ 0, keys @@ [1 .. (Nr - 1)], keys @ `Nr) where seed : [Nk][4][8] seed = split (split key) keys = ExpandKeyForever seed
function
ExpandKey
examples
examples/AES.cry
[]
[ ":", "ExpandKeyForever", "split" ]
null
152
152
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
fromKS : KeySchedule -> [Nr+1][4][32] fromKS (f, ms, l) = [ formKeyWords (transpose k) | k <- [f] # ms # [l] ] where formKeyWords bbs = [ join bs | bs <- bbs ]
fromKS : KeySchedule -> [Nr+1][4][32]
fromKS (f, ms, l) = [ formKeyWords (transpose k) | k <- [f] # ms # [l] ] where formKeyWords bbs = [ join bs | bs <- bbs ]
function
fromKS
examples
examples/AES.cry
[]
[ ":", "and", "join", "transpose" ]
null
158
158
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
AESRound : (RoundKey, State) -> State AESRound (rk, s) = AddRoundKey (rk, MixColumns (ShiftRows (SubBytes s)))
AESRound : (RoundKey, State) -> State
AESRound (rk, s) = AddRoundKey (rk, MixColumns (ShiftRows (SubBytes s)))
function
AESRound
examples
examples/AES.cry
[]
[ ":", "AddRoundKey", "MixColumns", "ShiftRows", "SubBytes" ]
null
163
163
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
AESFinalRound : (RoundKey, State) -> State AESFinalRound (rk, s) = AddRoundKey (rk, ShiftRows (SubBytes s))
AESFinalRound : (RoundKey, State) -> State
AESFinalRound (rk, s) = AddRoundKey (rk, ShiftRows (SubBytes s))
function
AESFinalRound
examples
examples/AES.cry
[]
[ ":", "AddRoundKey", "ShiftRows", "SubBytes" ]
null
166
166
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
AESInvRound : (RoundKey, State) -> State AESInvRound (rk, s) = InvMixColumns (AddRoundKey (rk, InvSubBytes (InvShiftRows s)))
AESInvRound : (RoundKey, State) -> State
AESInvRound (rk, s) = InvMixColumns (AddRoundKey (rk, InvSubBytes (InvShiftRows s)))
function
AESInvRound
examples
examples/AES.cry
[]
[ ":", "AddRoundKey", "InvMixColumns", "InvShiftRows", "InvSubBytes" ]
null
169
169
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
AESFinalInvRound : (RoundKey, State) -> State AESFinalInvRound (rk, s) = AddRoundKey (rk, InvSubBytes (InvShiftRows s))
AESFinalInvRound : (RoundKey, State) -> State
AESFinalInvRound (rk, s) = AddRoundKey (rk, InvSubBytes (InvShiftRows s))
function
AESFinalInvRound
examples
examples/AES.cry
[]
[ ":", "AddRoundKey", "InvShiftRows", "InvSubBytes", "and" ]
null
172
172
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
msgToState : [128] -> State msgToState msg = transpose (split (split msg))
msgToState : [128] -> State
msgToState msg = transpose (split (split msg))
function
msgToState
examples
examples/AES.cry
[]
[ ":", "split", "transpose" ]
null
176
176
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
stateToMsg : State -> [128] stateToMsg st = join (join (transpose st))
stateToMsg : State -> [128]
stateToMsg st = join (join (transpose st))
function
stateToMsg
examples
examples/AES.cry
[]
[ ":", "join", "transpose" ]
null
179
179
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
aesEncrypt : ([128], [AESKeySize]) -> [128] aesEncrypt (pt, key) = stateToMsg (AESFinalRound (kFinal, rounds ! 0)) where (kInit, ks, kFinal) = ExpandKey key state0 = AddRoundKey(kInit, msgToState pt) rounds = [state0] # [ AESRound (rk, s) | rk <- ks ...
aesEncrypt : ([128], [AESKeySize]) -> [128]
aesEncrypt (pt, key) = stateToMsg (AESFinalRound (kFinal, rounds ! 0)) where (kInit, ks, kFinal) = ExpandKey key state0 = AddRoundKey(kInit, msgToState pt) rounds = [state0] # [ AESRound (rk, s) | rk <- ks | s <- rounds ...
function
aesEncrypt
examples
examples/AES.cry
[]
[ ":", "AESFinalRound", "AESRound", "AddRoundKey", "ExpandKey", "ks", "msgToState", "stateToMsg" ]
null
183
183
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
aesDecrypt : ([128], [AESKeySize]) -> [128] aesDecrypt (ct, key) = stateToMsg (AESFinalInvRound (kFinal, rounds ! 0)) where (kFinal, ks, kInit) = ExpandKey key state0 = AddRoundKey(kInit, msgToState ct) rounds = [state0] # [ AESInvRound (rk, s) | rk <- reverse ks ...
aesDecrypt : ([128], [AESKeySize]) -> [128]
aesDecrypt (ct, key) = stateToMsg (AESFinalInvRound (kFinal, rounds ! 0)) where (kFinal, ks, kInit) = ExpandKey key state0 = AddRoundKey(kInit, msgToState ct) rounds = [state0] # [ AESInvRound (rk, s) | rk <- reverse ks | s <- rounds ...
function
aesDecrypt
examples
examples/AES.cry
[]
[ ":", "AESFinalInvRound", "AESInvRound", "AddRoundKey", "ExpandKey", "ks", "msgToState", "reverse", "stateToMsg" ]
null
192
192
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
sbox : [256]GF28 sbox = [ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0...
sbox : [256]GF28
sbox = [ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, ...
function
sbox
examples
examples/AES.cry
[]
[ ":", "aesEncrypt" ]
null
201
201
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
type AES128 = 4 type AES192 = 6 type AES256 = 8 type Nk = AES128 // For Cryptol 2.x | x > 0 // NkValid: `Nk -> Bit // property NkValid k = (k == `AES128) || (k == `AES192) || (k == `AES256) // Number of blocks and Number of rounds type Nb = 4 type Nr = 6 + Nk type AESKeySize = (Nk*32) // Helper type definitions typ...
type AES128 = 4
type AES192 = 6 type AES256 = 8 type Nk = AES128 // For Cryptol 2.x | x > 0 // NkValid: `Nk -> Bit // property NkValid k = (k == `AES128) || (k == `AES192) || (k == `AES256) // Number of blocks and Number of rounds type Nb = 4 type Nr = 6 + Nk type AESKeySize = (Nk*32) // Helper type definitions type GF28 = ...
function
type
examples
examples/AES.cry
[]
[ "and", "property" ]
null
15
15
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
irreducible = <| x^^8 + x^^4 + x^^3 + x + 1 |>
irreducible = <| x^^8 + x^^4 + x^^3 + x + 1 |>
function
irreducible
examples
examples/AES.cry
[]
[]
null
41
41
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
property AESCorrect msg key = aesDecrypt (aesEncrypt (msg, key), key) == msg
property AESCorrect msg key = aesDecrypt (aesEncrypt (msg, key), key) == msg
function
property
examples
examples/AES.cry
[]
[ "aesDecrypt", "aesEncrypt" ]
null
236
236
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
x : [_][8] x = [1,2,3,4,5,19,12,38,5,3]
x : [_][8]
x = [1,2,3,4,5,19,12,38,5,3]
function
x
examples
examples/append.cry
[]
[ ":" ]
null
1
1
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
y : [_][8] y = [19,3,27,5,12]
y : [_][8]
y = [19,3,27,5,12]
function
y
examples
examples/append.cry
[]
[ ":" ]
null
4
4
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
z = x # y
z = x # y
function
z
examples
examples/append.cry
[]
[]
null
7
7
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
m = z @ (0 : [1])
m = z @ (0 : [1])
function
m
examples
examples/append.cry
[]
[ ":" ]
null
9
9
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
w = z @ 2
w = z @ 2
function
w
examples
examples/append.cry
[]
[]
null
10
10
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
t = z @ 10
t = z @ 10
function
t
examples
examples/append.cry
[]
[]
null
12
12
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
v = z @ 11
v = z @ 11
function
v
examples
examples/append.cry
[]
[]
null
13
13
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
t : [8] t = if True then 5 else 4
t : [8]
t = if True then 5 else 4
function
t
examples
examples/builtins.cry
[]
[ ":", "True" ]
null
4
4
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
f : [8] f = if False then 3 else 5
f : [8]
f = if False then 3 else 5
function
f
examples
examples/builtins.cry
[]
[ ":", "False" ]
null
7
7
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
times : [8] times = 5 * 1 * 2 * 3
times : [8]
times = 5 * 1 * 2 * 3
function
times
examples
examples/builtins.cry
[]
[ ":" ]
null
10
10
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
div : [8] div = (((30/1)/2)/3)
div : [8]
div = (((30/1)/2)/3)
function
div
examples
examples/builtins.cry
[]
[ ":" ]
null
13
13
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
mod : [8] mod = 205%10
mod : [8]
mod = 205%10
function
mod
examples
examples/builtins.cry
[]
[ ":" ]
null
16
16
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
exp : [8] exp = 2^^7
exp : [8]
exp = 2^^7
function
exp
examples
examples/builtins.cry
[]
[ ":" ]
null
19
19
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
lgtest : [8] lgtest = lg2 128
lgtest : [8]
lgtest = lg2 128
function
lgtest
examples
examples/builtins.cry
[]
[ ":", "lg2" ]
null
22
22
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
p : [8] p = 3+2
p : [8]
p = 3+2
function
p
examples
examples/builtins.cry
[]
[ ":" ]
null
25
25
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
m : [8] m = 8-3
m : [8]
m = 8-3
function
m
examples
examples/builtins.cry
[]
[ ":" ]
null
28
28
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
neg : [8] neg = -(-5)
neg : [8]
neg = -(-5)
function
neg
examples
examples/builtins.cry
[]
[ ":" ]
null
31
31
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
comp : [8] comp = ~250
comp : [8]
comp = ~250
function
comp
examples
examples/builtins.cry
[]
[ ":" ]
null
34
34
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
x = [True,False]
x = [True,False]
function
x
examples
examples/builtin_lifting.cry
[]
[]
null
6
6
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
y = [False,True]
y = [False,True]
function
y
examples
examples/builtin_lifting.cry
[]
[]
null
7
9
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
property p1 = x == (2 : [2]) //same thing written 2 different ways property p2 = x + y == 3 property p3 = x + y == [True,True] property p4 = xx + yy == [3] //negation is a unary operator that also lifts over sequences property p5 = ~ xx == yy property p6 = (xinf + yinf) @ (0 : [0]) == (1 : [2]) //negation lifts poin...
property p1 = x == (2 : [2])
property p2 = x + y == 3 property p3 = x + y == [True,True] property p4 = xx + yy == [3] //negation is a unary operator that also lifts over sequences property p5 = ~ xx == yy property p6 = (xinf + yinf) @ (0 : [0]) == (1 : [2]) //negation lifts pointwise over an infinite list property p7 = (~ xinf) @ (0 : [0]) == (1...
function
property
examples
examples/builtin_lifting.cry
[]
[ ":", "and", "xinf", "xrec", "xx", "yinf", "yy" ]
null
10
12
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
xx = [[True,False]]
xx = [[True,False]]
function
xx
examples
examples/builtin_lifting.cry
[]
[]
null
17
17
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
yy = [[False,True]]
yy = [[False,True]]
function
yy
examples
examples/builtin_lifting.cry
[]
[]
null
18
20
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
xinf = [2 ... ]
xinf = [2 ... ]
function
xinf
examples
examples/builtin_lifting.cry
[]
[]
null
27
27
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
yinf = [3 ... ]
yinf = [3 ... ]
function
yinf
examples
examples/builtin_lifting.cry
[]
[]
null
28
30
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
xrec = { x = 2 : [2], y = 2 : [2] } : {x : [2], y : [2]}
xrec = { x = 2 : [2], y = 2 : [2] } : {x : [2], y : [2]}
function
xrec
examples
examples/builtin_lifting.cry
[]
[ ":" ]
null
36
36
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
type Cipher KeySize BlockSize = { encrypt : [KeySize] -> [BlockSize] -> [BlockSize] , decrypt : [KeySize] -> [BlockSize] -> [BlockSize] }
type Cipher KeySize BlockSize = { encrypt : [KeySize] -> [BlockSize] -> [BlockSize] , decrypt : [KeySize] -> [BlockSize] -> [BlockSize] }
function
type
examples
examples/Cipher.cry
[]
[ ":", "decrypt", "encrypt" ]
null
8
11
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
x : [_]([2],[3],[3],[4]) x = [(a,b,c,d) | a <- [1,2], b <- [3,4] | c <- [5,6], d <- [7,8,9] ]
x : [_]([2],[3],[3],[4])
x = [(a,b,c,d) | a <- [1,2], b <- [3,4] | c <- [5,6], d <- [7,8,9] ]
function
x
examples
examples/comp.cry
[]
[ ":" ]
null
1
1
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
property t1 = x @ 0 == (1,3,5,7) property t2 = x @ 2 == (2,3,5,9) property t3 = x @ 3 == (2,4,6,7) property t4 = y @ 3 == (2,2,0)
property t1 = x @ 0 == (1,3,5,7)
property t2 = x @ 2 == (2,3,5,9) property t3 = x @ 3 == (2,4,6,7) property t4 = y @ 3 == (2,2,0)
function
property
examples
examples/comp.cry
[]
[ "t1", "t2" ]
null
4
4
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
y = [(a,b,c) | a <- [1,2,3], b <- [1,2] | c <- [1 ... ] ]
y = [(a,b,c) | a <- [1,2,3], b <- [1,2] | c <- [1 ... ] ]
function
y
examples
examples/comp.cry
[]
[]
null
8
8
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
x : {a}(fin a) => [a] -> [(a*2)+3] x v = 0 + 1
x : {a}(fin a) => [a] -> [(a*2)+3]
x v = 0 + 1
function
x
examples
examples/demote.cry
[]
[ ":" ]
null
1
1
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
y = x (2 : [3])
y = x (2 : [3])
function
y
examples
examples/demote.cry
[]
[ ":" ]
null
4
4
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
DES : Cipher 64 64 DES = { encrypt key pt = des pt (expandKey key) , decrypt key ct = des ct (reverse (expandKey key)) }
DES : Cipher 64 64
DES = { encrypt key pt = des pt (expandKey key) , decrypt key ct = des ct (reverse (expandKey key)) }
function
DES
examples
examples/DES.cry
[ "Cipher" ]
[ ":", "decrypt", "des", "encrypt", "expandKey", "reverse" ]
null
11
11
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
round : ([48],[2][32]) -> [64] round (k, [l, r]) = r # (l ^ f (r, k))
round : ([48],[2][32]) -> [64]
round (k, [l, r]) = r # (l ^ f (r, k))
function
round
examples
examples/DES.cry
[ "Cipher" ]
[ ":", "lg2" ]
null
27
27
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
expandKey : [64] -> [16][48] expandKey key = expand (split (key @@ KPz))
expandKey : [64] -> [16][48]
expandKey key = expand (split (key @@ KPz))
function
expandKey
examples
examples/DES.cry
[ "Cipher" ]
[ ":", "KPz", "expand", "split" ]
null
38
38
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
expand: [2][28] -> [16][48]
expand: [2][28] -> [16][48]
function
expand:
examples
examples/DES.cry
[ "Cipher" ]
[]
null
41
41
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
sums : [16][8] -> [16][8] sums xs = ys where ys = [ x + y | x <- xs | y <- [0] # ys ]
sums : [16][8] -> [16][8]
sums xs = ys where ys = [ x + y | x <- xs | y <- [0] # ys ]
function
sums
examples
examples/DES.cry
[ "Cipher" ]
[ ":", "xs" ]
null
46
46
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
KP : [56][6] KP = [57,49,41,33,25,17, 9, 1,58,50,42,34,26,18, 10, 2,59,51,43,35,27,19,11, 3,60,52,44,36, 63,55,47,39,31,23,15, 7,62,54,46,38,30,22, 14, 6,61,53,45,37,29,21,13, 5,28,20,12, 4 ]
KP : [56][6]
KP = [57,49,41,33,25,17, 9, 1,58,50,42,34,26,18, 10, 2,59,51,43,35,27,19,11, 3,60,52,44,36, 63,55,47,39,31,23,15, 7,62,54,46,38,30,22, 14, 6,61,53,45,37,29,21,13, 5,28,20,12, 4 ]
function
KP
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
58
58
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
CP : [48][6] CP = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32 ]
CP : [48][6]
CP = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32 ]
function
CP
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
66
66
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
PP : [32][6] PP = [16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25 ]
PP : [32][6]
PP = [16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25 ]
function
PP
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
73
73
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
EP : [48][6] EP = [32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1 ]
EP : [48][6]
EP = [32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1 ]
function
EP
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
78
78
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
IP : [64][7] IP = [58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7 ]
IP : [64][7]
IP = [58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7 ]
function
IP
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
86
86
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
FP : [64][7] FP = [40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, 38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29, 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27, 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25 ]
FP : [64][7]
FP = [40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, 38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29, 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27, 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25 ]
function
FP
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
93
93
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
SBox : [48] -> [32] SBox x = join [ sbox (n, b) | n <- [1 .. 8] | b <- split x ]
SBox : [48] -> [32]
SBox x = join [ sbox (n, b) | n <- [1 .. 8] | b <- split x ]
function
SBox
examples
examples/DES.cry
[ "Cipher" ]
[ ":", "join", "sbox", "split" ]
null
101
101
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
sbox : ([4], [6]) -> [4] sbox (n, x) = (s @ [b1, b6] @ [b2, b3, b4, b5]) where s = sboxes @ (n - 1) b1 = x @ 0 b2 = x @ 1 b3 = x @ 2 b4 = x @ 3 b5 = x @ 4 b6 = x @ 5
sbox : ([4], [6]) -> [4]
sbox (n, x) = (s @ [b1, b6] @ [b2, b3, b4, b5]) where s = sboxes @ (n - 1) b1 = x @ 0 b2 = x @ 1 b3 = x @ 2 b4 = x @ 3 b5 = x @ 4 b6 = x @ 5
function
sbox
examples
examples/DES.cry
[ "Cipher" ]
[ ":", "all", "sboxes" ]
null
104
104
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
sbox1 : [4][16][4] sbox1 = [[14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7], [0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8], [4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0], [15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13] ]
sbox1 : [4][16][4]
sbox1 = [[14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7], [0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8], [4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0], [15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13] ]
function
sbox1
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
118
118
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
sbox2 : [4][16][4] sbox2 = [[15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10], [3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5], [0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15], [13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9] ]
sbox2 : [4][16][4]
sbox2 = [[15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10], [3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5], [0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15], [13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9] ]
function
sbox2
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
124
124
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
sbox3 : [4][16][4] sbox3 = [[10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8], [13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1], [13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7], [1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12] ]
sbox3 : [4][16][4]
sbox3 = [[10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8], [13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1], [13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7], [1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12] ]
function
sbox3
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
131
131
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
sbox4 : [4][16][4] sbox4 = [[7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15], [13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9], [10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4], [3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14] ]
sbox4 : [4][16][4]
sbox4 = [[7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15], [13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9], [10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4], [3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14] ]
function
sbox4
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
138
138
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
sbox5 : [4][16][4] sbox5 = [[2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9], [14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6], [4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14], [11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3] ]
sbox5 : [4][16][4]
sbox5 = [[2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9], [14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6], [4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14], [11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3] ]
function
sbox5
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
145
145
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
sbox6 : [4][16][4] sbox6 = [[12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11], [10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8], [9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6], [4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13] ]
sbox6 : [4][16][4]
sbox6 = [[12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11], [10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8], [9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6], [4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13] ]
function
sbox6
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
152
152
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
sbox7 : [4][16][4] sbox7 = [[4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1], [13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6], [1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2], [6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12] ]
sbox7 : [4][16][4]
sbox7 = [[4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1], [13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6], [1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2], [6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12] ]
function
sbox7
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
159
159
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
sbox8 : [4][16][4] sbox8 = [[13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7], [1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2], [7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8], [2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11] ]
sbox8 : [4][16][4]
sbox8 = [[13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7], [1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2], [7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8], [2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11] ]
function
sbox8
examples
examples/DES.cry
[ "Cipher" ]
[ ":" ]
null
166
166
true
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
des pt keys = (swap (split lst)) @@ FPz where pt' = pt @@ IPz iv = [ round (k, split lr) | k <- keys | lr <- [pt'] # iv ] lst = iv @ (length keys - 1)
des pt keys = (swap (split lst)) @@ FPz where pt' = pt @@ IPz iv = [ round (k, split lr) | k <- keys | lr <- [pt'] # iv ] lst = iv @ (length keys - 1)
function
des
examples
examples/DES.cry
[ "Cipher" ]
[ "FPz", "IPz", "length", "round", "split", "swap" ]
null
19
25
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
f (r, k) = (SBox(k ^ (r @@ EPz))) @@ PPz
f (r, k) = (SBox(k ^ (r @@ EPz))) @@ PPz
function
f
examples
examples/DES.cry
[ "Cipher" ]
[ "EPz", "PPz", "SBox" ]
null
32
32
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
swap [a, b] = b # a
swap [a, b] = b # a
function
swap
examples
examples/DES.cry
[ "Cipher" ]
[]
null
34
36
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
expand [kl, kr] = [ ((kl <<< i) # (kr <<< i)) @@ CPz | i <- sums [ 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 ] ]
expand [kl, kr] = [ ((kl <<< i) # (kr <<< i)) @@ CPz | i <- sums [ 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 ] ]
function
expand
examples
examples/DES.cry
[ "Cipher" ]
[ "CPz", "sums" ]
null
42
44
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
zeroBasify XP = [ i - 1 | i <- XP ]
zeroBasify XP = [ i - 1 | i <- XP ]
function
zeroBasify
examples
examples/DES.cry
[ "Cipher" ]
[]
null
50
50
false
https://github.com/GaloisInc/cryptol
a50cac6eb2c30a79503814f423f375f9476aaceb
End of preview. Expand in Data Studio

Cryptol

Cryptol declarations, each row carrying the statement and, where present, the proof.

Source

Schema

Column Type Description
fact string Complete verbatim declaration (keyword, signature, and body/proof)
statement string Signature with the leading keyword removed (verbatim slice)
proof string Verbatim proof/body, empty if none
type string Declaration keyword
symbolic_name string Declaration identifier
library string Sub-library
filename string Repository-relative source path
imports list[string] File-level Require/Import modules
deps list[string] Intra-corpus identifiers referenced
docstring string Preceding documentation comment, null if absent
line_start int First source line
line_end int Last source line
has_proof bool Whether a proof block was captured
source_url string Upstream repository
commit string Upstream commit extracted

Statistics

  • Entries: 761
  • With proof: 461 (60.6%)
  • With docstring: 0 (0.0%)
  • Libraries: 13

By type

Type Count
function 761

Example

gf28Add : {n} (fin n) => [n]GF28 -> GF28
gf28Add ps = sums ! 0
  where sums = [zero] # [  p ^ s | p <- ps | s <- sums ]
  • type: function | symbolic_name: gf28Add | examples/AES.cry:37

Use

Statement and proof are available both joined (fact) and split (statement, proof) for proof-term modeling, autoformalization, retrieval, and dependency analysis via deps.

Citation

@misc{cryptol_dataset,
  title  = {Cryptol},
  author = {Norton, Charles},
  year   = {2026},
  note   = {Extracted from https://github.com/GaloisInc/cryptol, commit a50cac6eb2c3},
  url    = {https://huggingface.co/datasets/phanerozoic/Cryptol}
}
Downloads last month
-

Collection including phanerozoic/Cryptol