summaryrefslogtreecommitdiff
path: root/libtomcrypt/src/modes/lrw/lrw_setiv.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtomcrypt/src/modes/lrw/lrw_setiv.c')
-rw-r--r--libtomcrypt/src/modes/lrw/lrw_setiv.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/libtomcrypt/src/modes/lrw/lrw_setiv.c b/libtomcrypt/src/modes/lrw/lrw_setiv.c
index 2ff9a80..5c04157 100644
--- a/libtomcrypt/src/modes/lrw/lrw_setiv.c
+++ b/libtomcrypt/src/modes/lrw/lrw_setiv.c
@@ -5,8 +5,6 @@
*
* The library is free for all purposes without any express
* guarantee it works.
- *
- * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
@@ -27,7 +25,7 @@
int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw)
{
int err;
-#ifdef LRW_TABLES
+#ifdef LTC_LRW_TABLES
unsigned char T[16];
int x, y;
#endif
@@ -51,12 +49,12 @@ int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw)
return CRYPT_OK;
}
-#ifdef LRW_TABLES
+#ifdef LTC_LRW_TABLES
XMEMCPY(T, &lrw->PC[0][IV[0]][0], 16);
for (x = 1; x < 16; x++) {
#ifdef LTC_FAST
for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) {
- *((LTC_FAST_TYPE *)(T + y)) ^= *((LTC_FAST_TYPE *)(&lrw->PC[x][IV[x]][y]));
+ *(LTC_FAST_TYPE_PTR_CAST(T + y)) ^= *(LTC_FAST_TYPE_PTR_CAST(&lrw->PC[x][IV[x]][y]));
}
#else
for (y = 0; y < 16; y++) {
@@ -65,8 +63,8 @@ int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw)
#endif
}
XMEMCPY(lrw->pad, T, 16);
-#else
- gcm_gf_mult(lrw->tweak, IV, lrw->pad);
+#else
+ gcm_gf_mult(lrw->tweak, IV, lrw->pad);
#endif
return CRYPT_OK;
@@ -74,6 +72,6 @@ int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw)
#endif
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
+/* ref: $Format:%D$ */
+/* git commit: $Format:%H$ */
+/* commit time: $Format:%ai$ */