diff options
Diffstat (limited to 'src/crypto')
-rw-r--r-- | src/crypto/crypto.cpp | 9 | ||||
-rw-r--r-- | src/crypto/oaes_lib.c | 4 | ||||
-rw-r--r-- | src/crypto/slow-hash.c | 6 |
3 files changed, 6 insertions, 13 deletions
diff --git a/src/crypto/crypto.cpp b/src/crypto/crypto.cpp index e251d0ec2..f5e655274 100644 --- a/src/crypto/crypto.cpp +++ b/src/crypto/crypto.cpp @@ -263,16 +263,17 @@ namespace crypto { PUSH_WARNINGS DISABLE_VS_WARNINGS(4200) + struct ec_point_pair { + ec_point a, b; + }; struct rs_comm { hash h; - struct { - ec_point a, b; - } ab[]; + struct ec_point_pair ab[]; }; POP_WARNINGS static inline size_t rs_comm_size(size_t pubs_count) { - return sizeof(rs_comm) + pubs_count * sizeof(rs_comm().ab[0]); + return sizeof(rs_comm) + pubs_count * sizeof(ec_point_pair); } void crypto_ops::generate_ring_signature(const hash &prefix_hash, const key_image &image, diff --git a/src/crypto/oaes_lib.c b/src/crypto/oaes_lib.c index 7fbe96e4c..4c1446898 100644 --- a/src/crypto/oaes_lib.c +++ b/src/crypto/oaes_lib.c @@ -27,10 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. * --------------------------------------------------------------------------- */ -static const char _NR[] = { - 0x4e,0x61,0x62,0x69,0x6c,0x20,0x53,0x2e,0x20, - 0x41,0x6c,0x20,0x52,0x61,0x6d,0x6c,0x69,0x00 }; - #include <stddef.h> #include <time.h> #include <string.h> diff --git a/src/crypto/slow-hash.c b/src/crypto/slow-hash.c index 6e03be4d4..8a1807657 100644 --- a/src/crypto/slow-hash.c +++ b/src/crypto/slow-hash.c @@ -658,10 +658,6 @@ void slow_hash_free_state(void) return; } -static void (*const extra_hashes[4])(const void *, size_t, char *) = { - hash_extra_blake, hash_extra_groestl, hash_extra_jh, hash_extra_skein -}; - #define MEMORY (1 << 21) /* 2 MiB */ #define ITER (1 << 20) #define AES_BLOCK_SIZE 16 @@ -827,7 +823,7 @@ void cn_slow_hash(const void *data, size_t length, char *hash) { for(j = 0; j < INIT_SIZE_BLK; j++) aesb_pseudo_round(&text[AES_BLOCK_SIZE * j], &text[AES_BLOCK_SIZE * j], expandedKey); - memcpy(&long_state[i * INIT_SIZE_BYTE], text, INIT_SIZE_BYTE); + memcpy(&long_state[i * INIT_SIZE_BYTE], text, INIT_SIZE_BYTE); } U64(a)[0] = U64(&state.k[0])[0] ^ U64(&state.k[32])[0]; |