OSDN Git Service
(root)
/
lamexp
/
LameXP.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
e36451b
)
Make sure Keccak state gets allocated aligned to 32.
author
LoRd_MuldeR
<mulder2@gmx.de>
Thu, 17 Oct 2013 23:58:29 +0000
(
01:58
+0200)
committer
LoRd_MuldeR
<mulder2@gmx.de>
Thu, 17 Oct 2013 23:58:29 +0000
(
01:58
+0200)
etc/Prerequisites/keccak/src/qkeccakhash.cpp
patch
|
blob
|
history
diff --git
a/etc/Prerequisites/keccak/src/qkeccakhash.cpp
b/etc/Prerequisites/keccak/src/qkeccakhash.cpp
index
42a088d
..
bba43dc
100644
(file)
--- a/
etc/Prerequisites/keccak/src/qkeccakhash.cpp
+++ b/
etc/Prerequisites/keccak/src/qkeccakhash.cpp
@@
-31,7
+31,11
@@
QKeccakHash::QKeccakHash()
{
m_initialized = false;
- m_state = new KeccakImpl::hashState;
+ m_state = (KeccakImpl::hashState*) _aligned_malloc(sizeof(KeccakImpl::hashState), 32);
+ if(!m_state)
+ {
+ throw "[QKeccakHash] Error: _aligned_malloc() has failed, probably out of heap space!";
+ }
memset(m_state, 0, sizeof(KeccakImpl::hashState));
m_hashResult.clear();
}
@@
-42,7
+46,7
@@
QKeccakHash::~QKeccakHash()
if(m_state)
{
-
delete m_state
;
+
_aligned_free(m_state)
;
m_state = NULL;
}
}