mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-04 09:16:47 +00:00
28 lines
467 B
C++
28 lines
467 B
C++
#pragma once
|
|
|
|
#include <secp256k1.h>
|
|
|
|
namespace xrpl {
|
|
|
|
template <class = void>
|
|
secp256k1_context const*
|
|
secp256k1Context()
|
|
{
|
|
struct Holder
|
|
{
|
|
secp256k1_context* impl;
|
|
Holder() : impl(secp256k1_context_create(SECP256K1_CONTEXT_VERIFY | SECP256K1_CONTEXT_SIGN))
|
|
{
|
|
}
|
|
|
|
~Holder()
|
|
{
|
|
secp256k1_context_destroy(impl);
|
|
}
|
|
};
|
|
static Holder const kH;
|
|
return kH.impl;
|
|
}
|
|
|
|
} // namespace xrpl
|