encryption.h
// Copyright (c) 1999-2018 David Muse
// See the COPYING file for more information.
#ifndef RUDIMENTS_ENCRYPTION_H
#define RUDIMENTS_ENCRYPTION_H
#include <rudiments/private/encryptionincludes.h>
enum encryptionerror_t {
ENCRYPTION_ERROR_SUCCESS=0,
ENCRYPTION_ERROR_NULL,
ENCRYPTION_ERROR_INVALID_PADDING,
ENCRYPTION_ERROR_UNSUPPORTED
};
class RUDIMENTS_DLLSPEC encryption {
public:
encryption();
virtual ~encryption();
virtual bool setKey(const unsigned char *key,
size_t keysize);
virtual void setRandomKey();
virtual unsigned char *getKey();
virtual uint32_t getKeySize()=0;
virtual bool setIv(const unsigned char *iv, size_t ivsize);
virtual void setRandomIv();
virtual unsigned char *getIv();
virtual uint32_t getIvSize()=0;
virtual bool append(const unsigned char *data,
uint32_t size);
virtual const unsigned char *getEncryptedData()=0;
virtual uint64_t getEncryptedDataSize();
virtual const unsigned char *getDecryptedData()=0;
virtual uint64_t getDecryptedDataSize();
virtual bool clear();
virtual encryptionerror_t getError();
#include <rudiments/private/encryption.h>
};
#endif
encryption
Definition: encryption.h:18
encryption::~encryption
virtual ~encryption()
encryption::append
virtual bool append(const unsigned char *data, uint32_t size)
encryption::getKeySize
virtual uint32_t getKeySize()=0
encryption::clear
virtual bool clear()
encryption::setKey
virtual bool setKey(const unsigned char *key, size_t keysize)
encryption::getIv
virtual unsigned char * getIv()
encryption::getEncryptedData
virtual const unsigned char * getEncryptedData()=0
encryption::getIvSize
virtual uint32_t getIvSize()=0
encryption::getKey
virtual unsigned char * getKey()
encryption::getError
virtual encryptionerror_t getError()
encryption::setRandomIv
virtual void setRandomIv()
encryption::getEncryptedDataSize
virtual uint64_t getEncryptedDataSize()
encryption::getDecryptedData
virtual const unsigned char * getDecryptedData()=0
encryption::setIv
virtual bool setIv(const unsigned char *iv, size_t ivsize)
encryption::getDecryptedDataSize
virtual uint64_t getDecryptedDataSize()
encryption::encryption
encryption()
encryption::setRandomKey
virtual void setRandomKey()