isap.h 803 Bytes
Newer Older
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
#ifndef ISAP_H
#define ISAP_H

#include <inttypes.h>

// Rate in bits
#define ISAP_rH 64
#define ISAP_rB 1

// Number of rounds
#define ISAP_sH 12
#define ISAP_sB 1
#define ISAP_sE 6
#define ISAP_sK 12

// State size in bytes
#define ISAP_STATE_SZ 40

// Size of rate in bytes
#define ISAP_rH_SZ ((ISAP_rH + 7) / 8)

// Size of zero truncated IV in bytes
#define ISAP_IV_SZ 8

// Size of tag in bytes
#define ISAP_TAG_SZ 16

// Security level
#define ISAP_K 128

void isap_mac(
	const uint8_t *k,
	const uint8_t *npub,
	const uint8_t *ad, const uint64_t adlen,
	const uint8_t *c, const uint64_t clen,
	uint8_t *tag);

int pvp(
	const unsigned char *T,
	const unsigned char *T_star);

void isap_enc(
	const uint8_t *k,
	const uint8_t *npub,
	const uint8_t *m, const uint64_t mlen,
	uint8_t *c);

#endif