/* nanoka-core.h - Don Yang (uguu.org) 01/06/05 */ #ifndef NANOKA_CORE_H__ #define NANOKA_CORE_H__ #define MAX_ROUNDS 128 #define MIN_BLK_SIZE 2 /* Block size is measured in WORDs */ #define MAX_BLK_SIZE 32 #define MIN_FUNC_SIZE 3 #define MAX_FUNC_SIZE 32 #define MIN_COVERAGE 8 #define S_TABLE "P" #define K_TABLE "K" typedef struct { int in, out, xor; } Round; typedef enum { OP_XOR = 0, OP_MUL, OP_ADD, OP_SUB, OP_TABLE, OP_ROR, OPCOUNT } OpType; typedef struct { OpType op; int term; } Func; typedef struct { int rounds, iter, blocksize, funcsize; unsigned int s_table[32]; /*@only@*/unsigned int *k_table; /*@only@*/Round *r; /*@only@*/Func *f; } Cipher; void FreeCipher(/*@only@*/Cipher *c) /*@releases c@*/; /*@null@*/Cipher *GenerateCipher(FILE *keyfile); #endif