How to use Botan :: MemoryRegion?

Does anyone know how to create an object of type Botan :: MemoryRegion to use in this method?

BigInt BOTAN_DLL fe1_encrypt(const BigInt& n, const BigInt& X,
                         const SymmetricKey& key,
                         const MemoryRegion<byte>& tweak);

      

+3


source to share


1 answer


Both MemoryVector

and SecureVector

inherit from MemoryRegion

and can be used very similar to std::vector

.

BYTE tweakData[tweakDataLen] = { ... };
MemoryVector<byte> myTweak(tweakData, tweakDataLen);

      



SecureVector

takes some precautions to prevent data propagation (e.g. overwrite-before-delete and suppress some swap scripts)

+2


source







All Articles