Blake2Sharp.Blake2BCore.Initialize C# (CSharp) Метод

Initialize() публичный Метод

public Initialize ( ulong config ) : void
config ulong
Результат void
        public void Initialize(ulong[] config)
        {
            if (config == null)
                throw new ArgumentNullException("config");
            if (config.Length != 8)
                throw new ArgumentException("config length must be 8 words");
            _isInitialized = true;

            _h[0] = IV0;
            _h[1] = IV1;
            _h[2] = IV2;
            _h[3] = IV3;
            _h[4] = IV4;
            _h[5] = IV5;
            _h[6] = IV6;
            _h[7] = IV7;

            _counter0 = 0;
            _counter1 = 0;
            _finalizationFlag0 = 0;
            _finalizationFlag1 = 0;

            _bufferFilled = 0;

            Array.Clear(_buf, 0, _buf.Length);

            for (int i = 0; i < 8; i++)
                _h[i] ^= config[i];
        }

Usage Example

Пример #1
0
 public override void Init()
 {
     core.Initialize(rawConfig);
     if (key != null)
     {
         core.HashCore(key, 0, key.Length);
     }
 }