all repos — TinyCrypT @ 15791d38c8f011a16648742e77b25435ee93ab76

Short and sweet classical cryptographic primitives

tinycrypt/x86_64_aarch64/pctablegen.c (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
#include "tinycrypt/ed25519.h"
#include <stdint.h>
#include <stdio.h>

int
main (int argc, const char **argv)
{
  uint64_t lut[11520];
  tct_ed25519_pctable_gen_64bit (lut);
  printf ("#include <stdint.h>\n");
  printf ("const static uint64_t PRECOMPUTE_TABLE[11520] = {\n    ");
  for (unsigned int i = 0; i < 11520; ++i)
    {
      printf ("0x%lx, ", lut[i]);
      if (i % 8 == 7)
        {
          printf ("\n    ");
        }
    }
  printf ("};\n");
  return 0;
}