Keep aligned buffers around, instead of allocing on each packet
Fixes #238 github issue. Also fixes armel "Bad alignment" problem.
This commit is contained in:
+10
-1
@@ -73,8 +73,11 @@ namespace Crypto {
|
||||
};
|
||||
|
||||
class Nonce {
|
||||
public:
|
||||
static const int NONCE_LEN = 12;
|
||||
|
||||
private:
|
||||
char bytes[ 12 ] __attribute__((__aligned__ (16)));
|
||||
char bytes[ NONCE_LEN ];
|
||||
|
||||
public:
|
||||
Nonce( uint64_t val );
|
||||
@@ -101,8 +104,14 @@ namespace Crypto {
|
||||
AlignedBuffer ctx_buf;
|
||||
ae_ctx *ctx;
|
||||
uint64_t blocks_encrypted;
|
||||
|
||||
AlignedBuffer plaintext_buffer;
|
||||
AlignedBuffer ciphertext_buffer;
|
||||
AlignedBuffer nonce_buffer;
|
||||
|
||||
public:
|
||||
static const int RECEIVE_MTU = 2048;
|
||||
|
||||
Session( Base64Key s_key );
|
||||
~Session();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user