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

Method Put2

src/cryptopp/ida.cpp:253–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253size_t SecretSharing::Put2(const byte *begin, size_t length, int messageEnd, bool blocking)
254{
255 if (!blocking)
256 throw BlockingInputOnly("SecretSharing");
257
258 SecByteBlock buf(UnsignedMin(256, length));
259 unsigned int threshold = m_ida.GetThreshold();
260 while (length > 0)
261 {
262 size_t len = STDMIN(length, buf.size());
263 m_ida.ChannelData(0xffffffff, begin, len, false);
264 for (unsigned int i=0; i<threshold-1; i++)
265 {
266 m_rng.GenerateBlock(buf, len);
267 m_ida.ChannelData(i, buf, len, false);
268 }
269 length -= len;
270 begin += len;
271 }
272
273 if (messageEnd)
274 {
275 m_ida.SetAutoSignalPropagation(messageEnd-1);
276 if (m_pad)
277 {
278 SecretSharing::Put(1);
279 while (m_ida.InputBuffered(0xffffffff) > 0)
280 SecretSharing::Put(0);
281 }
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);
285 }
286
287 return 0;
288}
289
290void SecretRecovery::IsolatedInitialize(const NameValuePairs &parameters)
291{

Callers

nothing calls this directly

Calls 12

BlockingInputOnlyClass · 0.85
UnsignedMinFunction · 0.85
AttachedTransformationFunction · 0.85
OutputClass · 0.85
GetThresholdMethod · 0.80
ChannelDataMethod · 0.80
InputBufferedMethod · 0.80
PutFunction · 0.70
sizeMethod · 0.45
GenerateBlockMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected