From 5e0b449eae68f6adf1f988f9601a299f3aa6c468 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Thu, 30 Jul 2020 15:33:18 +0700 Subject: Misc. updates from bc-java --- crypto/src/math/raw/Mod.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'crypto/src/math/raw') diff --git a/crypto/src/math/raw/Mod.cs b/crypto/src/math/raw/Mod.cs index 8d9e8fd21..197b5c82b 100644 --- a/crypto/src/math/raw/Mod.cs +++ b/crypto/src/math/raw/Mod.cs @@ -144,7 +144,7 @@ namespace Org.BouncyCastle.Math.Raw } { - int zeroes = GetTrailingZeroes(u[0]); + int zeroes = Integers.NumberOfTrailingZeros((int)u[0]); if (zeroes > 0) { Nat.ShiftDownBits(uLen, u, zeroes, 0); @@ -170,17 +170,5 @@ namespace Org.BouncyCastle.Math.Raw Nat.ShiftDownBit(len, x, (uint)xc); } } - - private static int GetTrailingZeroes(uint x) - { - Debug.Assert(x != 0); - int count = 0; - while ((x & 1) == 0) - { - x >>= 1; - ++count; - } - return count; - } } } -- cgit 1.5.1