Class KyberKeyAgreement


  • public class KyberKeyAgreement
    extends java.lang.Object
    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 
      Constructor Description
      KyberKeyAgreement()
      Constructor for the Kyber key agreement functionality.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.crypto.SecretKey generateSecret​(java.lang.String algorithm)
      - Creates the shared secret and returns it as a SecretKey object of the specified algorithm.
      void init​(java.security.Key hybridKey, ECPrivateHWKey ecPrivKey, ECPublicKey ecPubKey, byte[] encryptedValue, byte[] iv)
      Initializes the KyberKeyAgreement object.
      void init​(java.security.Key hybridKey, ECPrivateHWKey ecPrivKey, ECPublicKey ecPubKey, byte[] encryptedValue, byte[] iv, java.security.spec.AlgorithmParameterSpec params)
      Initializes the KyberKeyAgreement object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KyberKeyAgreement

        public KyberKeyAgreement()
        Constructor for the Kyber key agreement functionality.
    • Method Detail

      • init

        public void init​(java.security.Key hybridKey,
                         ECPrivateHWKey ecPrivKey,
                         ECPublicKey ecPubKey,
                         byte[] encryptedValue,
                         byte[] iv,
                         java.security.spec.AlgorithmParameterSpec params)
                  throws java.security.InvalidKeyException,
                         java.security.InvalidAlgorithmParameterException
        Initializes the KyberKeyAgreement object.
        Parameters:
        hybridKey - A CCA AES CIPHER key or a Kyber private key
        ecPrivKey - An ECPrivateKey created by Bob.
        ecPubKey - An ECPublicKey created by Alice.
        aesEncryptedValue - The encrypted AES value generated by a KyberDerivationInput.encrypt() call.
        iv - The AES encryption initialization vector
        params - The algorithm parameters for the key agreement operation
        Throws:
        java.security.InvalidKeyException
        java.security.InvalidAlgorithmParameterException
      • init

        public void init​(java.security.Key hybridKey,
                         ECPrivateHWKey ecPrivKey,
                         ECPublicKey ecPubKey,
                         byte[] encryptedValue,
                         byte[] iv)
                  throws java.security.InvalidKeyException
        Initializes the KyberKeyAgreement object.
        Parameters:
        hybridKey - A CCA AES CIPHER key or a Kyber private key
        ecPrivKey - An ECPrivateKey created by Bob.
        ecPubKey - An ECPublicKey created by Alice.
        aesEncryptedValue - The encrypted AES value generated by a KyberDerivationInput.encrypt() call.
        iv - The AES encryption initialization vector
        Throws:
        java.security.InvalidKeyException
      • generateSecret

        public javax.crypto.SecretKey generateSecret​(java.lang.String algorithm)
                                              throws java.security.NoSuchAlgorithmException,
                                                     java.security.InvalidKeyException
        - Creates the shared secret and returns it as a SecretKey object of the specified algorithm.
        Parameters:
        algorithm -
        keyBitLength -
        Returns:
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.InvalidKeyException