OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
sb_crypt.h
1#ifndef _SB_CRYPT_H
2#define _SB_CRYPT_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8typedef struct _GOACryptState
9{
10 unsigned char cards[256]; // A permutation of 0-255.
11 unsigned char rotor; // Index that rotates smoothly
12 unsigned char ratchet; // Index that moves erratically
13 unsigned char avalanche; // Index heavily data dependent
14 unsigned char last_plain; // Last plain text byte
15 unsigned char last_cipher; // Last cipher text byte
16} GOACryptState;
17
18
19
20void GOACryptInit(GOACryptState *state, unsigned char *key, unsigned char keysize);
21void GOAHashInit(GOACryptState *state);
22unsigned char GOAEncryptByte(GOACryptState *state, unsigned char b); // Encrypt byte
23void GOAEncrypt(GOACryptState *state, unsigned char *bp, int len); // Encrypt byte array
24unsigned char GOADecryptByte(GOACryptState *state, unsigned char b); // Decrypt byte.
25void GOADecrypt(GOACryptState *state,unsigned char *bp, int len); // decrypt byte array
26void GOAHashFinal(GOACryptState *state, unsigned char *hash, unsigned char hashlength); // Hash length (16-32)
27
28#ifdef __cplusplus
29}
30#endif
31
32
33#endif
Definition sb_crypt.h:9
Definition puff.c:88