ElGamal encryption through OpenSSL backend, tested and proven to work within OpenPGP specification, is available in RNP sources: https://github.com/rnpgp/rnp/blob/main/src/lib/crypto/elgamal_ossl.cpp