/** * Construct a Pkcs 12 Parameters generator. * * @param digest the digest to be used as the source of derived keys. * @exception ArgumentException if an unknown digest is passed in. */ public Pkcs12ParametersGenerator( IDigest digest) { this.digest = digest; u = digest.GetDigestSize(); v = digest.GetByteLength(); }
public HMac(IDigest digest) { this.digest = digest; this.digestSize = digest.GetDigestSize(); this.blockLength = digest.GetByteLength(); this.inputPad = new byte[blockLength]; this.outputBuf = new byte[blockLength + digestSize]; }
public static byte[] ComputeHash(this IDigest digest, byte[] data) { digest.Reset(); digest.BlockUpdate(data, 0, data.Length); var hash = new byte[digest.GetByteLength()]; digest.DoFinal(hash, 0); return(hash); }
public HMac( IDigest digest) { this.digest = digest; digestSize = digest.GetDigestSize(); blockLength = digest.GetByteLength(); inputPad = new byte[blockLength]; outputPad = new byte[blockLength]; }
public override byte[] ComputeHash(Stream inputStream) { if (inputStream == null) { throw new ArgumentNullException("inputStream"); } _hashAlgorithm.Reset(); byte[] block = new byte[_hashAlgorithm.GetByteLength()]; int count; while ((count = inputStream.Read(block, 0, block.Length)) > 0) { _hashAlgorithm.BlockUpdate(block, 0, count); } return(Hash()); }
public int GetByteLength() { return(baseDigest.GetByteLength()); }
public virtual int GetByteLength() { return(System.Math.Max(mMd5.GetByteLength(), mSha1.GetByteLength())); }
public int GetByteLength() { return(System.Math.Max(md5.GetByteLength(), sha1.GetByteLength())); }
public virtual int GetByteLength() { return(mBaseDigest.GetByteLength()); }