INNER CODE UNIT · Python

_load_shared_obj

open-quantum-safe/liboqs-python · oqs/oqs.py:116

def _load_shared_obj(
    name: str,
    additional_searching_paths: Union[Sequence[Path], None] = None,
) -> ct.CDLL:
    """Attempt to load shared library."""
    paths: list[Path] = []
    dll = ct.windll if platform.system() == "Windows" else ct.cdll

    # Search additional path, if any
    if additional_searching_paths:
        for path in additional_searching_paths:
            if platform.system() == "Darwin":
                paths.append(path.absolute() / Path(f"lib{name}").with_suffix(".dylib"))
            elif platform.system() == "Windows":
                # Try both oqs.dll and liboqs.dll in the install path
                for dll_name in (name, f"lib{name}"):
                    paths.append(path.absolute() / Path(dll_name).with_suffix(".dll"))
            else:  # Linux/FreeBSD/UNIX

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…