diff options
author | des <des@FreeBSD.org> | 2014-11-11 13:37:28 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2014-11-11 13:37:28 +0000 |
commit | ce96d70e1715bdfa14d35a3fc0fbe85594d8a179 (patch) | |
tree | e9988b40fbefea377cd6c09d43d2ec6d9c2ab87a | |
parent | d40f3ad5b61ead78babefde00609c6413eee1c12 (diff) | |
download | FreeBSD-src-ce96d70e1715bdfa14d35a3fc0fbe85594d8a179.zip FreeBSD-src-ce96d70e1715bdfa14d35a3fc0fbe85594d8a179.tar.gz |
Fix gcc build: preserve const qualifier when casting input values.
Noticed by: bz@
Submitted by: dim@
-rw-r--r-- | sys/crypto/rijndael/rijndael-api-fst.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/crypto/rijndael/rijndael-api-fst.c b/sys/crypto/rijndael/rijndael-api-fst.c index 24e5646..bf7b4d1 100644 --- a/sys/crypto/rijndael/rijndael-api-fst.c +++ b/sys/crypto/rijndael/rijndael-api-fst.c @@ -233,10 +233,10 @@ int rijndael_padEncrypt(cipherInstance *cipher, keyInstance *key, case MODE_CBC: iv = cipher->IV; for (i = numBlocks; i > 0; i--) { - ((u_int32_t*)block)[0] = ((u_int32_t*)input)[0] ^ ((u_int32_t*)iv)[0]; - ((u_int32_t*)block)[1] = ((u_int32_t*)input)[1] ^ ((u_int32_t*)iv)[1]; - ((u_int32_t*)block)[2] = ((u_int32_t*)input)[2] ^ ((u_int32_t*)iv)[2]; - ((u_int32_t*)block)[3] = ((u_int32_t*)input)[3] ^ ((u_int32_t*)iv)[3]; + ((u_int32_t*)block)[0] = ((const u_int32_t*)input)[0] ^ ((u_int32_t*)iv)[0]; + ((u_int32_t*)block)[1] = ((const u_int32_t*)input)[1] ^ ((u_int32_t*)iv)[1]; + ((u_int32_t*)block)[2] = ((const u_int32_t*)input)[2] ^ ((u_int32_t*)iv)[2]; + ((u_int32_t*)block)[3] = ((const u_int32_t*)input)[3] ^ ((u_int32_t*)iv)[3]; rijndaelEncrypt(key->rk, key->Nr, block, outBuffer); iv = outBuffer; input += 16; |