X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_lcl.h;h=3a1027dfe15ce90cf4b4b59726a496b81fd8a015;hb=bdd018198b30328b39a82108efc0d13065888dda;hp=afa19ebb7bc708a5a21d6d8efb21307d1dc02103;hpb=214bb5e2b55c9bece27ef374ddf1db8c16dc2a99;p=openssl-gost%2Fengine.git diff --git a/gost_lcl.h b/gost_lcl.h index afa19eb..3a1027d 100644 --- a/gost_lcl.h +++ b/gost_lcl.h @@ -66,6 +66,9 @@ int register_pmeth_gost(int id, EVP_PKEY_METHOD **pmeth, int flags); # define EVP_PKEY_CTRL_GOST_MAC_HEXKEY (EVP_PKEY_ALG_CTRL+3) # define EVP_PKEY_CTRL_MAC_LEN (EVP_PKEY_ALG_CTRL+5) # define EVP_PKEY_CTRL_SET_VKO (EVP_PKEY_ALG_CTRL+11) +# define TLSTREE_MODE_NONE 0 +# define TLSTREE_MODE_S 1 +# define TLSTREE_MODE_L 2 /* Pmeth internal representation */ struct gost_pmeth_data { int sign_param_nid; /* Should be set whenever parameters are @@ -76,6 +79,7 @@ struct gost_pmeth_data { int peer_key_used; int cipher_nid; /* KExp15/KImp15 algs */ int vko_dgst_nid; + char derive_mode; }; struct gost_mac_pmeth_data { @@ -252,6 +256,8 @@ int gost_ec_verify(const unsigned char *dgst, int dgst_len, int gost_ec_compute_public(EC_KEY *ec); int gost_ec_point_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx); +size_t gost_ec_key2buf(const EC_KEY *key, unsigned char **pbuf); +int gost_ec_oct2key(EC_KEY *key, const unsigned char *buf, size_t len); #define CURVEDEF(a) \ int point_mul_##a(const EC_GROUP *group, EC_POINT *r, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);\ @@ -281,7 +287,7 @@ int gost_kdftree2012_256(unsigned char *keyout, size_t keyout_len, const size_t representation); int gost_tlstree(int cipher_nid, const unsigned char *in, unsigned char *out, - const unsigned char *tlsseq); + const unsigned char *tlsseq, int mode); /* KExp/KImp */ int gost_kexp15(const unsigned char *shared_key, const int shared_len, int cipher_nid, const unsigned char *cipher_key, @@ -305,6 +311,9 @@ int pack_sign_cp(ECDSA_SIG *s, int order, unsigned char *sig, size_t *siglen); /* Get private key as BIGNUM from both 34.10-2001 keys*/ /* Returns pointer into EVP_PKEY structure */ BIGNUM *gost_get0_priv_key(const EVP_PKEY *pkey); +/* from gost_crypt.c */ +/* Decrements 8-byte sequence */ +int decrement_sequence(unsigned char *seq, int decrement); /* Struct describing cipher and used for init/deinit.*/ struct gost_cipher_st {