mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
Elligator added
This commit is contained in:
parent
39300a5bbf
commit
29f0e10411
@ -82,6 +82,7 @@ set (LIBI2PD_SRC
|
||||
"${LIBI2PD_SRC_DIR}/Ed25519.cpp"
|
||||
"${LIBI2PD_SRC_DIR}/NTCP2.cpp"
|
||||
"${LIBI2PD_SRC_DIR}/Blinding.cpp"
|
||||
"${LIBI2PD_SRC_DIR}/Elligator.cpp"
|
||||
)
|
||||
|
||||
if (WITH_WEBSOCKETS)
|
||||
|
30
libi2pd/Elligator.cpp
Normal file
30
libi2pd/Elligator.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
#include "Elligator.h"
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace crypto
|
||||
{
|
||||
Elligator2::Elligator2 ()
|
||||
{
|
||||
}
|
||||
|
||||
Elligator2::~Elligator2 ()
|
||||
{
|
||||
}
|
||||
|
||||
static std::unique_ptr<Elligator2> g_Elligator;
|
||||
std::unique_ptr<Elligator2>& GetElligator ()
|
||||
{
|
||||
if (!g_Elligator)
|
||||
{
|
||||
auto el = new Elligator2();
|
||||
if (!g_Elligator) // make sure it was not created already
|
||||
g_Elligator.reset (el);
|
||||
else
|
||||
delete el;
|
||||
}
|
||||
return g_Elligator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
25
libi2pd/Elligator.h
Normal file
25
libi2pd/Elligator.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef ELLIGATOR_H__
|
||||
#define ELLIGATOR_H__
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace crypto
|
||||
{
|
||||
|
||||
class Elligator2
|
||||
{
|
||||
public:
|
||||
|
||||
Elligator2 ();
|
||||
~Elligator2 ();
|
||||
};
|
||||
|
||||
std::unique_ptr<Elligator2>& GetElligator ();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user