Class KyberKeyAgreement
java.lang.Object
com.ibm.crypto.hdwrCCA.provider.KyberKeyAgreement
This class is a concrete implementation of the Service Provider Interface
(SPI) for key agreement using the CRYSTALS-Kyber key
agreement algorithm.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateSecret(String algorithm) - Creates the shared secret and returns it as a SecretKey object of the specified algorithm.voidinit(Key hybridKey, ECPrivateHWKey ecPrivKey, ECPublicKey ecPubKey, byte[] encryptedValue, byte[] iv) Initializes the KyberKeyAgreement object.voidinit(Key hybridKey, ECPrivateHWKey ecPrivKey, ECPublicKey ecPubKey, byte[] encryptedValue, byte[] iv, AlgorithmParameterSpec params) Initializes the KyberKeyAgreement object.
-
Constructor Details
-
KyberKeyAgreement
public KyberKeyAgreement()Constructor for the Kyber key agreement functionality.
-
-
Method Details
-
init
public void init(Key hybridKey, ECPrivateHWKey ecPrivKey, ECPublicKey ecPubKey, byte[] encryptedValue, byte[] iv, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException Initializes the KyberKeyAgreement object.- Parameters:
hybridKey- A CCA AES CIPHER key or a Kyber private keyecPrivKey- An ECPrivateKey created by Bob.ecPubKey- An ECPublicKey created by Alice.iv- The AES encryption initialization vectorparams- The algorithm parameters for the key agreement operationaesEncryptedValue- The encrypted AES value generated by a KyberDerivationInput.encrypt() call.- Throws:
InvalidKeyExceptionInvalidAlgorithmParameterException
-
init
public void init(Key hybridKey, ECPrivateHWKey ecPrivKey, ECPublicKey ecPubKey, byte[] encryptedValue, byte[] iv) throws InvalidKeyException Initializes the KyberKeyAgreement object.- Parameters:
hybridKey- A CCA AES CIPHER key or a Kyber private keyecPrivKey- An ECPrivateKey created by Bob.ecPubKey- An ECPublicKey created by Alice.iv- The AES encryption initialization vectoraesEncryptedValue- The encrypted AES value generated by a KyberDerivationInput.encrypt() call.- Throws:
InvalidKeyException
-
generateSecret
public SecretKey generateSecret(String algorithm) throws NoSuchAlgorithmException, InvalidKeyException - Creates the shared secret and returns it as a SecretKey object of the specified algorithm.- Parameters:
algorithm-keyBitLength-- Returns:
- Throws:
NoSuchAlgorithmExceptionInvalidKeyException
-