37 #ifndef VIRGIL_BYTE_ARRAY_H 38 #define VIRGIL_BYTE_ARRAY_H 44 namespace virgil {
namespace crypto {
57 #define VIRGIL_BYTE_ARRAY_TO_PTR_AND_LEN(array) reinterpret_cast<const unsigned char *>(array.data()), array.size() 60 #define VIRGIL_BYTE_ARRAY_FROM_PTR_AND_LEN(ptr, len)\ 61 virgil::crypto::VirgilByteArray(reinterpret_cast<virgil::crypto::VirgilByteArray::const_pointer >(ptr), \ 62 reinterpret_cast<virgil::crypto::VirgilByteArray::const_pointer >((ptr) + (len))) 65 namespace virgil {
namespace crypto {
VirgilByteArray str2bytes(const std::string &str)
Represents given string as byte array.
VirgilByteArray & bytes_append(VirgilByteArray &dst, const VirgilByteArray &src)
Append given source bytes to the existing destination bytes.
std::tuple< VirgilByteArray, VirgilByteArray > bytes_split_half(const VirgilByteArray &src)
Split given bytes to two sequences of the same size.
VirgilByteArray hex2bytes(const std::string hexStr)
Translate given HEX string to the byte array.
Root namespace for all Virgil Security libraries.
Definition: VirgilAsn1Compatible.h:46
std::vector< unsigned char > VirgilByteArray
This type represents a sequence of bytes.
Definition: VirgilByteArray.h:50
void bytes_zeroize(VirgilByteArray &array)
Make all bytes zero.
std::string bytes2hex(const VirgilByteArray &array, bool formatted=false)
Translate given byte array to the HEX string.
void string_zeroize(std::string &str)
Make all chars zero.
std::string bytes2str(const VirgilByteArray &array)
Represent given byte array as string.
std::vector< VirgilByteArray > bytes_split_chunks(const VirgilByteArray &src, size_t chunkSize)
Split given bytes to the chuns of the given size.
std::tuple< VirgilByteArray, VirgilByteArray > bytes_split(const VirgilByteArray &src, size_t pos)
Split given bytes to two sequences.