2021-03-09 23:24:35 +01:00
|
|
|
#include <llarp/crypto/types.hpp>
|
|
|
|
#include <common.hpp>
|
2020-01-17 16:06:08 +01:00
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
void
|
|
|
|
CryptoTypes_Init(py::module& mod)
|
|
|
|
{
|
2020-04-07 20:38:56 +02:00
|
|
|
py::class_<PubKey>(mod, "PubKey")
|
2020-01-17 16:06:08 +01:00
|
|
|
.def(py::init<>())
|
|
|
|
.def("FromHex", &PubKey::FromString)
|
|
|
|
.def("__repr__", &PubKey::ToString);
|
2020-04-07 20:38:56 +02:00
|
|
|
py::class_<SecretKey>(mod, "SecretKey")
|
2020-01-17 16:06:08 +01:00
|
|
|
.def(py::init<>())
|
|
|
|
.def("LoadFile", &SecretKey::LoadFromFile)
|
|
|
|
.def("SaveFile", &SecretKey::SaveToFile)
|
|
|
|
.def("ToPublic", &SecretKey::toPublic);
|
2020-04-07 20:38:56 +02:00
|
|
|
py::class_<Signature>(mod, "Signature")
|
2020-01-17 16:06:08 +01:00
|
|
|
.def(py::init<>())
|
2022-07-19 20:22:38 +02:00
|
|
|
.def("__repr__", [](const Signature& sig) { return sig.ToHex(); });
|
2020-01-17 16:06:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace llarp
|