ascon.h 559 Bytes
Newer Older
Martin Schlaeffer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#ifndef ASCON_H_
#define ASCON_H_

#include <immintrin.h>
#include <stdint.h>

#include "word.h"

typedef union {
  __m512i z;
  struct {
    word_t x0, x1, x2, x3, x4, x5, x6, x7;
  };
} state_t;

Enrico Pozzobon committed
16
void ascon_aeadinit(state_t* s, const uint8_t* npub, const uint8_t* k);
Martin Schlaeffer committed
17 18 19 20 21 22
void ascon_adata(state_t* s, const uint8_t* ad, uint64_t adlen);
void ascon_encrypt(state_t* s, uint8_t* c, const uint8_t* m, uint64_t mlen);
void ascon_decrypt(state_t* s, uint8_t* m, const uint8_t* c, uint64_t clen);
void ascon_final(state_t* s, const uint8_t* k);

#endif /* ASCON_H */