Package org.bouncycastle.crypto

Examples of org.bouncycastle.crypto.DataLengthException


            throw new IllegalStateException("Twofish not initialised");
        }

        if ((inOff + BLOCK_SIZE) > in.length)
        {
            throw new DataLengthException("input buffer too short");
        }

        if ((outOff + BLOCK_SIZE) > out.length)
        {
            throw new DataLengthException("output buffer too short");
        }

        if (encrypting)
        {
            encryptBlock(in, inOff, out, outOff);
View Full Code Here


            throw new IllegalStateException("Camellia engine not initialised");
        }

        if ((inOff + BLOCK_SIZE) > in.length)
        {
            throw new DataLengthException("input buffer too short");
        }

        if ((outOff + BLOCK_SIZE) > out.length)
        {
            throw new DataLengthException("output buffer too short");
        }

        if (_keyIs128)
        {
            return processBlock128(in, inOff, out, outOff);
View Full Code Here

            throw new IllegalStateException("Serpent not initialised");
        }

        if ((inOff + BLOCK_SIZE) > in.length)
        {
            throw new DataLengthException("input buffer too short");
        }

        if ((outOff + BLOCK_SIZE) > out.length)
        {
            throw new DataLengthException("output buffer too short");
        }

        if (encrypting)
        {
            encryptBlock(in, inOff, out, outOff);
View Full Code Here

        }

        int blockSize = getBlockSize();
        if ((inOff + blockSize) > in.length)
        {
            throw new DataLengthException("Input buffer too short");
        }

        if ((outOff + blockSize) > out.length)
        {
            throw new DataLengthException("Output buffer too short");
        }

        if (_encrypting)
        {
            return encryptBlock(in, inOff, out, outOff);
View Full Code Here

            throw new IllegalStateException(getAlgorithmName()+" not initialised");
        }
       
        if ((inOff + len) > in.length)
        {
            throw new DataLengthException("input buffer too short");
        }

        if ((outOff + len) > out.length)
        {
            throw new DataLengthException("output buffer too short");
        }

        if (limitExceeded(len))
        {
            throw new MaxBytesExceededException("2^70 byte limit per IV would be exceeded; Change IV");
View Full Code Here

            throw new IllegalStateException(getAlgorithmName()+" not initialised");
        }
       
        if ((inOff + len) > in.length)
        {
            throw new DataLengthException("input buffer too short");
        }
       
        if ((outOff + len) > out.length)
        {
            throw new DataLengthException("output buffer too short");
        }
       
        for (int i = 0; i < len; i++)
        {
            if (index == 0)
View Full Code Here

            throw new IllegalStateException("AES engine not initialised");
        }

        if ((inOff + (32 / 2)) > in.length)
        {
            throw new DataLengthException("input buffer too short");
        }

        if ((outOff + (32 / 2)) > out.length)
        {
            throw new DataLengthException("output buffer too short");
        }

        if (forEncryption)
        {
            unpackBlock(in, inOff);
View Full Code Here

       
        if (length > 0)
        {
            if ((outOff + length) > out.length)
            {
                throw new DataLengthException("output buffer too short");
            }
        }

        int resultLen = 0;
        int gapLen = buf.length - bufOff;
View Full Code Here

            {
                if ((outOff + 2 * blockSize) > out.length)
                {
                    reset();

                    throw new DataLengthException("output buffer too short");
                }

                resultLen = cipher.processBlock(buf, 0, out, outOff);
                bufOff = 0;
            }

            padding.addPadding(buf, bufOff);

            resultLen += cipher.processBlock(buf, 0, out, outOff + resultLen);

            reset();
        }
        else
        {
            if (bufOff == blockSize)
            {
                resultLen = cipher.processBlock(buf, 0, buf, 0);
                bufOff = 0;
            }
            else
            {
                reset();

                throw new DataLengthException("last block incomplete in decryption");
            }

            try
            {
                resultLen -= padding.padCount(buf);
View Full Code Here

    public void processBytes(byte[] in, int inOff, int len, byte[] out,
        int outOff)
    {
        if ((inOff + len) > in.length)
        {
            throw new DataLengthException("input buffer too short");
        }

        if ((outOff + len) > out.length)
        {
            throw new DataLengthException("output buffer too short");
        }

        for (int i = 0; i < len; i++)
        {
            s = P[(s + P[n & 0xff]) & 0xff];
View Full Code Here

TOP

Related Classes of org.bouncycastle.crypto.DataLengthException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.