summary refs log tree commit diff
path: root/crypto/src/math/raw/Bits.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/math/raw/Bits.cs')
-rw-r--r--crypto/src/math/raw/Bits.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/math/raw/Bits.cs b/crypto/src/math/raw/Bits.cs
index 423151651..3efc890d6 100644
--- a/crypto/src/math/raw/Bits.cs
+++ b/crypto/src/math/raw/Bits.cs
@@ -66,8 +66,8 @@ namespace Org.BouncyCastle.Math.Raw
 #endif
         internal static uint BitPermuteStepSimple(uint x, uint m, int s)
         {
-            Debug.Assert((m & (m << s)) == 0U);
-            Debug.Assert((m << s) >> s == m);
+            Debug.Assert((m << s) == ~m);
+            Debug.Assert((m & ~m) == 0U);
 
             return ((x & m) << s) | ((x >> s) & m);
         }
@@ -77,8 +77,8 @@ namespace Org.BouncyCastle.Math.Raw
 #endif
         internal static ulong BitPermuteStepSimple(ulong x, ulong m, int s)
         {
-            Debug.Assert((m & (m << s)) == 0UL);
-            Debug.Assert((m << s) >> s == m);
+            Debug.Assert((m << s) == ~m);
+            Debug.Assert((m & ~m) == 0UL);
 
             return ((x & m) << s) | ((x >> s) & m);
         }