Class Zuc256Mac

  • All Implemented Interfaces:
    Mac

    public final class Zuc256Mac
    extends Object
    implements Mac
    Zuc256 Mac implementation. Based on https://www.is.cas.cn/ztzl2016/zouchongzhi/201801/W020180126529970733243.pdf
    • Constructor Detail

      • Zuc256Mac

        public Zuc256Mac​(int pLength)
        Constructor.
        Parameters:
        pLength - the bit length of the Mac
    • Method Detail

      • getAlgorithmName

        public String getAlgorithmName()
        Obtain Algorithm Name.
        Specified by:
        getAlgorithmName in interface Mac
        Returns:
        the name
      • getMacSize

        public int getMacSize()
        Obtain Mac Size.
        Specified by:
        getMacSize in interface Mac
        Returns:
        the size in Bytes
      • init

        public void init​(CipherParameters pParams)
        Initialise the Mac.
        Specified by:
        init in interface Mac
        Parameters:
        pParams - the parameters
      • update

        public void update​(byte in)
        Update the mac with a single byte.
        Specified by:
        update in interface Mac
        Parameters:
        in - the byte to update with
      • update

        public void update​(byte[] in,
                           int inOff,
                           int len)
        Update the mac.
        Specified by:
        update in interface Mac
        Parameters:
        in - the input buffer
        inOff - the starting offset in the input buffer
        len - the length of data to process
      • doFinal

        public int doFinal​(byte[] out,
                           int outOff)
        Finalize the mac.
        Specified by:
        doFinal in interface Mac
        Parameters:
        out - the output buffer
        outOff - the starting offset in the output buffer
        Returns:
        the size of the mac
      • reset

        public void reset()
        Reset the Mac.
        Specified by:
        reset in interface Mac