|
@@ -47,12 +47,12 @@ extension Int {
|
|
extension Int {
|
|
extension Int {
|
|
|
|
|
|
/** Shift bits to the left. All bits are shifted (including sign bit) */
|
|
/** Shift bits to the left. All bits are shifted (including sign bit) */
|
|
- fileprivate mutating func shiftLeft(by count: Int) {
|
|
|
|
|
|
+ mutating func shiftLeft(by count: Int) {
|
|
self = CryptoSwift.shiftLeft(self, by: count) //FIXME: count:
|
|
self = CryptoSwift.shiftLeft(self, by: count) //FIXME: count:
|
|
}
|
|
}
|
|
|
|
|
|
/** Shift bits to the right. All bits are shifted (including sign bit) */
|
|
/** Shift bits to the right. All bits are shifted (including sign bit) */
|
|
- fileprivate mutating func shiftRight(by count: Int) {
|
|
|
|
|
|
+ mutating func shiftRight(by count: Int) {
|
|
if (self == 0) {
|
|
if (self == 0) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -81,12 +81,12 @@ extension Int {
|
|
// Left operator
|
|
// Left operator
|
|
|
|
|
|
/** shift left and assign with bits truncation */
|
|
/** shift left and assign with bits truncation */
|
|
-public func &<<= (lhs: inout Int, rhs: Int) {
|
|
|
|
|
|
+func &<<= (lhs: inout Int, rhs: Int) {
|
|
lhs.shiftLeft(by: rhs)
|
|
lhs.shiftLeft(by: rhs)
|
|
}
|
|
}
|
|
|
|
|
|
/** shift left with bits truncation */
|
|
/** shift left with bits truncation */
|
|
-public func &<< (lhs: Int, rhs: Int) -> Int {
|
|
|
|
|
|
+func &<< (lhs: Int, rhs: Int) -> Int {
|
|
var l = lhs;
|
|
var l = lhs;
|
|
l.shiftLeft(by: rhs)
|
|
l.shiftLeft(by: rhs)
|
|
return l
|
|
return l
|