[Botan-devel] Is Botan SecureVector contiguous in memory??
lloyd at randombit.net
Fri Dec 17 11:24:09 EST 2010
On Fri, Dec 17, 2010 at 04:20:55PM +0000, Eugene N wrote:
> I heard that according to c++ standard stl vector is contiguous, and
> therefore whole vector can be treated as a memory block and quickly
> send via sockets or for instance MPI_SEND, by specifying the pointer
> to first element and size.
> I wonder whether SecureVector possess the same properties?
Yes, SecureVector is contiguious.
If T is something other than byte, remember you'll have to deal with
endian conversions somehow.
> In general, i am looking for a way to send BigInt's and PointGFp's
> over a network, so i would welcome any feedback concerning sending
> and/or serialization/reflection of Botan objects.
For PointGFp's, you want EC2OSP and OS2ECP which provide IEEE standard
For BigInt, you probably want BigInt::encode.
More information about the botan-devel