diff --git a/lib/src/crypto/math/int_ext.dart b/lib/src/crypto/math/int_ext.dart index 86254626..91fb09b7 100644 --- a/lib/src/crypto/math/int_ext.dart +++ b/lib/src/crypto/math/int_ext.dart @@ -4,7 +4,7 @@ import 'dart:typed_data'; -import 'package:fixnum/fixnum.dart'; +const _mask32 = 0xffffffff; /// Author Nguyen Van Nguyen extension IntExt on int { @@ -43,20 +43,20 @@ extension IntExt on int { } int shiftLeft32(final int n) { - return (Int64(toUnsigned(32)) << n).toInt(); + return (this & _mask32) << n; } int shiftRight32(final int n) { - return (Int64(toUnsigned(32)) >> n).toInt(); + return (this & _mask32) >> n; } int rotateLeft32(final int n) { - final num = Int64(toUnsigned(32)); - return ((num << n) + (num >> (32 - n))).toInt(); + final num = this & _mask32; + return (num << n) | (num >> 32 - n); } int rotateRight32(final int n) { - final num = Int64(toUnsigned(32)); - return ((num >> n) + (num << (32 - n))).toInt(); + final num = this & _mask32; + return (num >> n) | (num << 32 - n); } } diff --git a/pubspec.yaml b/pubspec.yaml index acf683e3..0b94badf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,6 @@ environment: sdk: ^3.2.0 dependencies: - fixnum: ^1.1.0 pinenacl: ^0.6.0 pointycastle: ^3.9.1