mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
Scrub keys from memory just before scope end.
Partially implements #74. Securely erases keys from memory after they are no longer needed. Might have a performance impact, which I haven't measured (perf measurements aren't generally reliable on laptops). Thanks to @stoffu for the suggestion to specialize the pod_to_hex/hex_to_pod functions. Using overloads + SFINAE instead generalizes it so other types can be marked as scrubbed without adding more boilerplate.
This commit is contained in:
parent
38ecd0526e
commit
7193b89fe5
6 changed files with 60 additions and 23 deletions
|
@ -108,7 +108,7 @@ namespace epee
|
|||
template<typename T>
|
||||
constexpr bool has_padding() noexcept
|
||||
{
|
||||
return !std::is_pod<T>() || alignof(T) != 1;
|
||||
return !std::is_pod<T>::value || alignof(T) != 1;
|
||||
}
|
||||
|
||||
//! \return Cast data from `src` as `span<const std::uint8_t>`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue