]> jfr.im git - irc/quakenet/newserv.git/blame - lib/helix.h
Add jupe support
[irc/quakenet/newserv.git] / lib / helix.h
CommitLineData
18f8bd28
CP
1#ifndef __helix_H
2#define __helix_H
3
4typedef unsigned long WORD;
5typedef unsigned char UCHAR;
6
7#define NONCE_LEN 16
8#define MAC_LEN 16
9
10/* HELIX variables */
11typedef struct helix_ctx {
12WORD h_iplus8[2]; /* block number maintained in two parts */
13WORD K[8]; /* expanded key */
14WORD N[8]; /* expanded nonce */
15int l_u; /* length of user key */
16WORD A, B, C, D, E; /* Z_0..Z_4 in the paper */
17} helix_ctx;
18
19#undef TEST
20
21void
22h_key(struct helix_ctx *ctx, unsigned char *U, int U_len);
23void
24h_nonce(struct helix_ctx *ctx, UCHAR nonce[16]);
25void
26h_encrypt(struct helix_ctx *ctx, UCHAR *buf, int n, UCHAR macbuf[16]);
27void
28h_decrypt(struct helix_ctx *ctx, UCHAR *buf, int n, UCHAR macbuf[16]);
29
30#endif