Update last two bytes with new page ordinal (instead of creating new page AAD from scratch)
| 755 | // Update last two bytes with new page ordinal (instead of creating new page AAD |
| 756 | // from scratch) |
| 757 | void QuickUpdatePageAad(int32_t new_page_ordinal, std::string* AAD) { |
| 758 | CheckPageOrdinal(new_page_ordinal); |
| 759 | const std::string page_ordinal_bytes = |
| 760 | ShortToBytesLe(static_cast<int16_t>(new_page_ordinal)); |
| 761 | std::memcpy(AAD->data() + AAD->length() - 2, page_ordinal_bytes.data(), 2); |
| 762 | } |
| 763 | |
| 764 | void RandBytes(unsigned char* buf, size_t num) { |
| 765 | if (num > static_cast<size_t>(std::numeric_limits<int>::max())) { |
no test coverage detected