use of com.google.common.io.NullOutputStream in project conceal by facebook.
the class CipherReadBenchmark method timeBouncyCastleGCMRead.
public void timeBouncyCastleGCMRead(int reps) throws Exception {
for (int i = 0; i < reps; ++i) {
ByteArrayInputStream cipheredInput = new ByteArrayInputStream(mBCGCMCipheredData);
InputStream input = mBCGCMCipher.getInputStream(cipheredInput);
readFully(input, new NullOutputStream());
// Not closing the bouncy castle stream on purpose because of a bug in
// bouncycastle.
//input.close();
}
}
use of com.google.common.io.NullOutputStream in project conceal by facebook.
the class MacBenchmark method timeNativeMac.
public void timeNativeMac(int reps) throws Exception {
for (int i = 0; i < reps; ++i) {
OutputStream output = mNativeMacHelper.getOutputStream(new NullOutputStream());
output.write(mData);
output.close();
}
}
use of com.google.common.io.NullOutputStream in project conceal by facebook.
the class MacBenchmark method timeJavaHmac.
public void timeJavaHmac(int reps) throws Exception {
for (int i = 0; i < reps; ++i) {
Mac mac = mHMAC.getMac();
OutputStream macOutput = new MacLayeredOutputStream(mac, new NullOutputStream());
macOutput.write(mData);
macOutput.close();
mac.doFinal();
}
}
use of com.google.common.io.NullOutputStream in project conceal by facebook.
the class CipherReadBenchmark method timeNativeGCMRead.
public void timeNativeGCMRead(int reps) throws Exception {
for (int i = 0; i < reps; ++i) {
ByteArrayInputStream cipheredInput = new ByteArrayInputStream(mNativeGCMCipheredData);
InputStream input = mNativeGCMCipherHelper.getInputStream(cipheredInput);
readFully(input, new NullOutputStream());
input.close();
}
}
use of com.google.common.io.NullOutputStream in project conceal by facebook.
the class CipherReadBenchmark method timeAESWithHmacRead.
public void timeAESWithHmacRead(int reps) throws Exception {
for (int i = 0; i < reps; ++i) {
ByteArrayInputStream cipheredInput = new ByteArrayInputStream(mAESCipherText);
Mac mac = mHMAC.getMac();
InputStream macStream = new MacLayeredInputStream(mac, cipheredInput);
InputStream input = mAESCipher.getInputStream(macStream);
readFully(input, new NullOutputStream());
mac.doFinal();
input.close();
}
}
Aggregations