/* All the functions in this file are considered "secure", specifically:
- Constant time in the input, i.e. the input can be a secret[2]
- Small and auditable code base, incl. simple types
- Either, no local variables = no need to clear them before exit (most functions)
- Or, only static allocation + clear local variable before exit (fd_ed25519_scalar_mul_base_const_time)
- Clear registers via FD_FN_SENSITIVE[3]
- C safety
*/
libsodium[4] implements similar mechanisms, and Linux kernel encryption code does too (example: use of kfree_sensitive)[5]. However, firedancer appears to better avoid moving secrets outside of CPU registers, and [3] explains that libraries such as libsodium have inadequate zeroisation, something which firedancer claims to improve upon.[1] https://github.com/firedancer-io/firedancer/blob/main/src/ba...
[2] https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplic...
[3] https://eprint.iacr.org/2023/1713
[4] https://libsodium.gitbook.io/doc/internals#security-first
[5] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...