ascon.h 542 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
#ifndef ASCON_H_
#define ASCON_H_

#include <stdint.h>

#include "config.h"
#include "word.h"

typedef struct {
  word_t x0, x1, x2, x3, x4;
} state_t;

#define ASCON_AD 0
#define ASCON_ENC 1
#define ASCON_DEC 2

void process_data(state_t* s, uint8_t* out, const uint8_t* in, uint64_t len,
                  uint8_t mode);

void ascon_core(state_t* s, uint8_t* out, const uint8_t* in, uint64_t tlen,
                const uint8_t* ad, uint64_t adlen, const uint8_t* npub,
                const uint8_t* k, uint8_t mode);

#endif  // ASCON_H_