2003-07-02 03:34:11 +00:00
|
|
|
#ifndef QCAPROVIDER_H
|
|
|
|
#define QCAPROVIDER_H
|
|
|
|
|
2003-07-02 17:38:03 +00:00
|
|
|
#include<qglobal.h>
|
2003-07-02 03:34:11 +00:00
|
|
|
#include"qca.h"
|
|
|
|
|
2003-07-02 17:38:03 +00:00
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
#define QCA_EXPORT extern "C" __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
#define QCA_EXPORT extern "C"
|
|
|
|
#endif
|
|
|
|
|
2003-07-02 03:34:11 +00:00
|
|
|
class QCAProvider
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
QCAProvider() {}
|
|
|
|
virtual ~QCAProvider() {}
|
|
|
|
|
|
|
|
virtual int capabilities() const=0;
|
2003-07-02 16:46:10 +00:00
|
|
|
virtual void *functions(int cap)=0;
|
|
|
|
};
|
2003-07-02 03:34:11 +00:00
|
|
|
|
2003-07-10 17:31:04 +00:00
|
|
|
struct QCA_HashFunctions
|
2003-07-02 16:46:10 +00:00
|
|
|
{
|
|
|
|
int (*create)();
|
|
|
|
void (*destroy)(int ctx);
|
|
|
|
void (*update)(int ctx, const char *in, unsigned int len);
|
2003-07-10 17:31:04 +00:00
|
|
|
void (*final)(int ctx, char *out);
|
|
|
|
unsigned int (*finalSize)(int ctx);
|
2003-07-03 02:23:29 +00:00
|
|
|
};
|
|
|
|
|
2003-07-10 17:31:04 +00:00
|
|
|
struct QCA_CipherFunctions
|
2003-07-09 00:31:45 +00:00
|
|
|
{
|
2003-07-10 23:23:40 +00:00
|
|
|
int (*keySize)();
|
|
|
|
int (*blockSize)();
|
|
|
|
bool (*generateKey)(char *out);
|
|
|
|
bool (*generateIV)(char *out);
|
|
|
|
|
2003-07-09 00:31:45 +00:00
|
|
|
int (*create)();
|
|
|
|
void (*destroy)(int ctx);
|
2003-07-10 23:23:40 +00:00
|
|
|
bool (*setup)(int ctx, int dir, const char *key, const char *iv);
|
|
|
|
bool (*update)(int ctx, const char *in, unsigned int len);
|
|
|
|
bool (*final)(int ctx, char *out);
|
2003-07-09 00:31:45 +00:00
|
|
|
unsigned int (*finalSize)(int ctx);
|
|
|
|
};
|
|
|
|
|
2003-07-02 03:34:11 +00:00
|
|
|
#endif
|