2 files changed, 3 insertions, 3 deletions
diff --git a/crypto/src/crypto/engines/HC128Engine.cs b/crypto/src/crypto/engines/HC128Engine.cs
index 7bd1a48ed..b83eb7083 100644
--- a/crypto/src/crypto/engines/HC128Engine.cs
+++ b/crypto/src/crypto/engines/HC128Engine.cs
@@ -107,7 +107,8 @@ namespace Org.BouncyCastle.Crypto.Engines
if (key.Length != 16)
throw new ArgumentException("The key must be 128 bits long");
- cnt = 0;
+ idx = 0;
+ cnt = 0;
uint[] w = new uint[1280];
@@ -223,7 +224,6 @@ namespace Org.BouncyCastle.Crypto.Engines
public virtual void Reset()
{
- idx = 0;
Init();
}
diff --git a/crypto/src/crypto/engines/HC256Engine.cs b/crypto/src/crypto/engines/HC256Engine.cs
index b72258a19..d8d83a634 100644
--- a/crypto/src/crypto/engines/HC256Engine.cs
+++ b/crypto/src/crypto/engines/HC256Engine.cs
@@ -92,6 +92,7 @@ namespace Org.BouncyCastle.Crypto.Engines
iv = newIV;
}
+ idx = 0;
cnt = 0;
uint[] w = new uint[2560];
@@ -207,7 +208,6 @@ namespace Org.BouncyCastle.Crypto.Engines
public virtual void Reset()
{
- idx = 0;
Init();
}
|