projects
/
umurmur.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into gnutls
[umurmur.git]
/
src
/
crypt.c
diff --git
a/src/crypt.c
b/src/crypt.c
index 8324bca5dc24b8050ccaaa3ae4320afd13092e69..ddf1f74af93dc9eff77e922e116555860aefbd79 100644
(file)
--- a/
src/crypt.c
+++ b/
src/crypt.c
@@
-1,5
+1,5
@@
-/* Copyright (C) 2009-201
0
, Martin Johansson <martin@fatbob.nu>
- Copyright (C) 2005-201
0
, Thorvald Natvig <thorvald@natvig.com>
+/* Copyright (C) 2009-201
4
, Martin Johansson <martin@fatbob.nu>
+ Copyright (C) 2005-201
4
, Thorvald Natvig <thorvald@natvig.com>
All rights reserved.
All rights reserved.
@@
-41,16
+41,9
@@
#include <string.h>
#include <arpa/inet.h>
#include "crypt.h"
#include <string.h>
#include <arpa/inet.h>
#include "crypt.h"
+#include "ssl.h"
-#ifdef USE_POLARSSL
-#include <polarssl/havege.h>
-#define RAND_bytes(_dst_, _size_) do { \
- int i; \
- for (i = 0; i < _size_; i++) { \
- _dst_[i] = havege_rand(&hs); \
- } \
- } while (0);
-
+#ifdef USE_POLARSSL_HAVEGE
extern havege_state hs;
#endif
extern havege_state hs;
#endif
@@
-206,7
+199,7
@@
bool_t CryptState_decrypt(cryptState_t *cs, const unsigned char *source, unsigne
CryptState_ocb_decrypt(cs, source+4, dst, plain_length, cs->decrypt_iv, tag);
if (memcmp(tag, source+1, 3) != 0) {
CryptState_ocb_decrypt(cs, source+4, dst, plain_length, cs->decrypt_iv, tag);
if (memcmp(tag, source+1, 3) != 0) {
- memcpy(cs->decrypt_iv, saveiv, AES_BLOCK_SIZE);
+ memcpy(cs->decrypt_iv, saveiv, AES_BLOCK_SIZE);
return false;
}
cs->decrypt_history[cs->decrypt_iv[0]] = cs->decrypt_iv[1];
return false;
}
cs->decrypt_history[cs->decrypt_iv[0]] = cs->decrypt_iv[1];