Just some minor observation:
There are various variants of memory functions in tfm core
Why are these functions duplicated? It would be Ok if they address some additional security concerns (that I currently don’t understand). But todays implementation just add complexity.
Reinhard