-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Constantine 0.1.0 compilation error with Nim 2.2.0/2.0.10 on Win10/macOS Sonoma #474
Comments
Can you confirm whether you are on the latest master branch? I had this error 2 weeks ago #469 but it was fixed in august. I'll create a new release later in the day. |
I updated Nim with the |
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. Thank you for your excellent libraries! |
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: