private byte[] hash(byte[] input) { GeneralDigest digest = new SHA256Digest(); digest.update(input, 0, input.length); byte[] buffer = new byte[digest.getDigestSize()]; digest.doFinal(buffer, 0); Arrays.fill(input, (byte) 0); return buffer; }
public byte[] hashUp(byte[] input) { GeneralDigest d = new SHA1Digest(); d.update(input, 0, input.length); byte[] b = new byte[d.getDigestSize()]; d.doFinal(b, 0); return b; }
public DIGEST(String name, Class<? extends GeneralDigest> digestAlgo) { super(name); this.digestAlgo = digestAlgo; }
public HMAC(String name, Class<? extends GeneralDigest> digestAlgo) { super(name); this.digestAlgo = digestAlgo; }
SnapshotDirectory(Path folder, GeneralDigest digest) { this.folder = folder; this.digest = digest; }
FileDecrypter(BufferedBlockCipher cbcAes, GeneralDigest digest) { this.cbcAes = cbcAes; this.digest = digest; }
ChunkDecrypter(StreamBlockCipher cfbAes, GeneralDigest digest) { this.cfbAes = Objects.requireNonNull(cfbAes); this.digest = Objects.requireNonNull(digest); }