The tests in #1698 reminded me that some functions, e.g., secp256k1_ec_pubkey_cmp
, may call the illegal callback more than once (see #1390 (review) for more context). This PR clarifies the API docs to state explicitly that this is possible.
This is the simplest solution. Any production code should crash anyway if it encounters a callback. And in debug code or in our test code, it doesn’t really matter whether you see an error message once or twice.
The alternative is to provide a guarantee that the callback is called only once. But that would make our code more complex for no good reason.
The second commit fixes a few typos, wording, and consistency.