bend-osdev-legacy-ciphers
Releases (1)
-
0.1.0.0 indexed
Definitions (970)
rc4.bend
- def LcRc4.out_data
- def LcRc4.cryptthe data under a key, in one call
- def LcRc4.keystreamthe next n keystream bytes (the data n zero bytes), and the state after them
serpent.bend
- type LcSpBox
- def sp.table
- def sp.itablethe inverse S-boxes
- def sp.pick
- def sp.sboxthe S-box (inv False) or its inverse (inv True) at v
- type LcSpNibFour bits: bit j of X0, X1, X2, X3 (X0's is the low bit of the S-box input)
- def sp.na
- def sp.nb
- def sp.nc
- def sp.nd
- def sp.bit
- def sp.nib
- type LcSpQFour m-bit words
- def sp.qa
- def sp.qb
- def sp.qc
- def sp.qd
- def sp.layerthe S-box (or its inverse) at every bit position of four m-bit words
- def sp.sopthe S-box layer (or its inverse) on the state X0..X3
- def sp.lt1
- def sp.lt2
- def sp.lt3X1 = X1 xor X0 xor X2 (its own inverse)
- def sp.lt4X3 = X3 xor X2 xor (X0 << 3) (its own inverse)
- def sp.lt5
- def sp.lt6X0 = X0 xor X1 xor X3 (its own inverse)
- def sp.lt7X2 = X2 xor X3 xor (X1 << 7) (its own inverse)
- def sp.lt8
- def sp.ilt1
- def sp.ilt2
- def sp.ilt5
- def sp.ilt8
- def sp.lt
- def sp.ilt
- type LcSpOpThe steps of the cipher (internal)
- def sp.op
- def sp.unopthe step undone
- def sp.run
- def sp.unrun
- def sp.box.goS-box n (n = 0 to 7)
- def sp.boxthe prekeys w_i = (w_(i-8) xor w_(i-5) xor w_(i-3) xor w_(i-1) xor phi xor i) <<< 11, for n more words from i; win holds w_(i-8) ..
- def sp.prekeys
- def sp.round_keysround key K_i = S_((3 - i) mod 8)(w_(4i) ..
- def sp.roundsthe steps of the 32 rounds from round i: K_i, S_(i mod 8), then LT (rounds 0 to 30) or K_32 (round 31)
- def sp.append
- type LcSerpentKeyA Serpent key: the steps of the cipher (opaque; built by LcSerpent.key)
- def sp.pad.pick
- def sp.padthe key bytes padded to 256 bits: a 1 bit after the key, then zeros
- def sp.le
- def sp.key
- def sp.key.pick
- def LcSerpent.keya key of 0 to 32 bytes (16, 24 and 32 are the usual sizes; a shorter key is padded as the specification says)
- def LcSerpent.encrypt
- def LcSerpent.decrypt
sm4.bend
- def sm4.sbox.listThe S-box (GB/T 32907-2016, 6.2: row i, column j is entry 16i + j)
- def sm4.sbox
- def sm4.s
- def sm4.tautau: the S-box on each byte of a word
- def sm4.tT = L(tau(x)), L(B) = B xor B<<<2 xor B<<<10 xor B<<<18 xor B<<<24
- def sm4.t2T' of the key schedule: L'(B) = B xor B<<<13 xor B<<<23
- def sm4.step
- def sm4.unstepthe round undone
- def sm4.rounds
- def sm4.unrounds
- def sm4.revthe reverse transformation R: (A0, A1, A2, A3) -> (A3, A2, A1, A0)
- def sm4.fkFK and CK_i (ck_(i,j) = (4i + j) * 7 mod 256)
- def sm4.ck
- def sm4.schedulerk_i = K_(i+4) = K_i xor T'(K_(i+1) xor K_(i+2) xor K_(i+3) xor CK_i), for n more rounds from round i, the window K_i ..
- type LcSm4KeyAn SM4 key: the S-box table (built once per key) and the 32 round keys (opaque; built by LcSm4.key)
- def sm4.mk
- def sm4.key.pick
- def LcSm4.keya 16-byte key
- def LcSm4.encrypt
- def LcSm4.decrypt
tdes.bend
- type LcTdesKeyA TDEA key bundle: three DES keys (opaque)
- def LcTdes.of_desthe bundle of three DES keys, in the order K1, K2, K3
- def tdes.des_key
- def tdes.key3
- def tdes.key2
- def tdes.key.pick
- def LcTdes.key3keying option 1: K1, K2, K3 as 24 bytes
- def LcTdes.key2keying option 2: K1, K2 as 16 bytes, and K3 = K1
- def LcTdes.keyoption 1 for 24 bytes, option 2 for 16
- def LcTdes.encrypt
- def LcTdes.decrypt
tea.bend
- type LcTeaOpThe steps (internal), on the block as LcBlock64{y, z}
- def tea.gTEA's function of one half: ((x << 4) + a) xor (x + s) xor ((x >> 5) + b)
- def xtea.gXTEA's: (((x << 4) xor (x >> 5)) + x) xor c
- def tea.op
- def tea.unopthe step undone
- def tea.run
- def tea.unrun
- def tea.delta
- def tea.wordthe four key words, little-endian (le True) or big-endian
- def tea.append
- def tea.orderthe steps in the chosen byte order: little-endian words are byte-swapped on the way in and out
- def tea.cyclesTEA's steps for n more cycles, sum the value before the next
- type LcTeaKeyA TEA key: the steps of the cipher (opaque; built by LcTea.key)