if (encrypt) { hashInputData(availBacking, availPos, Integer.MAX_VALUE, avail); hashInputData(targetBacking, targetPos, targetMask, result); publishDoFinal();
public RawDataCryptAESCBCPKCS5Stage(GraphManager graphManager, byte[] pass, boolean encrypt, Pipe<RawDataSchema> input, Pipe<RawDataSchema> output, //both decrypt and encrypt instances must point to same file Pipe<BlockStorageReceiveSchema> finalInput, Pipe<BlockStorageXmitSchema> finalOutput ) { super(graphManager, join(input, finalInput), join(output, finalOutput)); if (pass.length!=passSize) { throw new UnsupportedOperationException("pass must be "+passSize+" bytes"); } this.encrypt = encrypt; this.pass = pass; this.input = input; this.output = output; this.finalInput = finalInput; this.finalOutput = finalOutput; }
int blockLen = processBlock(finalLen, 0, finalData, targetPos, targetBuffer, targetMask); int finalLen2 = doFinalIntoRing(targetBuffer, targetPos+blockLen, targetMask); hashInputData(targetBuffer, targetPos+blockLen, targetMask, finalLen2); int targetLen = blockLen + finalLen2; publishBockOut(targetPos, targetLen); resetToBeginning();
requestShutdown(); processFinalInputResponse(); while (processAvail()) {} while (processAvail()){} resetToBeginning(); Pipe.readNextWithoutReleasingReadLock(input); while (processAvail()){}
private ConsoleJSONDumpStage buildGraph2(String blockFilePath, File tempFile, StringBuilder results, GraphManager gm2) { Pipe<RawDataSchema> encryptedDataPipe2 = RawDataSchema.instance.newPipe(10, 1000); Pipe<RawDataSchema> resultDataPipe2 = RawDataSchema.instance.newPipe(10, 1000); Pipe<BlockStorageReceiveSchema> doFinalInput3 = BlockStorageReceiveSchema.instance.newPipe(10, 1000); Pipe<BlockStorageXmitSchema> doFinalOutput3 = BlockStorageXmitSchema.instance.newPipe(10, 1000); BlockStorageStage.newInstance(gm2, blockFilePath, doFinalOutput3, doFinalInput3); results.setLength(0); results.append("single large message: "); FileBlobReadStage read= new FileBlobReadStage(gm2, encryptedDataPipe2, tempFile.getAbsolutePath()); RawDataCryptAESCBCPKCS5Stage decrypt2 = new RawDataCryptAESCBCPKCS5Stage(gm2, pass, false, encryptedDataPipe2, resultDataPipe2, doFinalInput3, doFinalOutput3 ); ConsoleJSONDumpStage lastStage2 = ConsoleJSONDumpStage.newInstance(gm2, resultDataPipe2, results, true); return lastStage2; }
int finalMask = finalOutput.blobMask; int finalLength = doFinalIntoRing(blob, finalOffset, finalMask); hashInputData(targetBuffer, finalOffset, targetMask, finalLength);
RawDataCryptAESCBCPKCS5Stage crypt1 = new RawDataCryptAESCBCPKCS5Stage(gm, cypherBlock, true, cypherDataToSave[i], fileDataToSave[i], doFinalReceive1, doFinalXmit1); RawDataCryptAESCBCPKCS5Stage crypt2 = new RawDataCryptAESCBCPKCS5Stage(gm, cypherBlock, false, fileDataToLoad[i], cypherDataToLoad[i], doFinalReceive2, doFinalXmit2);
new Pipe[]{doFinalInput1,doFinalInput2}); new RawDataCryptAESCBCPKCS5Stage(gm, pass, true, testDataPipe, encryptedDataPipe, new RawDataCryptAESCBCPKCS5Stage(gm, pass, false, encryptedDataPipeB, resultDataPipe,