fact stringlengths 5 19.5k | statement stringlengths 5 19.5k | proof stringlengths 0 4.29k | type stringclasses 7
values | symbolic_name stringlengths 0 36 | library stringclasses 13
values | filename stringclasses 71
values | imports listlengths 0 23 | deps listlengths 0 14 | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
byteSwap : {n} (fin n) => [8 * n] -> [8 * n]
byteSwap xs = join (reverse (split`{each=8} xs)) | byteSwap : {n} (fin n) => [8 * n] -> [8 * n] | byteSwap xs = join (reverse (split`{each=8} xs)) | function | byteSwap | examples.param_modules.Common | examples/param_modules/Common/AES_GCM_SIV.cry | [
"AES"
] | [
"fin",
"join",
"reverse",
"xs"
] | null | 115 | 115 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
K : # | K : # | type | K | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [] | null | 13 | 13 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
(fin K)
/** Size of initialization vector */ | (fin K)
/** Size of initialization vector */ | type constraint | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
"fin"
] | null | 14 | 16 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | ||
IV : # | IV : # | type | IV | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [] | null | 17 | 17 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
(64 >= width IV, IV >= 1)
/** Size of additional authenticated data */ | (64 >= width IV, IV >= 1)
/** Size of additional authenticated data */ | type constraint | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
">=",
"IV",
"width"
] | null | 18 | 20 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | ||
AAD : # | AAD : # | type | AAD | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [] | null | 21 | 21 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
(64 >= width AAD)
/** Size of authentication tag */ | (64 >= width AAD)
/** Size of authentication tag */ | type constraint | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
">=",
"AAD",
"width"
] | null | 22 | 24 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | ||
T : # | T : # | type | T | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [] | null | 25 | 25 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
(128 >= T, T >= 64)
/** Block encryption function */ | (128 >= T, T >= 64)
/** Block encryption function */ | type constraint | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
">="
] | null | 26 | 28 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | ||
E : [K] -> [128] -> [128] | E : [K] -> [128] -> [128] | function | E | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [] | null | 29 | 29 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
encrypt :
{n} (2^^39 - 256 >= n) =>
{ key : [K], iv : [IV], aad : [AAD], pt : [n] } -> { ct : [n], tag : [T] }
encrypt input = { ct = C, tag = T }
where (C,T) = enc_dec input.key input.iv input.aad input.pt | encrypt :
{n} (2^^39 - 256 >= n) =>
{ key : [K], iv : [IV], aad : [AAD], pt : [n] } -> { ct : [n], tag : [T] } | encrypt input = { ct = C, tag = T }
where (C,T) = enc_dec input.key input.iv input.aad input.pt | function | encrypt | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
">=",
"enc_dec"
] | null | 31 | 33 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
decrypt :
{n} (2^^39 - 256 >= n) =>
{ key : [K], iv : [IV], aad : [AAD], ct : [n], tag : [T] } ->
{ valid : Bool, pt : [n] }
decrypt input = if input.tag == T then { valid = True, pt = P }
else { valid = False, pt = 0 }
where (P,T) = enc_dec input.key input.iv input.aad input... | decrypt :
{n} (2^^39 - 256 >= n) =>
{ key : [K], iv : [IV], aad : [AAD], ct : [n], tag : [T] } ->
{ valid : Bool, pt : [n] } | decrypt input = if input.tag == T then { valid = True, pt = P }
else { valid = False, pt = 0 }
where (P,T) = enc_dec input.key input.iv input.aad input.ct
/**
The basic functionality between encryption and decryption.
In the case of decryption, the plain text is only valid if the ... | function | decrypt | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
"==",
">=",
"enc_dec"
] | null | 37 | 40 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
enc_dec :
{n} ((2^^39 - 256) >= n) => [K] -> [IV] -> [AAD] -> [n] -> ([n], [T])
enc_dec K IV A P = (C,T)
where
H = E K 0
Y0 = ifWidth`{96} IV (\IV96 -> IV96 # 1)
(GHASH H [] IV)
Ys = [Y0] # [ y+1 | y <- Ys ]
Cs = [ p ^ E K y | p <- blockify P | y <- drop`{1} Ys ]
C = unblockify... | enc_dec :
{n} ((2^^39 - 256) >= n) => [K] -> [IV] -> [AAD] -> [n] -> ([n], [T]) | enc_dec K IV A P = (C,T)
where
H = E K 0
Y0 = ifWidth`{96} IV (\IV96 -> IV96 # 1)
(GHASH H [] IV)
Ys = [Y0] # [ y+1 | y <- Ys ]
Cs = [ p ^ E K y | p <- blockify P | y <- drop`{1} Ys ]
C = unblockify Cs
T = take (GHASH H A C ^ E K Y0)
/** Section 2.3, equation (2) */ | function | enc_dec | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
">=",
"GHASH",
"IV",
"blockify",
"take",
"unblockify"
] | null | 51 | 52 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
GHASH : {C,A} (64 >= width C, 64 >= width A) => [128] -> [A] -> [C] -> [128]
GHASH H A C = step (XS ! 0) (wa # wc)
where
wa = `A : [64]
wc = `C : [64]
XS = [0] # [ step X' B | X' <- XS | B <- blockify A # blockify C ]
step x b = mult (x ^ b) H
/** Section 2.5, multiplication in GF(2^^128)
This is simple... | GHASH : {C,A} (64 >= width C, 64 >= width A) => [128] -> [A] -> [C] -> [128] | GHASH H A C = step (XS ! 0) (wa # wc)
where
wa = `A : [64]
wc = `C : [64]
XS = [0] # [ step X' B | X' <- XS | B <- blockify A # blockify C ]
step x b = mult (x ^ b) H
/** Section 2.5, multiplication in GF(2^^128)
This is simple polynomial multipliation and reduction in Cryptol.
Somewhat oddly, when thin... | function | GHASH | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
">=",
"blockify",
"mult",
"width"
] | null | 69 | 69 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
mult : [128] -> [128] -> [128]
mult X Y = reverse (pmod (pmult (reverse X) (reverse Y)) irred)
where irred = <| 1 + x + x^^2 + x^^7 + x^^128 |>
/** Create blocks as described in the spec, first paragraph of Section 2.3.
Basically we split into 128-bit chunk and pad the last one with 0. */ | mult : [128] -> [128] -> [128] | mult X Y = reverse (pmod (pmult (reverse X) (reverse Y)) irred)
where irred = <| 1 + x + x^^2 + x^^7 + x^^128 |>
/** Create blocks as described in the spec, first paragraph of Section 2.3.
Basically we split into 128-bit chunk and pad the last one with 0. */ | function | mult | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
"pmod",
"pmult",
"reverse"
] | null | 88 | 88 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
blockify : {n} (fin n) => [n] -> [n /^ 128][128]
blockify msg = split (msg # 0)
/** Join back the blocks, dropping any additional padding. */ | blockify : {n} (fin n) => [n] -> [n /^ 128][128] | blockify msg = split (msg # 0)
/** Join back the blocks, dropping any additional padding. */ | function | blockify | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
"fin",
"split"
] | null | 95 | 95 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
unblockify : {n} (fin n) => [n /^ 128][128] -> [n]
unblockify ms = take (join ms) | unblockify : {n} (fin n) => [n /^ 128][128] -> [n] | unblockify ms = take (join ms) | function | unblockify | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
"fin",
"join",
"take"
] | null | 99 | 99 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
ifWidth : {w,n,a} (fin n, fin w) => [n] -> ([w] -> a) -> a -> a
ifWidth thing yep nope = if `w == (`n : [max (width w) (width n)])
then yep (take (thing # (zero : [inf])))
else nope | ifWidth : {w,n,a} (fin n, fin w) => [n] -> ([w] -> a) -> a -> a | ifWidth thing yep nope = if `w == (`n : [max (width w) (width n)])
then yep (take (thing # (zero : [inf])))
else nope | function | ifWidth | examples.param_modules.Common | examples/param_modules/Common/GCM.cry | [] | [
"==",
"fin",
"take",
"width",
"zero"
] | null | 103 | 103 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
w : # | w : # | type | w | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [] | null | 13 | 13 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
(fin w, w >= 1)
/** The number of iterations in the hash computation
(i.e. the number of words in K) */ | (fin w, w >= 1)
/** The number of iterations in the hash computation
(i.e. the number of words in K) */ | type constraint | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
">=",
"fin"
] | null | 14 | 19 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | ||
j : # | j : # | type | j | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [] | null | 21 | 21 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
(fin j, j >= 17) | (fin j, j >= 17) | type constraint | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
">=",
"fin"
] | null | 22 | 22 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | ||
block_size = 16 * w | block_size = 16 * w | type | block_size | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [] | null | 46 | 46 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
num_blocks L = (L+1+2*w) /^ block_size | num_blocks L = (L+1+2*w) /^ block_size | type | num_blocks | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
"block_size"
] | null | 48 | 48 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
padded_size L = num_blocks L * block_size
/** (4.1) (w==32), (4.2) (w==32), (4.8) (w==64) */ | padded_size L = num_blocks L * block_size
/** (4.1) (w==32), (4.2) (w==32), (4.8) (w==64) */ | type | padded_size | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
"block_size",
"num_blocks"
] | null | 49 | 52 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
H0 : [8][w] | H0 : [8][w] | function | H0 | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [] | null | 24 | 24 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
K : [j][w]
/* FIPS 180-4 defines lowercase and uppercase
(respective to the Greek alphabet) sigma functions for SHA-256 and SHA-512.
(4.4)-(4.7) SHA-224, SHA-256 (w==32)
(4.10)-(4.13) SHA-384, SHA-512, SHA-512/224, SHA-512/256 (w==64) */ | K : [j][w]
/* FIPS 180-4 defines lowercase and uppercase
(respective to the Greek alphabet) sigma functions for SHA-256 and SHA-512.
(4.4)-(4.7) SHA-224, SHA-256 (w==32)
(4.10)-(4.13) SHA-384, SHA-512, SHA-512/224, SHA-512/256 (w==64) */ | function | K | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [] | null | 25 | 30 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
SIGMA_0 : [w] -> [w] | SIGMA_0 : [w] -> [w] | function | SIGMA_0 | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [] | null | 32 | 32 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
SIGMA_1 : [w] -> [w] | SIGMA_1 : [w] -> [w] | function | SIGMA_1 | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [] | null | 33 | 33 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
sigma_0 : [w] -> [w] | sigma_0 : [w] -> [w] | function | sigma_0 | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [] | null | 34 | 34 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
sigma_1 : [w] -> [w] | sigma_1 : [w] -> [w] | function | sigma_1 | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [] | null | 35 | 35 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
sha : {L} (2 * w >= width L) => [L] -> [8 * w]
sha M = join (SHA_2_Common' [ split x | x <- parse`{num_blocks L} (pad`{L} M) ]) | sha : {L} (2 * w >= width L) => [L] -> [8 * w] | sha M = join (SHA_2_Common' [ split x | x <- parse`{num_blocks L} (pad`{L} M) ]) | function | sha | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
">=",
"SHA_2_Common'",
"join",
"num_blocks",
"split",
"width"
] | null | 38 | 38 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
Ch : [w] -> [w] -> [w] -> [w]
Ch x y z = (x && y) ^ (~x && z)
/** (4.1) (w==32), (4.3) (w==32), (4.9) (w==64) */ | Ch : [w] -> [w] -> [w] -> [w] | Ch x y z = (x && y) ^ (~x && z)
/** (4.1) (w==32), (4.3) (w==32), (4.9) (w==64) */ | function | Ch | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
"&&"
] | null | 53 | 53 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
Maj : [w] -> [w] -> [w] -> [w]
Maj x y z = (x && y) ^ (x && z) ^ (y && z)
/**
5.1 Padding the Message
5.1.1 SHA-1, SHA-224 and SHA-256 (w==32)
5.1.2 SHA-384, SHA-512, SHA-512/224 and SHA-512/256 (w==64)
The constraint ensure that the message size, `L`, fits within a
(2 * w)-bit word (consistent w/ ... | Maj : [w] -> [w] -> [w] -> [w] | Maj x y z = (x && y) ^ (x && z) ^ (y && z)
/**
5.1 Padding the Message
5.1.1 SHA-1, SHA-224 and SHA-256 (w==32)
5.1.2 SHA-384, SHA-512, SHA-512/224 and SHA-512/256 (w==64)
The constraint ensure that the message size, `L`, fits within a
(2 * w)-bit word (consistent w/ Figure 1)
*/ | function | Maj | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
"&&"
] | null | 58 | 58 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
pad : {L} (2 * w >= width L) => [L] -> [padded_size L]
pad M = M # 0b1 # zero # (`L : [2*w])
/**
5.2 Parsing the Message
5.2.1 SHA-1, SHA-224 and SHA-256 (w==32)
5.2.2 SHA-384, SHA-512, SHA-512/224 and SHA-512/256 (w==64)
*/ | pad : {L} (2 * w >= width L) => [L] -> [padded_size L] | pad M = M # 0b1 # zero # (`L : [2*w])
/**
5.2 Parsing the Message
5.2.1 SHA-1, SHA-224 and SHA-256 (w==32)
5.2.2 SHA-384, SHA-512, SHA-512/224 and SHA-512/256 (w==64)
*/ | function | pad | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
">=",
"width",
"zero"
] | null | 70 | 70 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
parse : {m} [m * block_size] -> [m][block_size]
parse = split
/**
SHA-256 and SHA-512 (and their respective derivatives) use a similar
message schedule that can be expressed in the same way relative to their
respective sigma functions.
6.2.2 SHA-256 Hash Computation (w==32, j=64)
6.4.2 SHA-512 Hash Co... | parse : {m} [m * block_size] -> [m][block_size] | parse = split
/**
SHA-256 and SHA-512 (and their respective derivatives) use a similar
message schedule that can be expressed in the same way relative to their
respective sigma functions.
6.2.2 SHA-256 Hash Computation (w==32, j=64)
6.4.2 SHA-512 Hash Computation (w==64, j=80)
*/ | function | parse | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
"split"
] | null | 78 | 78 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
messageSchedule_Common : [16][w] -> [j][w]
messageSchedule_Common Mi = take W
where
W : [inf][_]
W = Mi # [ w1 + sigma_0 w2 + w3 + sigma_1 w4
| w1 <- W
| w2 <- drop`{1} W
| w3 <- drop`{9} W
| w4 <- drop`{14} W
]
/**
Amazon S2N's SHA-256 ... | messageSchedule_Common : [16][w] -> [j][w] | messageSchedule_Common Mi = take W
where
W : [inf][_]
W = Mi # [ w1 + sigma_0 w2 + w3 + sigma_1 w4
| w1 <- W
| w2 <- drop`{1} W
| w3 <- drop`{9} W
| w4 <- drop`{14} W
]
/**
Amazon S2N's SHA-256 specification includes a compression routin... | function | messageSchedule_Common | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
"sigma_0",
"sigma_1",
"take"
] | null | 89 | 89 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
compress_Common : [8][w] -> [j][w] -> [8][w]
compress_Common H W =
// XXX: This whole definitions looks like it might be simplifiable.
[ (as ! 0) + (H @ 0),
(bs ! 0) + (H @ 1),
(cs ! 0) + (H @ 2),
(ds ! 0) + (H @ 3),
(es ! 0) + (H @ 4),
(fs ! 0) + (H @ 5),
(gs ! 0) + (H @ 6),... | compress_Common : [8][w] -> [j][w] -> [8][w] | compress_Common H W =
// XXX: This whole definitions looks like it might be simplifiable.
[ (as ! 0) + (H @ 0),
(bs ! 0) + (H @ 1),
(cs ! 0) + (H @ 2),
(ds ! 0) + (H @ 3),
(es ! 0) + (H @ 4),
(fs ! 0) + (H @ 5),
(gs ! 0) + (H @ 6),
(hs ! 0) + (H @ 7)
]
where
... | function | compress_Common | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
"Ch",
"Maj",
"SIGMA_0",
"SIGMA_1",
"t1",
"t2"
] | null | 108 | 108 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
processBlock_Common : [8][w] -> [16][w] -> [8][w]
processBlock_Common H Mi = compress_Common H (messageSchedule_Common Mi) | processBlock_Common : [8][w] -> [16][w] -> [8][w] | processBlock_Common H Mi = compress_Common H (messageSchedule_Common Mi) | function | processBlock_Common | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
"compress_Common",
"messageSchedule_Common"
] | null | 134 | 134 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
SHA_2_Common' : {L} (fin L) => [L][16][w] -> [8][w]
SHA_2_Common' blocks = hash ! 0
where
hash = [H0] # [ processBlock_Common h b | h <- hash | b <- blocks] | SHA_2_Common' : {L} (fin L) => [L][16][w] -> [8][w] | SHA_2_Common' blocks = hash ! 0
where
hash = [H0] # [ processBlock_Common h b | h <- hash | b <- blocks] | function | SHA_2_Common' | examples.param_modules.Common | examples/param_modules/Common/SHA.cry | [] | [
"fin",
"processBlock_Common"
] | null | 138 | 138 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
AES128 = SB::AES128
/**
* Key schedule parameter setting for AES-192
*/ | AES128 = SB::AES128
/**
* Key schedule parameter setting for AES-192
*/ | type | AES128 | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [] | null | 10 | 14 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
AES192 = SB::AES192
/**
* Key schedule parameter setting for AES-256
*/ | AES192 = SB::AES192
/**
* Key schedule parameter setting for AES-256
*/ | type | AES192 | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [] | null | 15 | 19 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
AES256 = SB::AES256
/**
* Element of an AES key schedule for use in a particular round
*/ | AES256 = SB::AES256
/**
* Element of an AES key schedule for use in a particular round
*/ | type | AES256 | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [] | null | 20 | 24 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
AESRoundKey = SB::AESRoundKey
/**
* Expanded encryption key schedule for AES
*/ | AESRoundKey = SB::AESRoundKey
/**
* Expanded encryption key schedule for AES
*/ | type | AESRoundKey | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [] | null | 25 | 29 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
AESEncryptKeySchedule k = SB::AESEncryptKeySchedule k
/**
* Expanded decryption key schedule for AES
*/ | AESEncryptKeySchedule k = SB::AESEncryptKeySchedule k
/**
* Expanded decryption key schedule for AES
*/ | type | AESEncryptKeySchedule | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [] | null | 30 | 34 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
AESDecryptKeySchedule k = SB::AESDecryptKeySchedule k
/**
* Encryption key expansion for AES-128.
* See FIPS 197, section 5.2.
*/ | AESDecryptKeySchedule k = SB::AESDecryptKeySchedule k
/**
* Encryption key expansion for AES-128.
* See FIPS 197, section 5.2.
*/ | type | AESDecryptKeySchedule | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [] | null | 35 | 40 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
aes128EncryptSchedule : [128] -> AESEncryptKeySchedule AES128
aes128EncryptSchedule =
if aesniSupported
then \key -> aesniExpandEncrypt128 (split key)
else SB::aes128EncryptSchedule
/**
* Decryption key expansion for AES-128, for use in the "equivalent inverse cypher".
* See FIPS 197, sections 5.2 and 5.... | aes128EncryptSchedule : [128] -> AESEncryptKeySchedule AES128 | aes128EncryptSchedule =
if aesniSupported
then \key -> aesniExpandEncrypt128 (split key)
else SB::aes128EncryptSchedule
/**
* Decryption key expansion for AES-128, for use in the "equivalent inverse cypher".
* See FIPS 197, sections 5.2 and 5.3.5.
*/ | function | aes128EncryptSchedule | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [
"AES128",
"AESEncryptKeySchedule",
"split"
] | null | 41 | 41 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
aes128DecryptSchedule : [128] -> AESDecryptKeySchedule AES128
aes128DecryptSchedule =
if aesniSupported
then \key -> aesniExpandDecrypt128 (split key)
else SB::aes128DecryptSchedule
/**
* Encryption and decryption key schedules for AES-128.
* If you will need both schedules, it is slightly more efficient
... | aes128DecryptSchedule : [128] -> AESDecryptKeySchedule AES128 | aes128DecryptSchedule =
if aesniSupported
then \key -> aesniExpandDecrypt128 (split key)
else SB::aes128DecryptSchedule
/**
* Encryption and decryption key schedules for AES-128.
* If you will need both schedules, it is slightly more efficient
* to call this function than to compute the two schedules sepa... | function | aes128DecryptSchedule | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [
"AES128",
"AESDecryptKeySchedule",
"split"
] | null | 51 | 51 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
aes128Schedules : [128] -> (AESEncryptKeySchedule AES128, AESDecryptKeySchedule AES128)
aes128Schedules =
if aesniSupported
then \key -> aesniExpandEncryptDecrypt128 (split key)
else SB::aes128Schedules
/**
* Encryption key expansion for AES-192.
* See FIPS 197, section 5.2.
*/ | aes128Schedules : [128] -> (AESEncryptKeySchedule AES128, AESDecryptKeySchedule AES128) | aes128Schedules =
if aesniSupported
then \key -> aesniExpandEncryptDecrypt128 (split key)
else SB::aes128Schedules
/**
* Encryption key expansion for AES-192.
* See FIPS 197, section 5.2.
*/ | function | aes128Schedules | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [
"AES128",
"AESDecryptKeySchedule",
"AESEncryptKeySchedule",
"split"
] | null | 63 | 63 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
aes192EncryptSchedule : [192] -> AESEncryptKeySchedule AES192
aes192EncryptSchedule =
if aesniSupported
then \key -> aesniExpandEncrypt192 (split key)
else SB::aes192EncryptSchedule
/**
* Decryption key expansion for AES-192, for use in the "equivalent inverse cypher".
* See FIPS 197, sections 5.2 and 5.... | aes192EncryptSchedule : [192] -> AESEncryptKeySchedule AES192 | aes192EncryptSchedule =
if aesniSupported
then \key -> aesniExpandEncrypt192 (split key)
else SB::aes192EncryptSchedule
/**
* Decryption key expansion for AES-192, for use in the "equivalent inverse cypher".
* See FIPS 197, sections 5.2 and 5.3.5.
*/ | function | aes192EncryptSchedule | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [
"AES192",
"AESEncryptKeySchedule",
"split"
] | null | 73 | 73 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
aes192DecryptSchedule : [192] -> AESDecryptKeySchedule AES192
aes192DecryptSchedule =
if aesniSupported
then \key -> aesniExpandDecrypt192 (split key)
else SB::aes192DecryptSchedule
/**
* Encryption and decryption key schedules for AES-192.
* If you will need both schedules, it is slightly more efficient
... | aes192DecryptSchedule : [192] -> AESDecryptKeySchedule AES192 | aes192DecryptSchedule =
if aesniSupported
then \key -> aesniExpandDecrypt192 (split key)
else SB::aes192DecryptSchedule
/**
* Encryption and decryption key schedules for AES-192.
* If you will need both schedules, it is slightly more efficient
* to call this function than to compute the two schedules sepa... | function | aes192DecryptSchedule | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [
"AES192",
"AESDecryptKeySchedule",
"split"
] | null | 83 | 83 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
aes192Schedules : [192] -> (AESEncryptKeySchedule AES192, AESDecryptKeySchedule AES192)
aes192Schedules =
if aesniSupported
then \key -> aesniExpandEncryptDecrypt192 (split key)
else SB::aes192Schedules
/**
* Encryption key expansion for AES-256.
* See FIPS 197, section 5.2
*/ | aes192Schedules : [192] -> (AESEncryptKeySchedule AES192, AESDecryptKeySchedule AES192) | aes192Schedules =
if aesniSupported
then \key -> aesniExpandEncryptDecrypt192 (split key)
else SB::aes192Schedules
/**
* Encryption key expansion for AES-256.
* See FIPS 197, section 5.2
*/ | function | aes192Schedules | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [
"AES192",
"AESDecryptKeySchedule",
"AESEncryptKeySchedule",
"split"
] | null | 95 | 95 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
aes256EncryptSchedule : [256] -> AESEncryptKeySchedule AES256
aes256EncryptSchedule =
if aesniSupported
then \key -> aesniExpandEncrypt256 (split key)
else SB::aes256EncryptSchedule
/**
* Decryption key expansion for AES-256, for use in the "equivalent inverse cypher".
* See FIPS 197, sections 5.2 and 5.... | aes256EncryptSchedule : [256] -> AESEncryptKeySchedule AES256 | aes256EncryptSchedule =
if aesniSupported
then \key -> aesniExpandEncrypt256 (split key)
else SB::aes256EncryptSchedule
/**
* Decryption key expansion for AES-256, for use in the "equivalent inverse cypher".
* See FIPS 197, sections 5.2 and 5.3.5.
*/ | function | aes256EncryptSchedule | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [
"AES256",
"AESEncryptKeySchedule",
"split"
] | null | 106 | 106 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
aes256DecryptSchedule : [256] -> AESDecryptKeySchedule AES256
aes256DecryptSchedule =
if aesniSupported
then \key -> aesniExpandDecrypt256 (split key)
else SB::aes256DecryptSchedule
/**
* Encryption and decryption key schedules for AES-256.
* If you will need both schedules, it is slightly more efficient
... | aes256DecryptSchedule : [256] -> AESDecryptKeySchedule AES256 | aes256DecryptSchedule =
if aesniSupported
then \key -> aesniExpandDecrypt256 (split key)
else SB::aes256DecryptSchedule
/**
* Encryption and decryption key schedules for AES-256.
* If you will need both schedules, it is slightly more efficient
* to call this function than to compute the two schedules sepa... | function | aes256DecryptSchedule | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [
"AES256",
"AESDecryptKeySchedule",
"split"
] | null | 116 | 116 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
aes256Schedules : [256] -> (AESEncryptKeySchedule AES256, AESDecryptKeySchedule AES256)
aes256Schedules =
if aesniSupported
then \key -> aesniExpandEncryptDecrypt256 (split key)
else SB::aes256Schedules
/**
* AES block encryption algorithm.
* See FIPS 197, section 5.1.
*/ | aes256Schedules : [256] -> (AESEncryptKeySchedule AES256, AESDecryptKeySchedule AES256) | aes256Schedules =
if aesniSupported
then \key -> aesniExpandEncryptDecrypt256 (split key)
else SB::aes256Schedules
/**
* AES block encryption algorithm.
* See FIPS 197, section 5.1.
*/ | function | aes256Schedules | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [
"AES256",
"AESDecryptKeySchedule",
"AESEncryptKeySchedule",
"split"
] | null | 128 | 128 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
aesEncryptBlock : {k} (fin k) => AESEncryptKeySchedule k -> [128] -> [128]
aesEncryptBlock =
if aesniSupported
then \schedule plaintext -> join (aesniEncryptBlock schedule (split plaintext))
else SB::aesEncryptBlock
/**
* AES block decryption algorithm, via the "equivalent inverse cypher".
* See FIPS 197... | aesEncryptBlock : {k} (fin k) => AESEncryptKeySchedule k -> [128] -> [128] | aesEncryptBlock =
if aesniSupported
then \schedule plaintext -> join (aesniEncryptBlock schedule (split plaintext))
else SB::aesEncryptBlock
/**
* AES block decryption algorithm, via the "equivalent inverse cypher".
* See FIPS 197, section 5.3.5.
*/ | function | aesEncryptBlock | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [
"AESEncryptKeySchedule",
"fin",
"join",
"split"
] | null | 138 | 138 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
aesDecryptBlock : {k} (fin k) => AESDecryptKeySchedule k -> [128] -> [128]
aesDecryptBlock =
if aesniSupported
then \schedule ciphertext -> join (aesniDecryptBlock schedule (split ciphertext))
else SB::aesDecryptBlock | aesDecryptBlock : {k} (fin k) => AESDecryptKeySchedule k -> [128] -> [128] | aesDecryptBlock =
if aesniSupported
then \schedule ciphertext -> join (aesniDecryptBlock schedule (split ciphertext))
else SB::aesDecryptBlock | function | aesDecryptBlock | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [
"AESDecryptKeySchedule",
"fin",
"join",
"split"
] | null | 148 | 148 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
sha224 = SB::sha224
/**
* The SHA-256 secure hash algorithm. See FIPS 180-4, section 6.2.2.
*/ | sha224 = SB::sha224
/**
* The SHA-256 secure hash algorithm. See FIPS 180-4, section 6.2.2.
*/ | function | sha224 | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [] | null | 179 | 183 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
sha256 = SB::sha256
/**
* The SHA-384 secure hash algorithm. See FIPS 180-4, section 6.5.
*/ | sha256 = SB::sha256
/**
* The SHA-384 secure hash algorithm. See FIPS 180-4, section 6.5.
*/ | function | sha256 | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [] | null | 184 | 188 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
sha384 = SB::sha384
/**
* The SHA-512 secure hash algorithm. See FIPS 180-4, section 6.4.
*/ | sha384 = SB::sha384
/**
* The SHA-512 secure hash algorithm. See FIPS 180-4, section 6.4.
*/ | function | sha384 | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [] | null | 189 | 193 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
sha512 = SB::sha512 | sha512 = SB::sha512 | function | sha512 | examples.SuiteB_FFI | examples/SuiteB_FFI/SuiteB_FFI.cry | [
"SuiteB"
] | [] | null | 194 | 194 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
Array : * -> * -> * | Array : * -> * -> * | primitive type | Array | lib | lib/Array.cry | [] | [] | null | 8 | 8 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
arrayConstant : {a, b} b -> (Array a b) | arrayConstant : {a, b} b -> (Array a b) | primitive | arrayConstant | lib | lib/Array.cry | [] | [
"Array"
] | null | 10 | 10 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
arrayLookup : {a, b} (Array a b) -> a -> b | arrayLookup : {a, b} (Array a b) -> a -> b | primitive | arrayLookup | lib | lib/Array.cry | [] | [
"Array"
] | null | 11 | 11 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
arrayUpdate : {a, b} (Array a b) -> a -> b -> (Array a b) | arrayUpdate : {a, b} (Array a b) -> a -> b -> (Array a b) | primitive | arrayUpdate | lib | lib/Array.cry | [] | [
"Array"
] | null | 12 | 12 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
arrayEq : {n, a} (Array [n] a) -> (Array [n] a) -> Bool
/**
* Copy elements from the source array to the destination array.
*
* 'arrayCopy dest_arr dest_idx src_arr src_idx len' copies the
* elements from 'src_arr' at indices '[src_idx ..< (src_idx + len)]' into
* 'dest_arr' at indices '[dest_idx ..< (dest_idx + ... | arrayEq : {n, a} (Array [n] a) -> (Array [n] a) -> Bool
/**
* Copy elements from the source array to the destination array.
*
* 'arrayCopy dest_arr dest_idx src_arr src_idx len' copies the
* elements from 'src_arr' at indices '[src_idx ..< (src_idx + len)]' into
* 'dest_arr' at indices '[dest_idx ..< (dest_idx + ... | primitive | arrayEq | lib | lib/Array.cry | [] | [
"Array",
"Bool"
] | null | 13 | 24 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
arrayCopy : {n, a} (fin n) => (Array [n] a) -> [n] -> (Array [n] a) -> [n] -> [n] -> (Array [n] a)
/**
* Set elements of the given array.
*
* 'arraySet' arr idx val len' sets the elements of 'arr' at indices
* '[idx ..< (idx + len)]' to 'val'.
*
* The result is undefined if 'idx + len' wraps around.
*/ | arrayCopy : {n, a} (fin n) => (Array [n] a) -> [n] -> (Array [n] a) -> [n] -> [n] -> (Array [n] a)
/**
* Set elements of the given array.
*
* 'arraySet' arr idx val len' sets the elements of 'arr' at indices
* '[idx ..< (idx + len)]' to 'val'.
*
* The result is undefined if 'idx + len' wraps around.
*/ | primitive | arrayCopy | lib | lib/Array.cry | [] | [
"Array",
"fin"
] | null | 25 | 33 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
arraySet : {n, a} (fin n) => (Array [n] a) -> [n] -> a -> [n] -> (Array [n] a)
/**
* Check whether the lhs array and rhs array are equal at a range of
* indices.
*
* 'arrayRangeEqual sym lhs_arr lhs_idx rhs_arr rhs_idx len' checks whether
* the elements of 'lhs_arr' at indices '[lhs_idx ..< (lhs_idx + len)]' and
... | arraySet : {n, a} (fin n) => (Array [n] a) -> [n] -> a -> [n] -> (Array [n] a)
/**
* Check whether the lhs array and rhs array are equal at a range of
* indices.
*
* 'arrayRangeEqual sym lhs_arr lhs_idx rhs_arr rhs_idx len' checks whether
* the elements of 'lhs_arr' at indices '[lhs_idx ..< (lhs_idx + len)]' and
... | primitive | arraySet | lib | lib/Array.cry | [] | [
"Array",
"fin"
] | null | 34 | 46 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
arrayRangeEqual : {n, a} (fin n) => (Array [n] a) -> [n] -> (Array [n] a) -> [n] -> [n] -> Bool | arrayRangeEqual : {n, a} (fin n) => (Array [n] a) -> [n] -> (Array [n] a) -> [n] -> [n] -> Bool | primitive | arrayRangeEqual | lib | lib/Array.cry | [] | [
"Array",
"Bool",
"fin"
] | null | 47 | 47 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
arrayRangeLookup : {a, b, n} (Integral a, fin n, LiteralLessThan n a) => (Array a b) -> a -> [n]b
arrayRangeLookup arr idx = res
where
res @ i = arrayLookup arr (idx + i) | arrayRangeLookup : {a, b, n} (Integral a, fin n, LiteralLessThan n a) => (Array a b) -> a -> [n]b | arrayRangeLookup arr idx = res
where
res @ i = arrayLookup arr (idx + i) | function | arrayRangeLookup | lib | lib/Array.cry | [] | [
"Array",
"Integral",
"LiteralLessThan",
"arrayLookup",
"fin"
] | null | 49 | 49 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
arrayRangeUpdate : {a, b, n} (Integral a, fin n, LiteralLessThan n a) => (Array a b) -> a -> [n]b -> (Array a b)
arrayRangeUpdate arr idx vals = arrs ! 0
where
arrs = [arr] # [ arrayUpdate acc (idx + i) val | acc <- arrs | i <- [0 ..< n] | val <- vals ] | arrayRangeUpdate : {a, b, n} (Integral a, fin n, LiteralLessThan n a) => (Array a b) -> a -> [n]b -> (Array a b) | arrayRangeUpdate arr idx vals = arrs ! 0
where
arrs = [arr] # [ arrayUpdate acc (idx + i) val | acc <- arrs | i <- [0 ..< n] | val <- vals ] | function | arrayRangeUpdate | lib | lib/Array.cry | [] | [
"Array",
"Integral",
"LiteralLessThan",
"arrayUpdate",
"fin"
] | null | 54 | 54 | true | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
Bit : *
/** The type of unbounded integers. */ | Bit : *
/** The type of unbounded integers. */ | primitive type | Bit | lib | lib/Cryptol.cry | [] | [] | null | 27 | 29 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
Integer : *
/**
* 'Z n' is the type of integers, modulo 'n'.
*
* The values of 'Z n' may be thought of as equivalence
* classes of integers according to the equivalence
* 'x ~ y' iff 'n' divides 'x - y'. 'Z n' naturally
* forms a ring, but does not support integral division
* or indexing.
*
* However, you ma... | Integer : *
/**
* 'Z n' is the type of integers, modulo 'n'.
*
* The values of 'Z n' may be thought of as equivalence
* classes of integers according to the equivalence
* 'x ~ y' iff 'n' divides 'x - y'. 'Z n' naturally
* forms a ring, but does not support integral division
* or indexing.
*
* However, you ma... | primitive type | Integer | lib | lib/Cryptol.cry | [] | [] | null | 30 | 50 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
n : #} (fin n, n >= 1) => Z n : *
/**
* 'Rational' is the type of rational numbers.
* Rational numbers form a Field (and thus a Ring).
*
* The 'ratio' operation may be used to directly create
* rational values from as a ratio of integers, or
* the 'fromInteger' method and the field operations
* can be used.
*/ | n : #} (fin n, n >= 1) => Z n : *
/**
* 'Rational' is the type of rational numbers.
* Rational numbers form a Field (and thus a Ring).
*
* The 'ratio' operation may be used to directly create
* rational values from as a ratio of integers, or
* the 'fromInteger' method and the field operations
* can be used.
*/ | primitive type | n | lib | lib/Cryptol.cry | [] | [
">=",
"fin"
] | null | 51 | 61 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
Rational : * | Rational : * | primitive type | Rational | lib | lib/Cryptol.cry | [] | [] | null | 62 | 62 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
Bool = Bit | Bool = Bit | type | Bool | lib | lib/Cryptol.cry | [] | [
"Bit"
] | null | 64 | 64 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
Word n = [n] | Word n = [n] | type | Word | lib | lib/Cryptol.cry | [] | [] | null | 65 | 65 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
Char = [8] | Char = [8] | type | Char | lib | lib/Cryptol.cry | [] | [] | null | 66 | 66 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
String n = [n]Char
// Numeric operators and constraints ----------------------------------------------
/** A numeric type representing infinity. */ | String n = [n]Char
// Numeric operators and constraints ----------------------------------------------
/** A numeric type representing infinity. */ | type | String | lib | lib/Cryptol.cry | [] | [] | null | 67 | 71 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
inf : #
/** Assert that two numeric types are equal. */ | inf : #
/** Assert that two numeric types are equal. */ | primitive type | inf | lib | lib/Cryptol.cry | [] | [] | null | 72 | 74 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
==) : # -> # -> Prop
/** Assert that two numeric types are different. */ | ==) : # -> # -> Prop
/** Assert that two numeric types are different. */ | primitive type | == | lib | lib/Cryptol.cry | [] | [] | null | 75 | 77 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
!=) : # -> # -> Prop
/** Assert that the first numeric type is larger than, or equal to the second.*/ | !=) : # -> # -> Prop
/** Assert that the first numeric type is larger than, or equal to the second.*/ | primitive type | != | lib | lib/Cryptol.cry | [] | [] | null | 78 | 80 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
>=) : # -> # -> Prop
/** Assert that a numeric type is a proper natural number (not 'inf'). */ | >=) : # -> # -> Prop
/** Assert that a numeric type is a proper natural number (not 'inf'). */ | primitive type | >= | lib | lib/Cryptol.cry | [] | [] | null | 81 | 83 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
fin : # -> Prop
/** Assert that a numeric type is a prime number. */ | fin : # -> Prop
/** Assert that a numeric type is a prime number. */ | primitive type | fin | lib | lib/Cryptol.cry | [] | [] | null | 84 | 86 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
prime : # -> Prop
/** Add numeric types. */ | prime : # -> Prop
/** Add numeric types. */ | primitive type | prime | lib | lib/Cryptol.cry | [] | [] | null | 87 | 89 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
+) : # -> # -> #
/** Multiply numeric types. */ | +) : # -> # -> #
/** Multiply numeric types. */ | primitive type | + | lib | lib/Cryptol.cry | [] | [] | null | 90 | 92 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
*) : # -> # -> #
/** Subtract numeric types. */ | *) : # -> # -> #
/** Subtract numeric types. */ | primitive type | * | lib | lib/Cryptol.cry | [] | [] | null | 93 | 95 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
m : #, n : # }
(fin n, m >= n) =>
m - n : #
/** Divide numeric types, rounding down. */ | m : #, n : # }
(fin n, m >= n) =>
m - n : #
/** Divide numeric types, rounding down. */ | primitive type | m | lib | lib/Cryptol.cry | [] | [
">=",
"fin"
] | null | 97 | 101 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
m : #, n : # }
(fin m, n >= 1) =>
m / n : #
/** Remainder of numeric type division. */ | m : #, n : # }
(fin m, n >= 1) =>
m / n : #
/** Remainder of numeric type division. */ | primitive type | m | lib | lib/Cryptol.cry | [] | [
">=",
"fin"
] | null | 103 | 107 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
m : #, n : # }
(fin m, n >= 1) =>
m % n : #
/** Exponentiate numeric types. */ | m : #, n : # }
(fin m, n >= 1) =>
m % n : #
/** Exponentiate numeric types. */ | primitive type | m | lib | lib/Cryptol.cry | [] | [
">=",
"fin"
] | null | 109 | 113 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
^^) : # -> # -> #
/** The number of bits required to represent the value of a numeric type. */ | ^^) : # -> # -> #
/** The number of bits required to represent the value of a numeric type. */ | primitive type | ^^ | lib | lib/Cryptol.cry | [] | [] | null | 114 | 116 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
width : # -> #
/**
* The ceiling of the base-2 logarithm of a numeric type.
* We define 'lg2 n = width (n - 1)' for nonzero n, and 'lg2 0 = 0'.
*/ | width : # -> #
/**
* The ceiling of the base-2 logarithm of a numeric type.
* We define 'lg2 n = width (n - 1)' for nonzero n, and 'lg2 0 = 0'.
*/ | primitive type | width | lib | lib/Cryptol.cry | [] | [] | null | 117 | 122 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
lg2 n = width (max n 1 - 1)
/** The smaller of two numeric types. */ | lg2 n = width (max n 1 - 1)
/** The smaller of two numeric types. */ | type | lg2 | lib | lib/Cryptol.cry | [] | [
"max",
"width"
] | null | 123 | 125 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
min : # -> # -> #
/** The larger of two numeric types. */ | min : # -> # -> #
/** The larger of two numeric types. */ | primitive type | min | lib | lib/Cryptol.cry | [] | [] | null | 126 | 128 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
max : # -> # -> #
/** Divide numeric types, rounding up. */ | max : # -> # -> #
/** Divide numeric types, rounding up. */ | primitive type | max | lib | lib/Cryptol.cry | [] | [] | null | 129 | 131 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
m : #, n : # }
(fin n, n >= 1) =>
m /^ n : #
/** How much we need to add to make a proper multiple of the second argument. */ | m : #, n : # }
(fin n, n >= 1) =>
m /^ n : #
/** How much we need to add to make a proper multiple of the second argument. */ | primitive type | m | lib | lib/Cryptol.cry | [] | [
">=",
"fin"
] | null | 133 | 137 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
m : #, n : # }
(fin n, n >= 1) =>
m %^ n : #
/** The length of an enumeration. */ | m : #, n : # }
(fin n, n >= 1) =>
m %^ n : #
/** The length of an enumeration. */ | primitive type | m | lib | lib/Cryptol.cry | [] | [
">=",
"fin"
] | null | 139 | 143 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
start : #, next : #, last : # }
(fin start, fin next, fin last, start != next) =>
lengthFromThenTo start next last : #
/**
* Assert that the first numeric type is less than or equal to the second.
*/ | start : #, next : #, last : # }
(fin start, fin next, fin last, start != next) =>
lengthFromThenTo start next last : #
/**
* Assert that the first numeric type is less than or equal to the second.
*/ | primitive type | start | lib | lib/Cryptol.cry | [] | [
"!=",
"fin",
"last"
] | null | 145 | 151 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | |
i <= j = (j >= i)
/**
* Assert that the first numeric type is greater than the second.
*/ | i <= j = (j >= i)
/**
* Assert that the first numeric type is greater than the second.
*/ | type constraint | lib | lib/Cryptol.cry | [] | [
"<=",
">="
] | null | 152 | 156 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb | ||
i > j = i >= j + 1
/**
* Assert that the first numeric type is less than the second.
*/ | i > j = i >= j + 1
/**
* Assert that the first numeric type is less than the second.
*/ | type constraint | lib | lib/Cryptol.cry | [] | [
">="
] | null | 157 | 161 | false | https://github.com/GaloisInc/cryptol | a50cac6eb2c30a79503814f423f375f9476aaceb |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.