Commit 478b53fe authored by Milan Broz's avatar Milan Broz
Browse files

Fix some typos and relicts in ECC example.

parent 20b2437f
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ static void print_pkey(EVP_PKEY *pkey)
	BN_clear_free(bn_priv);
}

/* Quietly ignore errors here, as not all curves can be exported here */
/* Quietly ignore errors here, as not all curves attributes can be exported */
static void export_pkey(EVP_PKEY *pkey)
{
	BIO *bio = BIO_new_fp(stdout, BIO_NOCLOSE);
@@ -65,8 +65,7 @@ static EVP_PKEY *ec_keygen(char *name)
		goto out;
	}

	params[0] = OSSL_PARAM_construct_utf8_string(
		OSSL_PKEY_PARAM_GROUP_NAME, name, 0);
	params[0] = OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME, name, 0);
	params[1] = OSSL_PARAM_construct_end();

	if (!EVP_PKEY_CTX_set_params(genctx, params)) {
@@ -105,10 +104,6 @@ out:
	return key;
}

static void sign_verify(EVP_PKEY *pkey)
{
}

/*
 * ED25519,ED448 - sign and verify C string as an example.
 * Edward curves supports only one-shot interface.
@@ -180,7 +175,7 @@ int main(int arc, char **argv)
	 * EVP_EC_gen("ED25519");
	 * EVP_PKEY_Q_keygen(NULL, NULL, "EC", "P-521");
	 *
	 * Curve oparameters:
	 * Curve parameters:
	 * https://www.openssl.org/docs/man3.0/man7/EVP_PKEY-EC.html
	 *	- EC requires OSSL_PKEY_PARAM_GROUP_NAME (EC curve type)
	 * https://www.openssl.org/docs/man3.0/man7/EVP_PKEY-RSA.html
@@ -196,7 +191,6 @@ int main(int arc, char **argv)
	pkey = ec_keygen("P-256");
	print_pkey(pkey);
	export_pkey(pkey);
	sign_verify(pkey);
	EVP_PKEY_free(pkey);

	/*