{"record":{"id":"ea0fbbc7b4ecc815","repo":"peass-ng/PEASS-ng","slug":"skein-engine-is-not-initialised","errorCode":null,"errorMessage":"Skein engine is not initialised.","messagePattern":"Skein engine is not initialised\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/crypto/digests/SkeinEngine.cs","lineNumber":723,"sourceCode":"            this.ubi.Update(value, 0, value.Length, chain);\n            UbiFinal();\n        }\n\n        private void UbiInit(int type)\n        {\n            this.ubi.Reset(type);\n        }\n\n        private void UbiFinal()\n        {\n            ubi.DoFinal(chain);\n        }\n\n        private void CheckInitialised()\n        {\n            if (this.ubi == null)\n            {\n                throw new ArgumentException(\"Skein engine is not initialised.\");\n            }\n        }\n\n        public void Update(byte inByte)\n        {\n            singleByte[0] = inByte;\n            Update(singleByte, 0, 1);\n        }\n\n        public void Update(byte[] inBytes, int inOff, int len)\n        {\n            CheckInitialised();\n            ubi.Update(inBytes, inOff, len, chain);\n        }\n\n        public int DoFinal(byte[] outBytes, int outOff)\n        {\n            CheckInitialised();","sourceCodeStart":705,"sourceCodeEnd":741,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/crypto/digests/SkeinEngine.cs#L705-L741","documentation":"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.","triggerScenarios":"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.","commonSituations":"Reusing a digest instance without re-initializing, forgetting Init when switching digest implementations behind an IDigest interface, or swallowing an earlier Init exception.","solutions":["Call engine.Init(SkeinParameters) before any Update/BlockUpdate/DoFinal call","Check that a prior Init call did not throw and leave the engine uninitialized","If reusing the engine after DoFinal, call Reset() (and Init again if needed)"],"exampleFix":"// before\nvar engine = new SkeinEngine(512, 512);\nengine.Update(0x01);\n// after\nvar engine = new SkeinEngine(512, 512);\nengine.Init(SkeinParameters.GetDefault());\nengine.Update(0x01);","handlingStrategy":"try-catch","validationCode":"if (!isInitialized) engine.Init(SkeinParameters.GetDefault());","typeGuard":"static bool IsSkeinReady(SkeinEngine e) => e != null; // track your own initialized flag; engine state is private","tryCatchPattern":"try { engine.Update(data, 0, data.Length); } catch (ArgumentException ex) { /* re-Init and retry: engine.Init(...); */ }","preventionTips":["Wrap digest usage in a helper that always calls Init before Update","Track an initialized bool alongside shared digest instances","Call Reset() after DoFinal before reusing the engine"],"tags":["csharp","cryptography","state-machine"],"backgroundTag":"cipher-not-initialised","analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}