Package org.bouncycastle.crypto.params

Examples of org.bouncycastle.crypto.params.ParametersForThreefish


    public void init(boolean forEncryption, CipherParameters params)
        throws IllegalArgumentException {

        if (params instanceof ParametersForThreefish){
            ParametersForThreefish pft = (ParametersForThreefish)params;

            stateSize = pft.getStateSize();
            setCipher(stateSize);
            if (cipher == null)
                throw new IllegalArgumentException("Threefish: unsupported state size: " + stateSize);

            byte[] key = ((KeyParameter)pft.getParameters()).getKey();
            if (key.length != (stateSize / 8))
                throw new IllegalArgumentException("Threefish: key length does not match state size: " + key.length);

            long[] tweak = pft.getTweak();
            if (tweak == null)
                throw new IllegalArgumentException("Threefish: tweak data not set");
            cipher.setTweak(tweak);
           
            // Get a long array for cipher key and moves the byte key buffer to it
View Full Code Here

TOP

Related Classes of org.bouncycastle.crypto.params.ParametersForThreefish

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.