diff --git a/src/main/scala/uk/ac/soton/ecs/can/core/QuarterRound.scala b/src/main/scala/uk/ac/soton/ecs/can/core/QuarterRound.scala index 5e1ffbae3fc2ddf8b25ff52231290ba0c9641330..b84740baa9d1e52321e6fcaff1da1cc4439406f3 100644 --- a/src/main/scala/uk/ac/soton/ecs/can/core/QuarterRound.scala +++ b/src/main/scala/uk/ac/soton/ecs/can/core/QuarterRound.scala @@ -12,20 +12,20 @@ class QuarterRound extends MultiIOModule { private def rotateLeft(v: UInt, b: Int): UInt = v(31 - b, 0) ## v(31, 32 - b) - val a0 = in(0) - val b0 = in(1) - val c0 = in(2) - val d0 = in(3) - - val a1 = a0 + b0 - val d1 = rotateLeft(d0 ^ a1, 16) - val c1 = c0 + d1 - val b1 = rotateLeft(b0 ^ c1, 12) - - val a2 = a1 + b1 - val d2 = rotateLeft(d1 ^ a2, 8) - val c2 = c1 + d2 - val b2 = rotateLeft(b1 ^ c2, 7) + private val a0 = in(0) + private val b0 = in(1) + private val c0 = in(2) + private val d0 = in(3) + + private val a1 = a0 + b0 + private val d1 = rotateLeft(d0 ^ a1, 16) + private val c1 = c0 + d1 + private val b1 = rotateLeft(b0 ^ c1, 12) + + private val a2 = a1 + b1 + private val d2 = rotateLeft(d1 ^ a2, 8) + private val c2 = c1 + d2 + private val b2 = rotateLeft(b1 ^ c2, 7) out(0) := a2 out(1) := b2