public virtual IDigest ForkPrfHash() { CheckStopBuffering(); byte b = (byte)mPrfHashAlgorithm; if (mBuf != null) { IDigest digest = TlsUtilities.CreateHash(b); mBuf.UpdateDigest(digest); return(digest); } return(TlsUtilities.CloneHash(b, (IDigest)mHashes[b])); }
public virtual TlsHandshakeHash StopTracking() { byte prfHashAlgorithm = (byte)mPrfHashAlgorithm; IDigest prfHash = TlsUtilities.CloneHash(prfHashAlgorithm, (IDigest)mHashes[prfHashAlgorithm]); if (mBuf != null) { mBuf.UpdateDigest(prfHash); } DeferredHash result = new DeferredHash(prfHashAlgorithm, prfHash); result.Init(mContext); return(result); }
public virtual TlsHandshakeHash StopTracking() { byte b = (byte)mPrfHashAlgorithm; IDigest digest = TlsUtilities.CloneHash(b, (IDigest)mHashes[b]); if (mBuf != null) { mBuf.UpdateDigest(digest); } DeferredHash deferredHash = new DeferredHash(b, digest); deferredHash.Init(mContext); return(deferredHash); }
public virtual IDigest ForkPrfHash() { CheckStopBuffering(); byte prfHashAlgorithm = (byte)mPrfHashAlgorithm; if (mBuf != null) { IDigest prfHash = TlsUtilities.CreateHash(prfHashAlgorithm); mBuf.UpdateDigest(prfHash); return(prfHash); } return(TlsUtilities.CloneHash(prfHashAlgorithm, (IDigest)mHashes[prfHashAlgorithm])); }
public virtual byte[] GetFinalHash(byte hashAlgorithm) { IDigest digest = (IDigest)mHashes[hashAlgorithm]; if (digest == null) { throw new InvalidOperationException("HashAlgorithm." + HashAlgorithm.GetText(hashAlgorithm) + " is not being tracked"); } digest = TlsUtilities.CloneHash(hashAlgorithm, digest); if (mBuf != null) { mBuf.UpdateDigest(digest); } return(DigestUtilities.DoFinal(digest)); }
internal CombinedHash(CombinedHash t) { this.mContext = t.mContext; this.mMd5 = TlsUtilities.CloneHash(HashAlgorithm.md5, t.mMd5); this.mSha1 = TlsUtilities.CloneHash(HashAlgorithm.sha1, t.mSha1); }
internal CombinedHash(CombinedHash t) { mContext = t.mContext; mMd5 = TlsUtilities.CloneHash(1, t.mMd5); mSha1 = TlsUtilities.CloneHash(2, t.mSha1); }