xrpld
Loading...
Searching...
No Matches
secp256k1.h
1#pragma once
2
3#include <secp256k1.h>
4
5namespace xrpl {
6
7template <class = void>
8secp256k1_context const*
10{
11 struct Holder
12 {
13 secp256k1_context* impl;
14 // SECP256K1_CONTEXT_SIGN and SECP256K1_CONTEXT_VERIFY were deprecated.
15 // All contexts support both signing and verification, so
16 // SECP256K1_CONTEXT_NONE is the correct flag to use.
17 Holder() : impl(secp256k1_context_create(SECP256K1_CONTEXT_NONE))
18 {
19 }
20
21 ~Holder()
22 {
23 secp256k1_context_destroy(impl);
24 }
25 };
26 static Holder const kH;
27 return kH.impl;
28}
29
30} // namespace xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
secp256k1_context const * secp256k1Context()
Definition secp256k1.h:9