Package org.bouncycastle2.crypto

Examples of org.bouncycastle2.crypto.DataLengthException


        Key                     key,
        AlgorithmParameterSpec  params,
        SecureRandom            random)
    throws InvalidKeyException, InvalidAlgorithmParameterException
    {
        CipherParameters        param;

        //
        // a note on iv's - if ivLength is zero the IV gets ignored (we don't use it).
        //
        if (key instanceof JCEPBEKey)
View Full Code Here


            throw new IllegalStateException("SEED 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");
        }

        long l = bytesToLong(in, inOff + 0);
        long r = bytesToLong(in, inOff + 8);
View Full Code Here

                + " 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++)
        {
            out[outOff + i] = (byte)(in[inOff + i] ^ getKeyStream());
View Full Code Here

            throw new IllegalStateException(getAlgorithmName()+" not initialised");
        }
       
        if ((inOff + genericSize) > in.length)
        {
            throw new DataLengthException("input buffer too short");
        }
       
        if ((outOff + genericSize) > out.length)
        {
            throw new DataLengthException("output buffer too short");
        }
       
        return (_forEncryption) ? encryptBlock(in, inOff, out, outOff)
                                : decryptBlock(in, inOff, out, outOff);
    }
View Full Code Here

            throw new IllegalStateException("DESede 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");
        }

        byte[] temp = new byte[BLOCK_SIZE];

        if (forEncryption)
View Full Code Here

        int     n = inLen / 8;

        if ((n * 8) != inLen)
        {
            throw new DataLengthException("wrap data must be a multiple of 8 bytes");
        }

        byte[]  block = new byte[inLen + iv.length];
        byte[]  buf = new byte[8 + iv.length];

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

        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++)
        {
            x = (x + 1) & 0xff;
View Full Code Here

        {
            throw new IllegalStateException("RC6 engine not initialised");
        }
        if ((inOff + blockSize) > in.length)
        {
            throw new DataLengthException("input buffer too short");
        }
        if ((outOff + blockSize) > out.length)
        {
            throw new DataLengthException("output buffer too short");
        }

        return (forEncryption)
            ?   encryptBlock(in, inOff, out, outOff)
            :   decryptBlock(in, inOff, out, outOff);
View Full Code Here

        int outOff)
        throws DataLengthException, IllegalStateException
    {
        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 (count > blockSize)
        {
            FR[blockSize - 2] = out[outOff] = encryptByte(in[inOff], blockSize - 2);
View Full Code Here

TOP

Related Classes of org.bouncycastle2.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.