For signature schemes we should find a way to restrict the usage of secure (non-swapable) memory to the key generation and the private (signing) operation. For this purpose, we might hand to each function that needs to allocate memory a pointer to an allocation function. I think this would be the best solution. The reason is that we assume that a hash is signed (and not the message directly, in which case it would have to be treated as a secret).
ML-KEM should use secure memory also in the encapsulation operation, as the message is a secret.
@TJ-91
For signature schemes we should find a way to restrict the usage of secure (non-swapable) memory to the key generation and the private (signing) operation. For this purpose, we might hand to each function that needs to allocate memory a pointer to an allocation function. I think this would be the best solution. The reason is that we assume that a hash is signed (and not the message directly, in which case it would have to be treated as a secret).
ML-KEM should use secure memory also in the encapsulation operation, as the message is a secret.
@TJ-91