1. C lang: passing (void *) as an parameter (typed *) seems legit for the gcc 
compiler (apparently not so for g++)
  2. the Nim to C backend _might_ actually consider the type of the message 
variable and create the proper/compatible parameter for the C call



both work in your favor and this simpler form also works (basically save some 
typing and let the C compiler do the pointer casting): 
    
    
    proc crypto_ed25519_sign(signature: array[64, uint8];
                secret_key: array[32, uint8];
                message: ptr;
                message_size: csize) {.cdecl, importc: "crypto_ed25519_sign".}
    
    var msg = @[0xFE.uint8, 0x32, 0xd5, 0x5C, 0x77, 0x2A, 0x49, 0x11]
    crypto_ed25519_sign(sig, key, addr msg[0], len(msg))
    

Reply via email to