diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-01-22 22:03:49 +0100 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-01-22 22:03:49 +0100 |
commit | 38f01037de197285181c8ce1868b2a69dcf136ee (patch) | |
tree | 755e4180b3d0de82c03ca18e8c8e3b59732ea6c9 | |
parent | f95bd41761db8c2894dbba60c5e8a1a3a60230cb (diff) | |
download | compcert-kvx-38f01037de197285181c8ce1868b2a69dcf136ee.tar.gz compcert-kvx-38f01037de197285181c8ce1868b2a69dcf136ee.zip |
to test memcpy one day
-rw-r--r-- | test/monniaux/sha-2/sha-256.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/monniaux/sha-2/sha-256.c b/test/monniaux/sha-2/sha-256.c index f083a2e1..17ba98aa 100644 --- a/test/monniaux/sha-2/sha-256.c +++ b/test/monniaux/sha-2/sha-256.c @@ -1,5 +1,10 @@ #include <stdint.h> #include <string.h> +#if 0 /* __COMPCERT__ */ +#define my_memcpy(dst, src, size) __builtin_memcpy_aligned(dst, src, size, 1) +#else +#define my_memcpy(dst, src, size) memcpy(dst, src, size) +#endif #include "sha-256.h" @@ -66,7 +71,7 @@ static int calc_chunk(uint8_t chunk[CHUNK_SIZE], struct buffer_state * state) } if (state->len >= CHUNK_SIZE) { - memcpy(chunk, state->p, CHUNK_SIZE); + my_memcpy(chunk, state->p, CHUNK_SIZE); state->p += CHUNK_SIZE; state->len -= CHUNK_SIZE; return 1; |