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

## Class BaseMac

- java.lang.Object
- - javax.crypto.MacSpi
  - - org.bouncycastle.jcajce.provider.symmetric.util.BaseMac

- All Implemented Interfaces:
    `PBE`
  Direct Known Subclasses:
    `AES.AESCCMMAC`, `AES.AESCMAC`, `AES.AESGMAC`, `AES.Poly1305`, `ARIA.GMAC`, `ARIA.Poly1305`, `Blowfish.CMAC`, `Camellia.GMAC`, `Camellia.Poly1305`, `CAST6.GMAC`, `CAST6.Poly1305`, `DES.CBCMAC`, `DES.CMAC`, `DES.DES64`, `DES.DES64with7816d4`, `DES.DES9797Alg3`, `DES.DES9797Alg3with7816d4`, `DES.DESCFB8`, `DESede.CBCMAC`, `DESede.CMAC`, `DESede.DESede64`, `DESede.DESede64with7816d4`, `DESede.DESedeCFB8`, `DSTU7564.HashMac256`, `DSTU7564.HashMac384`, `DSTU7564.HashMac512`, `DSTU7624.GMAC`, `DSTU7624.GMAC128`, `DSTU7624.GMAC256`, `DSTU7624.GMAC512`, `GOST28147.Mac`, `GOST3411.HashMac`, `GOST3411.HashMac2012_256`, `GOST3411.HashMac2012_512`, `GOST3412_2015.Mac`, `IDEA.CFB8Mac`, `IDEA.Mac`, `Keccak.HashMac224`, `Keccak.HashMac256`, `Keccak.HashMac288`, `Keccak.HashMac384`, `Keccak.HashMac512`, `MD2.HashMac`, `MD4.HashMac`, `MD5.HashMac`, `Noekeon.GMAC`, `Noekeon.Poly1305`, `Poly1305.Mac`, `RC2.CBCMAC`, `RC2.CFB8MAC`, `RC5.CFB8Mac32`, `RC5.Mac32`, `RC6.GMAC`, `RC6.Poly1305`, `RIPEMD128.HashMac`, `RIPEMD160.HashMac`, `RIPEMD160.PBEWithHmac`, `RIPEMD256.HashMac`, `RIPEMD320.HashMac`, `SEED.CMAC`, `SEED.GMAC`, `SEED.Poly1305`, `Serpent.Poly1305`, `Serpent.SerpentGMAC`, `Serpent.TSerpentGMAC`, `SHA1.HashMac`, `SHA1.SHA1Mac`, `SHA224.HashMac`, `SHA256.HashMac`, `SHA3.HashMacSHA3`, `SHA384.HashMac`, `SHA384.OldSHA384`, `SHA512.HashMac`, `SHA512.HashMacT224`, `SHA512.HashMacT256`, `SHA512.OldSHA512`, `Shacal2.CMAC`, `SipHash.Mac24`, `SipHash.Mac48`, `SipHash128.Mac24`, `SipHash128.Mac48`, `Skein.HashMac_1024_1024`, `Skein.HashMac_1024_384`, `Skein.HashMac_1024_512`, `Skein.HashMac_256_128`, `Skein.HashMac_256_160`, `Skein.HashMac_256_224`, `Skein.HashMac_256_256`, `Skein.HashMac_512_128`, `Skein.HashMac_512_160`, `Skein.HashMac_512_224`, `Skein.HashMac_512_256`, `Skein.HashMac_512_384`, `Skein.HashMac_512_512`, `Skein.SkeinMac_1024_1024`, `Skein.SkeinMac_1024_384`, `Skein.SkeinMac_1024_512`, `Skein.SkeinMac_256_128`, `Skein.SkeinMac_256_160`, `Skein.SkeinMac_256_224`, `Skein.SkeinMac_256_256`, `Skein.SkeinMac_512_128`, `Skein.SkeinMac_512_160`, `Skein.SkeinMac_512_224`, `Skein.SkeinMac_512_256`, `Skein.SkeinMac_512_384`, `Skein.SkeinMac_512_512`, `Skipjack.Mac`, `Skipjack.MacCFB8`, `SM3.HashMac`, `SM4.CMAC`, `SM4.GMAC`, `SM4.Poly1305`, `Threefish.CMAC_1024`, `Threefish.CMAC_256`, `Threefish.CMAC_512`, `Tiger.HashMac`, `Tiger.PBEWithHashMac`, `Tiger.TigerHmac`, `Twofish.GMAC`, `Twofish.Poly1305`, `VMPC.Mac`, `Whirlpool.HashMac`, `Zuc.ZucMac128`, `Zuc.ZucMac256`, `Zuc.ZucMac256_32`, `Zuc.ZucMac256_64`

      public class BaseMac
      extends javax.crypto.MacSpi
      implements PBE

- - ### Nested Class Summary

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

      `PBE.Util`

  - ### Field Summary

    - ### 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` | `BaseMac​(Mac macEngine)` |
    `protected` | `BaseMac​(Mac macEngine, int scheme, int pbeHash, int keySize)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected byte[]` | `engineDoFinal()` |
    `protected int` | `engineGetMacLength()` |
    `protected void` | `engineInit​(java.security.Key key, java.security.spec.AlgorithmParameterSpec params)` |
    `protected void` | `engineReset()` |
    `protected void` | `engineUpdate​(byte input)` |
    `protected void` | `engineUpdate​(byte[] input, int offset, int len)` |

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

      `clone, engineUpdate`

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

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

- - ### Constructor Detail

    - #### BaseMac

          protected BaseMac​(Mac macEngine)

    - #### BaseMac

          protected BaseMac​(Mac macEngine,
                            int scheme,
                            int pbeHash,
                            int keySize)

  - ### Method Detail

    - #### engineInit

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

      Specified by:
        `engineInit` in class `javax.crypto.MacSpi`
      Throws:
        `java.security.InvalidKeyException`
        `java.security.InvalidAlgorithmParameterException`

    - #### engineGetMacLength

          protected int engineGetMacLength()

      Specified by:
        `engineGetMacLength` in class `javax.crypto.MacSpi`

    - #### engineReset

          protected void engineReset()

      Specified by:
        `engineReset` in class `javax.crypto.MacSpi`

    - #### engineUpdate

          protected void engineUpdate​(byte input)

      Specified by:
        `engineUpdate` in class `javax.crypto.MacSpi`

    - #### engineUpdate

          protected void engineUpdate​(byte[] input,
                                      int offset,
                                      int len)

      Specified by:
        `engineUpdate` in class `javax.crypto.MacSpi`

    - #### engineDoFinal

          protected byte[] engineDoFinal()

      Specified by:
        `engineDoFinal` in class `javax.crypto.MacSpi`