#![warn(missing_docs)] #![warn(clippy::missing_docs_in_private_items)] //! # various tools for use in cryptology contexts //! //! This is a mixed rust/python library that also offers an executable. //! The intended usage is the solving of tasks for cryptology and maybe math, in the context of a //! university degree. I wrote this for cryptology at DHBW Mannheim. //! //! ___ //! Author: Christoph J. Scherr //! //! License: MIT //! //! Source: use pyo3::prelude::*; mod binary; mod math; #[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(()) } #[pymodule] fn register_math_module(py: Python, parent_module: &PyModule) -> PyResult<()> { let math_module = PyModule::new(py, "math")?; math_module.add_function(wrap_pyfunction!(math::modexp::py_modular_exponentiation, math_module)?)?; parent_module.add_submodule(math_module)?; Ok(()) } /// A Python module implemented in Rust. #[pymodule] fn plexcryptool(py: Python, m: &PyModule) -> PyResult<()> { register_binary_module(py, m)?; register_math_module(py, m)?; Ok(()) }