Package freenet.crypt

Examples of freenet.crypt.PCFBMode.encipher()


    PCFBMode pcfb = PCFBMode.create(cipher, iv);
    System.arraycopy(iv, 0, data, 0, iv.length);
    pcfb.blockEncipher(hash, 0, hash.length);
    System.arraycopy(hash, 0, data, iv.length, hash.length);
    if(logMINOR) Logger.minor(this, "Payload length: "+length+" padded length "+data.length);
    data[hash.length+iv.length] = (byte) pcfb.encipher((byte)(length>>8));
    data[hash.length+iv.length+1] = (byte) pcfb.encipher((byte)length);
    pcfb.blockEncipher(output, 0, output.length);
    System.arraycopy(output, 0, data, hash.length+iv.length+2, output.length);

    Util.randomBytes(node.fastWeakRandom, data, hash.length+iv.length+2+output.length, paddingLength);
View Full Code Here


    System.arraycopy(iv, 0, data, 0, iv.length);
    pcfb.blockEncipher(hash, 0, hash.length);
    System.arraycopy(hash, 0, data, iv.length, hash.length);
    if(logMINOR) Logger.minor(this, "Payload length: "+length+" padded length "+data.length);
    data[hash.length+iv.length] = (byte) pcfb.encipher((byte)(length>>8));
    data[hash.length+iv.length+1] = (byte) pcfb.encipher((byte)length);
    pcfb.blockEncipher(output, 0, output.length);
    System.arraycopy(output, 0, data, hash.length+iv.length+2, output.length);

    Util.randomBytes(node.fastWeakRandom, data, hash.length+iv.length+2+output.length, paddingLength);
    try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.