secrets
secrets copied to clipboard
Align `Secret` to the page size of the current system.
Closes #109.
Multiple Secret<T> instances could previously share the same memory page. This would cause funlock to unlock multiple secrets at a time. With secrets aligned to page boundaries, we ensure that no two secrets can share the same page.
Additionally we had detected the multiple-unlock case in Windows, which returns an error when funlock is called on an already-unlocked page. We swallowed errors in this case, but with this change we no longer need to do so.
I hate this approach. I'm going to play around and see if I can get a #[repr(align(…))] one to work.