Eneboo - Documentación para desarrolladores
|
'defines' | |
#define | CAMELLIA_SIGMA1L (0xA09E667FL) |
#define | CAMELLIA_SIGMA1R (0x3BCC908BL) |
#define | CAMELLIA_SIGMA2L (0xB67AE858L) |
#define | CAMELLIA_SIGMA2R (0x4CAA73B2L) |
#define | CAMELLIA_SIGMA3L (0xC6EF372FL) |
#define | CAMELLIA_SIGMA3R (0xE94F82BEL) |
#define | CAMELLIA_SIGMA4L (0x54FF53A5L) |
#define | CAMELLIA_SIGMA4R (0xF1D36F1CL) |
#define | CAMELLIA_SIGMA5L (0x10E527FAL) |
#define | CAMELLIA_SIGMA5R (0xDE682D1DL) |
#define | CAMELLIA_SIGMA6L (0xB05688C2L) |
#define | CAMELLIA_SIGMA6R (0xB3E6C1FDL) |
#define | CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2]) |
#define | CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1]) |
#define | CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24)) |
#define | CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31)) |
#define | CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24)) |
#define | CAMELLIA_ROLDQ(ll, lr, rl, rr, w0, w1, bits) |
#define | CAMELLIA_ROLDQo32(ll, lr, rl, rr, w0, w1, bits) |
#define | CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)]) |
#define | CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)]) |
#define | CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)]) |
#define | CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)]) |
#define | CAMELLIA_F(xl, xr, kl, kr, yl, yr, il, ir, t0, t1) |
#define | CAMELLIA_FLS(ll, lr, rl, rr, kll, klr, krl, krr, t0, t1, t2, t3) |
#define | CAMELLIA_ROUNDSM(xl, xr, kl, kr, yl, yr, il, ir, t0, t1) |
#define | subl(x) subL[(x)] |
#define | subr(x) subR[(x)] |
Funciones | |
void | camellia_setup128 (const u8 *key, u32 *subkey) |
void | camellia_setup256 (const u8 *key, u32 *subkey) |
void | camellia_setup192 (const u8 *key, u32 *subkey) |
void | camellia_encrypt128 (const u32 *subkey, u32 *io) |
void | camellia_decrypt128 (const u32 *subkey, u32 *io) |
void | camellia_encrypt256 (const u32 *subkey, u32 *io) |
void | camellia_decrypt256 (const u32 *subkey, u32 *io) |
#define CAMELLIA_F | ( | xl, | |
xr, | |||
kl, | |||
kr, | |||
yl, | |||
yr, | |||
il, | |||
ir, | |||
t0, | |||
t1 | |||
) |
do \ { \ il = xl ^ kl; \ ir = xr ^ kr; \ t0 = il >> 16; \ t1 = ir >> 16; \ yl = CAMELLIA_SP1110(ir & 0xff) \ ^ CAMELLIA_SP0222((t1 >> 8) & 0xff) \ ^ CAMELLIA_SP3033(t1 & 0xff) \ ^ CAMELLIA_SP4404((ir >> 8) & 0xff); \ yr = CAMELLIA_SP1110((t0 >> 8) & 0xff) \ ^ CAMELLIA_SP0222(t0 & 0xff) \ ^ CAMELLIA_SP3033((il >> 8) & 0xff) \ ^ CAMELLIA_SP4404(il & 0xff); \ yl ^= yr; \ yr = CAMELLIA_RR8(yr); \ yr ^= yl; \ } while(0)
#define CAMELLIA_FLS | ( | ll, | |
lr, | |||
rl, | |||
rr, | |||
kll, | |||
klr, | |||
krl, | |||
krr, | |||
t0, | |||
t1, | |||
t2, | |||
t3 | |||
) |
do \ { \ t0 = kll; \ t0 &= ll; \ lr ^= CAMELLIA_RL1(t0); \ t1 = klr; \ t1 |= lr; \ ll ^= t1; \ \ t2 = krr; \ t2 |= rr; \ rl ^= t2; \ t3 = krl; \ t3 &= rl; \ rr ^= CAMELLIA_RL1(t3); \ } while(0)
#define CAMELLIA_RL1 | ( | x | ) | (((x) << 1) + ((x) >> 31)) |
#define CAMELLIA_RL8 | ( | x | ) | (((x) << 8) + ((x) >> 24)) |
#define CAMELLIA_ROLDQ | ( | ll, | |
lr, | |||
rl, | |||
rr, | |||
w0, | |||
w1, | |||
bits | |||
) |
#define CAMELLIA_ROLDQo32 | ( | ll, | |
lr, | |||
rl, | |||
rr, | |||
w0, | |||
w1, | |||
bits | |||
) |
#define CAMELLIA_ROUNDSM | ( | xl, | |
xr, | |||
kl, | |||
kr, | |||
yl, | |||
yr, | |||
il, | |||
ir, | |||
t0, | |||
t1 | |||
) |
do \ { \ il = xl; \ ir = xr; \ t0 = il >> 16; \ t1 = ir >> 16; \ ir = CAMELLIA_SP1110(ir & 0xff) \ ^ CAMELLIA_SP0222((t1 >> 8) & 0xff) \ ^ CAMELLIA_SP3033(t1 & 0xff) \ ^ CAMELLIA_SP4404((ir >> 8) & 0xff); \ il = CAMELLIA_SP1110((t0 >> 8) & 0xff) \ ^ CAMELLIA_SP0222(t0 & 0xff) \ ^ CAMELLIA_SP3033((il >> 8) & 0xff) \ ^ CAMELLIA_SP4404(il & 0xff); \ il ^= kl; \ ir ^= kr; \ ir ^= il; \ il = CAMELLIA_RR8(il); \ il ^= ir; \ yl ^= ir; \ yr ^= il; \ } while(0)
#define CAMELLIA_RR8 | ( | x | ) | (((x) >> 8) + ((x) << 24)) |
#define CAMELLIA_SIGMA1L (0xA09E667FL) |
#define CAMELLIA_SIGMA1R (0x3BCC908BL) |
#define CAMELLIA_SIGMA2L (0xB67AE858L) |
#define CAMELLIA_SIGMA2R (0x4CAA73B2L) |
#define CAMELLIA_SIGMA3L (0xC6EF372FL) |
#define CAMELLIA_SIGMA3R (0xE94F82BEL) |
#define CAMELLIA_SIGMA4L (0x54FF53A5L) |
#define CAMELLIA_SIGMA4R (0xF1D36F1CL) |
#define CAMELLIA_SIGMA5L (0x10E527FAL) |
#define CAMELLIA_SIGMA5R (0xDE682D1DL) |
#define CAMELLIA_SIGMA6L (0xB05688C2L) |
#define CAMELLIA_SIGMA6R (0xB3E6C1FDL) |
#define CAMELLIA_SP0222 | ( | INDEX | ) | (camellia_sp0222[(INDEX)]) |
#define CAMELLIA_SP1110 | ( | INDEX | ) | (camellia_sp1110[(INDEX)]) |
#define CAMELLIA_SP3033 | ( | INDEX | ) | (camellia_sp3033[(INDEX)]) |
#define CAMELLIA_SP4404 | ( | INDEX | ) | (camellia_sp4404[(INDEX)]) |
#define CamelliaSubkeyL | ( | INDEX | ) | (subkey[(INDEX)*2]) |
#define CamelliaSubkeyR | ( | INDEX | ) | (subkey[(INDEX)*2 + 1]) |
#define subl | ( | x | ) | subL[(x)] |
Stuff related to the Camellia key schedule
#define subr | ( | x | ) | subR[(x)] |
Stuff related to camellia encryption/decryption
stuff for 192 and 256bit encryption/decryption
k == kll || klr || krl || krr (|| is concatination)
generate KL dependent subkeys