Changeset 740 for vendor/current/source4/heimdal/lib/hcrypto/aes.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified vendor/current/source4/heimdal/lib/hcrypto/aes.c ¶
r414 r740 120 120 } 121 121 } 122 123 void 124 AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, 125 unsigned long size, const AES_KEY *key, 126 unsigned char *iv, int forward_encrypt) 127 { 128 int i; 129 130 for (i = 0; i < size; i++) { 131 unsigned char tmp[AES_BLOCK_SIZE + 1]; 132 133 memcpy(tmp, iv, AES_BLOCK_SIZE); 134 AES_encrypt(iv, iv, key); 135 if (!forward_encrypt) { 136 tmp[AES_BLOCK_SIZE] = in[i]; 137 } 138 out[i] = in[i] ^ iv[0]; 139 if (forward_encrypt) { 140 tmp[AES_BLOCK_SIZE] = out[i]; 141 } 142 memcpy(iv, &tmp[1], AES_BLOCK_SIZE); 143 } 144 }
Note:
See TracChangeset
for help on using the changeset viewer.