Package freenet.crypt

Examples of freenet.crypt.PCFBMode.reset()


    // First 32 bytes are the key
    byte[] dataDecryptKey = Arrays.copyOf(decryptedHeaders, DATA_DECRYPT_KEY_LENGTH);
    aes.initialize(dataDecryptKey);
    byte[] dataOutput = block.data.clone();
    // Data decrypt key should be unique, so use it as IV
    pcfb.reset(dataDecryptKey);
    pcfb.blockDecipher(dataOutput, 0, dataOutput.length);
    // 2 bytes - data length
    int dataLength = ((decryptedHeaders[DATA_DECRYPT_KEY_LENGTH] & 0xff) << 8) +
      (decryptedHeaders[DATA_DECRYPT_KEY_LENGTH+1] & 0xff);
    // Metadata flag is top bit
View Full Code Here


      encryptedHeaders[y++] = (byte) (compressionAlgo >> 8);
      encryptedHeaders[y++] = (byte) compressionAlgo;
      if (encryptedHeaders.length != y)
        throw new IllegalStateException("Have more bytes to generate encoding SSK");
      aes.initialize(cryptoKey);
      pcfb.reset(ehDocname);
      pcfb.blockEncipher(encryptedHeaders, 0, encryptedHeaders.length);
      System.arraycopy(encryptedHeaders, 0, headers, x, encryptedHeaders.length);
      x += encryptedHeaders.length;
      // Generate implicit overall hash.
      md256.update(headers, 0, x);
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.