public void WriteEndWithHmac(V2HmacCalculator hmacCalculator, Stream hmacStream, long plaintextLength, long compressedPlaintextLength) { if (hmacCalculator == null) { throw new ArgumentNullException("hmacCalculator"); } if (hmacStream == null) { throw new ArgumentNullException("hmacStream"); } WriteGeneralHeaders(hmacStream); V2PlaintextLengthsEncryptedHeaderBlock lengths = new V2PlaintextLengthsEncryptedHeaderBlock(CreateKeyStreamCrypto(LENGTHSINFO_KEYSTREAM_INDEX)); lengths.PlaintextLength = plaintextLength; lengths.CompressedPlaintextLength = compressedPlaintextLength; lengths.Write(hmacStream); hmacStream.Flush(); V2HmacHeaderBlock hmac = new V2HmacHeaderBlock(); hmac.Hmac = hmacCalculator.Hmac; hmac.Write(hmacStream); }
public override object Clone() { V2PlaintextLengthsEncryptedHeaderBlock clone = new V2PlaintextLengthsEncryptedHeaderBlock((byte[])GetDataBlockBytesReference().Clone()); return(CopyTo(clone)); }