diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-08-07 20:35:20 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-08-07 20:35:20 +0700 |
commit | 94a215651b23921043cb3d7d41550ea49dd7a79c (patch) | |
tree | 5b498f9b9462f029e9c7616fde43293d1170e93e /crypto/src/util/Longs.cs | |
parent | Fix Encode return values (diff) | |
download | BouncyCastle.NET-ed25519-94a215651b23921043cb3d7d41550ea49dd7a79c.tar.xz |
Cleanup after bc-fips-csharp updates
Diffstat (limited to 'crypto/src/util/Longs.cs')
-rw-r--r-- | crypto/src/util/Longs.cs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/crypto/src/util/Longs.cs b/crypto/src/util/Longs.cs index 66b14b95c..4d675bdba 100644 --- a/crypto/src/util/Longs.cs +++ b/crypto/src/util/Longs.cs @@ -35,10 +35,7 @@ namespace Org.BouncyCastle.Utilities public static long Reverse(long i) { - i = (long)Bits.BitPermuteStepSimple((ulong)i, 0x5555555555555555UL, 1); - i = (long)Bits.BitPermuteStepSimple((ulong)i, 0x3333333333333333UL, 2); - i = (long)Bits.BitPermuteStepSimple((ulong)i, 0x0F0F0F0F0F0F0F0FUL, 4); - return ReverseBytes(i); + return (long)Reverse((ulong)i); } [CLSCompliantAttribute(false)] @@ -52,10 +49,7 @@ namespace Org.BouncyCastle.Utilities public static long ReverseBytes(long i) { - return RotateLeft((long)((ulong)i & 0xFF000000FF000000UL), 8) | - RotateLeft((long)((ulong)i & 0x00FF000000FF0000UL), 24) | - RotateLeft((long)((ulong)i & 0x0000FF000000FF00UL), 40) | - RotateLeft((long)((ulong)i & 0x000000FF000000FFUL), 56); + return (long)ReverseBytes((ulong)i); } [CLSCompliantAttribute(false)] |