mirror of https://github.com/GOSTSec/gostcoin
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
619 B
26 lines
619 B
#ifndef CRYPTO_H__ |
|
#define CRYPTO_H__ |
|
|
|
#include <openssl/bn.h> |
|
#include <openssl/ecdsa.h> |
|
|
|
#include <openssl/opensslv.h> |
|
#if (OPENSSL_VERSION_NUMBER < 0x010100000) || defined(LIBRESSL_VERSION_NUMBER) // 1.1.0 or LibreSSL |
|
// define getters and setters introduced in 1.1.0 |
|
|
|
inline int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s) |
|
{ |
|
if (sig->r) BN_free (sig->r); |
|
if (sig->s) BN_free (sig->s); |
|
sig->r = r; sig->s = s; return 1; |
|
} |
|
inline void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) |
|
{ *pr = sig->r; *ps = sig->s; } |
|
|
|
// ssl |
|
#define TLS_method TLSv1_method |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|