| 448 | } |
| 449 | |
| 450 | void entropy_get(uchar *buf, int len) |
| 451 | { |
| 452 | ASSERT(len <= ENTPOOLSIZE); |
| 453 | uchar *tempbuf = new uchar[len + SHA512SIZE]; |
| 454 | memcpy(tempbuf, entpool, len); |
| 455 | memcpy(entpool + ENTPOOLSIZE, entpool, 128); |
| 456 | sha512(tempbuf, entpool, ENTPOOLSIZE); |
| 457 | loopi(len) sha512_compress((uint64_t*)(tempbuf + (i & ~7)), entpool + rnd(ENTPOOLSIZE / 8) * 8); |
| 458 | memcpy(buf, tempbuf, len); |
| 459 | delete[] tempbuf; |
| 460 | } |
| 461 | |
| 462 | #ifndef STANDALONE |
| 463 | /////////////////////////////////////////////// key derivation function //////////////////////////////////////////////////////////////////////// |
no test coverage detected