peass-ng/PEASS-ng · error · ArgumentException

Skein engine is not initialised.

Error message

Skein engine is not initialised.

What it means

CheckInitialised() throws this ArgumentException when the Skein engine's internal UBI state is null, i.e. Update/DoFinal (or BlockUpdate) was called before Init. SkeinEngine requires explicit initialization before absorbing any message bytes.

Source

Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/crypto/digests/SkeinEngine.cs:723

            this.ubi.Update(value, 0, value.Length, chain);
            UbiFinal();
        }

        private void UbiInit(int type)
        {
            this.ubi.Reset(type);
        }

        private void UbiFinal()
        {
            ubi.DoFinal(chain);
        }

        private void CheckInitialised()
        {
            if (this.ubi == null)
            {
                throw new ArgumentException("Skein engine is not initialised.");
            }
        }

        public void Update(byte inByte)
        {
            singleByte[0] = inByte;
            Update(singleByte, 0, 1);
        }

        public void Update(byte[] inBytes, int inOff, int len)
        {
            CheckInitialised();
            ubi.Update(inBytes, inOff, len, chain);
        }

        public int DoFinal(byte[] outBytes, int outOff)
        {
            CheckInitialised();

View on GitHub (pinned to 53fb989abc)

Solutions

  1. Call engine.Init(SkeinParameters) before any Update/BlockUpdate/DoFinal call
  2. Check that a prior Init call did not throw and leave the engine uninitialized
  3. If reusing the engine after DoFinal, call Reset() (and Init again if needed)

Example fix

// before
var engine = new SkeinEngine(512, 512);
engine.Update(0x01);
// after
var engine = new SkeinEngine(512, 512);
engine.Init(SkeinParameters.GetDefault());
engine.Update(0x01);
Defensive patterns

Strategy: try-catch

Validate before calling

if (!isInitialized) engine.Init(SkeinParameters.GetDefault());

Type guard

static bool IsSkeinReady(SkeinEngine e) => e != null; // track your own initialized flag; engine state is private

Try / catch

try { engine.Update(data, 0, data.Length); } catch (ArgumentException ex) { /* re-Init and retry: engine.Init(...); */ }

Prevention

When it happens

Trigger: Calling Update(byte), BlockUpdate, or DoFinal on a freshly constructed SkeinEngine without calling Init(SkeinParameters) first, or calling them after Reset on an engine that was never initialized.

Common situations: Reusing a digest instance without re-initializing, forgetting Init when switching digest implementations behind an IDigest interface, or swallowing an earlier Init exception.

Related errors


AI-assisted analysis of peass-ng/PEASS-ng@53fb989abc (2026-09-02). Data as JSON: /api/errors/ea0fbbc7b4ecc815. Report an issue: GitHub.