2023-04-25 18:09:04 +02:00
|
|
|
use pyo3::prelude::*;
|
|
|
|
|
|
|
|
mod binary;
|
2023-05-02 14:05:36 +02:00
|
|
|
mod iterated_squaring;
|
2023-04-25 18:09:04 +02:00
|
|
|
|
|
|
|
#[pymodule]
|
|
|
|
fn register_binary_module(py: Python, parent_module: &PyModule) -> PyResult<()> {
|
|
|
|
let binary_module = PyModule::new(py, "binary")?;
|
|
|
|
binary_module.add_function(wrap_pyfunction!(binary::rotl32, binary_module)?)?;
|
|
|
|
binary_module.add_function(wrap_pyfunction!(binary::rotr32, binary_module)?)?;
|
|
|
|
parent_module.add_submodule(binary_module)?;
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
/// A Python module implemented in Rust.
|
|
|
|
#[pymodule]
|
|
|
|
fn plexcryptool(py: Python, m: &PyModule) -> PyResult<()> {
|
|
|
|
register_binary_module(py, m)?;
|
|
|
|
Ok(())
|
|
|
|
}
|