]> git.stg.codes - stg.git/blob - stglibs/crypto.lib/blowfish.h
Добавление исходников
[stg.git] / stglibs / crypto.lib / blowfish.h
1 /*
2  * Author     :  Paul Kocher
3  * E-mail     :  pck@netcom.com
4  * Date       :  1997
5  * Description:  C implementation of the Blowfish algorithm.
6  */
7
8 #ifndef BLOWFISH_H
9 #define BLOWFISH_H
10
11 #include "os_int.h"
12
13 #define MAXKEYBYTES 56          /* 448 bits */
14
15 typedef struct {
16   uint32_t P[16 + 2];
17   uint32_t S[4][256];
18 } BLOWFISH_CTX;
19
20 void Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen);
21 void Blowfish_Encrypt(BLOWFISH_CTX *ctx, uint32_t *xl, uint32_t *xr);
22 void Blowfish_Decrypt(BLOWFISH_CTX *ctx, uint32_t *xl, uint32_t *xr);
23
24 void EnDecodeInit(const char * key, int passwdLen, BLOWFISH_CTX *ctx);
25 void DecodeString(char * d, const char * s, BLOWFISH_CTX *ctx);
26 void EncodeString(char * d, const char * s, BLOWFISH_CTX *ctx);
27
28 #endif
29