You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating Nim from version 2.0.8 to 2.2.0, a compilation error appeared in Constantine 0.1.0:
D:\nim\choosenim>choosenim.exe 2.2.0
Info: C:\Users\kornw.choosenim\downloads\dlls.zip already downloaded
Extracting dlls.zip
Switched to Nim 2.2.0
D:\az\prg\nim\constantine_issue>nim c test_chacha20.nim
Hint: used config file 'C:\Users\kornw.choosenim\toolchains\nim-2.2.0\config\nim.cfg' [Conf] Hint: used config file 'C:\Users\kornw.choosenim\toolchains\nim-2.2.0\config\config.nims' [Conf] .....................................................................................................................
C:\Users\kornw.nimble\pkgs2\constantine-0.1.0-7dd8d47cf5c1bb7df2a501f1a7a4170fc4f6f23f\constantine\platforms\abstractions.nim(68, 34) template/generic instantiation of log2_vartime from here C:\Users\kornw.nimble\pkgs2\constantine-0.1.0-7dd8d47cf5c1bb7df2a501f1a7a4170fc4f6f23f\constantine\platforms\bithacks.nim(105, 28) Error: type mismatch: got 'cint' for 'log2_c_compiler_vartime(n)' but expected 'uint32'
The same thing happens when switching to Nim 2.0.10:
D:\nim\choosenim>choosenim.exe 2.0.10
Info: C:\Users\kornw.choosenim\downloads\dlls.zip already downloaded Extracting dlls.zip
Switched to Nim 2.0.10
D:\az\prg\nim\constantine_issue>nim c test_chacha20.nim Hint: used config file 'C:\Users\kornw.choosenim\toolchains\nim-2.0.10\config\nim.cfg' [Conf] Hint: used config file 'C:\Users\kornw.choosenim\toolchains\nim-2.0.10\config\config.nims' [Conf] ......................................................................................................................
C:\Users\kornw.nimble\pkgs2\constantine-0.1.0-7dd8d47cf5c1bb7df2a501f1a7a4170fc4f6f23f\constantine\platforms\abstractions.nim(68, 34) template/generic instantiation of log2_vartime from here C:\Users\kornw.nimble\pkgs2\constantine-0.1.0-7dd8d47cf5c1bb7df2a501f1a7a4170fc4f6f23f\constantine\platforms\bithacks.nim(105, 28) Error: type mismatch: got 'cint' for 'log2_c_compiler_vartime(n)' but expected 'uint32'
But if you go back to Nim 2.0.8, the application compiles without errors and works as expected:
I updated Nim with the
choosenim 2.2.0,
then installed constantine to version 0.1.0 using
nimble install constantine.
It happened on October 4th. I suppose there was the latest up-to-date version of constantine on GitHub at that time?
I began to compare the sources of bithacks.nim on GitHub and those installed locally (attached screenshots). And I found that the code is different. It looks like nimble has installed something wrong.
I downloaded the code from GitHub as a zip and updated the library manually. Everything is going to be ready. Apparently, the point is that nimble, for some reason, receives an incorrect version from GitHub.
After updating Nim from version 2.0.8 to 2.2.0, a compilation error appeared in Constantine 0.1.0:
D:\nim\choosenim>choosenim.exe 2.2.0
Info: C:\Users\kornw.choosenim\downloads\dlls.zip already downloaded
Extracting dlls.zip
Switched to Nim 2.2.0
D:\az\prg\nim\constantine_issue>nim c test_chacha20.nim
Hint: used config file 'C:\Users\kornw.choosenim\toolchains\nim-2.2.0\config\nim.cfg' [Conf] Hint: used config file 'C:\Users\kornw.choosenim\toolchains\nim-2.2.0\config\config.nims' [Conf] .....................................................................................................................
C:\Users\kornw.nimble\pkgs2\constantine-0.1.0-7dd8d47cf5c1bb7df2a501f1a7a4170fc4f6f23f\constantine\platforms\abstractions.nim(68, 34) template/generic instantiation of
log2_vartime
from here C:\Users\kornw.nimble\pkgs2\constantine-0.1.0-7dd8d47cf5c1bb7df2a501f1a7a4170fc4f6f23f\constantine\platforms\bithacks.nim(105, 28) Error: type mismatch: got 'cint' for 'log2_c_compiler_vartime(n)' but expected 'uint32'The same thing happens when switching to Nim 2.0.10:
D:\nim\choosenim>choosenim.exe 2.0.10
Info: C:\Users\kornw.choosenim\downloads\dlls.zip already downloaded Extracting dlls.zip
Switched to Nim 2.0.10
D:\az\prg\nim\constantine_issue>nim c test_chacha20.nim Hint: used config file 'C:\Users\kornw.choosenim\toolchains\nim-2.0.10\config\nim.cfg' [Conf] Hint: used config file 'C:\Users\kornw.choosenim\toolchains\nim-2.0.10\config\config.nims' [Conf] ......................................................................................................................
C:\Users\kornw.nimble\pkgs2\constantine-0.1.0-7dd8d47cf5c1bb7df2a501f1a7a4170fc4f6f23f\constantine\platforms\abstractions.nim(68, 34) template/generic instantiation of
log2_vartime
from here C:\Users\kornw.nimble\pkgs2\constantine-0.1.0-7dd8d47cf5c1bb7df2a501f1a7a4170fc4f6f23f\constantine\platforms\bithacks.nim(105, 28) Error: type mismatch: got 'cint' for 'log2_c_compiler_vartime(n)' but expected 'uint32'But if you go back to Nim 2.0.8, the application compiles without errors and works as expected:
D:\nim\choosenim>choosenim.exe 2.0.8
Info: C:\Users\kornw.choosenim\downloads\dlls.zip already downloaded Extracting dlls.zip
Switched to Nim 2.0.8
D:\az\prg\nim\constantine_issue>nim c test_chacha20.nim Hint: used config file 'C:\Users\kornw.choosenim\toolchains\nim-2.0.8\config\nim.cfg' [Conf] Hint: used config file 'C:\Users\kornw.choosenim\toolchains\nim-2.0.8\config\config.nims' [Conf] .......................................................................................................................
Hint: [Link]
Hint: mm: orc; threads: on; opt: none (DEBUG BUILD,
-d:release
generates faster code) 49336 lines; 1.103s; 70.945MiB peakmem; proj: D:\az\prg\nim\constantine_issue\test_chacha20.nim; out: D:\az\prg\nim\constantine_issue\test_chacha20.exe [SuccessX]App source:
import
constantine/ciphers/chacha20,
ed25519
var
kPair1, kPair2: KeyPair
ss: SharedSecret
sd: Seed
data: string = "Hello, world!!!"
nonce: array[12, byte]
kPair1 = createKeypair(seed())
kPair2 = createKeypair(seed())
ss = keyExchange(kPair2[0], kPair1[1])
sd = seed()
copyMem(nonce[0].addr, sd[0].addr, len(nonce))
discard chacha20_cipher(ss, counter = 1, nonce, data)
echo "Encrypted: ", data
discard chacha20_cipher(ss, counter = 1, nonce, data)
echo "Decrypted: ", data
===
The situation repeats under mac OS Sonoma
The text was updated successfully, but these errors were encountered: