Skip to content

Commit

Permalink
fix: template typechecking is more stringent (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim authored Sep 25, 2024
1 parent d5c2bbc commit c5e88a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions constantine/ciphers/chacha20.nim
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ template rotl(x, n: uint32): uint32 =
# We always use it with constants in 0 ..< 32
# so no undefined behaviour.
(x shl n) or (x shr (32 - n))
template `^=`(x: var uint32, y: uint32) =
template `^=`[T: uint32|byte](x: var T, y: T) =
x = x xor y
template `<<<=`(x: var uint32, n: uint32) =
x = x.rotl(n)
Expand Down Expand Up @@ -126,4 +126,4 @@ func chacha20_cipher*(
eaten += 64
counter += 1

return counter
return counter

0 comments on commit c5e88a9

Please sign in to comment.