Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: template typechecking is more stringent #470

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading