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
test_crypto_kdf_derive_from_key segfaults on the ARM architecture due to incorrect use of ctypes.
The information about argument/return types of C function is present in .h files that aren't available at run time. So, when using ctypes, you need to declare argument types (technically only if different from defaults – but it's better to do it always). See ctypes documentation.
For kdf_derive_from_key specifically, this should probably be:
Without that, subkey_id is treated as C int instead of uint64_t. This is most likely causing #122 (Cannot use 64bit subkey ID) and the segfault on ARM architecture.
Take the above fix with a grain of NaCl though. I'm not really a ctypes expert.
You probably know about tools like Cython or CFFI, which can use info in .h files to avoid problems like this.
The text was updated successfully, but these errors were encountered:
test_crypto_kdf_derive_from_key
segfaults on the ARM architecture due to incorrect use ofctypes
.The information about argument/return types of C function is present in
.h
files that aren't available at run time. So, when using ctypes, you need to declare argument types (technically only if different from defaults – but it's better to do it always). See ctypes documentation.For
kdf_derive_from_key
specifically, this should probably be:Without that,
subkey_id
is treated as Cint
instead ofuint64_t
. This is most likely causing #122 (Cannot use 64bit subkey ID) and the segfault on ARM architecture.Take the above fix with a grain of NaCl though. I'm not really a
ctypes
expert.You probably know about tools like Cython or CFFI, which can use info in
.h
files to avoid problems like this.The text was updated successfully, but these errors were encountered: