Download | Plain Text | Line Numbers
#ifndef CIPHER_H
#define CIPHER_H
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdint.h>
/* size of key */
#define KEY_SIZE 256
typedef struct
{
char *out; /* pointer to output buffer */
char cipher[KEY_SIZE]; /* cipher used for decryption */
uint32_t ret; /* internal */
uint32_t off1; /* internal */
uint32_t off2; /* internal */
uint32_t prepend_hashkey; /* use for omit prepending a hashkey */
uint32_t unused;
} ctx_t;
/*
* returns number of initialized cipher values
* that's always KEY_SIZE (=256)
*/
extern int CipherInit(ctx_t *ctx);
/*
* returns number of "decrypted" bytes written to output buffer
* NOTE: that's in_len+1 on first run (hashkey will be prepended)
* and in_len for the rest
*/
extern uint32_t CipherUpdate(ctx_t *ctx, const char *in_data, uint32_t in_len);
#ifdef __cplusplus
}
#endif
#endif