Optimization stuff
This commit is contained in:
parent
990333e7ec
commit
b9ef09dd58
3 changed files with 97 additions and 63 deletions
12
node/AES.hpp
12
node/AES.hpp
|
@ -135,11 +135,21 @@ public:
|
|||
|
||||
const uint8_t *i = (const uint8_t *)in;
|
||||
uint8_t *o = (uint8_t *)out;
|
||||
|
||||
while (len >= 16) {
|
||||
_encryptSW((const uint8_t *)ctr,(uint8_t *)cenc);
|
||||
ctr[1] = Utils::hton(++bctr);
|
||||
#ifdef ZT_NO_TYPE_PUNNING
|
||||
for(unsigned int k=0;k<16;++k)
|
||||
*(o++) = *(i++) ^ ((uint8_t *)cenc)[k];
|
||||
#else
|
||||
*((uint64_t *)o) = *((const uint64_t *)i) ^ cenc[0];
|
||||
o += 8;
|
||||
i += 8;
|
||||
*((uint64_t *)o) = *((const uint64_t *)i) ^ cenc[1];
|
||||
o += 8;
|
||||
i += 8;
|
||||
#endif
|
||||
len -= 16;
|
||||
}
|
||||
|
||||
|
@ -280,7 +290,7 @@ private:
|
|||
#endif
|
||||
struct {
|
||||
uint64_t h[2];
|
||||
uint32_t ek[30];
|
||||
uint32_t ek[60];
|
||||
} sw;
|
||||
} _k;
|
||||
/**************************************************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue