[BACK]Return to rijndael.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

File: [local] / src / usr.bin / ssh / rijndael.h (download)

Revision 1.2, Wed Dec 6 23:05:43 2000 UTC (23 years, 6 months ago) by markus
Branch: MAIN
Changes since 1.1: +26 -30 lines

new rijndael implementation. fixes endian bugs

/*
 * rijndael-alg-fst.h   v2.4   April '2000
 * rijndael-api-fst.h   v2.4   April '2000
 *
 * Optimised ANSI C code
 *
 */

#ifndef RIJNDAEL_H
#define RIJNDAEL_H

#define RIJNDAEL_MAXKC		(256/32)
#define RIJNDAEL_MAXROUNDS	14

#define	RIJNDAEL_ENCRYPT	0
#define	RIJNDAEL_DECRYPT	1

typedef struct {
	int ROUNDS;		/* key-length-dependent number of rounds */
	u_int8_t keySched[RIJNDAEL_MAXROUNDS+1][4][4];
} rijndael_key;

int rijndael_encrypt(rijndael_key *key, u_int8_t a[16], u_int8_t b[16]);
int rijndael_decrypt(rijndael_key *key, u_int8_t a[16], u_int8_t b[16]);
int rijndael_makekey(rijndael_key *key, int direction, int keyLen, u_int8_t *keyMaterial);

#endif