public void Initialize() { if (handle == IntPtr.Zero) { GC.ReRegisterForFinalize(this); } handle = MHashWrapper.mhash_init(type); }
public MHashHelper(MHashId type) { this.type = type; handle = MHashWrapper.mhash_init(type); if (handle == IntPtr.Zero) { string msg = String.Format("Unknown mhash id '{0}'.", type); throw new CryptographicException(msg); } blocksize = (int)MHashWrapper.mhash_get_block_size(type); }