Lines Matching refs:cipher

67 int rijndael_cipherInit(cipherInstance *cipher, BYTE mode, char *IV) {  in rijndael_cipherInit()  argument
69 cipher->mode = mode; in rijndael_cipherInit()
74 memcpy(cipher->IV, IV, RIJNDAEL_MAX_IV_SIZE); in rijndael_cipherInit()
76 memset(cipher->IV, 0, RIJNDAEL_MAX_IV_SIZE); in rijndael_cipherInit()
81 int rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key, in rijndael_blockEncrypt() argument
86 if (cipher == NULL || in rijndael_blockEncrypt()
97 switch (cipher->mode) { in rijndael_blockEncrypt()
108 memcpy(block, cipher->IV, 16); in rijndael_blockEncrypt()
115 ((uint32_t*)block)[0] = ((uint32_t*)cipher->IV)[0] ^ ((uint32_t*)input)[0]; in rijndael_blockEncrypt()
116 ((uint32_t*)block)[1] = ((uint32_t*)cipher->IV)[1] ^ ((uint32_t*)input)[1]; in rijndael_blockEncrypt()
117 ((uint32_t*)block)[2] = ((uint32_t*)cipher->IV)[2] ^ ((uint32_t*)input)[2]; in rijndael_blockEncrypt()
118 ((uint32_t*)block)[3] = ((uint32_t*)cipher->IV)[3] ^ ((uint32_t*)input)[3]; in rijndael_blockEncrypt()
144 memcpy(iv, cipher->IV, 16); in rijndael_blockEncrypt()
146 *((uint32_t*)iv[0]) = *((uint32_t*)(cipher->IV )); in rijndael_blockEncrypt()
147 *((uint32_t*)iv[1]) = *((uint32_t*)(cipher->IV+ 4)); in rijndael_blockEncrypt()
148 *((uint32_t*)iv[2]) = *((uint32_t*)(cipher->IV+ 8)); in rijndael_blockEncrypt()
149 *((uint32_t*)iv[3]) = *((uint32_t*)(cipher->IV+12)); in rijndael_blockEncrypt()
197 int rijndael_padEncrypt(cipherInstance *cipher, keyInstance *key, in rijndael_padEncrypt() argument
202 if (cipher == NULL || in rijndael_padEncrypt()
213 switch (cipher->mode) { in rijndael_padEncrypt()
230 iv = cipher->IV; in rijndael_padEncrypt()
261 int rijndael_blockDecrypt(cipherInstance *cipher, keyInstance *key, in rijndael_blockDecrypt() argument
266 if (cipher == NULL || in rijndael_blockDecrypt()
268 (cipher->mode != MODE_CFB1 && key->direction == DIR_ENCRYPT)) { in rijndael_blockDecrypt()
277 switch (cipher->mode) { in rijndael_blockDecrypt()
288 memcpy(iv, cipher->IV, 16); in rijndael_blockDecrypt()
290 *((uint32_t*)iv[0]) = *((uint32_t*)(cipher->IV )); in rijndael_blockDecrypt()
291 *((uint32_t*)iv[1]) = *((uint32_t*)(cipher->IV+ 4)); in rijndael_blockDecrypt()
292 *((uint32_t*)iv[2]) = *((uint32_t*)(cipher->IV+ 8)); in rijndael_blockDecrypt()
293 *((uint32_t*)iv[3]) = *((uint32_t*)(cipher->IV+12)); in rijndael_blockDecrypt()
317 memcpy(iv, cipher->IV, 16); in rijndael_blockDecrypt()
319 *((uint32_t*)iv[0]) = *((uint32_t*)(cipher->IV)); in rijndael_blockDecrypt()
320 *((uint32_t*)iv[1]) = *((uint32_t*)(cipher->IV+ 4)); in rijndael_blockDecrypt()
321 *((uint32_t*)iv[2]) = *((uint32_t*)(cipher->IV+ 8)); in rijndael_blockDecrypt()
322 *((uint32_t*)iv[3]) = *((uint32_t*)(cipher->IV+12)); in rijndael_blockDecrypt()
361 int rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key, in rijndael_padDecrypt() argument
367 if (cipher == NULL || in rijndael_padDecrypt()
381 switch (cipher->mode) { in rijndael_padDecrypt()
406 memcpy(iv, cipher->IV, 16); in rijndael_padDecrypt()