MCPcopy Create free account
hub / github.com/LUX-Core/lux / ProcessInputQueues

Method ProcessInputQueues

src/cryptopp/ida.cpp:169–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169void RawIDA::ProcessInputQueues()
170{
171 bool finished = (m_channelsFinished == size_t(m_threshold));
172 unsigned int i;
173
174 while (finished ? m_channelsReady > 0 : m_channelsReady == size_t(m_threshold))
175 {
176 m_channelsReady = 0;
177 for (i=0; i<size_t(m_threshold); i++)
178 {
179 MessageQueue &queue = m_inputQueues[i];
180 queue.GetWord32(m_y[i]);
181
182 if (finished)
183 m_channelsReady += queue.AnyRetrievable();
184 else
185 m_channelsReady += queue.NumberOfMessages() > 0 || queue.MaxRetrievable() >= 4;
186 }
187
188 for (i=0; (unsigned int)i<m_outputChannelIds.size(); i++)
189 {
190 if (m_outputToInput[i] != size_t(m_threshold))
191 m_outputQueues[i].PutWord32(m_y[m_outputToInput[i]]);
192 else if (m_v[i].size() == size_t(m_threshold))
193 m_outputQueues[i].PutWord32(BulkPolynomialInterpolateAt(field, m_y.begin(), m_v[i].begin(), m_threshold));
194 else
195 {
196 m_u.resize(m_threshold);
197 PrepareBulkPolynomialInterpolationAt(field, m_u.begin(), m_outputChannelIds[i], &(m_inputChannelIds[0]), m_w.begin(), m_threshold);
198 m_outputQueues[i].PutWord32(BulkPolynomialInterpolateAt(field, m_y.begin(), m_u.begin(), m_threshold));
199 }
200 }
201 }
202
203 if (m_outputChannelIds.size() > 0 && m_outputQueues[0].AnyRetrievable())
204 FlushOutputQueues();
205
206 if (finished)
207 {
208 OutputMessageEnds();
209
210 m_channelsReady = 0;
211 m_channelsFinished = 0;
212 m_v.clear();
213
214 std::vector<MessageQueue> inputQueues;
215 std::vector<word32> inputChannelIds;
216
217 inputQueues.swap(m_inputQueues);
218 inputChannelIds.swap(m_inputChannelIds);
219 m_inputChannelMap.clear();
220 m_lastMapPosition = m_inputChannelMap.end();
221
222 for (i=0; i<size_t(m_threshold); i++)
223 {
224 inputQueues[i].GetNextMessage();
225 inputQueues[i].TransferAllTo(*AttachedTransformation(), WordToString(inputChannelIds[i]));
226 }

Callers

nothing calls this directly

Calls 15

AttachedTransformationFunction · 0.85
WordToStringFunction · 0.85
GetWord32Method · 0.80
AnyRetrievableMethod · 0.80
NumberOfMessagesMethod · 0.80
PutWord32Method · 0.80
MaxRetrievableMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected