mirror of
git://anongit.mindrot.org/openssh.git
synced 2024-11-27 23:08:48 +08:00
01f8463b15
[rijndael.c] unexpand(1) - markus@cvs.openbsd.org 2000/12/06 23:05:43 [cipher.c cipher.h rijndael.c rijndael.h rijndael_boxes.h] new rijndael implementation. fixes endian bugs
28 lines
668 B
C
28 lines
668 B
C
/*
|
|
* 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
|