6 #if CRYPTOPP_MSC_VERSION 7 # pragma warning(disable: 4127 4189 4459) 10 #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 11 # pragma GCC diagnostic ignored "-Wunused-value" 12 # pragma GCC diagnostic ignored "-Wunused-variable" 13 # pragma GCC diagnostic ignored "-Wunused-parameter" 16 #ifndef CRYPTOPP_IMPORTS 36 #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE 51 throw SelfTestFailure(
"Cryptographic algorithms are disabled before the power-up self tests are performed.");
54 throw SelfTestFailure(
"Cryptographic algorithms are disabled after a power-up self test failed.");
60 this->ThrowIfInvalidKeyLength(length);
61 this->UncheckedSetKey(key, static_cast<unsigned int>(length), params);
74 void SimpleKeyingInterface::ThrowIfInvalidKeyLength(
size_t length)
76 if (!IsValidKeyLength(length))
80 void SimpleKeyingInterface::ThrowIfResynchronizable()
82 if (IsResynchronizable())
86 void SimpleKeyingInterface::ThrowIfInvalidIV(
const byte *iv)
88 if (!iv && IVRequirement() == UNPREDICTABLE_RANDOM_IV)
92 size_t SimpleKeyingInterface::ThrowIfInvalidIVLength(
int length)
96 size =
static_cast<size_t>(IVSize());
97 else if ((
size_t)length < MinIVLength())
99 else if ((
size_t)length > MaxIVLength())
102 size =
static_cast<size_t>(length);
107 const byte * SimpleKeyingInterface::GetIVAndThrowIfInvalid(
const NameValuePairs ¶ms,
size_t &size)
110 const byte *iv = NULLPTR;
118 iv = ivWithLength.
begin();
119 ThrowIfInvalidIV(iv);
120 size = ThrowIfInvalidIVLength(static_cast<int>(ivWithLength.
size()));
124 ThrowIfInvalidIV(iv);
125 size =
static_cast<size_t>(IVSize());
129 ThrowIfResynchronizable();
147 const unsigned int blockSize =
BlockSize();
148 size_t inIncrement = (flags & (BT_InBlockIsCounter|BT_DontIncrementInOutPointers)) ? 0 : blockSize;
149 size_t xorIncrement = xorBlocks ? blockSize : 0;
150 size_t outIncrement = (flags & BT_DontIncrementInOutPointers) ? 0 : blockSize;
152 if (flags & BT_ReverseDirection)
154 inBlocks =
PtrAdd(inBlocks, length - blockSize);
155 xorBlocks =
PtrAdd(xorBlocks, length - blockSize);
156 outBlocks =
PtrAdd(outBlocks, length - blockSize);
157 inIncrement = 0-inIncrement;
158 xorIncrement = 0-xorIncrement;
159 outIncrement = 0-outIncrement;
163 const bool xorFlag = xorBlocks && (flags & BT_XorInput);
164 while (length >= blockSize)
169 xorbuf(outBlocks, xorBlocks, inBlocks, blockSize);
170 ProcessBlock(outBlocks);
175 ProcessAndXorBlock(inBlocks, xorBlocks, outBlocks);
178 if (flags & BT_InBlockIsCounter)
179 const_cast<byte *
>(inBlocks)[blockSize-1]++;
181 inBlocks =
PtrAdd(inBlocks, inIncrement);
182 outBlocks =
PtrAdd(outBlocks, outIncrement);
183 xorBlocks =
PtrAdd(xorBlocks, xorIncrement);
192 return GetAlignmentOf<word32>();
197 return GetAlignmentOf<word32>();
202 return GetAlignmentOf<word32>();
210 if (length == MandatoryBlockSize())
211 ProcessData(outString, inString, length);
212 else if (length != 0)
222 if (inLength == MandatoryBlockSize())
224 outLength = inLength;
225 ProcessData(outString, inString, inLength);
227 else if (inLength != 0)
235 if (headerLength > MaxHeaderLength())
238 if (messageLength > MaxMessageLength())
241 if (footerLength > MaxFooterLength())
244 UncheckedSpecifyDataLengths(headerLength, messageLength, footerLength);
249 Resynchronize(iv, ivLength);
250 SpecifyDataLengths(headerLength, messageLength);
251 Update(header, headerLength);
252 ProcessString(ciphertext, message, messageLength);
253 TruncatedFinal(mac, macSize);
258 Resynchronize(iv, ivLength);
259 SpecifyDataLengths(headerLength, ciphertextLength);
260 Update(header, headerLength);
261 ProcessString(message, ciphertext, ciphertextLength);
262 return TruncatedVerify(mac, macLength);
273 return GenerateByte() & 1;
279 GenerateBlock(&b, 1);
285 const word32 range = max-min;
292 GenerateBlock((byte *)&value,
sizeof(value));
293 value =
Crop(value, maxBits);
294 }
while (value > range);
313 CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size);
330 GenerateBlock(buffer, len);
331 (void)target.
ChannelPut(channel, buffer, len);
343 return static_cast<size_t>(-1);
346 void KeyDerivationFunction::ThrowIfInvalidDerivedLength(
size_t length)
const 348 if (!IsValidDerivedLength(length))
353 CRYPTOPP_UNUSED(params);
367 #if defined(CRYPTOPP_DOXYGEN_PROCESSING) 379 CRYPTOPP_UNUSED(output); CRYPTOPP_UNUSED(size);
380 throw NotImplemented(
"NullRNG: NullRNG should only be passed to functions that don't need to generate random bytes");
383 #if defined(CRYPTOPP_DOXYGEN_PROCESSING) 408 ThrowIfInvalidTruncatedSize(digestLength);
410 TruncatedFinal(calculated, digestLength);
414 void HashTransformation::ThrowIfInvalidTruncatedSize(
size_t size)
const 435 CRYPTOPP_UNUSED(propagation);
437 IsolatedInitialize(parameters);
442 CRYPTOPP_UNUSED(propagation);
444 return IsolatedFlush(hardFlush, blocking);
449 CRYPTOPP_UNUSED(propagation);
451 return IsolatedMessageSeriesEnd(blocking);
456 byte* space = NULLPTR;
458 space = CreatePutSpace(size);
468 size = Put2(inString, length, messageEnd, blocking);
478 size = PutModifiable2(inString, length, messageEnd, blocking);
480 size = ChannelPut2(channel, inString, length, messageEnd, blocking);
488 result = Flush(hardFlush, propagation, blocking);
498 result = MessageSeriesEnd(propagation, blocking);
507 if (AttachedTransformation())
508 size = AttachedTransformation()->MaxRetrievable();
517 if (AttachedTransformation())
518 result = AttachedTransformation()->AnyRetrievable();
522 result = Peek(b) != 0;
530 if (AttachedTransformation())
531 size = AttachedTransformation()->Get(outByte);
533 size = Get(&outByte, 1);
540 if (AttachedTransformation())
541 size = AttachedTransformation()->Get(outString, getMax);
545 size = (size_t)TransferTo(arraySink, getMax);
553 if (AttachedTransformation())
554 size = AttachedTransformation()->Peek(outByte);
556 size = Peek(&outByte, 1);
563 if (AttachedTransformation())
564 size = AttachedTransformation()->Peek(outString, peekMax);
568 size = (size_t)CopyTo(arraySink, peekMax);
576 if (AttachedTransformation())
577 size = AttachedTransformation()->Skip(skipMax);
586 if (AttachedTransformation())
587 size = AttachedTransformation()->TotalBytesRetrievable();
589 size = MaxRetrievable();
595 unsigned int size = 0;
596 if (AttachedTransformation())
597 size = AttachedTransformation()->NumberOfMessages();
606 if (AttachedTransformation())
607 result = AttachedTransformation()->AnyMessages();
609 result = NumberOfMessages() != 0;
616 if (AttachedTransformation())
617 result = AttachedTransformation()->GetNextMessage();
627 unsigned int size = 0;
628 if (AttachedTransformation())
629 size = AttachedTransformation()->SkipMessages(count);
637 if (AttachedTransformation())
638 return AttachedTransformation()->TransferMessagesTo2(target, messageCount, channel, blocking);
641 unsigned int maxMessages = messageCount;
642 for (messageCount=0; messageCount < maxMessages && AnyMessages(); messageCount++)
645 lword transferredBytes;
647 while (AnyRetrievable())
649 transferredBytes = LWORD_MAX;
650 blockedBytes = TransferTo2(target, transferredBytes, channel, blocking);
651 if (blockedBytes > 0)
658 bool result = GetNextMessage();
667 unsigned int size = 0;
668 if (AttachedTransformation())
669 size = AttachedTransformation()->CopyMessagesTo(target, count, channel);
675 if (AttachedTransformation())
676 AttachedTransformation()->SkipAll();
679 while (SkipMessages()) {}
686 if (AttachedTransformation())
687 return AttachedTransformation()->TransferAllTo2(target, channel, blocking);
692 unsigned int messageCount;
695 messageCount = UINT_MAX;
696 size_t blockedBytes = TransferMessagesTo2(target, messageCount, channel, blocking);
700 while (messageCount != 0);
705 byteCount = ULONG_MAX;
706 size_t blockedBytes = TransferTo2(target, byteCount, channel, blocking);
710 while (byteCount != 0);
718 if (AttachedTransformation())
719 AttachedTransformation()->CopyAllTo(target, channel);
723 while (CopyMessagesTo(target, UINT_MAX, channel)) {}
729 if (AttachedTransformation())
730 AttachedTransformation()->SetRetrievalChannel(channel);
735 PutWord(
false, order, m_buf, value);
736 return ChannelPut(channel, m_buf, 2, blocking);
741 PutWord(
false, order, m_buf, value);
742 return ChannelPut(channel, m_buf, 4, blocking);
756 #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 757 # pragma GCC diagnostic push 758 # pragma GCC diagnostic ignored "-Wconversion" 759 # pragma GCC diagnostic ignored "-Wsign-conversion" 764 byte buf[2] = {0, 0};
765 size_t len = Peek(buf, 2);
768 value = (buf[0] << 8) | buf[1];
770 value = (buf[1] << 8) | buf[0];
777 byte buf[4] = {0, 0, 0, 0};
778 size_t len = Peek(buf, 4);
781 value = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf [3];
783 value = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf [0];
789 #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE 790 # pragma GCC diagnostic pop 795 return (
size_t)Skip(PeekWord16(value, order));
800 return (
size_t)Skip(PeekWord32(value, order));
805 if (AttachedTransformation() && AttachedTransformation()->Attachable())
806 AttachedTransformation()->Attach(newAttachment);
808 Detach(newAttachment);
820 : m_rng(rng), m_encryptor(encryptor), m_parameters(parameters)
825 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
828 m_plaintextQueue.Put(inString, length);
833 size_t plaintextLength;
834 if (!
SafeConvert(m_plaintextQueue.CurrentSize(), plaintextLength))
835 throw InvalidArgument(
"PK_DefaultEncryptionFilter: plaintext too long");
836 size_t ciphertextLength = m_encryptor.CiphertextLength(plaintextLength);
839 m_plaintextQueue.Get(plaintext, plaintextLength);
840 m_ciphertext.resize(ciphertextLength);
841 m_encryptor.Encrypt(m_rng, plaintext, plaintextLength, m_ciphertext, m_parameters);
844 FILTER_OUTPUT(1, m_ciphertext, m_ciphertext.size(), messageEnd);
846 FILTER_END_NO_MESSAGE_END;
865 : m_rng(rng), m_decryptor(decryptor), m_parameters(parameters)
870 size_t Put2(
const byte *inString,
size_t length,
int messageEnd,
bool blocking)
873 m_ciphertextQueue.Put(inString, length);
878 size_t ciphertextLength;
879 if (!
SafeConvert(m_ciphertextQueue.CurrentSize(), ciphertextLength))
880 throw InvalidArgument(
"PK_DefaultDecryptionFilter: ciphertext too long");
881 size_t maxPlaintextLength = m_decryptor.MaxPlaintextLength(ciphertextLength);
884 m_ciphertextQueue.Get(ciphertext, ciphertextLength);
885 m_plaintext.resize(maxPlaintextLength);
886 m_result = m_decryptor.Decrypt(m_rng, ciphertext, ciphertextLength, m_plaintext, m_parameters);
887 if (!m_result.isValidCoding)
891 FILTER_OUTPUT(1, m_plaintext, m_result.messageLength, messageEnd);
893 FILTER_END_NO_MESSAGE_END;
912 return SignAndRestart(rng, *m, signature,
false);
918 m->
Update(message, messageLen);
919 return SignAndRestart(rng, *m, signature,
false);
923 const byte *nonrecoverableMessage,
size_t nonrecoverableMessageLength, byte *signature)
const 926 InputRecoverableMessage(*m, recoverableMessage, recoverableMessageLength);
927 m->
Update(nonrecoverableMessage, nonrecoverableMessageLength);
928 return SignAndRestart(rng, *m, signature,
false);
934 return VerifyAndRestart(*m);
940 InputSignature(*m, signature, signatureLen);
941 m->
Update(message, messageLen);
942 return VerifyAndRestart(*m);
948 return RecoverAndRestart(recoveredMessage, *m);
952 const byte *nonrecoverableMessage,
size_t nonrecoverableMessageLength,
953 const byte *signature,
size_t signatureLength)
const 956 InputSignature(*m, signature, signatureLength);
957 m->
Update(nonrecoverableMessage, nonrecoverableMessageLength);
958 return RecoverAndRestart(recoveredMessage, *m);
963 GeneratePrivateKey(rng, privateKey);
964 GeneratePublicKey(rng, privateKey, publicKey);
969 GenerateStaticPrivateKey(rng, privateKey);
970 GenerateStaticPublicKey(rng, privateKey, publicKey);
975 GenerateEphemeralPrivateKey(rng, privateKey);
976 GenerateEphemeralPublicKey(rng, privateKey, publicKey);
981 #ifndef CRYPTOPP_BUILD_VERSION 982 # define CRYPTOPP_BUILD_VERSION CRYPTOPP_VERSION 986 return CRYPTOPP_BUILD_VERSION;
993 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const 994 {CRYPTOPP_UNUSED(name); CRYPTOPP_UNUSED(valueType); CRYPTOPP_UNUSED(pValue);
return false;}
997 #if HAVE_GCC_INIT_PRIORITY 998 const std::string
DEFAULT_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 25))) =
"";
999 const std::string
AAD_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 26))) =
"AAD";
1000 const NullNameValuePairs s_nullNameValuePairs __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 27)));
1002 #elif HAVE_MSC_INIT_PRIORITY 1003 #pragma warning(disable: 4073) 1004 #pragma init_seg(lib) 1008 const NameValuePairs& g_nullNameValuePairs = s_nullNameValuePairs;
1009 #pragma warning(default: 4073) 1010 #elif HAVE_XLC_INIT_PRIORITY 1011 #pragma priority(260) 1012 const std::string DEFAULT_CHANNEL =
"";
1013 const std::string AAD_CHANNEL =
"AAD";
1015 const NameValuePairs& g_nullNameValuePairs = s_nullNameValuePairs;
1017 const std::string DEFAULT_CHANNEL =
"";
1018 const std::string AAD_CHANNEL =
"AAD";
1020 const NameValuePairs &g_nullNameValuePairs = *s_pNullNameValuePairs.m_p;
1025 #endif // CRYPTOPP_IMPORTS Used to pass byte array input as part of a NameValuePairs object.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
Standard names for retrieving values by name when working with NameValuePairs.
const char * DigestSize()
int, in bytes
An invalid argument was detected.
virtual void SetParameters(const NameValuePairs ¶ms)
Set or change parameters.
virtual void GenerateKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
Generate a private/public key pair.
Classes for working with NameValuePairs.
word32 GenerateWord32(word32 min, word32 max)
An implementation that throws NotImplemented.
bool SafeConvert(T1 from, T2 &to)
Tests whether a conversion from -> to is safe to perform.
Utility functions for the Crypto++ library.
virtual void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms=g_nullNameValuePairs)
Sets or reset the key of this object.
ByteOrder
Provides the byte ordering.
virtual void GenerateBlock(byte *output, size_t size)
Generate random array of bytes.
size_t size() const
Length of the memory block.
virtual bool Verify(PK_MessageAccumulator *messageAccumulator) const
Check whether messageAccumulator contains a valid signature and message.
virtual size_t SignMessage(RandomNumberGenerator &rng, const byte *message, size_t messageLen, byte *signature) const
Sign a message.
Exception thrown when an invalid key length is encountered.
void PutWord(bool assumeAligned, ByteOrder order, byte *block, T value, const byte *xorBlock=NULL)
Access a block of memory.
virtual void GenerateStaticKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
Generate a static private/public key pair.
Interface for public-key encryptors.
byte GenerateByte()
An implementation that throws NotImplemented.
virtual word32 GenerateWord32(word32 min=0, word32 max=0xffffffffUL)
Generate a random 32 bit word in the range min to max, inclusive.
Abstract base classes that provide a uniform interface to this library.
Thrown when an unexpected type is encountered.
BufferedTransformation & TheBitBucket()
An input discarding BufferedTransformation.
void GenerateBlock(byte *output, size_t size)
An implementation that throws NotImplemented.
virtual void DiscardBytes(size_t n)
Generate and discard n bytes.
The self tests were executed via DoPowerUpSelfTest() or DoDllPowerUpSelfTest(), but the result was fa...
Classes for automatic resource management.
virtual Clonable * Clone() const
Copies this object.
void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword length)
An implementation that throws NotImplemented.
Library configuration file.
Interface for random number generators.
void SetKeyWithRounds(const byte *key, size_t length, int rounds)
Sets or reset the key of this object.
virtual void GenerateEphemeralKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const
Generate private/public key pair.
Interface for cloning objects.
virtual size_t SignMessageWithRecovery(RandomNumberGenerator &rng, const byte *recoverableMessage, size_t recoverableMessageLength, const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, byte *signature) const
Sign a recoverable message.
std::string AlgorithmName() const
The name of the generator.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
Classes and functions for secure memory allocations.
bool FIPS_140_2_ComplianceEnabled()
Determines whether the library provides FIPS validated cryptography.
Copy input to a memory buffer.
Returns a decoding results.
Algorithm(bool checkSelfTestStatus=true)
Interface for all crypto algorithms.
Interface for public-key decryptors.
void Shuffle(IT begin, IT end)
An implementation that does nothing.
A method was called which was not implemented.
const byte * begin() const
Pointer to the first byte in the memory block.
const std::string DEFAULT_CHANNEL
Default channel for BufferedTransformation.
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
Manages resources for a single object.
Exception thrown when a crypto algorithm is used after a self test fails.
virtual DecodingResult RecoverMessage(byte *recoveredMessage, const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, const byte *signature, size_t signatureLength) const
Recover a message from its signature.
#define CRYPTOPP_COMPILE_ASSERT(expr)
Compile time assertion.
T Crop(T value, size_t bits)
Truncates the value to the specified number of bits.
virtual bool VerifyMessage(const byte *message, size_t messageLen, const byte *signature, size_t signatureLen) const
Check whether input signature is a valid signature for input message.
const T1 UnsignedMin(const T1 &a, const T2 &b)
Safe comparison of values that could be neagtive and incorrectly promoted.
const NameValuePairs & g_nullNameValuePairs
An empty set of name-value pairs.
unsigned int GenerateBit()
An implementation that throws NotImplemented.
virtual BufferedTransformation * CreateDecryptionFilter(RandomNumberGenerator &rng, BufferedTransformation *attachment=NULL, const NameValuePairs ¶meters=g_nullNameValuePairs) const
Create a new decryption filter.
virtual std::string AlgorithmName() const
Provides the name of this algorithm.
virtual size_t MinDerivedLength() const
Determine minimum number of bytes.
virtual std::string AlgorithmName() const
Provides the name of this algorithm.
RandomNumberGenerator & NullRNG()
Random Number Generator that does not produce random numbers.
#define CRYPTOPP_ASSERT(exp)
Debugging and diagnostic assertion.
virtual byte GenerateByte()
Generate new random byte and return it.
Data structure used to store byte strings.
const char * BlockSize()
int, in bytes
PowerUpSelfTestStatus GetPowerUpSelfTestStatus()
Provides the current power-up self test status.
Random Number Generator that does not produce random numbers.
Implementation of BufferedTransformation's attachment interface.
const char * IV()
ConstByteArrayParameter, also accepts const byte * for backwards compatibility.
The self tests have not been performed.
Interface for accumulating messages to be signed or verified.
A decryption filter encountered invalid ciphertext.
void SetKeyWithIV(const byte *key, size_t length, const byte *iv, size_t ivLength)
Sets or reset the key of this object.
PTR PtrAdd(PTR pointer, OFF offset)
Create a pointer with an offset.
virtual unsigned int GenerateBit()
Generate new random bit and return it.
Base class for unflushable filters.
virtual size_t Sign(RandomNumberGenerator &rng, PK_MessageAccumulator *messageAccumulator, byte *signature) const
Sign and delete the messageAccumulator.
virtual BufferedTransformation * CreateEncryptionFilter(RandomNumberGenerator &rng, BufferedTransformation *attachment=NULL, const NameValuePairs ¶meters=g_nullNameValuePairs) const
Create a new encryption filter.
Classes and functions for the FIPS 140-2 validated library.
virtual void EncryptAndAuthenticate(byte *ciphertext, byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *message, size_t messageLength)
Encrypts and calculates a MAC in one call.
void xorbuf(byte *buf, const byte *mask, size_t count)
Performs an XOR of a buffer with a mask.
virtual bool DecryptAndVerify(byte *message, const byte *mac, size_t macLength, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *ciphertext, size_t ciphertextLength)
Decrypts and verifies a MAC in one call.
virtual size_t MaxDerivedLength() const
Determine maximum number of bytes.
void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize)
Generate a random key or crypto parameters.
std::string IntToString(T value, unsigned int base=10)
Converts a value to a string.
bool VerifyBufsEqual(const byte *buf1, const byte *buf2, size_t count)
Performs a near constant-time comparison of two equally sized buffers.
Exception thrown when an invalid derived key length is encountered.
void SpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength=0)
Prespecifies the data lengths.
Acts as an input discarding Filter or Sink.
int LibraryVersion(...)
Specifies the build-time version of the library.
Crypto++ library namespace.
bool GetValue(const char *name, T &value) const
Get a named value.
virtual DecodingResult Recover(byte *recoveredMessage, PK_MessageAccumulator *messageAccumulator) const
Recover a message from its signature.
bool CanIncorporateEntropy() const
An implementation that returns false.
void IncorporateEntropy(const byte *input, size_t length)
An implementation that throws NotImplemented.
const std::string AAD_CHANNEL
Channel for additional authenticated data.
void DiscardBytes(size_t n)
An implementation that does nothing.
virtual void GetNextIV(RandomNumberGenerator &rng, byte *iv)
Retrieves a secure IV for the next message.
unsigned int BitPrecision(const T &value)
Returns the number of bits required for a value.
size_type size() const
Provides the count of elements in the SecBlock.
virtual void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword length)
Generate random bytes into a BufferedTransformation.
Classes for access to the operating system's random number generators.
Interface for retrieving values given their names.
size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.