/// <summary> /// Optionally initialises the Skein digest with the provided parameters. /// </summary> /// See <see cref="BitcoinKit.BouncyCastle.Crypto.Parameters.SkeinParameters"></see> for details on the parameterisation of the Skein hash function. /// <param name="parameters">the parameters to apply to this engine, or <code>null</code> to use no parameters.</param> public void Init(SkeinParameters parameters) { engine.Init(parameters); }
/// <summary> /// Initialises the Skein engine with the provided parameters. See <see cref="BitcoinKit.BouncyCastle.Crypto.Parameters.SkeinParameters"/> for /// details on the parameterisation of the Skein hash function. /// </summary> /// <param name="parameters">the parameters to apply to this engine, or <code>null</code> to use no parameters.</param> public void Init(SkeinParameters parameters) { this.chain = null; this.key = null; this.preMessageParameters = null; this.postMessageParameters = null; if (parameters != null) { byte[] key = parameters.GetKey(); if (key.Length < 16) { throw new ArgumentException("Skein key must be at least 128 bits."); } InitParams(parameters.GetParameters()); } CreateInitialState(); // Initialise message block UbiInit(PARAM_TYPE_MESSAGE); }
public Builder(SkeinParameters parameters) { IEnumerator keys = parameters.parameters.Keys.GetEnumerator(); while (keys.MoveNext()) { int key = (int)keys.Current; this.parameters.Add(key, parameters.parameters[key]); } }