I am trying to generate shared secret from remote EC public key(static) and client EC private key(ephemeral). In this process I am successfully able to generate shared secret using ECDH Key agreement available BC library.My work requirement is to use ElGamal key agreement but there is no specific supported Key agreement representing ECKA-ElGamal.
I was wondering if you can help confirm that ECKA-ElGamal is indeed a version of ECKA-ECDH where remote public key is static and client ephemeral key is dymanic.
Code snippet:
//I am using ECDH
KeyAgreement ka = KeyAgreement.getInstance("ECDH","BC");
// clientEphemeralPrivateKey is Client ephemeral Private key already generated
ka.init(clientEphemeralPrivateKey);
//serverECCPublicKey is remote server public key
ka.doPhase(serverECCPublicKey, true);