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

Win10 FFIError: multiple declarations of function Salsa20_8_core (for interactive usage, try cdef(xx, override=True)) #801

Open
QGB opened this issue Mar 21, 2024 · 0 comments

Comments

@QGB
Copy link

QGB commented Mar 21, 2024


In [435]: from Crypto.Protocol.KDF import scrypt
---------------------------------------------------------------------------
FFIError                                  Traceback (most recent call last)
<ipython-input-435-dea27a2b3051> in <module>
----> 1 from Crypto.Protocol.KDF import scrypt

C:\QGB\Anaconda3\lib\site-packages\Crypto\Protocol\KDF.py in <module>
     43                     int Salsa20_8_core(const uint8_t *x, const uint8_t *y,
     44                                        uint8_t *out);
---> 45                     """)
     46
     47 _raw_scrypt_lib = load_pycryptodome_raw_lib("Cryptodome.Protocol._scrypt",

C:\QGB\Anaconda3\lib\site-packages\Cryptodome\Util\_raw_api.py in load_pycryptodome_raw_lib(name, cdecl)
    304                 attempts.append("Not found '%s'" % filename)
    305                 continue
--> 306             return load_lib(full_name, cdecl)
    307         except OSError as exp:
    308             attempts.append("Cannot load '%s': %s" % (filename, str(exp)))

C:\QGB\Anaconda3\lib\site-packages\Cryptodome\Util\_raw_api.py in load_lib(name, cdecl)
     98         else:
     99             lib = ffi.dlopen(name)
--> 100         ffi.cdef(cdecl)
    101         return lib
    102

C:\QGB\Anaconda3\lib\site-packages\cffi\api.py in cdef(self, csource, override, packed, pack)
    110         packed=True).
    111         """
--> 112         self._cdef(csource, override=override, packed=packed, pack=pack)
    113
    114     def embedding_api(self, csource, packed=False, pack=None):

C:\QGB\Anaconda3\lib\site-packages\cffi\api.py in _cdef(self, csource, override, **options)
    124         with self._lock:
    125             self._cdef_version = object()
--> 126             self._parser.parse(csource, override=override, **options)
    127             self._cdefsources.append(csource)
    128             if override:

C:\QGB\Anaconda3\lib\site-packages\cffi\cparser.py in parse(self, csource, override, packed, pack, dllexport)
    356                              'packed': pack,
    357                              'dllexport': dllexport}
--> 358             self._internal_parse(csource)
    359         finally:
    360             self._options = prev_options

C:\QGB\Anaconda3\lib\site-packages\cffi\cparser.py in _internal_parse(self, csource)
    379                 current_decl = decl
    380                 if isinstance(decl, pycparser.c_ast.Decl):
--> 381                     self._parse_decl(decl)
    382                 elif isinstance(decl, pycparser.c_ast.Typedef):
    383                     if not decl.name:

C:\QGB\Anaconda3\lib\site-packages\cffi\cparser.py in _parse_decl(self, decl)
    471             tp, quals = self._get_type_and_quals(node, name=decl.name)
    472             assert isinstance(tp, model.RawFunctionType)
--> 473             self._declare_function(tp, quals, decl)
    474         else:
    475             if isinstance(node, pycparser.c_ast.Struct):

C:\QGB\Anaconda3\lib\site-packages\cffi\cparser.py in _declare_function(self, tp, quals, decl)
    464         else:
    465             tag = 'function '
--> 466         self._declare(tag + decl.name, tp)
    467
    468     def _parse_decl(self, decl):

C:\QGB\Anaconda3\lib\site-packages\cffi\cparser.py in _declare(self, name, obj, included, quals)
    536                 raise FFIError(
    537                     "multiple declarations of %s (for interactive usage, "
--> 538                     "try cdef(xx, override=True))" % (name,))
    539         assert '__dotdotdot__' not in name.split()
    540         self._declarations[name] = (obj, quals)

FFIError: multiple declarations of function Salsa20_8_core (for interactive usage, try cdef(xx, override=True))

In [436]: Crypto.__version__
Out[436]: '3.15.0'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant