| 251 | } |
| 252 | |
| 253 | size_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 | |
| 290 | void SecretRecovery::IsolatedInitialize(const NameValuePairs ¶meters) |
| 291 | { |
nothing calls this directly
no test coverage detected