printstate.h 577 Bytes
Newer Older
Martin Schläffer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#ifndef PRINTSTATE_H_
#define PRINTSTATE_H_

#ifdef NDEBUG

#define printword(text, w)
#define printstate(text, s)

#else

#include <inttypes.h>
#include <stdio.h>

#include "ascon.h"

__forceinline void printword(const char* text, const word_t x) {
  printf("%s=%016" PRIx64 "\n", text, WORDTOU64(x));
}

__forceinline void printstate(const char* text, const state_t* s) {
  printf("%s:\n", text);
  printword("  x0", s->x0);
  printword("  x1", s->x1);
  printword("  x2", s->x2);
  printword("  x3", s->x3);
  printword("  x4", s->x4);
}

#endif

#endif /* PRINTSTATE_H_ */