k[0] = bytes2int(key, 0); k[1] = bytes2int(key, 4); k[2] = bytes2int(key, 8); k[3] = bytes2int(key, 12); k[4] = k[5] = k[6] = k[7] = 0; break; case 24: k[0] = bytes2int(key, 0); k[1] = bytes2int(key, 4); k[2] = bytes2int(key, 8); k[3] = bytes2int(key, 12); k[4] = bytes2int(key, 16); k[5] = bytes2int(key, 20); k[6] = ~k[4]; k[7] = ~k[5]; break; case 32: k[0] = bytes2int(key, 0); k[1] = bytes2int(key, 4); k[2] = bytes2int(key, 8); k[3] = bytes2int(key, 12); k[4] = bytes2int(key, 16); k[5] = bytes2int(key, 20); k[6] = bytes2int(key, 24); k[7] = bytes2int(key, 28); _keyIs128 = false; break;
k[0] = bytes2int(key, 0); k[1] = bytes2int(key, 4); k[2] = bytes2int(key, 8); k[3] = bytes2int(key, 12); k[4] = k[5] = k[6] = k[7] = 0; break; case 24: k[0] = bytes2int(key, 0); k[1] = bytes2int(key, 4); k[2] = bytes2int(key, 8); k[3] = bytes2int(key, 12); k[4] = bytes2int(key, 16); k[5] = bytes2int(key, 20); k[6] = ~k[4]; k[7] = ~k[5]; break; case 32: k[0] = bytes2int(key, 0); k[1] = bytes2int(key, 4); k[2] = bytes2int(key, 8); k[3] = bytes2int(key, 12); k[4] = bytes2int(key, 16); k[5] = bytes2int(key, 20); k[6] = bytes2int(key, 24); k[7] = bytes2int(key, 28); _keyIs128 = false; break;
private int processBlock128(byte[] in, int inOff, byte[] out, int outOff) { for (int i = 0; i < 4; i++) { state[i] = bytes2int(in, inOff + (i * 4)); state[i] ^= kw[i]; } camelliaF2(state, subkey, 0); camelliaF2(state, subkey, 4); camelliaF2(state, subkey, 8); camelliaFLs(state, ke, 0); camelliaF2(state, subkey, 12); camelliaF2(state, subkey, 16); camelliaF2(state, subkey, 20); camelliaFLs(state, ke, 4); camelliaF2(state, subkey, 24); camelliaF2(state, subkey, 28); camelliaF2(state, subkey, 32); state[2] ^= kw[4]; state[3] ^= kw[5]; state[0] ^= kw[6]; state[1] ^= kw[7]; int2bytes(state[2], out, outOff); int2bytes(state[3], out, outOff + 4); int2bytes(state[0], out, outOff + 8); int2bytes(state[1], out, outOff + 12); return BLOCK_SIZE; }
private int processBlock128(byte[] in, int inOff, byte[] out, int outOff) { for (int i = 0; i < 4; i++) { state[i] = bytes2int(in, inOff + (i * 4)); state[i] ^= kw[i]; } camelliaF2(state, subkey, 0); camelliaF2(state, subkey, 4); camelliaF2(state, subkey, 8); camelliaFLs(state, ke, 0); camelliaF2(state, subkey, 12); camelliaF2(state, subkey, 16); camelliaF2(state, subkey, 20); camelliaFLs(state, ke, 4); camelliaF2(state, subkey, 24); camelliaF2(state, subkey, 28); camelliaF2(state, subkey, 32); state[2] ^= kw[4]; state[3] ^= kw[5]; state[0] ^= kw[6]; state[1] ^= kw[7]; int2bytes(state[2], out, outOff); int2bytes(state[3], out, outOff + 4); int2bytes(state[0], out, outOff + 8); int2bytes(state[1], out, outOff + 12); return BLOCK_SIZE; }
state[i] = bytes2int(in, inOff + (i * 4)); state[i] ^= kw[i];
state[i] = bytes2int(in, inOff + (i * 4)); state[i] ^= kw[i];