19 #if (defined(_MSC_VER) && (_MSC_VER < 1400)) && !defined(__MWERKS__) 21 typedef std::reverse_bidirectional_iterator<const byte *, const byte>
RevIt;
22 #elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) 23 typedef std::reverse_iterator<const byte *, std::random_access_iterator_tag, const byte>
RevIt;
25 typedef std::reverse_iterator<const byte *>
RevIt;
35 throw InvalidArgument(
"RawIDA: RecoveryThreshold must be greater than 0");
49 if (parameters.
GetValue(
"OutputChannelID", outputChannelID))
56 for (
unsigned int i=0; i< (
unsigned int)(nShares); i++)
91 std::map<word32, unsigned int>::const_iterator it =
m_inputChannelMap.find(channelId);
105 if (size < 4 && size + length >= 4)
214 std::vector<MessageQueue> inputQueues;
215 std::vector<word32> inputChannelIds;
224 inputQueues[i].GetNextMessage();
250 m_ida.IsolatedInitialize(parameters);
259 unsigned int threshold = m_ida.GetThreshold();
263 m_ida.ChannelData(0xffffffff, begin, len,
false);
264 for (
unsigned int i=0; i<threshold-1; i++)
266 m_rng.GenerateBlock(buf, len);
267 m_ida.ChannelData(i, buf, len,
false);
275 m_ida.SetAutoSignalPropagation(messageEnd-1);
279 while (m_ida.InputBuffered(0xffffffff) > 0)
282 m_ida.ChannelData(0xffffffff, NULL, 0,
true);
283 for (
unsigned int i=0; i<m_ida.GetThreshold()-1; i++)
284 m_ida.ChannelData(i, NULL, 0,
true);
322 m_ida.IsolatedInitialize(parameters);
332 m_ida.ChannelData(m_nextChannel, begin, 1,
false);
335 if (m_nextChannel == m_ida.GetThreshold())
341 m_ida.SetAutoSignalPropagation(messageEnd-1);
344 for (
word32 i=0; i<m_ida.GetThreshold(); i++)
345 m_ida.ChannelData(i, NULL, 0,
true);
376 m_queue.TransferAllTo(paddingRemover);
388 const byte *
const end = begin + length;
390 if (m_possiblePadding)
392 size_t len = std::find_if(begin, end, std::bind2nd(std::not_equal_to<byte>(),
byte(0))) - begin;
399 while (m_zeroCount--)
402 m_possiblePadding =
false;
405 const byte *
x = std::find_if(
RevIt(end),
RevIt(begin), std::bind2nd(std::not_equal_to<byte>(),
byte(0))).base();
406 if (x != begin && *(x-1) == 1)
409 m_possiblePadding =
true;
410 m_zeroCount = end -
x;
417 m_possiblePadding =
false;
418 Output(0, begin, length, messageEnd, blocking);
An invalid argument was detected.
std::vector< MessageQueue > m_inputQueues
std::vector< word32 > m_outputChannelIds
std::vector< word32 > m_outputToInput
std::vector< word32 > m_inputChannelIds
T GetValueWithDefault(const char *name, T defaultValue) const
Get a named value.
unsigned int NumberOfMessages() const
Provides the number of meesages processed by this object.
void resize(size_type newSize)
Change size and preserve contents.
std::vector< SecBlock< word32 > > m_v
#define NAMESPACE_BEGIN(x)
CRYPTOPP_DLL bool GetIntValue(const char *name, int &value) const
Get a named value with type int.
size_type size() const
Provides the count of elements in the SecBlock.
InputChannelMap m_inputChannelMap
Library configuration file.
unsigned int InsertInputChannel(word32 channelId)
std::string WordToString(T value, ByteOrder order=BIG_ENDIAN_ORDER)
void New(size_type newSize)
Change size without preserving contents.
Combines two sets of NameValuePairs.
std::vector< std::string > m_outputChannelIdStrings
Classes for performing mathematics over different fields.
lword MaxRetrievable() const
Provides the number of bytes ready for retrieval.
void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs)
Initialize or reinitialize this object, without signal propagation.
concurrent_queue< JitTask > m_queue
virtual void OutputMessageEnds()
void AddOutputChannel(word32 channelId)
std::vector< ByteQueue > m_outputQueues
size_t Output(int outputSite, const byte *inString, size_t length, int messageEnd, bool blocking, const std::string &channel=DEFAULT_CHANNEL)
Forward processed data on to attached transformation.
bool AnyRetrievable() const
Determines whether bytes are ready for retrieval.
Classes and functions for schemes over GF(2^32)
bool GetValue(const char *name, T &value) const
Get a named value.
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
CRYPTOPP_DLL int GetIntValueWithDefault(const char *name, int defaultValue) const
Get a named value with type int, with default.
BufferedTransformation * AttachedTransformation()
Retrieve attached transformation.
unsigned int m_channelsFinished
unsigned int m_channelsReady
const T1 UnsignedMin(const T1 &a, const T2 &b)
Safe comparison of values that could be neagtive and incorrectly promoted.
ANONYMOUS_NAMESPACE_BEGIN const CryptoPP::GF2_32 field
size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
unsigned int LookupInputChannel(word32 channelId) const
const T & STDMIN(const T &a, const T &b)
Replacement function for std::min.
#define CRYPTOPP_ASSERT(exp)
Classes for polynomial basis and operations.
Redirect input to another BufferedTransformation without owning it.
Data structure used to store byte strings.
void PrepareBulkPolynomialInterpolationAt(const Ring &ring, Element *v, const Element &position, const Element x[], const Element w[], unsigned int n)
iterator begin()
Provides an iterator pointing to the first element in the memory block.
#define ANONYMOUS_NAMESPACE_BEGIN
void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs)
Initialize or reinitialize this object, without signal propagation.
void PrepareInterpolation()
NAMESPACE_END typedef std::reverse_iterator< const byte * > RevIt
void ProcessInputQueues()
InputChannelMap::iterator m_lastMapPosition
uint8_t const size_t const size
int GetAutoSignalPropagation() const
Retrieve automatic signal propagation value.
void IsolatedInitialize(const NameValuePairs ¶meters=g_nullNameValuePairs)
Initialize or reinitialize this object, without signal propagation.
std::vector< char * > parameters
virtual void FlushOutputQueues()
lword InputBuffered(word32 channelId) const
void ComputeV(unsigned int)
void ChannelData(word32 channelId, const byte *inString, size_t length, bool messageEnd)
size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking)
Input multiple bytes for processing.
void PrepareBulkPolynomialInterpolation(const Ring &ring, Element *w, const Element x[], unsigned int n)
Element BulkPolynomialInterpolateAt(const Ring &ring, const Element y[], const Element v[], unsigned int n)
Classes for Rabin's Information Dispersal and Shamir's Secret Sharing algorithms. ...
Interface for retrieving values given their names.