summaryrefslogtreecommitdiff
path: root/src/KM_prng.cpp
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-03-14 15:01:52 +0000
committerCarl Hetherington <cth@carlh.net>2019-12-03 17:01:32 +0100
commit9c508f6e70776ac3b2a9f1dd6153cd93e8ad7d62 (patch)
treea6ff8fbf8605eee958885e66fcb48852064d84a8 /src/KM_prng.cpp
parent565f3a6b5212bdbcc81e23ec86c771cb6fd7dd12 (diff)
Fix / hide some warnings on Linux.
Diffstat (limited to 'src/KM_prng.cpp')
-rwxr-xr-xsrc/KM_prng.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/KM_prng.cpp b/src/KM_prng.cpp
index 5afc598..31ae93e 100755
--- a/src/KM_prng.cpp
+++ b/src/KM_prng.cpp
@@ -116,7 +116,8 @@ public:
AutoMutex Lock(m_Lock);
AES_set_encrypt_key(sha_buf, RNG_KEY_SIZE_BITS, &m_Context);
- *(ui32_t*)(m_ctr_buf + 12) = 1;
+ ui32_t* m_ctr_buf_int = reinterpret_cast<ui32_t*> (m_ctr_buf + 12);
+ *m_ctr_buf_int = 1;
}
//
@@ -130,7 +131,8 @@ public:
while ( gen_count + RNG_BLOCK_SIZE <= len )
{
AES_encrypt(m_ctr_buf, buf + gen_count, &m_Context);
- *(ui32_t*)(m_ctr_buf + 12) += 1;
+ ui32_t* m_ctr_buf_int = reinterpret_cast<ui32_t*> (m_ctr_buf + 12);
+ *m_ctr_buf_int += 1;
gen_count += RNG_BLOCK_SIZE;
}