mirror of https://github.com/GOSTSec/gostcoin
orignal
7 years ago
3 changed files with 34 additions and 3 deletions
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
#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 |
||||
|
Loading…
Reference in new issue