>>I am really worried about the negative return value being added. Existing third party callers might not be ready to handle this correctly (i.e. if they cast the return to size_t without checking). Could we instead return 0? (In all the added error returns in this PR.)
Rust fixes it.
Sometimes I like to think of how little performance would be lost and how much would be gained by just collectively deciding to use Option/Result instead of sentinel values.
Things like the dumb (not like I'm any individual being dumb. Just collective accumulated stupidity) a*hole vulnerability some weeks ago. That wasn't even performance sensitive.
Be sure to let us know when your equivalent Rust crypto library is available.
Rust does not fix existing third party callers.