Implement CSecureDataStream for streaming CKeyingMaterial

This commit is contained in:
Jack Grigg
2016-09-28 13:44:31 +13:00
parent 3bbf2c1422
commit 6bffc46a87
3 changed files with 69 additions and 33 deletions

View File

@@ -7,6 +7,7 @@
#include "keystore.h"
#include "serialize.h"
#include "streams.h"
#include "support/allocators/secure.h"
#include "zcash/Address.hpp"
@@ -67,6 +68,18 @@ public:
typedef std::vector<unsigned char, secure_allocator<unsigned char> > CKeyingMaterial;
class CSecureDataStream : public CBaseDataStream<CKeyingMaterial>
{
public:
explicit CSecureDataStream(int nTypeIn, int nVersionIn) : CBaseDataStream(nTypeIn, nVersionIn) { }
CSecureDataStream(const_iterator pbegin, const_iterator pend, int nTypeIn, int nVersionIn) :
CBaseDataStream(pbegin, pend, nTypeIn, nVersionIn) { }
CSecureDataStream(const vector_type& vchIn, int nTypeIn, int nVersionIn) :
CBaseDataStream(vchIn, nTypeIn, nVersionIn) { }
};
/** Encryption/decryption context with key information */
class CCrypter
{