Package org.bouncycastle.jcajce.provider.symmetric.util

## Class BaseStreamCipher

- java.lang.Object
- - javax.crypto.CipherSpi
  - - org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher
    - - org.bouncycastle.jcajce.provider.symmetric.util.BaseStreamCipher

- All Implemented Interfaces:
    `PBE`
  Direct Known Subclasses:
    `ARC4.Base`, `ARC4.PBEWithSHAAnd128Bit`, `ARC4.PBEWithSHAAnd40Bit`, `ChaCha.Base`, `ChaCha.Base7539`, `Grain128.Base`, `Grainv1.Base`, `HC128.Base`, `HC256.Base`, `Salsa20.Base`, `VMPC.Base`, `VMPCKSA3.Base`, `XSalsa20.Base`, `Zuc.Zuc128`, `Zuc.Zuc256`

      public class BaseStreamCipher
      extends BaseWrapCipher
      implements PBE

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher

      `BaseWrapCipher.ErasableOutputStream, BaseWrapCipher.InvalidKeyOrParametersException`

    - ### Nested classes/interfaces inherited from interface org.bouncycastle.jcajce.provider.symmetric.util.PBE

      `PBE.Util`

  - ### Field Summary

    - ### Fields inherited from class org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher

      `engineParams, pbeHash, pbeIvSize, pbeKeySize, pbeType, wrapEngine`

    - ### Fields inherited from interface org.bouncycastle.jcajce.provider.symmetric.util.PBE

      `GOST3411, MD2, MD5, OPENSSL, PKCS12, PKCS5S1, PKCS5S1_UTF8, PKCS5S2, PKCS5S2_UTF8, RIPEMD160, SHA1, SHA224, SHA256, SHA3_224, SHA3_256, SHA3_384, SHA3_512, SHA384, SHA512, SM3, TIGER`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `BaseStreamCipher​(StreamCipher engine, int ivLength)` |
    `protected` | `BaseStreamCipher​(StreamCipher engine, int ivLength, int keySizeInBits)` |
    `protected` | `BaseStreamCipher​(StreamCipher engine, int ivLength, int keySizeInBits, int digest)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected byte[]` | `engineDoFinal​(byte[] input, int inputOffset, int inputLen)` |
    `protected int` | `engineDoFinal​(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)` |
    `protected int` | `engineGetBlockSize()` |
    `protected byte[]` | `engineGetIV()` |
    `protected int` | `engineGetKeySize​(java.security.Key key)` |
    `protected int` | `engineGetOutputSize​(int inputLen)` |
    `protected java.security.AlgorithmParameters` | `engineGetParameters()` |
    `protected void` | `engineInit​(int opmode, java.security.Key key, java.security.AlgorithmParameters params, java.security.SecureRandom random)` |
    `protected void` | `engineInit​(int opmode, java.security.Key key, java.security.SecureRandom random)` |
    `protected void` | `engineInit​(int opmode, java.security.Key key, java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)` |
    `protected void` | `engineSetMode​(java.lang.String mode)` | should never be called.
    `protected void` | `engineSetPadding​(java.lang.String padding)` | should never be called.
    `protected byte[]` | `engineUpdate​(byte[] input, int inputOffset, int inputLen)` |
    `protected int` | `engineUpdate​(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)` |

    - ### Methods inherited from class org.bouncycastle.jcajce.provider.symmetric.util.BaseWrapCipher

      `createParametersInstance, engineUnwrap, engineWrap`

    - ### Methods inherited from class javax.crypto.CipherSpi

      `engineDoFinal, engineUpdate, engineUpdateAAD, engineUpdateAAD`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BaseStreamCipher

          protected BaseStreamCipher​(StreamCipher engine,
                                     int ivLength)

    - #### BaseStreamCipher

          protected BaseStreamCipher​(StreamCipher engine,
                                     int ivLength,
                                     int keySizeInBits)

    - #### BaseStreamCipher

          protected BaseStreamCipher​(StreamCipher engine,
                                     int ivLength,
                                     int keySizeInBits,
                                     int digest)

  - ### Method Detail

    - #### engineGetBlockSize

          protected int engineGetBlockSize()

      Overrides:
        `engineGetBlockSize` in class `BaseWrapCipher`

    - #### engineGetIV

          protected byte[] engineGetIV()

      Overrides:
        `engineGetIV` in class `BaseWrapCipher`

    - #### engineGetKeySize

          protected int engineGetKeySize​(java.security.Key key)

      Overrides:
        `engineGetKeySize` in class `BaseWrapCipher`

    - #### engineGetOutputSize

          protected int engineGetOutputSize​(int inputLen)

      Overrides:
        `engineGetOutputSize` in class `BaseWrapCipher`

    - #### engineGetParameters

          protected java.security.AlgorithmParameters engineGetParameters()

      Overrides:
        `engineGetParameters` in class `BaseWrapCipher`

    - #### engineSetMode

          protected void engineSetMode​(java.lang.String mode)
                                throws java.security.NoSuchAlgorithmException

      should never be called.
      Overrides:
        `engineSetMode` in class `BaseWrapCipher`
      Throws:
        `java.security.NoSuchAlgorithmException`

    - #### engineSetPadding

          protected void engineSetPadding​(java.lang.String padding)
                                   throws javax.crypto.NoSuchPaddingException

      should never be called.
      Overrides:
        `engineSetPadding` in class `BaseWrapCipher`
      Throws:
        `javax.crypto.NoSuchPaddingException`

    - #### engineInit

          protected void engineInit​(int opmode,
                                    java.security.Key key,
                                    java.security.spec.AlgorithmParameterSpec params,
                                    java.security.SecureRandom random)
                             throws java.security.InvalidKeyException,
                                    java.security.InvalidAlgorithmParameterException

      Overrides:
        `engineInit` in class `BaseWrapCipher`
      Throws:
        `java.security.InvalidKeyException`
        `java.security.InvalidAlgorithmParameterException`

    - #### engineInit

          protected void engineInit​(int opmode,
                                    java.security.Key key,
                                    java.security.AlgorithmParameters params,
                                    java.security.SecureRandom random)
                             throws java.security.InvalidKeyException,
                                    java.security.InvalidAlgorithmParameterException

      Overrides:
        `engineInit` in class `BaseWrapCipher`
      Throws:
        `java.security.InvalidKeyException`
        `java.security.InvalidAlgorithmParameterException`

    - #### engineInit

          protected void engineInit​(int opmode,
                                    java.security.Key key,
                                    java.security.SecureRandom random)
                             throws java.security.InvalidKeyException

      Overrides:
        `engineInit` in class `BaseWrapCipher`
      Throws:
        `java.security.InvalidKeyException`

    - #### engineUpdate

          protected byte[] engineUpdate​(byte[] input,
                                        int inputOffset,
                                        int inputLen)

      Overrides:
        `engineUpdate` in class `BaseWrapCipher`

    - #### engineUpdate

          protected int engineUpdate​(byte[] input,
                                     int inputOffset,
                                     int inputLen,
                                     byte[] output,
                                     int outputOffset)
                              throws javax.crypto.ShortBufferException

      Overrides:
        `engineUpdate` in class `BaseWrapCipher`
      Throws:
        `javax.crypto.ShortBufferException`

    - #### engineDoFinal

          protected byte[] engineDoFinal​(byte[] input,
                                         int inputOffset,
                                         int inputLen)

      Overrides:
        `engineDoFinal` in class `BaseWrapCipher`

    - #### engineDoFinal

          protected int engineDoFinal​(byte[] input,
                                      int inputOffset,
                                      int inputLen,
                                      byte[] output,
                                      int outputOffset)
                               throws javax.crypto.ShortBufferException

      Overrides:
        `engineDoFinal` in class `BaseWrapCipher`
      Throws:
        `javax.crypto.ShortBufferException`