-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbindings.cpp
More file actions
22 lines (18 loc) · 763 Bytes
/
bindings.cpp
File metadata and controls
22 lines (18 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// SPDX-License-Identifier: MIT
// Copyright (c) 2025 Jon Breid
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "EnigmaMachine.h"
namespace py = pybind11;
PYBIND11_MODULE(enigma, m) {
py::class_<EnigmaMachine>(m, "EnigmaMachine")
.def(py::init<>())
.def("encode", &EnigmaMachine::encode)
.def("decode", &EnigmaMachine::decode)
.def("set_plugboard", &EnigmaMachine::setPlugboard)
.def("set_reflector", &EnigmaMachine::setReflector)
.def("set_rotors", &EnigmaMachine::setRotors)
.def("set_custom_rotors", &EnigmaMachine::setCustomRotors)
.def("set_custom_alphabet", &EnigmaMachine::setCustomAlphabet)
.def("set_rotor_positions", &EnigmaMachine::setRotorPositions);
}