Class McElieceFujisakiCipherSpi

    • Method Detail

      • update

        public byte[] update​(byte[] input,
                             int inOff,
                             int inLen)
        Continue a multiple-part encryption or decryption operation.
        Specified by:
        update in class AsymmetricHybridCipher
        Parameters:
        input - byte array containing the next part of the input
        inOff - index in the array where the input starts
        inLen - length of the input
        Returns:
        the processed byte array.
      • doFinal

        public byte[] doFinal​(byte[] input,
                              int inOff,
                              int inLen)
                       throws javax.crypto.BadPaddingException
        Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted or decrypted, depending on how this cipher was initialized.
        Specified by:
        doFinal in class AsymmetricHybridCipher
        Parameters:
        input - the input buffer
        inOff - the offset in input where the input starts
        inLen - the input length
        Returns:
        the new buffer with the result
        Throws:
        javax.crypto.BadPaddingException - on deryption errors.
      • encryptOutputSize

        protected int encryptOutputSize​(int inLen)
        Description copied from class: AsymmetricHybridCipher
        Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in encryption mode when given input of the specified length.
        Specified by:
        encryptOutputSize in class AsymmetricHybridCipher
        Parameters:
        inLen - the length of the input
        Returns:
        the output size
      • decryptOutputSize

        protected int decryptOutputSize​(int inLen)
        Description copied from class: AsymmetricHybridCipher
        Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in decryption mode when given input of the specified length.
        Specified by:
        decryptOutputSize in class AsymmetricHybridCipher
        Parameters:
        inLen - the length of the input
        Returns:
        the output size
      • initCipherEncrypt

        protected void initCipherEncrypt​(java.security.Key key,
                                         java.security.spec.AlgorithmParameterSpec params,
                                         java.security.SecureRandom sr)
                                  throws java.security.InvalidKeyException,
                                         java.security.InvalidAlgorithmParameterException
        Description copied from class: AsymmetricHybridCipher
        Initialize the AsymmetricHybridCipher with a certain key for data encryption.
        Specified by:
        initCipherEncrypt in class AsymmetricHybridCipher
        Parameters:
        key - the key which has to be used to encrypt data
        params - the algorithm parameters
        sr - the source of randomness
        Throws:
        java.security.InvalidKeyException - if the given key is inappropriate for initializing this cipher.
        java.security.InvalidAlgorithmParameterException - if the given parameters are inappropriate for initializing this cipher.
      • initCipherDecrypt

        protected void initCipherDecrypt​(java.security.Key key,
                                         java.security.spec.AlgorithmParameterSpec params)
                                  throws java.security.InvalidKeyException,
                                         java.security.InvalidAlgorithmParameterException
        Description copied from class: AsymmetricHybridCipher
        Initialize the AsymmetricHybridCipher with a certain key for data encryption.
        Specified by:
        initCipherDecrypt in class AsymmetricHybridCipher
        Parameters:
        key - the key which has to be used to decrypt data
        params - the algorithm parameters
        Throws:
        java.security.InvalidKeyException - if the given key is inappropriate for initializing this cipher
        java.security.InvalidAlgorithmParameterException - if the given parameters are inappropriate for initializing this cipher.
      • getName

        public java.lang.String getName()
        Specified by:
        getName in class CipherSpiExt
        Returns:
        the name of this cipher
      • getKeySize

        public int getKeySize​(java.security.Key key)
                       throws java.security.InvalidKeyException
        Description copied from class: CipherSpiExt
        Return the key size of the given key object in bits.
        Specified by:
        getKeySize in class CipherSpiExt
        Parameters:
        key - the key object
        Returns:
        the key size in bits of the given key object
        Throws:
        java.security.InvalidKeyException - if key is invalid.