openssl provides 2 subcommands GENPKEY and PKEY which can be used to generate a private and public key pair, eg. using algorithm x25519
e.g.
openssl genpkey -algorithm x25519 > key.pem
-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VuBCIEIIi4uhhOCvU8v4Vi7+qORXuIUYlaz+nlPQs8ubkgwnpy
-----END PRIVATE KEY-----
openssl pkey -in key.pem -pubout
-----BEGIN PUBLIC KEY-----
MCowBQYDK2VuAyEACkVQ78NAnw4QtUeCJjROvObTuYP8CvuHxzWQP8GsmVc=
-----END PUBLIC KEY-----
library crypto does currently not provide any predicates for private/public key generation.
I'd then suggest to add 2 new predicates in library crypto
e.g
%% crypto_private_key(+Algo, -PrivateKey, +Options) is nondet
% where PrivateKey is a random private key generated by openssl using algorithm Algo
% generates an infinite number of keys on backtracking
and
%% crypto_public_key(-PrivateKey, +PublicKey, +Options) is det
% where PublicKey is the public key associated with PrivateKey
For reference, see discussion in Curve25519 in library crypto
openssl provides 2 subcommands GENPKEY and PKEY which can be used to generate a private and public key pair, eg. using algorithm x25519
e.g.
library crypto does currently not provide any predicates for private/public key generation.
I'd then suggest to add 2 new predicates in library crypto
e.g
%% crypto_private_key(+Algo, -PrivateKey, +Options) is nondet
% where PrivateKey is a random private key generated by openssl using algorithm Algo
% generates an infinite number of keys on backtracking
and
%% crypto_public_key(-PrivateKey, +PublicKey, +Options) is det
% where PublicKey is the public key associated with PrivateKey
For reference, see discussion in Curve25519 in library crypto