examples: make key generation doc consistent

This commit is contained in:
Jonas Nick
2024-10-13 19:11:02 +00:00
parent e8908221a4
commit 5bab8f6d3c
4 changed files with 13 additions and 15 deletions

View File

@@ -49,13 +49,13 @@ int main(void) {
assert(return_val);
/*** Key Generation ***/
/* If the secret key is zero or out of range (greater than secp256k1's
* order), we return 1. Note that the probability of this occurring
* is negligible with a properly functioning random number generator. */
if (!fill_random(seckey, sizeof(seckey))) {
printf("Failed to generate randomness\n");
return 1;
}
/* If the secret key is zero or out of range (greater than secp256k1's
* order), we fail. Note that the probability of this occurring is negligible
* with a properly functioning random number generator. */
if (!secp256k1_ec_seckey_verify(ctx, seckey)) {
printf("Generated secret key is invalid. This indicates an issue with the random number generator.\n");
return 1;