diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2018-11-21 16:34:25 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2018-11-21 16:34:49 +0100 |
| commit | 8d46de55be9fce55b297915e7086f77ceaab6f19 (patch) | |
| tree | 6847da64c3e46f455fdd626f8d9d2a0dcdc37cad /crypto_aead/lilliputaei128v1/ref/debug.h | |
| parent | 42b8c9908b04635cabc775c4f86f66cb91497c9f (diff) | |
| download | lilliput-ae-implem-8d46de55be9fce55b297915e7086f77ceaab6f19.tar.xz | |
Ajout de traces pour cipher.c (début)
Implémentation de test-cipher.c en passant.
Diffstat (limited to 'crypto_aead/lilliputaei128v1/ref/debug.h')
| -rw-r--r-- | crypto_aead/lilliputaei128v1/ref/debug.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crypto_aead/lilliputaei128v1/ref/debug.h b/crypto_aead/lilliputaei128v1/ref/debug.h index e107019..934a287 100644 --- a/crypto_aead/lilliputaei128v1/ref/debug.h +++ b/crypto_aead/lilliputaei128v1/ref/debug.h @@ -26,3 +26,22 @@ static inline void debug_dump_lanes(FILE *output, const char *header, size_t len } fprintf(output, "\n"); } + +static inline void debug_dump_buffer(FILE *output, const char *header, size_t len, const uint8_t buf[len], int indent) +{ + if (!output) + { + return; + } + + fprintf(output, "%s\n", header); + + fprintf(output, "%*s", indent, ""); + for (size_t b=0; b<len; b++) + { + /* start with MSB */ + size_t byte_index = len-1-b; + fprintf(output, "%*s%02x", 5, "", buf[byte_index]); + } + fprintf(output, "\n"); +} |
