mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-06 16:36:16 +08:00
version 2.5.3
new sms4 api, go api and ciphersuites
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -215,3 +215,6 @@ apps/gmca/.ca
|
||||
include/openssl/srp.h
|
||||
|
||||
/*.sh
|
||||
|
||||
/rust
|
||||
/python
|
||||
|
||||
@@ -24,3 +24,9 @@ INCLUDE[e_aes_cbc_hmac_sha256.o]=../modes
|
||||
INCLUDE[e_camellia.o]=.. ../modes
|
||||
INCLUDE[e_des.o]=..
|
||||
INCLUDE[e_des3.o]=..
|
||||
INCLUDE[e_sms4.o]=.. ../modes ../sms4
|
||||
INCLUDE[e_sms4_ccm.o]=.. ../modes
|
||||
INCLUDE[e_sms4_gcm.o]=.. ../modes
|
||||
INCLUDE[e_sms4_ocb.o]=.. ../modes
|
||||
INCLUDE[e_sms4_xts.o]=.. ../modes
|
||||
INCLUDE[e_sms4_wrap.o]=.. ../modes
|
||||
|
||||
@@ -60,12 +60,13 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/objects.h>
|
||||
#include "evp_locl.h"
|
||||
# include "internal/evp_int.h"
|
||||
#include "../modes/modes_lcl.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "modes_lcl.h"
|
||||
|
||||
#ifndef OPENSSL_NO_SMS4
|
||||
|
||||
# include <openssl/sms4.h>
|
||||
# include "sms4_lcl.h"
|
||||
|
||||
typedef struct {
|
||||
block128_f block;
|
||||
@@ -73,7 +74,10 @@ typedef struct {
|
||||
cbc128_f cbc;
|
||||
ctr128_f ctr;
|
||||
} stream;
|
||||
sms4_key_t ks;
|
||||
union {
|
||||
double align;
|
||||
sms4_key_t ks;
|
||||
} ks;
|
||||
} EVP_SMS4_KEY;
|
||||
|
||||
|
||||
@@ -85,12 +89,19 @@ static int sms4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
mode = EVP_CIPHER_CTX_mode(ctx);
|
||||
|
||||
if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE) && !enc) {
|
||||
sms4_set_decrypt_key(&dat->ks, key);
|
||||
sms4_set_decrypt_key(&dat->ks.ks, key);
|
||||
} else {
|
||||
sms4_set_encrypt_key(&dat->ks, key);
|
||||
sms4_set_encrypt_key(&dat->ks.ks, key);
|
||||
}
|
||||
dat->block = (block128_f)sms4_encrypt;
|
||||
dat->stream.cbc = mode == EVP_CIPH_CBC_MODE ? (cbc128_f) sms4_cbc_encrypt : NULL;
|
||||
|
||||
if (mode == EVP_CIPH_CTR_MODE) {
|
||||
# ifdef SMS4_AVX2
|
||||
dat->stream.ctr = (ctr128_f) sms4_avx2_ctr32_encrypt_blocks;
|
||||
# else
|
||||
dat->stream.ctr = (ctr128_f) sms4_ctr32_encrypt_blocks;
|
||||
# endif
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -106,7 +117,7 @@ static int sms4_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
IMPLEMENT_BLOCK_CIPHER(sms4, ks, sms4, EVP_SMS4_KEY, NID_sms4,
|
||||
IMPLEMENT_BLOCK_CIPHER(sms4, ks.ks, sms4, EVP_SMS4_KEY, NID_sms4,
|
||||
SMS4_BLOCK_SIZE, SMS4_KEY_LENGTH, SMS4_IV_LENGTH, 128,
|
||||
EVP_CIPH_FLAG_DEFAULT_ASN1, sms4_init_key, NULL, NULL, NULL, sms4_ctrl)
|
||||
|
||||
@@ -118,19 +129,19 @@ static int sms4_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
EVP_SMS4_KEY *sms4_key = (EVP_SMS4_KEY *)ctx->cipher_data;
|
||||
|
||||
if (ctx->flags & EVP_CIPH_FLAG_LENGTH_BITS) {
|
||||
CRYPTO_cfb128_1_encrypt(in, out, len, &sms4_key->ks,
|
||||
CRYPTO_cfb128_1_encrypt(in, out, len, &sms4_key->ks.ks,
|
||||
ctx->iv, &ctx->num, ctx->encrypt, (block128_f)sms4_encrypt);
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (len >= MAXBITCHUNK) {
|
||||
CRYPTO_cfb128_1_encrypt(in, out, MAXBITCHUNK * 8, &sms4_key->ks,
|
||||
CRYPTO_cfb128_1_encrypt(in, out, MAXBITCHUNK * 8, &sms4_key->ks.ks,
|
||||
ctx->iv, &ctx->num, ctx->encrypt, (block128_f)sms4_encrypt);
|
||||
len -= MAXBITCHUNK;
|
||||
}
|
||||
|
||||
if (len) {
|
||||
CRYPTO_cfb128_1_encrypt(in, out, len * 8, &sms4_key->ks,
|
||||
CRYPTO_cfb128_1_encrypt(in, out, len * 8, &sms4_key->ks.ks,
|
||||
ctx->iv, &ctx->num, ctx->encrypt, (block128_f)sms4_encrypt);
|
||||
}
|
||||
|
||||
@@ -160,7 +171,7 @@ static int sms4_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
{
|
||||
EVP_SMS4_KEY *sms4_key = (EVP_SMS4_KEY *)ctx->cipher_data;
|
||||
|
||||
CRYPTO_cfb128_8_encrypt(in, out, len, &sms4_key->ks,
|
||||
CRYPTO_cfb128_8_encrypt(in, out, len, &sms4_key->ks.ks,
|
||||
ctx->iv, &ctx->num, ctx->encrypt, (block128_f)sms4_encrypt);
|
||||
|
||||
return 1;
|
||||
@@ -190,10 +201,16 @@ static int sms4_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
unsigned int num = EVP_CIPHER_CTX_num(ctx);
|
||||
EVP_SMS4_KEY *sms4 = (EVP_SMS4_KEY *)ctx->cipher_data;
|
||||
|
||||
CRYPTO_ctr128_encrypt(in, out, len, &sms4->ks,
|
||||
EVP_CIPHER_CTX_iv_noconst(ctx),
|
||||
EVP_CIPHER_CTX_buf_noconst(ctx), &num,
|
||||
sms4->block);
|
||||
if (sms4->stream.ctr)
|
||||
CRYPTO_ctr128_encrypt_ctr32(in, out, len, &sms4->ks.ks,
|
||||
EVP_CIPHER_CTX_iv_noconst(ctx),
|
||||
EVP_CIPHER_CTX_buf_noconst(ctx),
|
||||
&num, sms4->stream.ctr);
|
||||
else
|
||||
CRYPTO_ctr128_encrypt(in, out, len, &sms4->ks.ks,
|
||||
EVP_CIPHER_CTX_iv_noconst(ctx),
|
||||
EVP_CIPHER_CTX_buf_noconst(ctx), &num,
|
||||
sms4->block);
|
||||
|
||||
EVP_CIPHER_CTX_set_num(ctx, num);
|
||||
return 1;
|
||||
|
||||
@@ -61,12 +61,12 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/objects.h>
|
||||
#include "evp_locl.h"
|
||||
# include "internal/evp_int.h"
|
||||
#include "../modes/modes_lcl.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "modes_lcl.h"
|
||||
|
||||
#ifndef OPENSSL_NO_SMS4
|
||||
|
||||
#include <openssl/sms4.h>
|
||||
# include <openssl/sms4.h>
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
@@ -312,10 +312,10 @@ static int sms4_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
}
|
||||
}
|
||||
|
||||
#define SMS4_CCM_BLOCK_SIZE 1
|
||||
#define SMS4_CCM_IV_LENGTH 7
|
||||
# define SMS4_CCM_BLOCK_SIZE 1
|
||||
# define SMS4_CCM_IV_LENGTH 7
|
||||
|
||||
#define SMS4_CCM_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1 \
|
||||
# define SMS4_CCM_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1 \
|
||||
| EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER \
|
||||
| EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT \
|
||||
| EVP_CIPH_CUSTOM_COPY \
|
||||
|
||||
@@ -62,12 +62,12 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/objects.h>
|
||||
#include "evp_locl.h"
|
||||
# include "internal/evp_int.h"
|
||||
#include "../modes/modes_lcl.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "modes_lcl.h"
|
||||
|
||||
#ifndef OPENSSL_NO_SMS4
|
||||
|
||||
#include <openssl/sms4.h>
|
||||
# include <openssl/sms4.h>
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
@@ -434,10 +434,10 @@ static int sms4_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
|
||||
}
|
||||
|
||||
#define SMS4_GCM_BLOCK_SIZE 1
|
||||
#define SMS4_GCM_IV_LENGTH 12
|
||||
# define SMS4_GCM_BLOCK_SIZE 1
|
||||
# define SMS4_GCM_IV_LENGTH 12
|
||||
|
||||
#define SMS4_GCM_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1 \
|
||||
# define SMS4_GCM_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1 \
|
||||
| EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER \
|
||||
| EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT \
|
||||
| EVP_CIPH_CUSTOM_COPY | EVP_CIPH_GCM_MODE \
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/objects.h>
|
||||
#include "evp_locl.h"
|
||||
# include "internal/evp_int.h"
|
||||
#include "../modes/modes_lcl.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "modes_lcl.h"
|
||||
|
||||
#ifndef OPENSSL_NO_SMS4
|
||||
|
||||
@@ -345,9 +345,9 @@ static int sms4_ocb_cleanup(EVP_CIPHER_CTX *c)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define SMS4_OCB_IV_LENGTH 12
|
||||
# define SMS4_OCB_IV_LENGTH 12
|
||||
|
||||
#define SMS4_OCB_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1 \
|
||||
# define SMS4_OCB_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1 \
|
||||
| EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER \
|
||||
| EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT \
|
||||
| EVP_CIPH_CUSTOM_COPY \
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/objects.h>
|
||||
#include "evp_locl.h"
|
||||
# include "internal/evp_int.h"
|
||||
#include "../modes/modes_lcl.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "modes_lcl.h"
|
||||
|
||||
#ifndef OPENSSL_NO_SMS4
|
||||
# include <openssl/sms4.h>
|
||||
@@ -152,7 +152,7 @@ static int sms4_wrap_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
return rv ? (int)rv : -1;
|
||||
}
|
||||
|
||||
#define SMS4_WRAP_FLAGS (EVP_CIPH_WRAP_MODE \
|
||||
# define SMS4_WRAP_FLAGS (EVP_CIPH_WRAP_MODE \
|
||||
| EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER \
|
||||
| EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_FLAG_DEFAULT_ASN1)
|
||||
|
||||
|
||||
@@ -61,8 +61,8 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/objects.h>
|
||||
#include "evp_locl.h"
|
||||
# include "internal/evp_int.h"
|
||||
#include "../modes/modes_lcl.h"
|
||||
#include "internal/evp_int.h"
|
||||
#include "modes_lcl.h"
|
||||
|
||||
#ifndef OPENSSL_NO_SMS4
|
||||
# include <openssl/sms4.h>
|
||||
@@ -151,9 +151,9 @@ static int sms4_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define SMS4_XTS_BLOCK_SIZE 1
|
||||
# define SMS4_XTS_BLOCK_SIZE 1
|
||||
|
||||
#define SMS4_XTS_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_CUSTOM_IV \
|
||||
# define SMS4_XTS_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_CUSTOM_IV \
|
||||
| EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT \
|
||||
| EVP_CIPH_CUSTOM_COPY)
|
||||
|
||||
|
||||
@@ -62,17 +62,29 @@
|
||||
|
||||
static int sm9hash2_sm3_init(EVP_MD_CTX *ctx)
|
||||
{
|
||||
return 0;
|
||||
if (!ctx || !EVP_MD_CTX_md_data(ctx)) {
|
||||
return 0;
|
||||
}
|
||||
sm3_init(EVP_MD_CTX_md_data(ctx));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int sm9hash2_sm3_update(EVP_MD_CTX *ctx, const void *in, size_t inlen)
|
||||
{
|
||||
return 0;
|
||||
if (!ctx || !EVP_MD_CTX_md_data(ctx) || (!in && inlen != 0)) {
|
||||
return 0;
|
||||
}
|
||||
sm3_update(EVP_MD_CTX_md_data(ctx), in, inlen);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int sm9hash2_sm3_final(EVP_MD_CTX *ctx, unsigned char *md)
|
||||
{
|
||||
return 0;
|
||||
if (!ctx || !EVP_MD_CTX_md_data(ctx) || !md) {
|
||||
return 0;
|
||||
}
|
||||
sm3_final(EVP_MD_CTX_md_data(ctx), md);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sm9hash2_sm3_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)
|
||||
|
||||
59
crypto/include/internal/rotate.h
Normal file
59
crypto/include/internal/rotate.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
/*
|
||||
* Engage compiler specific rotate intrinsic function if available.
|
||||
*/
|
||||
#undef ROL32
|
||||
#ifndef PEDANTIC
|
||||
# if defined(_MSC_VER)
|
||||
# define ROL32(a,n) _lrotl(a,n)
|
||||
# elif defined(__ICC)
|
||||
# define ROL32(a,n) _rotl(a,n)
|
||||
# elif defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
|
||||
/*
|
||||
* Some GNU C inline assembler templates. Note that these are
|
||||
* rotates by *constant* number of bits! But that's exactly
|
||||
* what we need here...
|
||||
* <appro@fy.chalmers.se>
|
||||
*/
|
||||
# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
|
||||
# define ROL32(a,n) ({ register unsigned int ret; \
|
||||
asm ( \
|
||||
"roll %1,%0" \
|
||||
: "=r"(ret) \
|
||||
: "I"(n), "0"((unsigned int)(a)) \
|
||||
: "cc"); \
|
||||
ret; \
|
||||
})
|
||||
# elif defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \
|
||||
defined(__powerpc) || defined(__ppc__) || defined(__powerpc64__)
|
||||
# define ROL32(a,n) ({ register unsigned int ret; \
|
||||
asm ( \
|
||||
"rlwinm %0,%1,%2,0,31" \
|
||||
: "=r"(ret) \
|
||||
: "r"(a), "I"(n)); \
|
||||
ret; \
|
||||
})
|
||||
# elif defined(__s390x__)
|
||||
# define ROL32(a,n) ({ register unsigned int ret; \
|
||||
asm ("rll %0,%1,%2" \
|
||||
: "=r"(ret) \
|
||||
: "r"(a), "I"(n)); \
|
||||
ret; \
|
||||
})
|
||||
# endif
|
||||
# endif
|
||||
#endif /* PEDANTIC */
|
||||
|
||||
#ifndef ROL32
|
||||
# define ROL32(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n))))
|
||||
#endif
|
||||
@@ -56,15 +56,6 @@
|
||||
#include <openssl/crypto.h>
|
||||
#include "sm9_lcl.h"
|
||||
|
||||
/*
|
||||
int SM9_do_wrap_key(const EVP_MD *kdf_md
|
||||
unsigned char *key, size_t keylen, EC_POINT *C,
|
||||
SM9PublicKey *pk);
|
||||
|
||||
int SM9_do_unwrap_key(const EVP_MD *kdf_md,
|
||||
unsigned char *key, size_t keylen, const EC_POINT *C,
|
||||
SM9PublicKey *pk);
|
||||
*/
|
||||
|
||||
int SM9_unwrap_key(int type,
|
||||
unsigned char *key, size_t keylen,
|
||||
@@ -82,7 +73,7 @@ int SM9_unwrap_key(int type,
|
||||
const EVP_MD *kdf_md;
|
||||
unsigned char wbuf[384];
|
||||
unsigned char *out = key;
|
||||
size_t outlen = keylen;
|
||||
size_t outlen = keylen;
|
||||
unsigned char counter[4] = {0, 0, 0, 1};
|
||||
unsigned char dgst[64];
|
||||
unsigned int len;
|
||||
@@ -132,7 +123,7 @@ int SM9_unwrap_key(int type,
|
||||
if (!fp12_to_bin(w, wbuf)) {
|
||||
SM9err(SM9_F_SM9_UNWRAP_KEY, ERR_R_MALLOC_FAILURE);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
/* K = KDF(C||w||ID_B, klen) */
|
||||
while (outlen > 0) {
|
||||
@@ -261,7 +252,7 @@ int SM9_wrap_key(int type, /* NID_sm9kdf_with_sm3 */
|
||||
|
||||
do {
|
||||
unsigned char *out = key;
|
||||
size_t outlen = keylen;
|
||||
size_t outlen = keylen;
|
||||
unsigned char counter[4] = {0, 0, 0, 1};
|
||||
unsigned int len;
|
||||
|
||||
@@ -337,11 +328,6 @@ end:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SM9_MASTER_KEY_ciphertext_size(const SM9_MASTER_KEY *master, size_t len)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int SM9_encrypt(int type,
|
||||
const unsigned char *in, size_t inlen,
|
||||
unsigned char *out, size_t *outlen,
|
||||
@@ -441,7 +427,7 @@ int SM9_decrypt(int type,
|
||||
int C2_len;
|
||||
unsigned char mac[EVP_MAX_MD_SIZE];
|
||||
unsigned int maclen = sizeof(mac);
|
||||
int len, i;
|
||||
int i;
|
||||
|
||||
/* parse type */
|
||||
switch (type) {
|
||||
@@ -525,6 +511,7 @@ int SM9_decrypt(int type,
|
||||
|
||||
end:
|
||||
SM9Ciphertext_free(sm9cipher);
|
||||
OPENSSL_clear_free(key, keylen);
|
||||
if (key)
|
||||
OPENSSL_clear_free(key, keylen);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -54,9 +54,6 @@
|
||||
#include "../bn/bn_lcl.h"
|
||||
#include "sm9_lcl.h"
|
||||
|
||||
static int BN_hash_to_range(const EVP_MD *md, BIGNUM **bn,
|
||||
const void *s, size_t slen, const BIGNUM *range, BN_CTX *bn_ctx);
|
||||
|
||||
#if 0
|
||||
typedef struct {
|
||||
int nid;
|
||||
@@ -152,28 +149,6 @@ int SM9PublicKey_get_gmtls_encoded(SM9PublicParameters *mpk,
|
||||
}
|
||||
|
||||
|
||||
int SM9_hash2(const EVP_MD *md, BIGNUM **r,
|
||||
const unsigned char *data, size_t datalen,
|
||||
const unsigned char *elem, size_t elemlen,
|
||||
const BIGNUM *range, BN_CTX *ctx)
|
||||
{
|
||||
unsigned char *buf;
|
||||
|
||||
if (!(buf = OPENSSL_malloc(datalen + elemlen))) {
|
||||
return 0;
|
||||
}
|
||||
memcpy(buf, data, datalen);
|
||||
memcpy(buf + datalen, elem, elemlen);
|
||||
|
||||
if (!BN_hash_to_range(md, r, buf, datalen + elemlen, range, ctx)) {
|
||||
OPENSSL_free(buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
OPENSSL_free(buf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int SM9_DigestInit(EVP_MD_CTX *ctx, unsigned char prefix,
|
||||
const EVP_MD *md, ENGINE *impl)
|
||||
{
|
||||
@@ -234,6 +209,10 @@ int sm9_check_sign_scheme(int nid)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* SM9_hash2() should be implemented as an EVP_MD module
|
||||
* and refactor the SM9_SignInit/Update/Final API
|
||||
*/
|
||||
#if 0
|
||||
int BN_hash_to_range(const EVP_MD *md, BIGNUM **bn,
|
||||
const void *s, size_t slen, const BIGNUM *range, BN_CTX *bn_ctx)
|
||||
{
|
||||
@@ -315,3 +294,25 @@ end:
|
||||
OPENSSL_free(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SM9_hash2(const EVP_MD *md, BIGNUM **r,
|
||||
const unsigned char *data, size_t datalen,
|
||||
const unsigned char *elem, size_t elemlen,
|
||||
const BIGNUM *range, BN_CTX *ctx)
|
||||
{
|
||||
EVP_MD_CTX *mctx = NULL;
|
||||
|
||||
if (!(mctx = EVP_MD_CTX_new())) {
|
||||
}
|
||||
|
||||
if (!EVP_DigestInit_ex(mctx, md, NULL)
|
||||
|| !EVP_DigestUpdate(mctx, data, datalen)
|
||||
|| !EVP_DigestUpdate(mctx, elem, elemlen)
|
||||
|| !EVP_DigestFinal_ex(mctx, buf, &buflen)) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -183,9 +183,11 @@ static int pkey_sm9_master_encrypt(EVP_PKEY_CTX *ctx,
|
||||
|
||||
static int pkey_sm9_master_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)
|
||||
{
|
||||
/*
|
||||
SM9_MASTER_PKEY_CTX *dctx = EVP_PKEY_CTX_get_data(ctx);
|
||||
SM9_MASTER_KEY *sm9_master = EVP_PKEY_get0_SM9_MASTER(
|
||||
EVP_PKEY_CTX_get0_pkey(ctx));
|
||||
*/
|
||||
|
||||
return -2;
|
||||
}
|
||||
|
||||
@@ -166,6 +166,7 @@ static int fp2_equ(const fp2_t a, const fp2_t b)
|
||||
return !BN_cmp(a[0], b[0]) && !BN_cmp(a[1], b[1]);
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp2_equ_hex(const fp2_t a, const char *str[2], BN_CTX *ctx)
|
||||
{
|
||||
fp2_t t;
|
||||
@@ -173,7 +174,9 @@ static int fp2_equ_hex(const fp2_t a, const char *str[2], BN_CTX *ctx)
|
||||
fp2_set_hex(t, str);
|
||||
return fp2_equ(a, t);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp2_add_word(fp2_t r, const fp2_t a, unsigned long b, const BIGNUM *p, BN_CTX *ctx)
|
||||
{
|
||||
BIGNUM *w = NULL;
|
||||
@@ -187,6 +190,7 @@ static int fp2_add_word(fp2_t r, const fp2_t a, unsigned long b, const BIGNUM *p
|
||||
BN_free(w);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fp2_add(fp2_t r, const fp2_t a, const fp2_t b, const BIGNUM *p, BN_CTX *ctx)
|
||||
{
|
||||
@@ -299,7 +303,7 @@ static int fp2_mul_num(fp2_t r, const fp2_t a, const BIGNUM *n, const BIGNUM *p,
|
||||
BIGNUM *r1 = NULL;
|
||||
if (!(r0 = BN_CTX_get(ctx))
|
||||
|| !(r1 = BN_CTX_get(ctx))
|
||||
|
||||
|
||||
|| !BN_mod_mul(r0, a[0], n, p, ctx)
|
||||
|| !BN_mod_mul(r1, a[1], n, p, ctx)
|
||||
|
||||
@@ -426,11 +430,13 @@ static int fp2_inv(fp2_t r, const fp2_t a, const BIGNUM *p, BN_CTX *ctx)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp2_div(fp2_t r, const fp2_t a, const fp2_t b, const BIGNUM *p, BN_CTX *ctx)
|
||||
{
|
||||
return fp2_inv(r, b, p, ctx)
|
||||
&& fp2_mul(r, a, r, p, ctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fp2_to_bin(const fp2_t a, unsigned char to[64])
|
||||
{
|
||||
@@ -443,9 +449,10 @@ static int fp2_to_bin(const fp2_t a, unsigned char to[64])
|
||||
static int fp2_from_bin(fp2_t a, const unsigned char from[64])
|
||||
{
|
||||
return BN_bin2bn(from, 32, a[1])
|
||||
&& BN_bin2bn(from + 32, 32, a[0]);
|
||||
&& BN_bin2bn(from + 32, 32, a[0]);
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp2_test(const BIGNUM *p, BN_CTX *ctx)
|
||||
{
|
||||
const char *_a[] = {
|
||||
@@ -540,7 +547,7 @@ static int fp2_test(const BIGNUM *p, BN_CTX *ctx)
|
||||
fp2_sqr_u(r, a, p, ctx);
|
||||
ok = fp2_equ_hex(r, sqru_a, ctx);
|
||||
printf("fp2 test %d: %s\n", __LINE__, ok ? "ok" : "error");
|
||||
|
||||
|
||||
fp2_inv(r, a, p, ctx);
|
||||
ok = fp2_equ_hex(r, inv_a, ctx);
|
||||
printf("fp2 test %d: %s\n", __LINE__, ok ? "ok" : "error");
|
||||
@@ -561,6 +568,7 @@ static int fp2_test(const BIGNUM *p, BN_CTX *ctx)
|
||||
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fp4_init(fp4_t a, BN_CTX *ctx)
|
||||
{
|
||||
@@ -580,11 +588,13 @@ static void fp4_cleanup(fp4_t a)
|
||||
fp2_cleanup(a[1]);
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static void fp4_clear_cleanup(fp4_t a)
|
||||
{
|
||||
fp2_clear_cleanup(a[0]);
|
||||
fp2_clear_cleanup(a[1]);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fp4_print(const fp4_t a)
|
||||
{
|
||||
@@ -672,6 +682,7 @@ static int fp4_equ(const fp4_t a, const fp4_t b)
|
||||
&& fp2_equ(a[1], b[1]);
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp4_equ_hex(const fp4_t a, const char *str[4], BN_CTX *ctx)
|
||||
{
|
||||
fp4_t t;
|
||||
@@ -679,6 +690,7 @@ static int fp4_equ_hex(const fp4_t a, const char *str[4], BN_CTX *ctx)
|
||||
fp4_set_hex(t, str);
|
||||
return fp4_equ(a, t);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fp4_to_bin(const fp4_t a, unsigned char to[128])
|
||||
{
|
||||
@@ -863,6 +875,7 @@ static int fp4_inv(fp4_t r, const fp4_t a, const BIGNUM *p, BN_CTX *ctx)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp4_test(const BIGNUM *p, BN_CTX *ctx)
|
||||
{
|
||||
const char *_a[] = {
|
||||
@@ -999,6 +1012,7 @@ static int fp4_test(const BIGNUM *p, BN_CTX *ctx)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int fp12_init(fp12_t a, BN_CTX *ctx)
|
||||
{
|
||||
@@ -1021,12 +1035,14 @@ void fp12_cleanup(fp12_t a)
|
||||
fp4_cleanup(a[2]);
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static void fp12_clear_cleanup(fp12_t a)
|
||||
{
|
||||
fp4_clear_cleanup(a[0]);
|
||||
fp4_clear_cleanup(a[1]);
|
||||
fp4_clear_cleanup(a[2]);
|
||||
}
|
||||
#endif
|
||||
|
||||
int fp12_print(const fp12_t a)
|
||||
{
|
||||
@@ -1036,6 +1052,7 @@ int fp12_print(const fp12_t a)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp12_is_zero(const fp12_t a)
|
||||
{
|
||||
return fp4_is_zero(a[0])
|
||||
@@ -1056,6 +1073,7 @@ static void fp12_set_zero(fp12_t r)
|
||||
fp4_set_zero(r[1]);
|
||||
fp4_set_zero(r[2]);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fp12_set_one(fp12_t r)
|
||||
{
|
||||
@@ -1071,12 +1089,14 @@ static int fp12_copy(fp12_t r, const fp12_t a)
|
||||
&& fp4_copy(r[2], a[2]);
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp12_set(fp12_t r, const fp4_t a0, const fp4_t a1, const fp4_t a2)
|
||||
{
|
||||
return fp4_copy(r[0], a0)
|
||||
&& fp4_copy(r[1], a1)
|
||||
&& fp4_copy(r[2], a2);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fp12_set_hex(fp12_t r, const char *str[12])
|
||||
{
|
||||
@@ -1085,12 +1105,14 @@ static int fp12_set_hex(fp12_t r, const char *str[12])
|
||||
&& fp4_set_hex(r[2], str + 8);
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp12_set_fp4(fp12_t r, const fp4_t a)
|
||||
{
|
||||
fp4_set_zero(r[1]);
|
||||
fp4_set_zero(r[2]);
|
||||
return fp4_copy(r[0], a);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fp12_set_fp2(fp12_t r, const fp2_t a)
|
||||
{
|
||||
@@ -1106,6 +1128,7 @@ static int fp12_set_bn(fp12_t r, const BIGNUM *a)
|
||||
return fp4_set_bn(r[0], a);
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp12_set_word(fp12_t r, unsigned long a)
|
||||
{
|
||||
fp4_set_zero(r[1]);
|
||||
@@ -1119,6 +1142,7 @@ static int fp12_set_u(fp12_t r)
|
||||
fp4_set_zero(r[2]);
|
||||
return fp4_set_u(r[0]);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fp12_set_v(fp12_t r)
|
||||
{
|
||||
@@ -1127,12 +1151,14 @@ static int fp12_set_v(fp12_t r)
|
||||
return fp4_set_v(r[0]);
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp12_set_w(fp12_t r)
|
||||
{
|
||||
fp4_set_zero(r[0]);
|
||||
fp4_set_zero(r[2]);
|
||||
return fp4_set_one(r[1]);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fp12_set_w_sqr(fp12_t r)
|
||||
{
|
||||
@@ -1148,6 +1174,7 @@ static int fp12_equ(const fp12_t a, const fp12_t b)
|
||||
&& fp4_equ(a[2], b[2]);
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp12_equ_hex(const fp12_t a, const char *str[12], BN_CTX *ctx)
|
||||
{
|
||||
fp12_t t;
|
||||
@@ -1155,6 +1182,7 @@ static int fp12_equ_hex(const fp12_t a, const char *str[12], BN_CTX *ctx)
|
||||
fp12_set_hex(t, str);
|
||||
return fp12_equ(a, t);
|
||||
}
|
||||
#endif
|
||||
|
||||
int fp12_to_bin(const fp12_t a, unsigned char to[384])
|
||||
{
|
||||
@@ -1165,14 +1193,13 @@ int fp12_to_bin(const fp12_t a, unsigned char to[384])
|
||||
|
||||
static int fp12_from_bin(fp4_t a, const unsigned char from[384])
|
||||
{
|
||||
return fp4_from_bin(a[2], from)
|
||||
&& fp4_from_bin(a[1], from + 128)
|
||||
&& fp4_from_bin(a[0], from + 256);
|
||||
return fp4_from_bin(&a[2], from)
|
||||
&& fp4_from_bin(&a[1], from + 128)
|
||||
&& fp4_from_bin(&a[0], from + 256);
|
||||
}
|
||||
|
||||
static int fp12_add(fp12_t r, const fp12_t a, const fp12_t b, const BIGNUM *p, BN_CTX *ctx)
|
||||
{
|
||||
|
||||
return fp4_add(r[0], a[0], b[0], p, ctx)
|
||||
&& fp4_add(r[1], a[1], b[1], p, ctx)
|
||||
&& fp4_add(r[2], a[2], b[2], p, ctx);
|
||||
@@ -1189,7 +1216,7 @@ static int fp12_tri(fp12_t r, const fp12_t a, const BIGNUM *p, BN_CTX *ctx)
|
||||
{
|
||||
fp12_t t;
|
||||
fp12_init(t, ctx);
|
||||
|
||||
|
||||
if (!fp12_dbl(t, a, p, ctx)
|
||||
|| !fp12_add(r, t, a, p, ctx)) {
|
||||
fp12_cleanup(t);
|
||||
@@ -1323,7 +1350,7 @@ static int fp12_inv(fp12_t r, const fp12_t a, const BIGNUM *p, BN_CTX *ctx)
|
||||
|| !fp4_mul(t, t, a[1], p, ctx)
|
||||
|| !fp4_add(k, k, t, p, ctx)
|
||||
|| !fp4_inv(k, k, p, ctx)
|
||||
|
||||
|
||||
/* r2 = a1^2 * k */
|
||||
|| !fp4_sqr(r[2], a[1], p, ctx)
|
||||
|| !fp4_mul(r[2], r[2], k, p, ctx)
|
||||
@@ -1348,12 +1375,12 @@ static int fp12_inv(fp12_t r, const fp12_t a, const BIGNUM *p, BN_CTX *ctx)
|
||||
return 1;
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
fp4_t t0, t1, t2, t3;
|
||||
|
||||
if (!(fp4_init(t0, ctx))
|
||||
|| !(fp4_init(t1, ctx)) //FIXME
|
||||
|| !(fp4_init(t2, ctx))
|
||||
|| !(fp4_init(t2, ctx))
|
||||
|| !(fp4_init(t3, ctx))
|
||||
|
||||
/* t0 = a1^2 - a0 * a2 */
|
||||
@@ -1377,7 +1404,7 @@ static int fp12_inv(fp12_t r, const fp12_t a, const BIGNUM *p, BN_CTX *ctx)
|
||||
|| !fp4_sub(t3, t3, r[0], p, ctx)
|
||||
|| !fp4_inv(t3, t3, p, ctx)
|
||||
|| !fp4_mul(t3, a[2], t3, p, ctx)
|
||||
|
||||
|
||||
/* r0 = t2 * t3 */
|
||||
|| !fp4_mul(r[0], t2, t3, p, ctx)
|
||||
|
||||
@@ -1443,6 +1470,8 @@ int fp12_pow(fp12_t r, const fp12_t a, const BIGNUM *k, const BIGNUM *p, BN_CTX
|
||||
}
|
||||
|
||||
fp12_copy(r, t);
|
||||
|
||||
fp12_cleanup(t);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1466,19 +1495,20 @@ static int fp12_fast_expo_p2(fp12_t r, const fp12_t a, const BIGNUM *p, BN_CTX *
|
||||
pw21 = SM9_get0_fast_final_exponent_p21();
|
||||
pw22 = SM9_get0_fast_final_exponent_p22();
|
||||
pw23 = SM9_get0_fast_final_exponent_p23();
|
||||
|
||||
|
||||
if(!fp2_copy(r[0][0], a[0][0])
|
||||
|| !fp2_neg (r[0][1], a[0][1], p, ctx)
|
||||
|| !fp2_mul_num(r[1][0], a[1][0], pw20, p, ctx)
|
||||
|| !fp2_mul_num(r[1][1], a[1][1], pw21, p, ctx)
|
||||
|| !fp2_mul_num(r[2][0], a[2][0], pw22, p, ctx)
|
||||
|| !fp2_mul_num(r[2][1], a[2][1], pw23, p, ctx)) {
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int fp12_test(const BIGNUM *p, BN_CTX *ctx)
|
||||
{
|
||||
const char *_a[] = {
|
||||
@@ -1762,6 +1792,7 @@ static int fp12_test(const BIGNUM *p, BN_CTX *ctx)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int point_init(point_t *P, BN_CTX *ctx)
|
||||
{
|
||||
@@ -1940,7 +1971,7 @@ int point_is_on_curve(point_t *P, const BIGNUM *p, BN_CTX *ctx)
|
||||
if (!r) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
fp2_set_5u(b);
|
||||
|
||||
if (!point_get_affine_coordinates(P, x, y)
|
||||
@@ -1979,7 +2010,7 @@ int point_to_octets(const point_t *P, unsigned char to[129], BN_CTX *ctx)
|
||||
fp2_to_bin(y, to + 65);
|
||||
fp2_cleanup(x);
|
||||
fp2_cleanup(y);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2090,7 +2121,7 @@ int point_add(point_t *R, const point_t *P, const point_t *Q, const BIGNUM *p, B
|
||||
|
||||
if (!point_get_affine_coordinates(P, x1, y1)
|
||||
|| !point_get_affine_coordinates(Q, x2, y2)
|
||||
|| !fp2_add(t, y1, y2, p, ctx)) {
|
||||
|| !fp2_add(t, y1, y2, p, ctx)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -2195,6 +2226,7 @@ int point_mul_generator(point_t *R, const BIGNUM *k, const BIGNUM *p, BN_CTX *ct
|
||||
return point_mul(R, k, &G, p, ctx);
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int point_test(const BIGNUM *p, BN_CTX *ctx)
|
||||
{
|
||||
const char *_G[] = {
|
||||
@@ -2263,7 +2295,7 @@ static int point_test(const BIGNUM *p, BN_CTX *ctx)
|
||||
printf("point test %d: %s\n", __LINE__, ok ? "ok" : "error");
|
||||
|
||||
point_sub(&P, &P, &G, p, ctx);
|
||||
ok = point_equ_hex(&P, sub_3G_G, ctx);
|
||||
ok = point_equ_hex(&P, sub_3G_G, ctx);
|
||||
printf("point test %d: %s\n", __LINE__, ok ? "ok" : "error");
|
||||
|
||||
point_neg(&P, &G, p, ctx);
|
||||
@@ -2290,11 +2322,12 @@ static int point_test(const BIGNUM *p, BN_CTX *ctx)
|
||||
|
||||
ok = point_equ(&P, &G);
|
||||
printf("point test %d: %s\n", __LINE__, ok ? "ok" : "error");
|
||||
|
||||
|
||||
//fp12_cleanup(x);
|
||||
//fp12_cleanup(y);
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int eval_tangent(fp12_t r, const point_t *T, const BIGNUM *xP, const BIGNUM *yP,
|
||||
const BIGNUM *p, BN_CTX *ctx)
|
||||
@@ -2315,7 +2348,7 @@ static int eval_tangent(fp12_t r, const point_t *T, const BIGNUM *xP, const BIGN
|
||||
}
|
||||
|
||||
point_get_ext_affine_coordinates(T, xT, yT, p, ctx);
|
||||
|
||||
|
||||
ret = 0;
|
||||
if (!fp12_set_bn(x, xP)
|
||||
|| !fp12_set_bn(y, yP)
|
||||
@@ -2343,14 +2376,14 @@ end:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int eval_line(fp12_t r, const point_t *T, const point_t *Q,
|
||||
static int eval_line(fp12_t r, const point_t *T, const point_t *Q,
|
||||
const BIGNUM *xP, const BIGNUM *yP,
|
||||
const BIGNUM *p, BN_CTX *ctx)
|
||||
{
|
||||
int ret;
|
||||
fp12_t x, y, lambda, t;
|
||||
fp12_t xT, yT, xQ, yQ;
|
||||
|
||||
|
||||
ret = 1;
|
||||
ret &= fp12_init(x, ctx);
|
||||
ret &= fp12_init(y, ctx);
|
||||
@@ -2445,6 +2478,8 @@ static int final_expo(fp12_t r, const fp12_t a, const BIGNUM *k, const BIGNUM *p
|
||||
}
|
||||
}
|
||||
fp12_copy(r, t);
|
||||
|
||||
fp12_cleanup(t);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2478,11 +2513,11 @@ static int fast_final_expo(fp12_t r, const fp12_t a, const BIGNUM *k, const BIGN
|
||||
if (!fp12_copy(t0, t)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if(!fp12_fast_expo_p2(t, t, p, ctx)){
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (!fp12_mul(t, t0, t, p, ctx)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -2503,6 +2538,9 @@ static int fast_final_expo(fp12_t r, const fp12_t a, const BIGNUM *k, const BIGN
|
||||
}
|
||||
}
|
||||
fp12_copy(r, t);
|
||||
|
||||
fp12_cleanup(t);
|
||||
fp12_cleanup(t0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2517,7 +2555,7 @@ static int rate(fp12_t f, const point_t *Q, const BIGNUM *xP, const BIGNUM *yP,
|
||||
memset(&T, 0, sizeof(T));
|
||||
memset(&Q1, 0, sizeof(Q1));
|
||||
memset(&Q2, 0, sizeof(Q2));
|
||||
|
||||
|
||||
point_init(&T, ctx);
|
||||
point_init(&Q1, ctx);
|
||||
point_init(&Q2, ctx);
|
||||
@@ -2582,7 +2620,7 @@ static int rate(fp12_t f, const point_t *Q, const BIGNUM *xP, const BIGNUM *yP,
|
||||
eval_line(g, &T, &Q2, xP, yP, p, ctx);
|
||||
fp12_mul(f, f, g, p, ctx);
|
||||
|
||||
/* T = T - Q2 */
|
||||
/* T = T - Q2 */
|
||||
point_add(&T, &T, &Q2, p, ctx);
|
||||
|
||||
#ifdef NOSM9_FAST
|
||||
@@ -2662,6 +2700,7 @@ int rate_pairing(fp12_t r, const point_t *Q, const EC_POINT *P, BN_CTX *ctx)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if SM9_TEST
|
||||
static int rate_test(void)
|
||||
{
|
||||
const char *Ppubs_str[] = {
|
||||
@@ -2699,7 +2738,7 @@ static int rate_test(void)
|
||||
point_set_affine_coordinates_hex(&Ppubs, Ppubs_str);
|
||||
|
||||
fp12_init(g, ctx);
|
||||
rate_pairing(g, &Ppubs, P1, ctx);
|
||||
rate_pairing(g, &Ppubs, P1, ctx);
|
||||
|
||||
ok = fp12_equ_hex(g, g_str, ctx);
|
||||
printf("rate %d: %s\n", __LINE__, ok ? "ok" : "error");
|
||||
@@ -2711,6 +2750,7 @@ static int rate_test(void)
|
||||
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* for SM9 sign, the (xP, yP) is the fixed generator of E(Fp)
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
LIBS=../../libcrypto
|
||||
SOURCE[../../libcrypto]=\
|
||||
sms4_common.c sms4_setkey.c sms4_enc.c sms4_enc_nblks.c \
|
||||
sms4_common.c sms4_setkey.c sms4_enc.c sms4_enc_avx2.c sms4_ede.c \
|
||||
sms4_ecb.c sms4_cbc.c sms4_cfb.c sms4_ctr.c sms4_ofb.c sms4_wrap.c
|
||||
|
||||
|
||||
INCLUDE[sms4_setkey.o]=../modes
|
||||
INCLUDE[sms4_enc.o]=../modes
|
||||
INCLUDE[sms4_enc_avx2.o]=../modes
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
129
crypto/sms4/sms4_ede.c
Normal file
129
crypto/sms4/sms4_ede.c
Normal file
@@ -0,0 +1,129 @@
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2014 - 2019 The GmSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the GmSSL Project.
|
||||
* (http://gmssl.org/)"
|
||||
*
|
||||
* 4. The name "GmSSL Project" must not be used to endorse or promote
|
||||
* products derived from this software without prior written
|
||||
* permission. For written permission, please contact
|
||||
* guanzhi1980@gmail.com.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "GmSSL"
|
||||
* nor may "GmSSL" appear in their names without prior written
|
||||
* permission of the GmSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the GmSSL Project
|
||||
* (http://gmssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE GmSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE GmSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
#include <openssl/sms4.h>
|
||||
#include <openssl/modes.h>
|
||||
|
||||
|
||||
void sms4_ede_set_encrypt_key(sms4_ede_key_t *key,
|
||||
const unsigned char user_key[48])
|
||||
{
|
||||
sms4_set_encrypt_key(&key->k1, user_key);
|
||||
sms4_set_decrypt_key(&key->k2, user_key + 16);
|
||||
sms4_set_encrypt_key(&key->k3, user_key + 32);
|
||||
}
|
||||
|
||||
void sms4_ede_set_decrypt_key(sms4_ede_key_t *key,
|
||||
const unsigned char user_key[48])
|
||||
{
|
||||
sms4_set_decrypt_key(&key->k1, user_key + 32);
|
||||
sms4_set_encrypt_key(&key->k2, user_key + 16);
|
||||
sms4_set_decrypt_key(&key->k3, user_key);
|
||||
}
|
||||
|
||||
void sms4_ede_encrypt(const unsigned char in[16], unsigned char out[16],
|
||||
const sms4_ede_key_t *key)
|
||||
{
|
||||
sms4_encrypt(in, out, &key->k1);
|
||||
sms4_encrypt(out, out, &key->k2);
|
||||
sms4_encrypt(out, out, &key->k3);
|
||||
}
|
||||
|
||||
void sms4_ede_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const sms4_ede_key_t *key, int enc)
|
||||
{
|
||||
sms4_ede_encrypt(in, out, key);
|
||||
}
|
||||
|
||||
void sms4_ede_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const sms4_ede_key_t *key, unsigned char *iv, int enc)
|
||||
{
|
||||
if (enc)
|
||||
CRYPTO_cbc128_encrypt(in, out, len, key, iv,
|
||||
(block128_f)sms4_ede_encrypt);
|
||||
else CRYPTO_cbc128_decrypt(in, out, len, key, iv,
|
||||
(block128_f)sms4_ede_encrypt);
|
||||
}
|
||||
|
||||
void sms4_ede_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const sms4_ede_key_t *key, unsigned char *iv, int *num,
|
||||
int enc)
|
||||
{
|
||||
CRYPTO_cfb128_encrypt(in, out, len, key, iv, num, enc,
|
||||
(block128_f)sms4_ede_encrypt);
|
||||
}
|
||||
|
||||
void sms4_ede_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const sms4_ede_key_t *key, unsigned char *iv, int *num)
|
||||
{
|
||||
CRYPTO_ofb128_encrypt(in, out, len, key, iv, num,
|
||||
(block128_f)sms4_ede_encrypt);
|
||||
}
|
||||
|
||||
void sms4_ede_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const sms4_ede_key_t *key, unsigned char *iv,
|
||||
unsigned char ecount_buf[SMS4_BLOCK_SIZE], unsigned int *num)
|
||||
{
|
||||
CRYPTO_ctr128_encrypt(in, out, len, key, iv, ecount_buf, num,
|
||||
(block128_f)sms4_ede_encrypt);
|
||||
}
|
||||
|
||||
int sms4_ede_wrap_key(sms4_ede_key_t *key, const unsigned char *iv,
|
||||
unsigned char *out, const unsigned char *in, unsigned int inlen)
|
||||
{
|
||||
return CRYPTO_128_wrap(key, iv, out, in, inlen,
|
||||
(block128_f)sms4_ede_encrypt);
|
||||
}
|
||||
|
||||
int sms4_ede_unwrap_key(sms4_ede_key_t *key, const unsigned char *iv,
|
||||
unsigned char *out, const unsigned char *in, unsigned int inlen)
|
||||
{
|
||||
return CRYPTO_128_unwrap(key, iv, out, in, inlen,
|
||||
(block128_f)sms4_ede_encrypt);
|
||||
}
|
||||
@@ -47,39 +47,87 @@
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <openssl/sms4.h>
|
||||
#include "internal/rotate.h"
|
||||
#include "modes_lcl.h"
|
||||
#include "sms4_lcl.h"
|
||||
|
||||
|
||||
#define L32(x) \
|
||||
((x) ^ \
|
||||
ROT32((x), 2) ^ \
|
||||
ROT32((x), 10) ^ \
|
||||
ROT32((x), 18) ^ \
|
||||
ROT32((x), 24))
|
||||
#define L32(x) \
|
||||
((x) ^ \
|
||||
ROL32((x), 2) ^ \
|
||||
ROL32((x), 10) ^ \
|
||||
ROL32((x), 18) ^ \
|
||||
ROL32((x), 24))
|
||||
|
||||
#define ROUND(x0, x1, x2, x3, x4, i) \
|
||||
x4 = x1 ^ x2 ^ x3 ^ *(rk + i); \
|
||||
x4 = S32(x4); \
|
||||
#define ROUND_SBOX(x0, x1, x2, x3, x4, i) \
|
||||
x4 = x1 ^ x2 ^ x3 ^ *(rk + i); \
|
||||
x4 = S32(x4); \
|
||||
x4 = x0 ^ L32(x4)
|
||||
|
||||
void sms4_encrypt(const unsigned char *in, unsigned char *out, const sms4_key_t *key)
|
||||
#define ROUND_TBOX(x0, x1, x2, x3, x4, i) \
|
||||
x4 = x1 ^ x2 ^ x3 ^ *(rk + i); \
|
||||
t0 = ROL32(SMS4_T[(uint8_t)x4], 8); \
|
||||
x4 >>= 8; \
|
||||
x0 ^= t0; \
|
||||
t0 = ROL32(SMS4_T[(uint8_t)x4], 16); \
|
||||
x4 >>= 8; \
|
||||
x0 ^= t0; \
|
||||
t0 = ROL32(SMS4_T[(uint8_t)x4], 24); \
|
||||
x4 >>= 8; \
|
||||
x0 ^= t0; \
|
||||
t1 = SMS4_T[x4]; \
|
||||
x4 = x0 ^ t1
|
||||
|
||||
#define ROUND_DBOX(x0, x1, x2, x3, x4, i) \
|
||||
x4 = x1 ^ x2 ^ x3 ^ *(rk + i); \
|
||||
x4 = x0 ^ SMS4_D[(uint16_t)(x4 >> 16)] ^ \
|
||||
ROL32(SMS4_D[(uint16_t)x4], 16)
|
||||
|
||||
#define ROUND ROUND_TBOX
|
||||
|
||||
|
||||
void sms4_encrypt(const unsigned char in[16], unsigned char out[16], const sms4_key_t *key)
|
||||
{
|
||||
const uint32_t *rk = key->rk;
|
||||
uint32_t x0, x1, x2, x3, x4;
|
||||
uint32_t t0, t1;
|
||||
|
||||
x0 = GET32(in );
|
||||
x1 = GET32(in + 4);
|
||||
x2 = GET32(in + 8);
|
||||
x3 = GET32(in + 12);
|
||||
|
||||
x0 = GETU32(in );
|
||||
x1 = GETU32(in + 4);
|
||||
x2 = GETU32(in + 8);
|
||||
x3 = GETU32(in + 12);
|
||||
ROUNDS(x0, x1, x2, x3, x4);
|
||||
|
||||
PUT32(x0, out );
|
||||
PUT32(x4, out + 4);
|
||||
PUT32(x3, out + 8);
|
||||
PUT32(x2, out + 12);
|
||||
|
||||
x0 = x1 = x2 = x3 = x4 = 0;
|
||||
PUTU32(out , x0);
|
||||
PUTU32(out + 4, x4);
|
||||
PUTU32(out + 8, x3);
|
||||
PUTU32(out + 12, x2);
|
||||
}
|
||||
|
||||
/* caller make sure counter not overflow */
|
||||
void sms4_ctr32_encrypt_blocks(const unsigned char *in, unsigned char *out,
|
||||
size_t blocks, const sms4_key_t *key, const unsigned char iv[16])
|
||||
{
|
||||
const uint32_t *rk = key->rk;
|
||||
unsigned int c0 = GETU32(iv );
|
||||
unsigned int c1 = GETU32(iv + 4);
|
||||
unsigned int c2 = GETU32(iv + 8);
|
||||
unsigned int c3 = GETU32(iv + 12);
|
||||
uint32_t x0, x1, x2, x3, x4;
|
||||
uint32_t t0, t1;
|
||||
|
||||
while (blocks--) {
|
||||
x0 = c0;
|
||||
x1 = c1;
|
||||
x2 = c2;
|
||||
x3 = c3;
|
||||
ROUNDS(x0, x1, x2, x3, x4);
|
||||
PUTU32(out , GETU32(in ) ^ x0);
|
||||
PUTU32(out + 4, GETU32(in + 4) ^ x4);
|
||||
PUTU32(out + 8, GETU32(in + 8) ^ x3);
|
||||
PUTU32(out + 12, GETU32(in + 12) ^ x2);
|
||||
in += 16;
|
||||
out += 16;
|
||||
c3++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2014 - 2016 The GmSSL Project. All rights reserved.
|
||||
* Copyright (c) 2014 - 2019 The GmSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -47,32 +47,15 @@
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include <immintrin.h>
|
||||
#include <openssl/sms4.h>
|
||||
#include "internal/rotate.h"
|
||||
#include "modes_lcl.h"
|
||||
#include "sms4_lcl.h"
|
||||
|
||||
static __m256i mask_ffff;
|
||||
static __m256i vindex_0s;
|
||||
static __m256i vindex_4i;
|
||||
static __m256i vindex_swap;
|
||||
static __m256i vindex_read;
|
||||
#ifdef SMS4_AVX2
|
||||
# include <immintrin.h>
|
||||
|
||||
|
||||
void sms4_avx2_encrypt_init(sms4_key_t *key)
|
||||
{
|
||||
mask_ffff = _mm256_set1_epi32(0xffff);
|
||||
vindex_0s = _mm256_set1_epi32(0);
|
||||
vindex_4i = _mm256_setr_epi32(0,4,8,12,16,20,24,28);
|
||||
vindex_read = _mm256_setr_epi32(0,8,16,24,1,9,17,25);
|
||||
vindex_swap = _mm256_setr_epi8(
|
||||
3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12,
|
||||
3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12
|
||||
);
|
||||
sms4_init_sbox32();
|
||||
}
|
||||
|
||||
#define GET_BLKS(x0, x1, x2, x3, in) \
|
||||
# define GET_BLKS(x0, x1, x2, x3, in) \
|
||||
t0 = _mm256_i32gather_epi32((int *)(in+4*0), vindex_4i, 4); \
|
||||
t1 = _mm256_i32gather_epi32((int *)(in+4*1), vindex_4i, 4); \
|
||||
t2 = _mm256_i32gather_epi32((int *)(in+4*2), vindex_4i, 4); \
|
||||
@@ -82,7 +65,7 @@ void sms4_avx2_encrypt_init(sms4_key_t *key)
|
||||
x2 = _mm256_shuffle_epi8(t2, vindex_swap); \
|
||||
x3 = _mm256_shuffle_epi8(t3, vindex_swap)
|
||||
|
||||
#define PUT_BLKS(out, x0, x1, x2, x3) \
|
||||
# define PUT_BLKS(out, x0, x1, x2, x3) \
|
||||
t0 = _mm256_shuffle_epi8(x0, vindex_swap); \
|
||||
t1 = _mm256_shuffle_epi8(x1, vindex_swap); \
|
||||
t2 = _mm256_shuffle_epi8(x2, vindex_swap); \
|
||||
@@ -91,59 +74,135 @@ void sms4_avx2_encrypt_init(sms4_key_t *key)
|
||||
_mm256_storeu_si256((__m256i *)(out+32*1), t1); \
|
||||
_mm256_storeu_si256((__m256i *)(out+32*2), t2); \
|
||||
_mm256_storeu_si256((__m256i *)(out+32*3), t3); \
|
||||
x0 = _mm256_i32gather_epi32((int *)(in+32*0), vindex_read, 4); \
|
||||
x1 = _mm256_i32gather_epi32((int *)(in+32*1), vindex_read, 4); \
|
||||
x2 = _mm256_i32gather_epi32((int *)(in+32*2), vindex_read, 4); \
|
||||
x3 = _mm256_i32gather_epi32((int *)(in+32*3), vindex_read, 4); \
|
||||
_mm256_storeu_si256((__m256i *)(out+2*0), x0); \
|
||||
_mm256_storeu_si256((__m256i *)(out+2*1), x1); \
|
||||
_mm256_storeu_si256((__m256i *)(out+2*2), x2); \
|
||||
_mm256_storeu_si256((__m256i *)(out+2*3), x3)
|
||||
x0 = _mm256_i32gather_epi32((int *)(out+8*0), vindex_read, 4); \
|
||||
x1 = _mm256_i32gather_epi32((int *)(out+8*1), vindex_read, 4); \
|
||||
x2 = _mm256_i32gather_epi32((int *)(out+8*2), vindex_read, 4); \
|
||||
x3 = _mm256_i32gather_epi32((int *)(out+8*3), vindex_read, 4); \
|
||||
_mm256_storeu_si256((__m256i *)(out+32*0), x0); \
|
||||
_mm256_storeu_si256((__m256i *)(out+32*1), x1); \
|
||||
_mm256_storeu_si256((__m256i *)(out+32*2), x2); \
|
||||
_mm256_storeu_si256((__m256i *)(out+32*3), x3)
|
||||
|
||||
#define S(x0, t0, t1, t2) \
|
||||
t0 = _mm256_and_si256(x0, mask_ffff); \
|
||||
t1 = _mm256_i32gather_epi32(SBOX32L, t0, 4); \
|
||||
t0 = _mm256_srli_epi32(x0, 16); \
|
||||
t2 = _mm256_i32gather_epi32(SBOX32H, t0, 4); \
|
||||
x0 = _mm256_xor_si256(t1, t2)
|
||||
# define _mm256_rotl_epi32(a, i) _mm256_xor_si256( \
|
||||
_mm256_slli_epi32(a, i), _mm256_srli_epi32(a, 32 - i))
|
||||
|
||||
#define ROT(r0, x0, i, t0, t1) \
|
||||
t0 = _mm256_slli_epi32(x0, i); \
|
||||
t1 = _mm256_srli_epi32(x0,32-i); \
|
||||
r0 = _mm256_xor_si256(t0, t1)
|
||||
# define INDEX_MASK_TBOX 0xff
|
||||
|
||||
#define L(x0, t0, t1, t2, t3, t4) \
|
||||
ROT(t0, x0, 2, t2, t3); \
|
||||
ROT(t1, x0, 10, t2, t3); \
|
||||
t4 = _mm256_xor_si256(t0, t1); \
|
||||
ROT(t0, x0, 18, t2, t3); \
|
||||
ROT(t1, x0, 24, t2, t3); \
|
||||
t3 = _mm256_xor_si256(t0, t1); \
|
||||
t2 = _mm256_xor_si256(x0, t3); \
|
||||
x0 = _mm256_xor_si256(t2, t4)
|
||||
# define ROUND_TBOX(x0, x1, x2, x3, x4, i) \
|
||||
t0 = _mm256_set1_epi32(*(rk + i)); \
|
||||
t1 = _mm256_xor_si256(x1, x2); \
|
||||
t2 = _mm256_xor_si256(x3, t0); \
|
||||
x4 = _mm256_xor_si256(t1, t2); \
|
||||
t0 = _mm256_and_si256(x4, vindex_mask); \
|
||||
t0 = _mm256_i32gather_epi32((int *)SMS4_T, t0, 4); \
|
||||
t0 = _mm256_rotl_epi32(t0, 8); \
|
||||
x4 = _mm256_srli_epi32(x4, 8); \
|
||||
x0 = _mm256_xor_si256(x0, t0); \
|
||||
t0 = _mm256_and_si256(x4, vindex_mask); \
|
||||
t0 = _mm256_i32gather_epi32((int *)SMS4_T, t0, 4); \
|
||||
t0 = _mm256_rotl_epi32(t0, 16); \
|
||||
x4 = _mm256_srli_epi32(x4, 8); \
|
||||
x0 = _mm256_xor_si256(x0, t0); \
|
||||
t0 = _mm256_and_si256(x4, vindex_mask); \
|
||||
t0 = _mm256_i32gather_epi32((int *)SMS4_T, t0, 4); \
|
||||
t0 = _mm256_rotl_epi32(t0, 24); \
|
||||
x4 = _mm256_srli_epi32(x4, 8); \
|
||||
x0 = _mm256_xor_si256(x0, t0); \
|
||||
t1 = _mm256_i32gather_epi32((int *)SMS4_T, x4, 4); \
|
||||
x4 = _mm256_xor_si256(x0, t1)
|
||||
|
||||
#define ROUND(x0, x1, x2, x3, x4, i) \
|
||||
t0 = _mm256_i32gather_epi32(rk+i, vindex_0s, 4); \
|
||||
t1 = _mm256_xor_si256(x1, x2); \
|
||||
t2 = _mm256_xor_si256(x3, t0); \
|
||||
t0 = _mm256_xor_si256(t1, t2); \
|
||||
S(t0, x4, t1, t2); \
|
||||
L(t0, x4, t1, t2, t3, t4); \
|
||||
x4 = _mm256_xor_si256(x0, t0);
|
||||
# define INDEX_MASK_DBOX 0xffff
|
||||
|
||||
# define ROUND_DBOX(x0, x1, x2, x3, x4, i) \
|
||||
t0 = _mm256_set1_epi32(*(rk + i)); \
|
||||
t1 = _mm256_xor_si256(x1, x2); \
|
||||
t2 = _mm256_xor_si256(x3, t0); \
|
||||
x4 = _mm256_xor_si256(t1, t2); \
|
||||
t0 = _mm256_srli_epi32(x4, 16); \
|
||||
t1 = _mm256_i32gather_epi32((int *)SMS4_D, t0, 4); \
|
||||
t2 = _mm256_and_si256(x4, vindex_mask); \
|
||||
t3 = _mm256_i32gather_epi32((int *)SMS4_D, t2, 4); \
|
||||
t0 = _mm256_rotl_epi32(t3, 16); \
|
||||
x4 = _mm256_xor_si256(x0, t1); \
|
||||
x4 = _mm256_xor_si256(x4, t0)
|
||||
|
||||
# define ROUND ROUND_TBOX
|
||||
# define INDEX_MASK INDEX_MASK_TBOX
|
||||
|
||||
|
||||
void sms4_avx2_encrypt_8blocks(const unsigned char *in, unsigned char *out, const sms4_key_t *key)
|
||||
void sms4_avx2_ecb_encrypt_blocks(const unsigned char *in, unsigned char *out,
|
||||
size_t blocks, const sms4_key_t *key)
|
||||
{
|
||||
const int *rk = (int *)key->rk;
|
||||
__m256i x0, x1, x2, x3, x4;
|
||||
__m256i t0, t1, t2, t3, t4;
|
||||
GET_BLKS(x0, x1, x2, x3, in);
|
||||
ROUNDS(x0, x1, x2, x3, x4);
|
||||
PUT_BLKS(out, x0, x4, x3, x2);
|
||||
__m256i t0, t1, t2, t3;
|
||||
__m256i vindex_4i = _mm256_setr_epi32(0,4,8,12,16,20,24,28);
|
||||
__m256i vindex_mask = _mm256_set1_epi32(INDEX_MASK);
|
||||
__m256i vindex_read = _mm256_setr_epi32(0,8,16,24,1,9,17,25);
|
||||
__m256i vindex_swap = _mm256_setr_epi8(
|
||||
3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12,
|
||||
3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12
|
||||
);
|
||||
|
||||
while (blocks >= 8) {
|
||||
GET_BLKS(x0, x1, x2, x3, in);
|
||||
ROUNDS(x0, x1, x2, x3, x4);
|
||||
PUT_BLKS(out, x0, x4, x3, x2);
|
||||
in += 128;
|
||||
out += 128;
|
||||
blocks -= 8;
|
||||
}
|
||||
|
||||
while (blocks--) {
|
||||
sms4_encrypt(in, out, key);
|
||||
in += 16;
|
||||
out += 16;
|
||||
}
|
||||
}
|
||||
|
||||
void sms4_avx2_encrypt_16blocks(const unsigned char *in, unsigned char *out, const sms4_key_t *key)
|
||||
void sms4_avx2_ctr32_encrypt_blocks(const unsigned char *in, unsigned char *out,
|
||||
size_t blocks, const sms4_key_t *key, const unsigned char iv[16])
|
||||
{
|
||||
sms4_encrypt_8blocks(key, in, out);
|
||||
sms4_encrypt_8blocks(key, in + 16*8, out + 16*8);
|
||||
const int *rk = (int *)key->rk;
|
||||
__m256i x0, x1, x2, x3, x4;
|
||||
__m256i t0, t1, t2, t3;
|
||||
__m256i vindex_4i = _mm256_setr_epi32(0,4,8,12,16,20,24,28);
|
||||
__m256i vindex_mask = _mm256_set1_epi32(INDEX_MASK);
|
||||
__m256i vindex_read = _mm256_setr_epi32(0,8,16,24,1,9,17,25);
|
||||
__m256i vindex_swap = _mm256_setr_epi8(
|
||||
3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12,
|
||||
3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12
|
||||
);
|
||||
__m256i incr = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7);
|
||||
int c0 = (int)GETU32(iv );
|
||||
int c1 = (int)GETU32(iv + 4);
|
||||
int c2 = (int)GETU32(iv + 8);
|
||||
int c3 = (int)GETU32(iv + 12);
|
||||
|
||||
while (blocks >= 8) {
|
||||
x0 = _mm256_set1_epi32(c0);
|
||||
x1 = _mm256_set1_epi32(c1);
|
||||
x2 = _mm256_set1_epi32(c2);
|
||||
x3 = _mm256_set1_epi32(c3);
|
||||
x3 = _mm256_add_epi32(x3, incr);
|
||||
ROUNDS(x0, x1, x2, x3, x4);
|
||||
GET_BLKS(t0, t1, t2, t3, in);
|
||||
x0 = _mm256_xor_si256(x0, t0);
|
||||
x4 = _mm256_xor_si256(x4, t1);
|
||||
x3 = _mm256_xor_si256(x3, t2);
|
||||
x2 = _mm256_xor_si256(x2, t3);
|
||||
PUT_BLKS(out, x0, x4, x3, x2);
|
||||
c3 += 8;
|
||||
in += 128;
|
||||
out += 128;
|
||||
blocks -= 8;
|
||||
}
|
||||
|
||||
if (blocks) {
|
||||
unsigned char ctr[16];
|
||||
memcpy(ctr, iv, 12);
|
||||
PUTU32(ctr + 12, c3);
|
||||
sms4_ctr32_encrypt_blocks(in, out, blocks, key, ctr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2014 - 2017 The GmSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the GmSSL Project.
|
||||
* (http://gmssl.org/)"
|
||||
*
|
||||
* 4. The name "GmSSL Project" must not be used to endorse or promote
|
||||
* products derived from this software without prior written
|
||||
* permission. For written permission, please contact
|
||||
* guanzhi1980@gmail.com.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "GmSSL"
|
||||
* nor may "GmSSL" appear in their names without prior written
|
||||
* permission of the GmSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the GmSSL Project
|
||||
* (http://gmssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE GmSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE GmSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include <openssl/sms4.h>
|
||||
|
||||
void sms4_encrypt_init(sms4_key_t *key)
|
||||
{
|
||||
}
|
||||
|
||||
void sms4_encrypt_8blocks(const unsigned char *in, unsigned char *out, const sms4_key_t *key)
|
||||
{
|
||||
sms4_encrypt(in, out, key);
|
||||
sms4_encrypt(in + 16, out + 16, key);
|
||||
sms4_encrypt(in + 16 * 2, out + 16 * 2, key);
|
||||
sms4_encrypt(in + 16 * 3, out + 16 * 3, key);
|
||||
sms4_encrypt(in + 16 * 4, out + 16 * 4, key);
|
||||
sms4_encrypt(in + 16 * 5, out + 16 * 5, key);
|
||||
sms4_encrypt(in + 16 * 6, out + 16 * 6, key);
|
||||
sms4_encrypt(in + 16 * 7, out + 16 * 7, key);
|
||||
}
|
||||
|
||||
void sms4_encrypt_16blocks(const unsigned char *in, unsigned char *out, const sms4_key_t *key)
|
||||
{
|
||||
sms4_encrypt_8blocks(in, out, key);
|
||||
sms4_encrypt_8blocks(in + 16 * 8, out + 16 * 8, key);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2014 - 2017 The GmSSL Project. All rights reserved.
|
||||
* Copyright (c) 2014 - 2019 The GmSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -50,37 +50,18 @@
|
||||
#ifndef HEADER_SMS4_LCL_H
|
||||
#define HEADER_SMS4_LCL_H
|
||||
|
||||
#include <openssl/sms4.h>
|
||||
#include <openssl/e_os2.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern const uint8_t SMS4_S[256];
|
||||
extern const uint32_t SMS4_T[256];
|
||||
extern const uint32_t SMS4_D[65536];
|
||||
|
||||
extern uint8_t SBOX[256];
|
||||
extern uint32_t SBOX32L[256 * 256];
|
||||
extern uint32_t SBOX32H[256 * 256];
|
||||
|
||||
|
||||
#define GET32(pc) ( \
|
||||
((uint32_t)(pc)[0] << 24) ^ \
|
||||
((uint32_t)(pc)[1] << 16) ^ \
|
||||
((uint32_t)(pc)[2] << 8) ^ \
|
||||
((uint32_t)(pc)[3]))
|
||||
|
||||
#define PUT32(st, ct) \
|
||||
(ct)[0] = (uint8_t)((st) >> 24); \
|
||||
(ct)[1] = (uint8_t)((st) >> 16); \
|
||||
(ct)[2] = (uint8_t)((st) >> 8); \
|
||||
(ct)[3] = (uint8_t)(st)
|
||||
|
||||
#define ROT32(x,i) \
|
||||
(((x) << i) | ((x) >> (32-i)))
|
||||
|
||||
#define S32(A) \
|
||||
((SBOX[((A) >> 24) ] << 24) ^ \
|
||||
(SBOX[((A) >> 16) & 0xff] << 16) ^ \
|
||||
(SBOX[((A) >> 8) & 0xff] << 8) ^ \
|
||||
(SBOX[((A)) & 0xff]))
|
||||
#define S32(A) \
|
||||
((SMS4_S[((A) >> 24) ] << 24) ^ \
|
||||
(SMS4_S[((A) >> 16) & 0xff] << 16) ^ \
|
||||
(SMS4_S[((A) >> 8) & 0xff] << 8) ^ \
|
||||
(SMS4_S[((A)) & 0xff]))
|
||||
|
||||
#define ROUNDS(x0, x1, x2, x3, x4) \
|
||||
ROUND(x0, x1, x2, x3, x4, 0); \
|
||||
@@ -116,9 +97,14 @@ extern uint32_t SBOX32H[256 * 256];
|
||||
ROUND(x0, x1, x2, x3, x4, 30); \
|
||||
ROUND(x1, x2, x3, x4, x0, 31)
|
||||
|
||||
void sms4_init_sbox32(void);
|
||||
void sms4_ctr32_encrypt_blocks(const unsigned char *in, unsigned char *out,
|
||||
size_t blocks, const sms4_key_t *key, const unsigned char iv[16]);
|
||||
|
||||
# ifdef SMS4_AVX2
|
||||
void sms4_avx2_ecb_encrypt_blocks(const unsigned char *in, unsigned char *out,
|
||||
size_t blocks, const sms4_key_t *key);
|
||||
void sms4_avx2_ctr32_encrypt_blocks(const unsigned char *in, unsigned char *out,
|
||||
size_t blocks, const sms4_key_t *key, const unsigned char iv[16]);
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2014 - 2017 The GmSSL Project. All rights reserved.
|
||||
* Copyright (c) 2014 - 2019 The GmSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -48,6 +48,8 @@
|
||||
*/
|
||||
|
||||
#include <openssl/sms4.h>
|
||||
#include "internal/rotate.h"
|
||||
#include "modes_lcl.h"
|
||||
#include "sms4_lcl.h"
|
||||
|
||||
static uint32_t FK[4] = {
|
||||
@@ -67,8 +69,8 @@ static uint32_t CK[32] = {
|
||||
|
||||
#define L32_(x) \
|
||||
((x) ^ \
|
||||
ROT32((x), 13) ^ \
|
||||
ROT32((x), 23))
|
||||
ROL32((x), 13) ^ \
|
||||
ROL32((x), 23))
|
||||
|
||||
#define ENC_ROUND(x0, x1, x2, x3, x4, i) \
|
||||
x4 = x1 ^ x2 ^ x3 ^ *(CK + i); \
|
||||
@@ -82,35 +84,36 @@ static uint32_t CK[32] = {
|
||||
x4 = x0 ^ L32_(x4); \
|
||||
*(rk + 31 - i) = x4
|
||||
|
||||
void sms4_set_encrypt_key(sms4_key_t *key, const unsigned char *user_key)
|
||||
void sms4_set_encrypt_key(sms4_key_t *key, const unsigned char user_key[16])
|
||||
{
|
||||
uint32_t *rk = key->rk;
|
||||
uint32_t x0, x1, x2, x3, x4;
|
||||
|
||||
x0 = GET32(user_key ) ^ FK[0];
|
||||
x1 = GET32(user_key + 4) ^ FK[1];
|
||||
x2 = GET32(user_key + 8) ^ FK[2];
|
||||
x3 = GET32(user_key + 12) ^ FK[3];
|
||||
x0 = GETU32(user_key ) ^ FK[0];
|
||||
x1 = GETU32(user_key + 4) ^ FK[1];
|
||||
x2 = GETU32(user_key + 8) ^ FK[2];
|
||||
x3 = GETU32(user_key + 12) ^ FK[3];
|
||||
|
||||
#define ROUND ENC_ROUND
|
||||
ROUNDS(x0, x1, x2, x3, x4);
|
||||
#undef ROUND
|
||||
|
||||
x0 = x1 = x2 = x3 = x4 = 0;
|
||||
}
|
||||
|
||||
void sms4_set_decrypt_key(sms4_key_t *key, const unsigned char *user_key)
|
||||
void sms4_set_decrypt_key(sms4_key_t *key, const unsigned char user_key[16])
|
||||
{
|
||||
uint32_t *rk = key->rk;
|
||||
uint32_t x0, x1, x2, x3, x4;
|
||||
|
||||
x0 = GET32(user_key ) ^ FK[0];
|
||||
x1 = GET32(user_key + 4) ^ FK[1];
|
||||
x2 = GET32(user_key + 8) ^ FK[2];
|
||||
x3 = GET32(user_key + 12) ^ FK[3];
|
||||
x0 = GETU32(user_key ) ^ FK[0];
|
||||
x1 = GETU32(user_key + 4) ^ FK[1];
|
||||
x2 = GETU32(user_key + 8) ^ FK[2];
|
||||
x3 = GETU32(user_key + 12) ^ FK[3];
|
||||
|
||||
#undef ROUND
|
||||
#define ROUND DEC_ROUND
|
||||
ROUNDS(x0, x1, x2, x3, x4);
|
||||
#undef ROUND
|
||||
|
||||
x0 = x1 = x2 = x3 = x4 = 0;
|
||||
}
|
||||
|
||||
47
crypto/zuc/zuc256.c
Normal file
47
crypto/zuc/zuc256.c
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
ZUC_UINT7 D[16] = {
|
||||
0x22,
|
||||
0x2F,
|
||||
0x24,
|
||||
0x2A,
|
||||
0x6D,
|
||||
0x40,
|
||||
0x40,
|
||||
0x40,
|
||||
0x40,
|
||||
0x40,
|
||||
0x40,
|
||||
0x40,
|
||||
0x52,
|
||||
0x10,
|
||||
0x30
|
||||
};
|
||||
|
||||
void ZUC_set_key(ZUC_KEY *key, const unsigned char *user_key, const unsigned char *iv)
|
||||
{
|
||||
LFSR[0] = MAKEU31(K[0], D[0], K[21], K[16]);
|
||||
LFSR[1] = MAKEU31(K[1], D[1], K[22], K[17]);
|
||||
LFSR[2] = MAKEU31(K[2], D[2], K[23], K[18]);
|
||||
LFSR[3] = MAKEU31(K[3], D[3], K[24], K[19]);
|
||||
LFSR[4] = MAKEU31(K[4], D[4], K[25], K[20]);
|
||||
LFSR[5] = MAKEU31(IV[0], (D[5] | IV[17]), K[5], K[26]);
|
||||
LFSR[6] = MAKEU31(IV[1], (D[6] | IV[18]), K[6], K[27]);
|
||||
LFSR[7] = MAKEU31(IV[10], (D[7] | IV[19]), K[7], IV[2]);
|
||||
LFSR[8] = MAKEU31(K[8], (D[8] | IV[20]), IV[13], IV[11]);
|
||||
LFSR[9] = MAKEU31(K[9], (D[9] | IV[21]), IV[12], IV[4]);
|
||||
LFSR[10] = MAKEU31(IV[5], (D[10] | IV[22]), K[10], K[28]);
|
||||
LFSR[11] = MAKEU31(K[11], (D[11] | IV[23]), IV[6], IV[13]);
|
||||
LFSR[12] = MAKEU31(K[12], (D[12] | IV[24]), IV[7], IV[14]);
|
||||
LFSR[13] = MAKEU31(K[13], D[13], IV[15], IV[8]);
|
||||
LFSR[14] = MAKEU31(K[14], (D[14] | (K[31] >> 4)), IV[16], IV[9]);
|
||||
LFSR[15] = MAKEU31(K[15], (D[15] | (K[31] & 0xF0)), K[30], K[29]);
|
||||
|
||||
R1 = R2 = 0;
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
BitReconstruction3(X0, X1, X2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -192,6 +192,7 @@ void ZUC_set_key(ZUC_KEY *key, const unsigned char *user_key, const unsigned cha
|
||||
for (i = 0; i < 16; i++) {
|
||||
LFSR[i] = MAKEU31(user_key[i], KD[i], iv[i]);
|
||||
}
|
||||
|
||||
R1 = 0;
|
||||
R2 = 0;
|
||||
|
||||
@@ -246,3 +247,135 @@ void ZUC_generate_keystream(ZUC_KEY *key, size_t nwords, uint32_t *keystream)
|
||||
key->R1 = R1;
|
||||
key->R2 = R2;
|
||||
}
|
||||
|
||||
#if 0
|
||||
typedef unsigned char ZUC_UINT7;
|
||||
|
||||
static const ZUC_UINT7 D[16] = {
|
||||
0x22,0x2F,0x24,0x2A,0x6D,0x40,0x40,0x40,
|
||||
0x40,0x40,0x40,0x40,0x40,0x52,0x10,0x30
|
||||
};
|
||||
|
||||
#define ZUC256_MAKEU31(a,b,c,d) \
|
||||
(((uint32_t)(a) << 23) | \
|
||||
((uint32_t)(b) << 16) | \
|
||||
((uint32_t)(c) << 8) | \
|
||||
(uint32_t)(d))
|
||||
|
||||
void ZUC256_set_key(ZUC_KEY *key, const unsigned char *K, const unsigned char *IV)
|
||||
{
|
||||
ZUC_UINT31 *LFSR = key->LFSR;
|
||||
uint32_t R1, R2;
|
||||
uint32_t X0, X1, X2;
|
||||
uint32_t W, W1, W2, U, V;
|
||||
int i;
|
||||
|
||||
LFSR[0] = ZUC256_MAKEU31(K[0], D[0], K[21], K[16]);
|
||||
LFSR[1] = ZUC256_MAKEU31(K[1], D[1], K[22], K[17]);
|
||||
LFSR[2] = ZUC256_MAKEU31(K[2], D[2], K[23], K[18]);
|
||||
LFSR[3] = ZUC256_MAKEU31(K[3], D[3], K[24], K[19]);
|
||||
LFSR[4] = ZUC256_MAKEU31(K[4], D[4], K[25], K[20]);
|
||||
LFSR[5] = ZUC256_MAKEU31(IV[0], (D[5] | IV[17]), K[5], K[26]);
|
||||
LFSR[6] = ZUC256_MAKEU31(IV[1], (D[6] | IV[18]), K[6], K[27]);
|
||||
LFSR[7] = ZUC256_MAKEU31(IV[10], (D[7] | IV[19]), K[7], IV[2]);
|
||||
LFSR[8] = ZUC256_MAKEU31(K[8], (D[8] | IV[20]), IV[13], IV[11]);
|
||||
LFSR[9] = ZUC256_MAKEU31(K[9], (D[9] | IV[21]), IV[12], IV[4]);
|
||||
LFSR[10] = ZUC256_MAKEU31(IV[5], (D[10] | IV[22]), K[10], K[28]);
|
||||
LFSR[11] = ZUC256_MAKEU31(K[11], (D[11] | IV[23]), IV[6], IV[13]);
|
||||
LFSR[12] = ZUC256_MAKEU31(K[12], (D[12] | IV[24]), IV[7], IV[14]);
|
||||
LFSR[13] = ZUC256_MAKEU31(K[13], D[13], IV[15], IV[8]);
|
||||
LFSR[14] = ZUC256_MAKEU31(K[14], (D[14] | (K[31] >> 4)), IV[16], IV[9]);
|
||||
LFSR[15] = ZUC256_MAKEU31(K[15], (D[15] | (K[31] & 0x0F)), K[30], K[29]);
|
||||
|
||||
R1 = 0;
|
||||
R2 = 0;
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
BitReconstruction3(X0, X1, X2);
|
||||
W = F(X0, X1, X2);
|
||||
LFSRWithInitialisationMode(W >> 1);
|
||||
}
|
||||
|
||||
BitReconstruction2(X1, X2);
|
||||
F_(X1, X2);
|
||||
LFSRWithWorkMode();
|
||||
|
||||
key->R1 = R1;
|
||||
key->R2 = R2;
|
||||
}
|
||||
|
||||
|
||||
static const ZUC_UINT7 ZUC256_MAC32_D[] = {
|
||||
0x22,0x2F,0x25,0x2A,0x6D,0x40,0x40,0x40,
|
||||
0x40,0x40,0x40,0x40,0x40,0x52,0x10,0x30
|
||||
};
|
||||
|
||||
static const ZUC_UINT7 ZUC256_MAC64_D[] = {
|
||||
0x23,0x2F,0x24,0x2A,0x6D,0x40,0x40,0x40,
|
||||
0x40,0x40,0x40,0x40,0x40,0x52,0x10,0x30,
|
||||
};
|
||||
|
||||
static const ZUC_UINT7 ZUC256_MAC128_D[] = {
|
||||
0x23,0x2F,0x25,0x2A,0x6D,0x40,0x40,0x40,
|
||||
0x40,0x40,0x40,0x40,0x40,0x52,0x10,0x30,
|
||||
};
|
||||
|
||||
int ZUC256_set_mac_key(ZUC_KEY *key, const unsigned char *key,
|
||||
const unsigned char *IV, int macbits)
|
||||
{
|
||||
const ZUC_UINT7 *K;
|
||||
ZUC_UINT31 *LFSR = key->LFSR;
|
||||
uint32_t R1, R2;
|
||||
uint32_t X0, X1, X2;
|
||||
uint32_t W, W1, W2, U, V;
|
||||
int i;
|
||||
|
||||
switch (macbits) {
|
||||
case 32:
|
||||
D = ZUC256_MAC32_D;
|
||||
break;
|
||||
case 64:
|
||||
D = ZUC256_MAC64_D;
|
||||
break;
|
||||
case 128:
|
||||
D = ZUC256_MAC128_D;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
LFSR[0] = MAKEU31(K[0], D[0], K[21], K[16]);
|
||||
LFSR[1] = MAKEU31(K[1], D[1], K[22], K[17]);
|
||||
LFSR[2] = MAKEU31(K[2], D[2], K[23], K[18]);
|
||||
LFSR[3] = MAKEU31(K[3], D[3], K[24], K[19]);
|
||||
LFSR[4] = MAKEU31(K[4], D[4], K[25], K[20]);
|
||||
LFSR[5] = MAKEU31(IV[0], (D[5] | IV[17]), K[5], K[26]);
|
||||
LFSR[6] = MAKEU31(IV[1], (D[6] | IV[18]), K[6], K[27]);
|
||||
LFSR[7] = MAKEU31(IV[10], (D[7] | IV[19]), K[7], IV[2]);
|
||||
LFSR[8] = MAKEU31(K[8], (D[8] | IV[20]), IV[13], IV[11]);
|
||||
LFSR[9] = MAKEU31(K[9], (D[9] | IV[21]), IV[12], IV[4]);
|
||||
LFSR[10] = MAKEU31(IV[5], (D[10] | IV[22]), K[10], K[28]);
|
||||
LFSR[11] = MAKEU31(K[11], (D[11] | IV[23]), IV[6], IV[13]);
|
||||
LFSR[12] = MAKEU31(K[12], (D[12] | IV[24]), IV[7], IV[14]);
|
||||
LFSR[13] = MAKEU31(K[13], D[13], IV[15], IV[8]);
|
||||
LFSR[14] = MAKEU31(K[14], (D[14] | (K[31] >> 4)), IV[16], IV[9]);
|
||||
LFSR[15] = MAKEU31(K[15], (D[15] | (K[31] & 0xF0)), K[30], K[29]);
|
||||
|
||||
R1 = 0;
|
||||
R2 = 0;
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
BitReconstruction3(X0, X1, X2);
|
||||
W = F(X0, X1, X2);
|
||||
LFSRWithInitialisationMode(W >> 1);
|
||||
}
|
||||
|
||||
BitReconstruction2(X1, X2);
|
||||
F_(X1, X2);
|
||||
LFSRWithWorkMode();
|
||||
|
||||
key->R1 = R1;
|
||||
key->R2 = R2;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
121
crypto/zuc/zuc_mac.c
Normal file
121
crypto/zuc/zuc_mac.c
Normal file
@@ -0,0 +1,121 @@
|
||||
|
||||
|
||||
#include <openssl/zuc.h>
|
||||
|
||||
static const ZUC_UINT7 ZUC256_MAC32_D[] = {
|
||||
0x22,0x2F,0x25,0x2A,0x6D,0x40,0x40,0x40,
|
||||
0x40,0x40,0x40,0x40,0x40,0x52,0x10,0x30
|
||||
};
|
||||
|
||||
static const ZUC_UINT7 ZUC256_MAC64_D[] = {
|
||||
0x23,0x2F,0x24,0x2A,0x6D,0x40,0x40,0x40,
|
||||
0x40,0x40,0x40,0x40,0x40,0x52,0x10,0x30,
|
||||
};
|
||||
|
||||
static const ZUC_UINT7 ZUC256_MAC128_D[] = {
|
||||
0x23,0x2F,0x25,0x2A,0x6D,0x40,0x40,0x40,
|
||||
0x40,0x40,0x40,0x40,0x40,0x52,0x10,0x30,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
ZUC_KEY zuc;
|
||||
ZUC_MAC_TAG t1;
|
||||
ZUC_MAC_TAG t2;
|
||||
int macbits;
|
||||
} ZUC256_MAC_CTX;
|
||||
|
||||
|
||||
int ZUC_MAC_init(ZUC_MAC *ctx, const unsigned char *key, int bits,
|
||||
const unsigned char *iv, int macbits)
|
||||
{
|
||||
const ZUC_UINT7 *K;
|
||||
ZUC_UINT31 *LFSR = key->LFSR;
|
||||
uint32_t R1, R2;
|
||||
uint32_t X0, X1, X2;
|
||||
uint32_t W, W1, W2, U, V;
|
||||
int i;
|
||||
|
||||
switch (macbits) {
|
||||
case 32:
|
||||
K = KD32;
|
||||
break;
|
||||
case 64:
|
||||
K = KD64;
|
||||
break;
|
||||
case 128:
|
||||
K = KD128;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
LFSR[0] = MAKEU31(K[0], D[0], K[21], K[16]);
|
||||
LFSR[1] = MAKEU31(K[1], D[1], K[22], K[17]);
|
||||
LFSR[2] = MAKEU31(K[2], D[2], K[23], K[18]);
|
||||
LFSR[3] = MAKEU31(K[3], D[3], K[24], K[19]);
|
||||
LFSR[4] = MAKEU31(K[4], D[4], K[25], K[20]);
|
||||
LFSR[5] = MAKEU31(IV[0], (D[5] | IV[17]), K[5], K[26]);
|
||||
LFSR[6] = MAKEU31(IV[1], (D[6] | IV[18]), K[6], K[27]);
|
||||
LFSR[7] = MAKEU31(IV[10], (D[7] | IV[19]), K[7], IV[2]);
|
||||
LFSR[8] = MAKEU31(K[8], (D[8] | IV[20]), IV[13], IV[11]);
|
||||
LFSR[9] = MAKEU31(K[9], (D[9] | IV[21]), IV[12], IV[4]);
|
||||
LFSR[10] = MAKEU31(IV[5], (D[10] | IV[22]), K[10], K[28]);
|
||||
LFSR[11] = MAKEU31(K[11], (D[11] | IV[23]), IV[6], IV[13]);
|
||||
LFSR[12] = MAKEU31(K[12], (D[12] | IV[24]), IV[7], IV[14]);
|
||||
LFSR[13] = MAKEU31(K[13], D[13], IV[15], IV[8]);
|
||||
LFSR[14] = MAKEU31(K[14], (D[14] | (K[31] >> 4)), IV[16], IV[9]);
|
||||
LFSR[15] = MAKEU31(K[15], (D[15] | (K[31] & 0xF0)), K[30], K[29]);
|
||||
|
||||
R1 = 0;
|
||||
R2 = 0;
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
BitReconstruction3(X0, X1, X2);
|
||||
W = F(X0, X1, X2);
|
||||
LFSRWithInitialisationMode(W >> 1);
|
||||
}
|
||||
|
||||
BitReconstruction2(X1, X2);
|
||||
F_(X1, X2);
|
||||
LFSRWithWorkMode();
|
||||
|
||||
key->R1 = R1;
|
||||
key->R2 = R2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#define MAKEU32(i,A,B) (((A) << (i)) | ((B) >> (32 - (i))))
|
||||
#define MASKU8(i,M) (-(((M) >> (7-i)) & 0x01))
|
||||
|
||||
int ZUC256_MAC32(ZUC256_MAC_CTX *ctx, const unsigned char *data, size_t len)
|
||||
{
|
||||
uint32_t T;
|
||||
uint32_t Z;
|
||||
uint32_t *m = data;
|
||||
|
||||
T = ZUC256_generate_keyword(key);
|
||||
Z0 = ZUC256_generate_keyword(key);
|
||||
Z1 = ZUC256_generate_keyword(key);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
|
||||
T ^= MAKEU32(Z0, Z1, (i * 8 + 0) % 32) & MASKU8(data[i], 7);
|
||||
T ^= MAKEU32(Z0, Z1, (i * 8 + 1) % 32) & MASKU8(data[i], 6);
|
||||
T ^= MAKEU32(Z0, Z1, (i * 8 + 2) % 32) & MASKU8(data[i], 5);
|
||||
T ^= MAKEU32(Z0, Z1, (i * 8 + 3) % 32) & MASKU8(data[i], 4);
|
||||
T ^= MAKEU32(Z0, Z1, (i * 8 + 4) % 32) & MASKU8(data[i], 3);
|
||||
T ^= MAKEU32(Z0, Z1, (i * 8 + 5) % 32) & MASKU8(data[i], 2);
|
||||
T ^= MAKEU32(Z0, Z1, (i * 8 + 6) % 32) & MASKU8(data[i], 1);
|
||||
T ^= MAKEU32(Z0, Z1, (i * 8 + 7) % 32) & MASKU8(data[i], 0);
|
||||
|
||||
if (i % 4 == 3) {
|
||||
Z0 = Z1;
|
||||
Z1 = ZUC256_generate_keyword(key);
|
||||
}
|
||||
}
|
||||
|
||||
T ^= MAKEU32(Z0, Z1, (i * 8) % 32);
|
||||
|
||||
return 0;
|
||||
}
|
||||
210
go/gmssl/sm9.go
Normal file
210
go/gmssl/sm9.go
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 2017 - 2019 The GmSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the GmSSL Project.
|
||||
* (http://gmssl.org/)"
|
||||
*
|
||||
* 4. The name "GmSSL Project" must not be used to endorse or promote
|
||||
* products derived from this software without prior written
|
||||
* permission. For written permission, please contact
|
||||
* guanzhi1980@gmail.com.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "GmSSL"
|
||||
* nor may "GmSSL" appear in their names without prior written
|
||||
* permission of the GmSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the GmSSL Project
|
||||
* (http://gmssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE GmSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE GmSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* +build cgo */
|
||||
package gmssl
|
||||
|
||||
/*
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <openssl/sm9.h>
|
||||
#include <openssl/is_gmssl.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
"errors"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func GetPublicKeyAlgorithmNames() []string {
|
||||
return []string{
|
||||
"DH",
|
||||
"DSA",
|
||||
"RSA",
|
||||
"EC",
|
||||
"X25519",
|
||||
}
|
||||
}
|
||||
|
||||
func GetPairingNames() []string {
|
||||
return []string{
|
||||
"sm9bn256v1",
|
||||
}
|
||||
}
|
||||
|
||||
func GetSchemeNames() []string {
|
||||
return []string{
|
||||
"sm9sign",
|
||||
"sm9encrypt",
|
||||
"sm9keyagreement",
|
||||
}
|
||||
}
|
||||
|
||||
func GetHash1Names() []string {
|
||||
return []string{
|
||||
"sm9hash1_with_sm3",
|
||||
"sm9hash1_with_sha256",
|
||||
}
|
||||
}
|
||||
|
||||
func GetSignAlgorithmNames() []string {
|
||||
return []string{
|
||||
"sm3",
|
||||
}
|
||||
}
|
||||
|
||||
func GetEncryptionAlgorithmNames() []string {
|
||||
return []string{
|
||||
"sm9encrypt_with_sm3_xor",
|
||||
}
|
||||
}
|
||||
|
||||
type SM9MasterSecret struct {
|
||||
msk *C.SM9MasterSecret
|
||||
}
|
||||
|
||||
type SM9PublicParameters struct {
|
||||
mpk *C.SM9PublicParameters
|
||||
}
|
||||
|
||||
type SM9PrivateKey struct {
|
||||
sk *C.SM9PrivateKey
|
||||
}
|
||||
|
||||
type SM9PublicKey struct {
|
||||
pk *C.SM9PublicKey
|
||||
}
|
||||
|
||||
|
||||
func SM9Setup(pairing string, scheme string, hash1 string) (*SM9PublicParameters, *SM9MasterSecret, error) {
|
||||
return nil, nil, nil;
|
||||
}
|
||||
|
||||
func NewSM9MasterSecretFromPEM(pem string, pass string) (*SM9MasterSecret, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (msk *SM9MasterSecret) GetPEM(cipher string, pass string) (string, error) {
|
||||
return nil, nil;
|
||||
}
|
||||
|
||||
func (msk *SM9MasterSecret) GetPublicParametersPEM() (string, error) {
|
||||
return nil, nil;
|
||||
}
|
||||
|
||||
func (msk *SM9MasterSecret) GetText() (string, error) {
|
||||
return nil, nil;
|
||||
}
|
||||
|
||||
func NewSM9PublicParametersFromPEM(pem string) (*SM9PublicParameters, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (mpk *SM9PublicParameters) GetPEM() (string, error) {
|
||||
return nil, nil;
|
||||
}
|
||||
|
||||
func (mpk *SM9PublicParameters) GetText() (string, error) {
|
||||
return nil, nil;
|
||||
}
|
||||
|
||||
func (msk *SM9MasterSecret) ExtractPrivateKey(id string) (*SM9PrivateKey, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (mpk *SM9PublicParameters) ExtractPublicKey(id string) (*SM9PublicKey, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func NewSM9PrivateKeyFromPEM(pem string, pass string) (*SM9PrivateKey, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (sk *SM9PrivateKey) GetPEM(cipher string, pass string) (string, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (sk *SM9PrivateKey) GetPublicKeyPEM() (string, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (sk *SM9PrivateKey) GetText() (string, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func NewSM9PublicKeyFromPEM(pem string) (*SM9PublicKey, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (pk *SM9PublicKey) GetPEM() (string, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (pk *SM9PublicKey) GetText() (string, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (sk *SM9PrivateKey) Sign(alg string, data []byte) ([]byte, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (mpk *SM9PublicParameters) Verify(alg string, data []byte, sig []byte, id string) (error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (mpk *SM9PublicParameters) Encrypt(alg string, in []byte, id string) ([]byte, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (sk *SM9PrivateKey) Decrypt(alg string, in []byte) ([]byte, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -73,11 +73,11 @@ extern "C" {
|
||||
# define GMTLS_CK_RSA_WITH_SM1_SM3 0x0300E009 /* reserved */
|
||||
# define GMTLS_CK_RSA_WITH_SM1_SHA1 0x0300E00A /* reserved */
|
||||
# define GMTLS_CK_SM2DHE_WITH_SMS4_SM3 0x0300E011
|
||||
# define GMTLS_CK_SM2_WITH_SMS4_SM3 0x0300E013 /* reserved */
|
||||
# define GMTLS_CK_SM9DHE_WITH_SMS4_SM3 0x0300E015 /* reserved */
|
||||
# define GMTLS_CK_SM9_WITH_SMS4_SM3 0x0300E017 /* reserved */
|
||||
# define GMTLS_CK_SM2_WITH_SMS4_SM3 0x0300E013
|
||||
# define GMTLS_CK_SM9DHE_WITH_SMS4_SM3 0x0300E015
|
||||
# define GMTLS_CK_SM9_WITH_SMS4_SM3 0x0300E017
|
||||
# define GMTLS_CK_RSA_WITH_SMS4_SM3 0x0300E019 /* reserved */
|
||||
# define GMTLS_CK_RSA_WITH_SMS4_SHA1 0x0300E01A
|
||||
# define GMTLS_CK_RSA_WITH_SMS4_SHA1 0x0300E01A /* reserved */
|
||||
|
||||
/* ECDHE-SM2-WITH-[SM1|SMS4|SSF33]-[SM3|SHA256] */
|
||||
# define GMTLS_CK_ECDHE_SM2_WITH_SM1_SM3 0x0300E101
|
||||
@@ -90,10 +90,12 @@ extern "C" {
|
||||
/* ECDHE-SM2-WITH-SMS4-[GCM|CCM|CCM-8]-[SM3|SHA256] */
|
||||
# define GMTLS_CK_ECDHE_SM2_WITH_SMS4_GCM_SM3 0x0300E107
|
||||
# define GMTLS_CK_ECDHE_SM2_WITH_SMS4_CCM_SM3 0x0300E108
|
||||
# define GMTLS_CK_ECDHE_SM2_WITH_SMS4_CCM_8_SM3 0x0300E109
|
||||
# define GMTLS_CK_ECDHE_SM2_WITH_SMS4_CCM_8_SM3 0x0300E109 /* reserved */
|
||||
# define GMTLS_CK_ECDHE_SM2_WITH_SMS4_GCM_SHA256 0x0300E10A /* reserved */
|
||||
# define GMTLS_CK_ECDHE_SM2_WITH_SMS4_CCM_SHA256 0x0300E10B /* reserved */
|
||||
# define GMTLS_CK_ECDHE_SM2_WITH_SMS4_CCM_8_SHA256 0x0300E10C /* reserved */
|
||||
# define GMTLS_CK_ECDHE_SM2_WITH_ZUC_SM3 0x0300E10D
|
||||
# define GMTLS_CK_ECDHE_SM2_WITH_ZUC256_SM3 0x0300E10E
|
||||
|
||||
/* SM2DHE-SM2-WITH-[SM1|SMS4|SSF33|ZUC]-[GCM|CCM|CCM-8|EIA]-SM3 */
|
||||
# define GMTLS_CK_SM2DHE_SM2_WITH_SM1_SM3 0x0300E201
|
||||
@@ -102,8 +104,9 @@ extern "C" {
|
||||
# define GMTLS_CK_SM2DHE_SM2_WITH_ZUC_SM3 0X0300E204
|
||||
# define GMTLS_CK_SM2DHE_SM2_WITH_SMS4_GCM_SM3 0x0300E205
|
||||
# define GMTLS_CK_SM2DHE_SM2_WITH_SMS4_CCM_SM3 0x0300E206
|
||||
# define GMTLS_CK_SM2DHE_SM2_WITH_SMS4_CCM_8_SM3 0x0300E207
|
||||
# define GMTLS_CK_SM2DHE_SM2_WITH_ZUC_EIA_SM3 0X0300E208
|
||||
# define GMTLS_CK_SM2DHE_SM2_WITH_SMS4_CCM_8_SM3 0x0300E207 /* reserved */
|
||||
# define GMTLS_CK_SM2DHE_SM2_WITH_ZUC_EIA_SM3 0x0300E208 /* obsoleted */
|
||||
# define GMTLS_CK_SM2DHE_SM2_WITH_ZUC256_SM3 0x0300E209
|
||||
|
||||
/* PSK ciphersuites with NULL cipher */
|
||||
# define GMTLS_CK_PSK_WITH_NULL_SM3 0x0300F001 /* reserved */
|
||||
@@ -116,11 +119,9 @@ extern "C" {
|
||||
# define GMTLS_CK_PSK_WITH_SMS4_CBC_SM3 0x0300F101
|
||||
# define GMTLS_CK_PSK_WITH_SMS4_GCM_SM3 0x0300F102
|
||||
# define GMTLS_CK_PSK_WITH_SMS4_CCM_SM3 0x0300F103
|
||||
# define GMTLS_CK_SM2_PSK_WITH_SMS4_CBC_SM3 0x0300F10B
|
||||
# define GMTLS_CK_SM2_PSK_WITH_SMS4_GCM_SM3 0x0300F10C
|
||||
# define GMTLS_CK_SM2_PSK_WITH_SMS4_CCM_SM3 0x0300F10D
|
||||
|
||||
# define GMTLS_CK_ECDHE_PSK_WITH_SMS4_CBC_SM3 0x0300F10E
|
||||
# define GMTLS_CK_SM2DHE_PSK_WITH_SMS4_CBC_SM3 0x0300F10B
|
||||
# define GMTLS_CK_SM2DHE_PSK_WITH_SMS4_GCM_SM3 0x0300F10C
|
||||
# define GMTLS_CK_SM2DHE_PSK_WITH_SMS4_CCM_SM3 0x0300F10D
|
||||
|
||||
# define GMTLS_CK_PSK_WITH_SM1_CBC_SM3 0x0300F10E
|
||||
# define GMTLS_CK_PSK_WITH_SM1_GCM_SM3 0x0300F10F /* reserved */
|
||||
@@ -136,6 +137,18 @@ extern "C" {
|
||||
# define GMTLS_CK_RSA_PSK_WITH_SSF33_GCM_SM3 0x0300F11E /* reserved */
|
||||
# define GMTLS_CK_RSA_PSK_WITH_SSF33_CCM_SM3 0x0300F11F /* reserved */
|
||||
|
||||
# define GMTLS_CK_ECDHE_PSK_WITH_SMS4_CBC_SM3 0x0300F120
|
||||
# define GMTLS_CK_ECDHE_PSK_WITH_SMS4_GCM_SM3 0x0300F121
|
||||
# define GMTLS_CK_ECDHE_PSK_WITH_SMS4_CCM_SM3 0x0300F122
|
||||
|
||||
# define GMTLS_CK_PSK_WITH_ZUC_SM3 0x0300F123
|
||||
# define GMTLS_CK_PSK_WITH_ZUC256_SM3 0x0300F124
|
||||
# define GMTLS_CK_ECDHE_PSK_WITH_ZUC_SM3 0x0300F125
|
||||
# define GMTLS_CK_ECDHE_PSK_WITH_ZUC256_SM3 0x0300F126
|
||||
# define GMTLS_CK_SM2DHE_PSK_WITH_ZUC_SM3 0x0300F127
|
||||
# define GMTLS_CK_SM2DHE_PSK_WITH_ZUC256_SM3 0x0300F128
|
||||
|
||||
|
||||
/* SRP ciphersuites */
|
||||
# define GMTLS_CK_SRP_SM3_WITH_SMS4_CBC_SM3 0x0300F201
|
||||
# define GMTLS_CK_SRP_SM3_WITH_SMS4_GCM_SM3 0x0300F202
|
||||
@@ -172,6 +185,8 @@ extern "C" {
|
||||
# define GMTLS_TXT_ECDHE_SM2_WITH_SMS4_GCM_SHA256 "ECDHE-SM2-WITH-SMS4-GCM-SHA256"
|
||||
# define GMTLS_TXT_ECDHE_SM2_WITH_SMS4_CCM_SHA256 "ECDHE-SM2-WITH-SMS4-CCM-SHA256"
|
||||
# define GMTLS_TXT_ECDHE_SM2_WITH_SMS4_CCM_8_SHA256 "ECDHE-SM2-WITH-SMS4-CCM-8-SHA256"
|
||||
# define GMTLS_TXT_ECDHE_SM2_WITH_ZUC_SM3 "ECDHE-SM2-WITH-ZUC-SM3"
|
||||
# define GMTLS_TXT_ECDHE_SM2_WITH_ZUC256_SM3 "ECDHE-SM2-WITH-ZUC256-SM3"
|
||||
|
||||
/* SM2DHE-SM2-WITH-[SM1|SMS4|SSF33|ZUC]-[GCM|CCM|CCM-8|EIA]-SM3 */
|
||||
# define GMTLS_TXT_SM2DHE_SM2_WITH_SM1_SM3 "SM2DHE-SM2-WITH-SM1-SM3"
|
||||
@@ -182,50 +197,26 @@ extern "C" {
|
||||
# define GMTLS_TXT_SM2DHE_SM2_WITH_SMS4_CCM_SM3 "SM2DHE-SM2-WITH-SMS4-CCM-SM3"
|
||||
# define GMTLS_TXT_SM2DHE_SM2_WITH_SMS4_CCM_8_SM3 "SM2DHE-SM2-WITH-SMS4-CCM-8-SM3"
|
||||
# define GMTLS_TXT_SM2DHE_SM2_WITH_ZUC_EIA_SM3 "SM2DHE-SM2-WITH-ZUC-EIA-SM3"
|
||||
|
||||
/* PSK ciphersuites with NULL cipher */
|
||||
# define GMTLS_TXT_PSK_WITH_NULL_SM3 "PSK-WITH-NULL-SM3"
|
||||
# define GMTLS_TXT_DHE_PSK_WITH_NULL_SM3 "DHE-PSK-WITH-NULL-SM3"
|
||||
# define GMTLS_TXT_RSA_PSK_WITH_NULL_SM3 "RSA-PSK-WITH-NULL-SM3"
|
||||
# define GMTLS_TXT_SM2_PSK_WITH_NULL_SM3 "SM2-PSK_WITH-NULL-SM3"
|
||||
# define GMTLS_TXT_ECDHE_PSK_WITH_NULL_SM3 "ECDHE-PSK-WITH-NULL-SM3"
|
||||
# define GMTLS_TXT_ECDHE_PSK_WITH_SMS4_CBC_SM3 "ECDHE-PSK-WITH-SMS4-CBC-SM3"
|
||||
# define GMTLS_TXT_SM2DHE_SM2_WITH_ZUC256_SM3 "SM2DHE-SM2-WITH-ZUC256-SM3"
|
||||
|
||||
/* PSK ciphersuits with SMS4 */
|
||||
# define GMTLS_TXT_PSK_WITH_SMS4_CBC_SM3 "PSK-WITH-SMS4-CBC-SM3"
|
||||
# define GMTLS_TXT_PSK_WITH_SMS4_GCM_SM3 "PSK-WITH-SMS4-GCM-SM3"
|
||||
# define GMTLS_TXT_PSK_WITH_SMS4_CCM_SM3 "PSK-WITH-SMS4-CCM-SM3"
|
||||
# define GMTLS_TXT_DHE_PSK_WITH_SMS4_CBC_SM3 "DHE-PSK-WITH-SMS4-CBC-SM3"
|
||||
# define GMTLS_TXT_DHE_PSK_WITH_SMS4_GCM_SM3 "DHE-PSK-WITH-SMS4-GCM-SM3"
|
||||
# define GMTLS_TXT_DHE_PSK_WITH_SMS4_CCM_SM3 "DHE-PSK-WITH-SMS4-CCM-SM3"
|
||||
# define GMTLS_TXT_RSA_PSK_WITH_SMS4_CBC_SM3 "RSA-PSK-WITH-SMS4-CBC-SM3"
|
||||
# define GMTLS_TXT_RSA_PSK_WITH_SMS4_GCM_SM3 "RSA-PSK-WITH-SMS4-GCM-SM3"
|
||||
# define GMTLS_TXT_RSA_PSK_WITH_SMS4_CCM_SM3 "RSA-PSK-WITH-SMS4-CCM-SM3"
|
||||
# define GMTLS_TXT_ECC_PSK_WITH_SMS4_CBC_SM3 "ECC-PSK-WITH-SMS4-CBC-SM3"
|
||||
# define GMTLS_TXT_ECC_PSK_WITH_SMS4_GCM_SM3 "ECC-PSK-WITH-SMS4-GCM-SM3"
|
||||
# define GMTLS_TXT_ECC_PSK_WITH_SMS4_CCM_SM3 "ECC-PSK-WITH-SMS4-CCM-SM3"
|
||||
|
||||
|
||||
# define GMTLS_TXT_SM2DHE_PSK_WITH_SMS4_CBC_SM3 "SM2DHE-PSK-WITH-SMS4-CBC-SM3"
|
||||
# define GMTLS_TXT_SM2DHE_PSK_WITH_SMS4_GCM_SM3 "SM2DHE-PSK-WITH-SMS4-GCM-SM3"
|
||||
# define GMTLS_TXT_SM2DHE_PSK_WITH_SMS4_CCM_SM3 "SM2DHE-PSK-WITH-SMS4-CCM-SM3"
|
||||
# define GMTLS_TXT_PSK_WITH_SM1_CBC_SM3 "PSK-WITH-SM1-CBC-SM3"
|
||||
# define GMTLS_TXT_PSK_WITH_SM1_GCM_SM3 "PSK-WITH-SM1-GCM-SM3"
|
||||
# define GMTLS_TXT_PSK_WITH_SM1_CCM_SM3 "PSK-WITH-SM1-CCM-SM3"
|
||||
# define GMTLS_TXT_DHE_PSK_WITH_SM1_CBC_SM3 "DHE-PSK-WITH-SM1-CBC-SM3"
|
||||
# define GMTLS_TXT_DHE_PSK_WITH_SM1_GCM_SM3 "DHE-PSK-WITH-SM1-GCM-SM3"
|
||||
# define GMTLS_TXT_DHE_PSK_WITH_SM1_CCM_SM3 "DHE-PSK-WITH-SM1-CCM-SM3"
|
||||
# define GMTLS_TXT_RSA_PSK_WITH_SM1_CBC_SM3 "RSA-PSK-WITH-SM1-CBC-SM3"
|
||||
# define GMTLS_TXT_RSA_PSK_WITH_SM1_GCM_SM3 "RSA-PSK-WITH-SM1-GCM-SM3"
|
||||
# define GMTLS_TXT_RSA_PSK_WITH_SM1_CCM_SM3 "RSA-PSK-WITH-SM1-CCM-SM3"
|
||||
|
||||
|
||||
# define GMTLS_TXT_PSK_WITH_SSF33_CBC_SM3 "PSK-WITH-SSF33-CBC-SM3"
|
||||
# define GMTLS_TXT_PSK_WITH_SSF33_GCM_SM3 "PSK-WITH-SSF33-GCM-SM3"
|
||||
# define GMTLS_TXT_PSK_WITH_SSF33_CCM_SM3 "PSK-WITH-SSF33-CCM-SM3"
|
||||
# define GMTLS_TXT_DHE_PSK_WITH_SSF33_CBC_SM3 "DHE-PSK-WITH-SSF33-CBC-SM3"
|
||||
# define GMTLS_TXT_DHE_PSK_WITH_SSF33_GCM_SM3 "DHE-PSK-WITH-SSF33-GCM-SM3"
|
||||
# define GMTLS_TXT_DHE_PSK_WITH_SSF33_CCM_SM3 "DHE-PSK-WITH-SSF33-CCM-SM3"
|
||||
# define GMTLS_TXT_RSA_PSK_WITH_SSF33_CBC_SM3 "RSA-PSK-WITH-SSF33-CBC-SM3"
|
||||
# define GMTLS_TXT_RSA_PSK_WITH_SSF33_GCM_SM3 "RSA-PSK-WITH-SSF33-GCM-SM3"
|
||||
# define GMTLS_TXT_RSA_PSK_WITH_SSF33_CCM_SM3 "RSA-PSK-WITH-SSF33-CCM-SM3"
|
||||
# define GMTLS_TXT_ECDHE_PSK_WITH_SMS4_CBC_SM3 "ECDHE-PSK-WITH-SMS4-CBC-SM3"
|
||||
# define GMTLS_TXT_ECDHE_PSK_WITH_SMS4_GCM_SM3 "ECDHE-PSK-WITH-SMS4-GCM-SM3"
|
||||
# define GMTLS_TXT_ECDHE_PSK_WITH_SMS4_CCM_SM3 "ECDHE-PSK-WITH-SMS4-CCM-SM3"
|
||||
# define GMTLS_TXT_PSK_WITH_ZUC_SM3 "PSK-WITH-ZUC-SM3"
|
||||
# define GMTLS_TXT_PSK_WITH_ZUC256_SM3 "PSK-WITH-ZUC256-SM3"
|
||||
# define GMTLS_TXT_ECDHE_PSK_WITH_ZUC_SM3 "ECDHE-PSK-WITH-ZUC-SM3"
|
||||
# define GMTLS_TXT_ECDHE_PSK_WITH_ZUC256_SM3 "ECDHE-PSK-WITH-ZUC256-SM3"
|
||||
# define GMTLS_TXT_SM2DHE_PSK_WITH_ZUC_SM3 "SM2DHE-PSK-WITH-ZUC-SM3"
|
||||
# define GMTLS_TXT_SM2DHE_PSK_WITH_ZUC256_SM3 "SM2DHE-PSK-WITH-ZUC256-SM3"
|
||||
|
||||
/* SRP ciphersuites */
|
||||
# define GMTLS_TXT_SRP_SM3_WITH_SMS4_CBC_SM3 "SRP-SM3-WITH-SMS4-CBC-SM3"
|
||||
|
||||
@@ -41,9 +41,9 @@ extern "C" {
|
||||
*/
|
||||
# define OPENSSL_VERSION_NUMBER 0x1010004fL
|
||||
# ifdef OPENSSL_FIPS
|
||||
# define OPENSSL_VERSION_TEXT "GmSSL 2.5.2 - OpenSSL 1.1.0d-fips 1 Aug 2019"
|
||||
# define OPENSSL_VERSION_TEXT "GmSSL 2.5.3 - OpenSSL 1.1.0d-fips 13 Aug 2019"
|
||||
# else
|
||||
# define OPENSSL_VERSION_TEXT "GmSSL 2.5.2 - OpenSSL 1.1.0d 1 Aug 2019"
|
||||
# define OPENSSL_VERSION_TEXT "GmSSL 2.5.3 - OpenSSL 1.1.0d 13 Aug 2019"
|
||||
# endif
|
||||
|
||||
/*-
|
||||
|
||||
@@ -81,6 +81,9 @@ void SM9_MASTER_KEY_free(SM9_MASTER_KEY *a);
|
||||
SM9_KEY *SM9_KEY_new(void);
|
||||
void SM9_KEY_free(SM9_KEY *a);
|
||||
|
||||
int SM9_MASTER_KEY_up_ref(SM9_MASTER_KEY *msk);
|
||||
int SM9_KEY_up_ref(SM9_KEY *sk);
|
||||
|
||||
int SM9_setup(int pairing, /* NID_sm9bn256v1 */
|
||||
int scheme, /* NID_[sm9sign | sm9encrypt | sm9keyagreement] */
|
||||
int hash1, /* NID_sm9hash1_with_[sm3 | sha256] */
|
||||
@@ -204,9 +207,6 @@ int i2d_SM9Signature_fp(FILE *fp, SM9Signature *a);
|
||||
int i2d_SM9Ciphertext_fp(FILE *fp, SM9Ciphertext *a);
|
||||
#endif
|
||||
|
||||
int SM9_MASTER_KEY_up_ref(SM9_MASTER_KEY *msk);
|
||||
int SM9_KEY_up_ref(SM9_KEY *sk);
|
||||
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_const(SM9_MASTER_KEY,SM9MasterSecret)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_const(SM9_MASTER_KEY,SM9PublicParameters)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_const(SM9_KEY,SM9PrivateKey)
|
||||
|
||||
@@ -53,32 +53,29 @@
|
||||
#include <openssl/opensslconf.h>
|
||||
#ifndef OPENSSL_NO_SMS4
|
||||
|
||||
#define SMS4_KEY_LENGTH 16
|
||||
#define SMS4_BLOCK_SIZE 16
|
||||
#define SMS4_IV_LENGTH (SMS4_BLOCK_SIZE)
|
||||
#define SMS4_NUM_ROUNDS 32
|
||||
# define SMS4_KEY_LENGTH 16
|
||||
# define SMS4_BLOCK_SIZE 16
|
||||
# define SMS4_IV_LENGTH (SMS4_BLOCK_SIZE)
|
||||
# define SMS4_NUM_ROUNDS 32
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <openssl/e_os2.h>
|
||||
#include <string.h>
|
||||
# include <sys/types.h>
|
||||
# include <openssl/e_os2.h>
|
||||
# include <string.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# endif
|
||||
|
||||
typedef struct {
|
||||
uint32_t rk[SMS4_NUM_ROUNDS];
|
||||
} sms4_key_t;
|
||||
|
||||
void sms4_set_encrypt_key(sms4_key_t *key, const unsigned char *user_key);
|
||||
void sms4_set_decrypt_key(sms4_key_t *key, const unsigned char *user_key);
|
||||
void sms4_encrypt(const unsigned char *in, unsigned char *out, const sms4_key_t *key);
|
||||
#define sms4_decrypt(in,out,key) sms4_encrypt(in,out,key)
|
||||
|
||||
void sms4_encrypt_init(sms4_key_t *key);
|
||||
void sms4_encrypt_8blocks(const unsigned char *in, unsigned char *out, const sms4_key_t *key);
|
||||
void sms4_encrypt_16blocks(const unsigned char *in, unsigned char *out, const sms4_key_t *key);
|
||||
void sms4_set_encrypt_key(sms4_key_t *key, const unsigned char user_key[16]);
|
||||
void sms4_set_decrypt_key(sms4_key_t *key, const unsigned char user_key[16]);
|
||||
void sms4_encrypt(const unsigned char in[16], unsigned char out[16],
|
||||
const sms4_key_t *key);
|
||||
# define sms4_decrypt(in,out,key) sms4_encrypt(in,out,key)
|
||||
|
||||
void sms4_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const sms4_key_t *key, int enc);
|
||||
@@ -97,34 +94,40 @@ int sms4_wrap_key(sms4_key_t *key, const unsigned char *iv,
|
||||
int sms4_unwrap_key(sms4_key_t *key, const unsigned char *iv,
|
||||
unsigned char *out, const unsigned char *in, unsigned int inlen);
|
||||
|
||||
/*
|
||||
void sms4_avx2_encrypt_init(sms4_key_t *key);
|
||||
void sms4_avx2_encrypt_8blocks(const unsigned char *in, unsigned char *out, const sms4_key_t *key);
|
||||
void sms4_avx2_encrypt_16blocks(const unsigned char *in, unsigned char *out, const sms4_key_t *key);
|
||||
|
||||
void sms4_knc_encrypt_init(sms4_key_t *key);
|
||||
void sms4_knc_encrypt_8blocks(const unsigned char *in, unsigned char *out, const sms4_key_t *key);
|
||||
void sms4_knc_encrypt_16blocks(const unsigned char *in, unsigned char *out, const sms4_key_t *key);
|
||||
|
||||
#define SMS4_EDE_KEY_LENGTH 32
|
||||
# define SMS4_EDE_KEY_LENGTH (SMS4_KEY_LENGTH * 3)
|
||||
|
||||
typedef struct {
|
||||
sms4_key_t k1;
|
||||
sms4_key_t k2;
|
||||
sms4_key_t k3;
|
||||
} sms4_ede_key_t;
|
||||
|
||||
void sms4_ede_set_encrypt_key(sms4_ede_key_t *key, const unsigned char *user_key);
|
||||
void sms4_ede_set_decrypt_key(sms4_ede_key_t *key, const unsigned char *user_key);
|
||||
void sms4_ede_encrypt(sms4_ede_key_t *key, const unsigned char *in, unsigned char *out);
|
||||
void sms4_ede_encrypt_8blocks(sms4_ede_key_t *key, const unsigned char *in, unsigned char *out);
|
||||
void sms4_ede_encrypt_16blocks(sms4_ede_key_t *key, const unsigned char *in, unsigned char *out);
|
||||
void sms4_ede_decrypt(sms4_ede_key_t *key, const unsigned char *in, unsigned char *out);
|
||||
void sms4_ede_decrypt_8blocks(sms4_ede_key_t *key, const unsigned char *in, unsigned char *out);
|
||||
void sms4_ede_decrypt_16blocks(sms4_ede_key_t *key, const unsigned char *in, unsigned char *out);
|
||||
*/
|
||||
void sms4_ede_set_encrypt_key(sms4_ede_key_t *key, const unsigned char user_key[48]);
|
||||
void sms4_ede_set_decrypt_key(sms4_ede_key_t *key, const unsigned char user_key[48]);
|
||||
void sms4_ede_encrypt(const unsigned char in[16], unsigned char out[16],
|
||||
const sms4_ede_key_t *key);
|
||||
# define sms4_ede_decrypt(in,out,key) sms4_ede_encrypt(in,out,key)
|
||||
|
||||
#ifdef __cplusplus
|
||||
void sms4_ede_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const sms4_ede_key_t *key, int enc);
|
||||
void sms4_ede_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const sms4_ede_key_t *key, unsigned char *iv, int enc);
|
||||
void sms4_ede_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const sms4_ede_key_t *key, unsigned char *iv, int *num,
|
||||
int enc);
|
||||
void sms4_ede_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const sms4_ede_key_t *key, unsigned char *iv, int *num);
|
||||
void sms4_ede_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const sms4_ede_key_t *key, unsigned char *iv,
|
||||
unsigned char ecount_buf[SMS4_BLOCK_SIZE], unsigned int *num);
|
||||
int sms4_ede_wrap_key(sms4_ede_key_t *key, const unsigned char *iv,
|
||||
unsigned char *out, const unsigned char *in, unsigned int inlen);
|
||||
int sms4_ede_unwrap_key(sms4_ede_key_t *key, const unsigned char *iv,
|
||||
unsigned char *out, const unsigned char *in, unsigned int inlen);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
|
||||
# define ZUC_IV_LENGTH 16
|
||||
# define ZUC_KEY_LENGTH 16
|
||||
# define ZUC256_KEY_LENGTH 32
|
||||
|
||||
typedef uint32_t ZUC_UINT1;
|
||||
typedef uint32_t ZUC_UINT5;
|
||||
@@ -81,6 +82,9 @@ void ZUC_set_key(ZUC_KEY *key, const unsigned char *user_key, const unsigned cha
|
||||
void ZUC_generate_keystream(ZUC_KEY *key, size_t nwords, uint32_t *words);
|
||||
uint32_t ZUC_generate_keyword(ZUC_KEY *key);
|
||||
|
||||
void ZUC256_set_key(ZUC_KEY *key, const unsigned char *K, const unsigned char *IV);
|
||||
int ZUC256_set_mac_key(ZUC_KEY *key, const unsigned char *K, const unsigned char *IV,
|
||||
int macbits /* macbits in {32, 64, 128} */);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
||||
172
ssl/s3_lib.c
172
ssl/s3_lib.c
@@ -150,8 +150,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
0,
|
||||
},
|
||||
#ifndef OPENSSL_NO_GMTLS
|
||||
/* GM/T 0024 ciphersuites
|
||||
* SM2(ENC) and SM9(ENC) only allowed in GMTLS 1.1
|
||||
/* GM/T 0024-2014 ciphersuites
|
||||
*/
|
||||
{
|
||||
1,
|
||||
@@ -161,10 +160,10 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_aSM2,
|
||||
SSL_SM1,
|
||||
SSL_SM3,
|
||||
GMTLS_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -177,9 +176,9 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_SM1,
|
||||
SSL_SM3,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -191,10 +190,10 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_aSM9,
|
||||
SSL_SM1,
|
||||
SSL_SM3,
|
||||
GMTLS_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -207,9 +206,9 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_SM1,
|
||||
SSL_SM3,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -221,10 +220,10 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_aRSA,
|
||||
SSL_SM1,
|
||||
SSL_SM3,
|
||||
GMTLS_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -236,10 +235,10 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_aRSA,
|
||||
SSL_SM1,
|
||||
SSL_SHA1,
|
||||
GMTLS_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SHA1 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -251,10 +250,10 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_aSM2,
|
||||
SSL_SMS4,
|
||||
SSL_SM3,
|
||||
GMTLS_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -267,9 +266,9 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_SMS4,
|
||||
SSL_SM3,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -281,10 +280,10 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_aSM9,
|
||||
SSL_SMS4,
|
||||
SSL_SM3,
|
||||
GMTLS_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -297,9 +296,9 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_SMS4,
|
||||
SSL_SM3,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -311,10 +310,10 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_aRSA,
|
||||
SSL_SMS4,
|
||||
SSL_SM3,
|
||||
GMTLS_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -326,32 +325,16 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_aRSA,
|
||||
SSL_SMS4,
|
||||
SSL_SHA1,
|
||||
GMTLS_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
GMTLS_VERSION, GMTLS_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_BAD_VER,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SHA1 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
#endif /* OPENSSL_NO_GMTLS */
|
||||
|
||||
#ifndef OPENSSL_NO_SM2
|
||||
/* ECDHE-SM2-[SM1|SMS4|SSF33]-[SM3|SHA256] */
|
||||
{
|
||||
1,
|
||||
GMTLS_TXT_ECDHE_SM2_WITH_SM1_SM3,
|
||||
GMTLS_CK_ECDHE_SM2_WITH_SM1_SM3,
|
||||
SSL_kECDHE,
|
||||
SSL_aSM2,
|
||||
SSL_SM1,
|
||||
SSL_SM3,
|
||||
TLS1_2_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
{
|
||||
1,
|
||||
GMTLS_TXT_ECDHE_SM2_WITH_SMS4_SM3,
|
||||
@@ -361,37 +344,7 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
SSL_SMS4,
|
||||
SSL_SM3,
|
||||
TLS1_2_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
{
|
||||
1,
|
||||
GMTLS_TXT_ECDHE_SM2_WITH_SMS4_GCM_SM3,
|
||||
GMTLS_CK_ECDHE_SM2_WITH_SMS4_GCM_SM3,
|
||||
SSL_kECDHE,
|
||||
SSL_aSM2,
|
||||
SSL_SMS4GCM,
|
||||
SSL_AEAD,
|
||||
TLS1_2_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
{
|
||||
1,
|
||||
GMTLS_TXT_ECDHE_SM2_WITH_SSF33_SM3,
|
||||
GMTLS_CK_ECDHE_SM2_WITH_SSF33_SM3,
|
||||
SSL_kECDHE,
|
||||
SSL_aSM2,
|
||||
SSL_SSF33,
|
||||
SSL_SM3,
|
||||
TLS1_2_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
DTLS1_2_VERSION, DTLS1_2_VERSION,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
128,
|
||||
@@ -399,46 +352,16 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
},
|
||||
{
|
||||
1,
|
||||
GMTLS_TXT_ECDHE_SM2_WITH_SM1_SHA256,
|
||||
GMTLS_CK_ECDHE_SM2_WITH_SM1_SHA256,
|
||||
GMTLS_TXT_ECDHE_SM2_WITH_SMS4_GCM_SM3,
|
||||
GMTLS_CK_ECDHE_SM2_WITH_SMS4_GCM_SM3,
|
||||
SSL_kECDHE,
|
||||
SSL_aSM2,
|
||||
SSL_SM1,
|
||||
SSL_SHA256,
|
||||
SSL_SMS4GCM,
|
||||
SSL_AEAD,
|
||||
TLS1_2_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
DTLS1_2_VERSION, DTLS1_2_VERSION,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
{
|
||||
1,
|
||||
GMTLS_TXT_ECDHE_SM2_WITH_SMS4_SHA256,
|
||||
GMTLS_CK_ECDHE_SM2_WITH_SMS4_SHA256,
|
||||
SSL_kECDHE,
|
||||
SSL_aSM2,
|
||||
SSL_SMS4,
|
||||
SSL_SHA256,
|
||||
TLS1_2_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
{
|
||||
1,
|
||||
GMTLS_TXT_ECDHE_SM2_WITH_SSF33_SHA256,
|
||||
GMTLS_CK_ECDHE_SM2_WITH_SSF33_SHA256,
|
||||
SSL_kECDHE,
|
||||
SSL_aSM2,
|
||||
SSL_SSF33,
|
||||
SSL_SHA256,
|
||||
TLS1_2_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
@@ -2042,6 +1965,21 @@ static SSL_CIPHER ssl3_ciphers[] = {
|
||||
128,
|
||||
128,
|
||||
},
|
||||
{
|
||||
1,
|
||||
GMTLS_TXT_PSK_WITH_SMS4_CBC_SM3,
|
||||
GMTLS_CK_PSK_WITH_SMS4_CBC_SM3,
|
||||
SSL_kPSK,
|
||||
SSL_aPSK,
|
||||
SSL_SMS4,
|
||||
SSL_SM3,
|
||||
SSL3_VERSION, TLS1_2_VERSION,
|
||||
DTLS1_BAD_VER, DTLS1_2_VERSION,
|
||||
SSL_HIGH,
|
||||
SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF,
|
||||
128,
|
||||
128,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
1,
|
||||
|
||||
@@ -400,6 +400,7 @@
|
||||
# define SSL_HANDSHAKE_MAC_GOST12_512 SSL_MD_GOST12_512_IDX
|
||||
# define SSL_HANDSHAKE_MAC_DEFAULT SSL_HANDSHAKE_MAC_MD5_SHA1
|
||||
# define SSL_HANDSHAKE_MAC_SM3 SSL_MD_SM3_IDX
|
||||
# define SSL_HANDSHAKE_MAC_SHA1 SSL_MD_SHA1_IDX
|
||||
|
||||
/* Bits 8-15 bits are PRF */
|
||||
# define TLS1_PRF_DGST_SHIFT 8
|
||||
|
||||
@@ -499,20 +499,42 @@ static ssl_trace_tbl ssl_ciphers_tbl[] = {
|
||||
{0xE019, "GMTLS_RSA_WITH_SMS4_SM3"},
|
||||
{0xE01A, "GMTLS_RSA_WITH_SMS4_SHA1"},
|
||||
# endif
|
||||
/* ECDHE-SM2-WITH-[SM1|SMS4|SSF33]-[SM3|SHA256] */
|
||||
{0xE101, "GMTLS_ECDHE_SM2_WITH_SM1_SM3"},
|
||||
{0xE102, "GMTLS_ECDHE_SM2_WITH_SMS4_SM3"},
|
||||
{0xE103, "GMTLS_ECDHE_SM2_WITH_SSF33_SM3"},
|
||||
{0xE104, "GMTLS_ECDHE_SM2_WITH_SM1_SHA256"},
|
||||
{0xE105, "GMTLS_ECDHE_SM2_WITH_SMS4_SHA256"},
|
||||
{0xE106, "GMTLS_ECDHE_SM2_WITH_SSF33_SHA256"},
|
||||
/* ECDHE-SM2-WITH-SMS4-[GCM|CCM|CCM-8]-[SM3|SHA256] */
|
||||
{0xE107, "GMTLS_ECDHE_SM2_WITH_SMS4_GCM_SM3"},
|
||||
{0xE108, "GMTLS_ECDHE_SM2_WITH_SMS4_CCM_SM3"},
|
||||
{0xE109, "GMTLS_ECDHE_SM2_WITH_SMS4_CCM_8_SM3"},
|
||||
{0xE10A, "GMTLS_ECDHE_SM2_WITH_SMS4_GCM_SHA256"},
|
||||
{0xE10B, "GMTLS_ECDHE_SM2_WITH_SMS4_CCM_SHA256"},
|
||||
{0xE10C, "GMTLS_ECDHE_SM2_WITH_SMS4_CCM_8_SHA256"},
|
||||
|
||||
{0xE10D, "GMTLS_ECDHE_SM2_WITH_ZUC_SM3"},
|
||||
{0xE10E, "GMTLS_ECDHE_SM2_WITH_ZUC256_SM3"},
|
||||
{0xE201, "GMTLS_SM2DHE_SM2_WITH_SM1_SM3"},
|
||||
{0xE202, "GMTLS_SM2DHE_SM2_WITH_SMS4_SM3"},
|
||||
{0xE203, "GMTLS_SM2DHE_SM2_WITH_SSF33_SM3"},
|
||||
{0xE204, "GMTLS_SM2DHE_SM2_WITH_ZUC_SM3"},
|
||||
{0xE205, "GMTLS_SM2DHE_SM2_WITH_SMS4_GCM_SM3"},
|
||||
{0xE206, "GMTLS_SM2DHE_SM2_WITH_SMS4_CCM_SM3"},
|
||||
{0xE209, "GMTLS_SM2DHE_SM2_WITH_ZUC256_SM3"},
|
||||
{0xF101, "GMTLS_PSK_WITH_SMS4_CBC_SM3"},
|
||||
{0xF102, "GMTLS_PSK_WITH_SMS4_GCM_SM3"},
|
||||
{0xF103, "GMTLS_PSK_WITH_SMS4_CCM_SM3"},
|
||||
{0xF10B, "GMTLS_SM2DHE_PSK_WITH_SMS4_CBC_SM3"},
|
||||
{0xF10C, "GMTLS_SM2DHE_PSK_WITH_SMS4_GCM_SM3"},
|
||||
{0xF10D, "GMTLS_SM2DHE_PSK_WITH_SMS4_CCM_SM3"},
|
||||
{0xF10E, "GMTLS_PSK_WITH_SM1_CBC_SM3"},
|
||||
{0xF117, "GMTLS_PSK_WITH_SSF33_CBC_SM3"},
|
||||
{0xF120, "GMTLS_ECDHE_PSK_WITH_SMS4_CBC_SM3"},
|
||||
{0xF121, "GMTLS_ECDHE_PSK_WITH_SMS4_GCM_SM3"},
|
||||
{0xF122, "GMTLS_ECDHE_PSK_WITH_SMS4_CCM_SM3"},
|
||||
{0xF123, "GMTLS_PSK_WITH_ZUC_SM3"},
|
||||
{0xF124, "GMTLS_PSK_WITH_ZUC256_SM3"},
|
||||
{0xF125, "GMTLS_ECDHE_PSK_WITH_ZUC_SM3"},
|
||||
{0xF126, "GMTLS_ECDHE_PSK_WITH_ZUC256_SM3"},
|
||||
{0xF127, "GMTLS_SM2DHE_PSK_WITH_ZUC_SM3"},
|
||||
{0xF128, "GMTLS_SM2DHE_PSK_WITH_ZUC256_SM3"},
|
||||
{0xF201, "GMTLS_SRP_SM3_WITH_SMS4_CBC_SM3"},
|
||||
{0xF202, "GMTLS_SRP_SM3_WITH_SMS4_GCM_SM3"},
|
||||
{0xF203, "GMTLS_SRP_SM3_WITH_SMS4_CCM_SM3"},
|
||||
{0xFEFE, "SSL_RSA_FIPS_WITH_DES_CBC_SHA"},
|
||||
{0xFEFF, "SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA"},
|
||||
|
||||
|
||||
171
test/sms4test.c
171
test/sms4test.c
@@ -61,6 +61,133 @@ int main(int argc, char **argv)
|
||||
#else
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/sms4.h>
|
||||
# include <openssl/rand.h>
|
||||
# include "../crypto/sms4/sms4_lcl.h"
|
||||
|
||||
static int test_ecb(int avx)
|
||||
{
|
||||
sms4_key_t key;
|
||||
unsigned char user_key[16] = {0};
|
||||
/* 2 rounds avx-512 and 2 rounds x86 */
|
||||
unsigned char in[(16 * 2 + 2) * 16] = {0};
|
||||
unsigned char out1[sizeof(in)] = {0};
|
||||
unsigned char out2[sizeof(in)] = {0};
|
||||
int i;
|
||||
|
||||
RAND_bytes(user_key, sizeof(user_key));
|
||||
RAND_bytes(in, sizeof(in));
|
||||
|
||||
sms4_set_encrypt_key(&key, user_key);
|
||||
for (i = 0; i < sizeof(in)/SMS4_BLOCK_SIZE; i++) {
|
||||
sms4_encrypt(in + 16*i, out1 + 16*i, &key);
|
||||
}
|
||||
|
||||
switch (avx) {
|
||||
# ifdef SMS4_AVX2
|
||||
case 2:
|
||||
sms4_avx2_ecb_encrypt_blocks(in, out2, sizeof(in)/SMS4_BLOCK_SIZE, &key);
|
||||
break;
|
||||
# endif
|
||||
default:
|
||||
printf("avx shuold be in {2}\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (memcmp(out1, out2, sizeof(out1)) != 0) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void xor_block(unsigned char *out, const unsigned char *in)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 16; i++) {
|
||||
out[i] ^= in[i];
|
||||
}
|
||||
}
|
||||
|
||||
static int test_ctr32(int avx)
|
||||
{
|
||||
sms4_key_t key;
|
||||
unsigned char user_key[16] = {0};
|
||||
unsigned char iv[16] = {0};
|
||||
unsigned char ctr1[16];
|
||||
unsigned char ctr2[16];
|
||||
/* 2 rounds avx-512 and 2 rounds x86 */
|
||||
unsigned char in[(16 * 2 + 2) * 16] = {0};
|
||||
unsigned char out1[sizeof(in)];
|
||||
unsigned char out2[sizeof(in)];
|
||||
int i;
|
||||
|
||||
RAND_bytes(user_key, sizeof(user_key));
|
||||
RAND_bytes(iv, sizeof(iv) - 1);
|
||||
RAND_bytes(in, sizeof(in));
|
||||
|
||||
sms4_set_encrypt_key(&key, user_key);
|
||||
memcpy(ctr1, iv, sizeof(iv));
|
||||
memcpy(ctr2, iv, sizeof(iv));
|
||||
|
||||
for (i = 0; i < sizeof(in)/16; i++) {
|
||||
sms4_encrypt(ctr1, out1 + 16 * i, &key);
|
||||
xor_block(out1 + 16 * i, in + 16 * i);
|
||||
ctr1[15]++;
|
||||
}
|
||||
|
||||
switch (avx) {
|
||||
# ifdef SMS4_AVX2
|
||||
case 2:
|
||||
sms4_avx2_ctr32_encrypt_blocks(in, out2, sizeof(in)/16, &key, ctr2);
|
||||
break;
|
||||
# endif
|
||||
case 0:
|
||||
sms4_ctr32_encrypt_blocks(in, out2, sizeof(in)/16, &key, ctr2);
|
||||
break;
|
||||
default:
|
||||
printf("avx should be in {0, 2}\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (memcmp(out1, out2, sizeof(out1)) != 0) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int test_ede(void)
|
||||
{
|
||||
sms4_key_t key;
|
||||
sms4_ede_key_t ede_key;
|
||||
unsigned char user_key[48];
|
||||
unsigned char in[16];
|
||||
unsigned char out1[16];
|
||||
unsigned char out2[16];
|
||||
|
||||
RAND_bytes(in, sizeof(in));
|
||||
|
||||
RAND_bytes(user_key, 16);
|
||||
memcpy(user_key + 16, user_key, 16);
|
||||
memcpy(user_key + 32, user_key, 16);
|
||||
sms4_set_encrypt_key(&key, user_key);
|
||||
sms4_encrypt(in, out1, &key);
|
||||
sms4_ede_set_encrypt_key(&ede_key, user_key);
|
||||
sms4_ede_encrypt(in, out2, &ede_key);
|
||||
if (memcmp(out1, out2, 16) != 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
RAND_bytes(user_key, sizeof(user_key));
|
||||
sms4_ede_set_encrypt_key(&ede_key, user_key);
|
||||
sms4_ede_encrypt(in, out1, &ede_key);
|
||||
sms4_ede_set_decrypt_key(&ede_key, user_key);
|
||||
sms4_ede_decrypt(out1, out2, &ede_key);
|
||||
if (memcmp(in, out2, 16) != 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
@@ -105,6 +232,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (memcmp(key.rk, rk, sizeof(rk)) != 0) {
|
||||
printf("sms4 key scheduling not passed!\n");
|
||||
err++;
|
||||
goto end;
|
||||
}
|
||||
printf("sms4 key scheduling passed!\n");
|
||||
@@ -114,6 +242,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (memcmp(buf, ciphertext1, sizeof(ciphertext1)) != 0) {
|
||||
printf("sms4 encrypt not pass!\n");
|
||||
err++;
|
||||
goto end;
|
||||
}
|
||||
printf("sms4 encrypt pass!\n");
|
||||
@@ -126,14 +255,48 @@ int main(int argc, char **argv)
|
||||
|
||||
if (memcmp(buf, ciphertext2, sizeof(ciphertext2)) != 0) {
|
||||
printf("sms4 encrypt 1000000 times not pass!\n");
|
||||
err++;
|
||||
goto end;
|
||||
}
|
||||
printf("sms4 encrypt 1000000 times pass!\n");
|
||||
printf("sms4 all test vectors pass!\n");
|
||||
|
||||
/* test ctr32 */
|
||||
if (!test_ctr32(0)) {
|
||||
printf("sms4 ctr32 not pass!\n");
|
||||
err++;
|
||||
} else
|
||||
printf("sms4 ctr32 pass!\n");
|
||||
|
||||
/* test ede */
|
||||
if (!test_ede()) {
|
||||
printf("sms4 ede not pass!\n");
|
||||
err++;
|
||||
} else
|
||||
printf("sms4 ede pass!\n");
|
||||
|
||||
|
||||
# ifdef SMS4_AVX2
|
||||
/* test ecb in avx2 */
|
||||
if (!test_ecb(2)) {
|
||||
printf("sms4 ecb in avx2 not pass!\n");
|
||||
err++;
|
||||
} else
|
||||
printf("sms4 ecb in avx2 pass!\n");
|
||||
|
||||
/* test ctr32 in avx2 */
|
||||
if (!test_ctr32(2)) {
|
||||
printf("sms4 ctr32 in avx2 not pass!\n");
|
||||
err++;
|
||||
} else
|
||||
printf("sms4 ctr32 in avx2 pass!\n");
|
||||
# endif
|
||||
|
||||
if (err == 0)
|
||||
printf("sms4 all test vectors pass!\n");
|
||||
else
|
||||
end:
|
||||
printf("some test vector failed\n");
|
||||
|
||||
return err;
|
||||
end:
|
||||
printf("some test vector failed\n");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
152
test/zuctest.c
152
test/zuctest.c
@@ -157,4 +157,156 @@ int main(int argc, char **argv)
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
#if 0
|
||||
int zuc256test(int argc, char **argv)
|
||||
{
|
||||
int err = 0;
|
||||
int i;
|
||||
|
||||
unsigned char key[][32] = {
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}
|
||||
};
|
||||
unsigned char iv[][23] = {
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff}
|
||||
};
|
||||
uint32_t ciphertext[][20] = {
|
||||
{0x58d03ad6,0x2e032ce2,0xdafc683a,0x39bdcb03,0x52a2bc67,
|
||||
0xf1b7de74,0x163ce3a1,0x01ef5558,0x9639d75b,0x95fa681b,
|
||||
0x7f090df7,0x56391ccc,0x903b7612,0x744d544c,0x17bc3fad,
|
||||
0x8b163b08,0x21787c0b,0x97775bb8,0x4943c6bb,0xe8ad8afd},
|
||||
{0x3356cbae,0xd1a1c18b,0x6baa4ffe,0x343f777c,0x9e15128f,
|
||||
0x251ab65b,0x949f7b26,0xef7157f2,0x96dd2fa9,0xdf95e3ee,
|
||||
0x7a5be02e,0xc32ba585,0x505af316,0xc2f9ded2,0x7cdbd935,
|
||||
0xe441ce11,0x15fd0a80,0xbb7aef67,0x68989416,0xb8fac8c2}
|
||||
};
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
ZUC_KEY zuc = {{0}};
|
||||
uint32_t buf[3] = {0};
|
||||
ZUC_set_key(&zuc, key[i], iv[i]);
|
||||
ZUC_generate_keystream(&zuc, 2, buf);
|
||||
printf("%08x %08x\n", buf[0], buf[1]);
|
||||
printf("%08x %08x\n", ciphertext[i][0], ciphertext[i][1]);
|
||||
if (buf[0] != ciphertext[i][0] || buf[1] != ciphertext[i][1]) {
|
||||
fprintf(stderr, "error generating ZUC key stream on test vector %d\n", i);
|
||||
err++;
|
||||
} else {
|
||||
fprintf(stderr, "ZUC test vector %d success\n", i);
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int zuc256mactest(void)
|
||||
{
|
||||
unsigned char key[][32] = {
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},
|
||||
{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}
|
||||
};
|
||||
unsigned char iv[][23] = {
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},
|
||||
{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}
|
||||
};
|
||||
unsigned char msg[][] = {
|
||||
/* 400 zero bits */
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
/* 4000 one bits */
|
||||
{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},
|
||||
/* 400 zero bits */
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
/* 4000 one bits */
|
||||
{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
|
||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}
|
||||
};
|
||||
unsigned int msg_num[] = {
|
||||
1,
|
||||
10,
|
||||
1,
|
||||
10
|
||||
};
|
||||
unsigned int tag32[] = {
|
||||
0x9b972a74,
|
||||
0x8754f5cf,
|
||||
0x1f3079b4,
|
||||
0x5c7c8b88
|
||||
};
|
||||
unsigned int tag64[][2] = {
|
||||
{0x673e5499,0x0034d38c},
|
||||
{0x130dc225,0xe72240cc},
|
||||
{0x8c71394d,0x39957725},
|
||||
{0xea1dee54,0x4bb6223b}
|
||||
};
|
||||
unsigned int tag128[][4] = {
|
||||
{0xd85e54bb,0xcb960096,0x7084c952,0xa1654b26},
|
||||
0xdf1e8307,0xb31cc62b,0xeca1ac6f,0x8190c22f},
|
||||
0xa35bb274,0xb567c48b,0x28319f11,0x1af34fbd},
|
||||
0x3a83b554,0xbe408ca5,0x494124ed,0x9d473205}
|
||||
};
|
||||
|
||||
ZUC_KEY zuc = {{0}};
|
||||
unsigned int mac32[1] = {0};
|
||||
unsigned int mac64[2] = {0};
|
||||
unsigned int mac128[4] = {0};
|
||||
|
||||
for (i = 0; i < sizeof(key)/sizeof(key[0]); i++) {
|
||||
ZUC_set_key(&zuc, key[i], iv[i]);
|
||||
ZUC_generate_keystream(&zuc, 2, buf);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
9437
util/libcrypto.num
9437
util/libcrypto.num
File diff suppressed because it is too large
Load Diff
822
util/libssl.num
822
util/libssl.num
@@ -1,411 +1,411 @@
|
||||
SSL_get_rbio 1 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_cert_cb 2 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_version 3 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_verify_callback 4 1_1_0d EXIST::FUNCTION:
|
||||
SSL_has_matching_session_id 5 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_cert_cb 6 1_1_0d EXIST::FUNCTION:
|
||||
SSL_select_next_proto 7 1_1_0d EXIST::FUNCTION:
|
||||
SSL_in_init 8 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_dane_mtype_set 9 1_1_0d EXIST::FUNCTION:
|
||||
SSL_dane_enable 10 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SRP_CTX_free 11 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSLv3_client_method 12 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
|
||||
TLSv1_2_method 13 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
|
||||
SSL_SESSION_get_protocol_version 14 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_read_ahead 15 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_cookie_verify_cb 16 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_shared_ciphers 17 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_psk_server_callback 18 1_1_0d EXIST::FUNCTION:PSK
|
||||
BIO_new_buffer_ssl_connect 19 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_cmd_value_type 20 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_alpn_selected 21 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_client_ciphers 22 1_1_0d EXIST::FUNCTION:
|
||||
SSLv3_server_method 23 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
|
||||
SSL_set_security_callback 24 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_privatekey 25 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_srp_g 26 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_set_default_passwd_cb_userdata 27 1_1_0d EXIST::FUNCTION:
|
||||
DTLS_method 28 1_1_0d EXIST::FUNCTION:
|
||||
BIO_new_ssl_connect 29 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_ex_data 30 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_add_session 31 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_config 32 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_flush_sessions 33 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_cipher_list 34 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_check_private_key 35 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_psk_identity_hint 36 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_get_error 37 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get0_param 38 1_1_0d EXIST::FUNCTION:
|
||||
SSL_add_file_cert_subjects_to_stack 39 1_1_0d EXIST::FUNCTION:
|
||||
SSL_up_ref 40 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_print_fp 41 1_1_0d EXIST::FUNCTION:STDIO
|
||||
SSL_CTX_use_PrivateKey_ASN1 42 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_peer_cert_chain 43 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_clear_flags 44 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_verify 45 1_1_0d EXIST::FUNCTION:
|
||||
i2d_SSL_SESSION 46 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_verify_depth 47 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_set_ex_data 48 1_1_0d EXIST::FUNCTION:
|
||||
SSL_add1_host 49 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_tlsext_use_srtp 50 1_1_0d EXIST::FUNCTION:SRTP
|
||||
SSL_session_reused 51 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_dane_authority 52 1_1_0d EXIST::FUNCTION:
|
||||
SSL_alert_type_string_long 53 1_1_0d EXIST::FUNCTION:
|
||||
SSL_use_RSAPrivateKey_ASN1 54 1_1_0d EXIST::FUNCTION:RSA
|
||||
SSL_CTX_SRP_CTX_free 55 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_use_PrivateKey_ASN1 56 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_quiet_shutdown 57 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get0_ctlog_store 58 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_use_RSAPrivateKey 59 1_1_0d EXIST::FUNCTION:RSA
|
||||
PEM_write_bio_SSL_SESSION 60 1_1_0d EXIST::FUNCTION:
|
||||
GMTLS_client_method 61 1_1_0d EXIST::FUNCTION:GMTLS
|
||||
SSL_use_certificate_file 62 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_purpose 63 1_1_0d EXIST::FUNCTION:
|
||||
SSL_add_dir_cert_subjects_to_stack 64 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_next_proto_select_cb 65 1_1_0d EXIST::FUNCTION:NEXTPROTONEG
|
||||
DTLSv1_server_method 66 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
|
||||
SSL_CONF_CTX_set_flags 67 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_srp_userinfo 68 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set0_security_ex_data 69 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_client_cert_cb 70 1_1_0d EXIST::FUNCTION:
|
||||
DTLSv1_client_method 71 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
|
||||
SSL_set_hostflags 72 1_1_0d EXIST::FUNCTION:
|
||||
SSL_dane_set_flags 73 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_SSL_CTX 74 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_current_cipher 75 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_remove_session 76 1_1_0d EXIST::FUNCTION:
|
||||
SSL_config 77 1_1_0d EXIST::FUNCTION:
|
||||
SSL_write 78 1_1_0d EXIST::FUNCTION:
|
||||
SSL_copy_session_id 79 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_session 80 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_ssl_method 81 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_ctlog_list_file 82 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_CTX_set_next_protos_advertised_cb 83 1_1_0d EXIST::FUNCTION:NEXTPROTONEG
|
||||
SSL_CTX_set_alpn_select_cb 84 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_ctlog_list_file 85 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_dane_clear_flags 86 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set_ssl 87 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_verified_chain 88 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_2_server_method 89 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
|
||||
SSL_get_quiet_shutdown 90 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_server_method 91 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
|
||||
SSL_get_options 92 1_1_0d EXIST::FUNCTION:
|
||||
SSL_rstate_string 93 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_sess_set_new_cb 94 1_1_0d EXIST::FUNCTION:
|
||||
SSL_alert_desc_string_long 95 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_ciphers 96 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_psk_server_callback 97 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_CTX_get_security_level 98 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_ct_validation_callback 99 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_CTX_set_trust 100 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_security_level 101 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_add_client_custom_ext 102 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_security_callback 103 1_1_0d EXIST::FUNCTION:
|
||||
BIO_ssl_shutdown 104 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_ssl_method 105 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_add_client_CA 106 1_1_0d EXIST::FUNCTION:
|
||||
SSL_version 107 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_ex_data 108 1_1_0d EXIST::FUNCTION:
|
||||
SSL_check_chain 109 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_free 110 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_info_callback 111 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get1_session 112 1_1_0d EXIST::FUNCTION:
|
||||
SRP_Calc_A_param 113 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_use_RSAPrivateKey_file 114 1_1_0d EXIST::FUNCTION:RSA
|
||||
SSL_get_peer_certificate 115 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set1_param 116 1_1_0d EXIST::FUNCTION:
|
||||
SSL_COMP_get_name 117 1_1_0d EXIST::FUNCTION:
|
||||
SSL_export_keying_material 118 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_sess_get_remove_cb 119 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_read_ahead 120 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_session_id_context 121 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_sess_set_remove_cb 122 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set1_prefix 123 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_verify_depth 124 1_1_0d EXIST::FUNCTION:
|
||||
SSL_certs_clear 125 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_verify_paths 126 1_1_0d EXIST::FUNCTION:
|
||||
BIO_new_ssl 127 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set0_wbio 128 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_cipher_nid 129 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_cert_store 130 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_psk_client_callback 131 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_CONF_cmd_argv 132 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_ct_validation_callback 133 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_CTX_use_certificate_chain_file 134 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_set_timeout 135 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_dane_set_flags 136 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set1_param 137 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_print 138 1_1_0d EXIST::FUNCTION:
|
||||
SSL_dup_CA_list 139 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_certificate 140 1_1_0d EXIST::FUNCTION:
|
||||
SSL_COMP_get_compression_methods 141 1_1_0d EXIST::FUNCTION:
|
||||
SSL_dane_tlsa_add 142 1_1_0d EXIST::FUNCTION:
|
||||
SSL_enable_ct 143 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_CTX_sessions 144 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_trust 145 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get0_security_ex_data 146 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set_ssl_ctx 147 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_callback_ctrl 148 1_1_0d EXIST::FUNCTION:
|
||||
PEM_read_SSL_SESSION 149 1_1_0d EXIST::FUNCTION:STDIO
|
||||
BIO_ssl_copy_session_id 150 1_1_0d EXIST::FUNCTION:
|
||||
SSL_add_client_CA 151 1_1_0d EXIST::FUNCTION:
|
||||
d2i_SSL_SESSION 152 1_1_0d EXIST::FUNCTION:
|
||||
SSL_callback_ctrl 153 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_session 154 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set0_security_ex_data 155 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_client_CA_list 156 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_session_ticket_ext_cb 157 1_1_0d EXIST::FUNCTION:
|
||||
SSL_has_pending 158 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_info_callback 159 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_bits 160 1_1_0d EXIST::FUNCTION:
|
||||
SSL_COMP_get_id 161 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_current_compression 162 1_1_0d EXIST::FUNCTION:
|
||||
SSL_accept 163 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_client_method 164 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
|
||||
SSL_get_shared_sigalgs 165 1_1_0d EXIST::FUNCTION:
|
||||
SSL_client_version 166 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_servername 167 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_ex_data_X509_STORE_CTX_idx 168 1_1_0d EXIST::FUNCTION:
|
||||
SSL_ct_is_enabled 169 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_set_generate_session_id 170 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_quiet_shutdown 171 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_srp_server_param 172 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set0_ctlog_store 173 1_1_0d EXIST::FUNCTION:CT
|
||||
TLS_client_method 174 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_srp_username 175 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_sess_get_get_cb 176 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_verify_depth 177 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_changed_async_fds 178 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_default_timeout 179 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_fd 180 1_1_0d EXIST::FUNCTION:SOCK
|
||||
SSL_CTX_use_certificate_file 181 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_SRP_CTX_init 182 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_state_string_long 183 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_verify 184 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_timeout 185 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_serverinfo_file 186 1_1_0d EXIST::FUNCTION:
|
||||
SSL_COMP_set0_compression_methods 187 1_1_0d EXIST::FUNCTION:
|
||||
SSL_alert_type_string 188 1_1_0d EXIST::FUNCTION:
|
||||
SSL_peek 189 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_auth_nid 190 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_cb_arg 191 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_generate_session_id 192 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_cipher_list 193 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_not_resumable_session_callback 194 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_dane_clear_flags 195 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_SSL_CTX 196 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_2_client_method 197 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
|
||||
SSL_set_accept_state 198 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_peer_scts 199 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_srp_server_param_with_username 200 1_1_0d EXIST::FUNCTION:SRP
|
||||
GMTLS_server_method 201 1_1_0d EXIST::FUNCTION:GMTLS
|
||||
SSL_get_srtp_profiles 202 1_1_0d EXIST::FUNCTION:SRTP
|
||||
SSL_get_client_CA_list 203 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_cipher_list 204 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_server_random 205 1_1_0d EXIST::FUNCTION:
|
||||
SSL_connect 206 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get0_privatekey 207 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_options 208 1_1_0d EXIST::FUNCTION:
|
||||
SSL_ctrl 209 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_next_proto_negotiated 210 1_1_0d EXIST::FUNCTION:NEXTPROTONEG
|
||||
SSL_CIPHER_get_id 211 1_1_0d EXIST::FUNCTION:
|
||||
SSL_is_init_finished 212 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_sess_get_new_cb 213 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_digest_nid 214 1_1_0d EXIST::FUNCTION:
|
||||
SSL_use_PrivateKey_file 215 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_id 216 1_1_0d EXIST::FUNCTION:
|
||||
TLS_server_method 217 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_dane_enable 218 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_method 219 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
|
||||
DTLSv1_2_method 220 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
|
||||
SSL_set_tmp_dh_callback 221 1_1_0d EXIST::FUNCTION:DH
|
||||
SSL_get0_security_ex_data 222 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_current_expansion 223 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_verify_result 224 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_srp_server_param_pw 225 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_is_gmtls 226 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_certificate 227 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_version 228 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_ticket_lifetime_hint 229 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_purpose 230 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set0_rbio 231 1_1_0d EXIST::FUNCTION:
|
||||
SSL_in_before 232 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_ct_is_enabled 233 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_use_RSAPrivateKey_file 234 1_1_0d EXIST::FUNCTION:RSA
|
||||
SSL_CTX_set_cookie_generate_cb 235 1_1_0d EXIST::FUNCTION:
|
||||
SSL_renegotiate_pending 236 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_username_callback 237 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_is_server 238 1_1_0d EXIST::FUNCTION:
|
||||
SSL_do_handshake 239 1_1_0d EXIST::FUNCTION:
|
||||
DTLS_client_method 240 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_add_server_custom_ext 241 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_param 242 1_1_0d EXIST::FUNCTION:
|
||||
SSL_want 243 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_ex_data 244 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_rfd 245 1_1_0d EXIST::FUNCTION:SOCK
|
||||
TLSv1_1_method 246 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
|
||||
SSL_alert_desc_string 247 1_1_0d EXIST::FUNCTION:
|
||||
SSL_test_functions 248 1_1_0d EXIST::FUNCTION:UNIT_TEST
|
||||
SSL_CTX_set_default_verify_dir 249 1_1_0d EXIST::FUNCTION:
|
||||
SSL_pending 250 1_1_0d EXIST::FUNCTION:
|
||||
SSL_use_psk_identity_hint 251 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_is_dtls 252 1_1_0d EXIST::FUNCTION:
|
||||
SSL_use_PrivateKey 253 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_finish 254 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_peername 255 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_PrivateKey_file 256 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_default_passwd_cb 257 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_verify_param_callback 258 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_SESSION_set_time 259 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_client_cert_engine 260 1_1_0d EXIST::FUNCTION:ENGINE
|
||||
SSL_CTX_use_PrivateKey 261 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_tmp_dh_callback 262 1_1_0d EXIST::FUNCTION:DH
|
||||
SSL_get_servername_type 263 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_print_keylog 264 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_verify_depth 265 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_wfd 266 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_options 267 1_1_0d EXIST::FUNCTION:
|
||||
DTLSv1_listen 268 1_1_0d EXIST::FUNCTION:SOCK
|
||||
SSL_get_srp_N 269 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_msg_callback 270 1_1_0d EXIST::FUNCTION:
|
||||
SSL_renegotiate_abbreviated 271 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_username 272 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_SESSION_get0_peer 273 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_RSAPrivateKey 274 1_1_0d EXIST::FUNCTION:RSA
|
||||
DTLS_server_method 275 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_security_level 276 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_kx_nid 277 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_session_id_context 278 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_cipher 279 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_peer_finished 280 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_alpn_protos 281 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_default_passwd_cb_userdata 282 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_psk_identity 283 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_get_info_callback 284 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_cert_verify_callback 285 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_sigalgs 286 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_security_callback 287 1_1_0d EXIST::FUNCTION:
|
||||
SSL_read 288 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_1_server_method 289 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
|
||||
SSL_use_certificate_ASN1 290 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_shutdown 291 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_default_passwd_cb 292 1_1_0d EXIST::FUNCTION:
|
||||
PEM_read_bio_SSL_SESSION 293 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_default_passwd_cb_userdata 294 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_strength 295 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_use_certificate_chain_file 296 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_shutdown 297 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_up_ref 298 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_description 299 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_master_key 300 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_security_level 301 1_1_0d EXIST::FUNCTION:
|
||||
SSL_load_client_CA_file 302 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_not_resumable_session_callback 303 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_timeout 304 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_state 305 1_1_0d EXIST::FUNCTION:
|
||||
SSL_state_string 306 1_1_0d EXIST::FUNCTION:
|
||||
TLS_method 307 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_has_ticket 308 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_ex_data 309 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_load_verify_locations 310 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_find 311 1_1_0d EXIST::FUNCTION:
|
||||
PEM_write_SSL_SESSION 312 1_1_0d EXIST::FUNCTION:STDIO
|
||||
SSL_shutdown 313 1_1_0d EXIST::FUNCTION:
|
||||
OPENSSL_init_ssl 314 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_client_CA_list 315 1_1_0d EXIST::FUNCTION:
|
||||
SSL_add_ssl_module 316 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_options 317 1_1_0d EXIST::FUNCTION:
|
||||
SSL_waiting_for_async 318 1_1_0d EXIST::FUNCTION:
|
||||
SSL_COMP_add_compression_method 319 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_quiet_shutdown 320 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_id_context 321 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_alpn_protos 322 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_security_callback 323 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_new 324 1_1_0d EXIST::FUNCTION:
|
||||
DTLSv1_method 325 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
|
||||
SSL_trace 326 1_1_0d EXIST::FUNCTION:SSL_TRACE
|
||||
SSL_set1_host 327 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_session_ticket_ext 328 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_bio 329 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_free 330 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_ciphers 331 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_default_read_buffer_len 332 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_verify_callback 333 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_wfd 334 1_1_0d EXIST::FUNCTION:SOCK
|
||||
DTLSv1_2_server_method 335 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
|
||||
SSL_get_client_random 336 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_passwd_cb 337 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_sess_set_get_cb 338 1_1_0d EXIST::FUNCTION:
|
||||
SSL_free 339 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_client_pwd_callback 340 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_SRP_CTX_init 341 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_get_fd 342 1_1_0d EXIST::FUNCTION:
|
||||
SSL_new 343 1_1_0d EXIST::FUNCTION:
|
||||
SSL_extension_supported 344 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_read_buffer_len 345 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_dane_tlsa 346 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_set1_id_context 347 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_time 348 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_debug 349 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0
|
||||
SSL_get_psk_identity_hint 350 1_1_0d EXIST::FUNCTION:PSK
|
||||
BIO_f_ssl 351 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_client_CA_list 352 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_ticket 353 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_verify_mode 354 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_session_secret_cb 355 1_1_0d EXIST::FUNCTION:
|
||||
DTLSv1_2_client_method 356 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
|
||||
SSL_CTX_use_serverinfo 357 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_up_ref 358 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_free 359 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_finished 360 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_compress_id 361 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_psk_client_callback 362 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_COMP_get0_name 363 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_ex_data 364 1_1_0d EXIST::FUNCTION:
|
||||
SSL_rstate_string_long 365 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_new 366 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_all_async_fds 367 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_rfd 368 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_1_client_method 369 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
|
||||
SSL_set_msg_callback 370 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_ssl_version 371 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_name 372 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_password 373 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_SESSION_get0_hostname 374 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_cert_store 375 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_timeout 376 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_verify_result 377 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_set1_id 378 1_1_0d EXIST::FUNCTION:
|
||||
SSLv3_method 379 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
|
||||
SSL_CTX_has_client_custom_ext 380 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get0_certificate 381 1_1_0d EXIST::FUNCTION:
|
||||
ERR_load_SSL_strings 382 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_clear_options 383 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_RSAPrivateKey_ASN1 384 1_1_0d EXIST::FUNCTION:RSA
|
||||
SSL_SESSION_new 385 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_info_callback 386 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_verify_mode 387 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_enable_ct 388 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_get_selected_srtp_profile 389 1_1_0d EXIST::FUNCTION:SRTP
|
||||
SSL_clear 390 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_tlsext_use_srtp 391 1_1_0d EXIST::FUNCTION:SRTP
|
||||
SSL_use_certificate 392 1_1_0d EXIST::FUNCTION:
|
||||
SSL_dup 393 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_ctrl 394 1_1_0d EXIST::FUNCTION:
|
||||
SSL_renegotiate 395 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_standard_name 396 1_1_0d EXIST::FUNCTION:SSL_TRACE
|
||||
SSL_check_private_key 397 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_cmd 398 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_verify_file 399 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get1_supported_ciphers 400 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_client_cert_cb 401 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_passwd_cb_userdata 402 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_certificate_ASN1 403 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_connect_state 404 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_is_aead 405 1_1_0d EXIST::FUNCTION:
|
||||
GMTLS_method 406 1_1_0d EXIST::FUNCTION:GMTLS
|
||||
SSL_get_default_passwd_cb 407 1_1_0d EXIST::FUNCTION:
|
||||
SSL_clear_options 408 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_wbio 409 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_dane 410 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_ssl_method 411 1_1_0d EXIST::FUNCTION:
|
||||
SSL_ctrl 1 1_1_0d EXIST::FUNCTION:
|
||||
GMTLS_client_method 2 1_1_0d EXIST::FUNCTION:GMTLS
|
||||
SSL_CTX_get0_certificate 3 1_1_0d EXIST::FUNCTION:
|
||||
BIO_new_ssl 4 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_verify 5 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_username 6 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_set_srp_server_param 7 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_info_callback 8 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_dane_clear_flags 9 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_verify_callback 10 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_bits 11 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_ex_data 12 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_rfd 13 1_1_0d EXIST::FUNCTION:SOCK
|
||||
SSL_get_servername_type 14 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_username_callback 15 1_1_0d EXIST::FUNCTION:SRP
|
||||
DTLSv1_listen 16 1_1_0d EXIST::FUNCTION:SOCK
|
||||
SSL_set_ex_data 17 1_1_0d EXIST::FUNCTION:
|
||||
BIO_ssl_shutdown 18 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set1_param 19 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_trust 20 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_tmp_dh_callback 21 1_1_0d EXIST::FUNCTION:DH
|
||||
SSL_SESSION_up_ref 22 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_client_CA_list 23 1_1_0d EXIST::FUNCTION:
|
||||
DTLSv1_2_client_method 24 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
|
||||
SSL_set_msg_callback 25 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_ctrl 26 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_certificate 27 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_psk_client_callback 28 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_peek 29 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_ct_is_enabled 30 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_get_privatekey 31 1_1_0d EXIST::FUNCTION:
|
||||
DTLSv1_server_method 32 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
|
||||
SSL_dup_CA_list 33 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_passwd_cb 34 1_1_0d EXIST::FUNCTION:
|
||||
SSL_check_chain 35 1_1_0d EXIST::FUNCTION:
|
||||
GMTLS_method 36 1_1_0d EXIST::FUNCTION:GMTLS
|
||||
SSL_CTX_set_default_read_buffer_len 37 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_finished 38 1_1_0d EXIST::FUNCTION:
|
||||
SSL_session_reused 39 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get0_security_ex_data 40 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_security_level 41 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_dane_set_flags 42 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_debug 43 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0
|
||||
SSL_renegotiate 44 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_2_client_method 45 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
|
||||
SSL_CTX_set_next_proto_select_cb 46 1_1_0d EXIST::FUNCTION:NEXTPROTONEG
|
||||
SSL_get_all_async_fds 47 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_srtp_profiles 48 1_1_0d EXIST::FUNCTION:SRTP
|
||||
SSL_trace 49 1_1_0d EXIST::FUNCTION:SSL_TRACE
|
||||
SSL_srp_server_param_with_username 50 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_ct_validation_callback 51 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_check_private_key 52 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_protocol_version 53 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_ct_validation_callback 54 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_CTX_get_cert_store 55 1_1_0d EXIST::FUNCTION:
|
||||
BIO_f_ssl 56 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get1_supported_ciphers 57 1_1_0d EXIST::FUNCTION:
|
||||
SSL_new 58 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_compress_id 59 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_sess_get_remove_cb 60 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_cookie_verify_cb 61 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_next_proto_negotiated 62 1_1_0d EXIST::FUNCTION:NEXTPROTONEG
|
||||
PEM_read_SSL_SESSION 63 1_1_0d EXIST::FUNCTION:STDIO
|
||||
SSL_use_PrivateKey_ASN1 64 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SRP_CTX_init 65 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_use_PrivateKey 66 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_security_callback 67 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set_ssl 68 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_sess_get_get_cb 69 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_bio 70 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_1_server_method 71 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
|
||||
SSL_CTX_use_PrivateKey_ASN1 72 1_1_0d EXIST::FUNCTION:
|
||||
SSL_test_functions 73 1_1_0d EXIST::FUNCTION:UNIT_TEST
|
||||
SSL_SESSION_get_timeout 74 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_psk_identity_hint 75 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_set_SSL_CTX 76 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_verify_param_callback 77 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_alert_type_string 78 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_PrivateKey_file 79 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_print_keylog 80 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set1_param 81 1_1_0d EXIST::FUNCTION:
|
||||
SSL_export_keying_material 82 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_client_cert_engine 83 1_1_0d EXIST::FUNCTION:ENGINE
|
||||
SSL_get0_security_ex_data 84 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_id_context 85 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_selected_srtp_profile 86 1_1_0d EXIST::FUNCTION:SRTP
|
||||
SSL_CTX_get_verify_callback 87 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set0_rbio 88 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_quiet_shutdown 89 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_server_random 90 1_1_0d EXIST::FUNCTION:
|
||||
SSL_version 91 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_error 92 1_1_0d EXIST::FUNCTION:
|
||||
SSLv3_method 93 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
|
||||
SSL_set1_host 94 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_quiet_shutdown 95 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_security_callback 96 1_1_0d EXIST::FUNCTION:
|
||||
SSL_alert_desc_string_long 97 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_set_timeout 98 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set0_ctlog_store 99 1_1_0d EXIST::FUNCTION:CT
|
||||
DTLSv1_2_server_method 100 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
|
||||
SSL_CONF_cmd_argv 101 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_wfd 102 1_1_0d EXIST::FUNCTION:SOCK
|
||||
SSL_get0_verified_chain 103 1_1_0d EXIST::FUNCTION:
|
||||
SSL_use_certificate_file 104 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_sessions 105 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_auth_nid 106 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_master_key 107 1_1_0d EXIST::FUNCTION:
|
||||
DTLS_client_method 108 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_cipher_list 109 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_shutdown 110 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_cmd 111 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_RSAPrivateKey_file 112 1_1_0d EXIST::FUNCTION:RSA
|
||||
SSL_get_rfd 113 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_version 114 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_ssl_method 115 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_msg_callback 116 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set0_security_ex_data 117 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_alpn_protos 118 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_cert_cb 119 1_1_0d EXIST::FUNCTION:
|
||||
SSL_has_pending 120 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_SSL_CTX 121 1_1_0d EXIST::FUNCTION:
|
||||
SSL_shutdown 122 1_1_0d EXIST::FUNCTION:
|
||||
SSL_renegotiate_pending 123 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_alpn_select_cb 124 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_param 125 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_new 126 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_verify_depth 127 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_ciphers 128 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set0_security_ex_data 129 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_not_resumable_session_callback 130 1_1_0d EXIST::FUNCTION:
|
||||
SSL_clear 131 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_hostname 132 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_finish 133 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_dane 134 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_client_ciphers 135 1_1_0d EXIST::FUNCTION:
|
||||
SSL_write 136 1_1_0d EXIST::FUNCTION:
|
||||
SSL_COMP_get_id 137 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set_ssl_ctx 138 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_current_compression 139 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_client_CA_list 140 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_options 141 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_set_time 142 1_1_0d EXIST::FUNCTION:
|
||||
SSL_is_server 143 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_purpose 144 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_connect_state 145 1_1_0d EXIST::FUNCTION:
|
||||
SSL_certs_clear 146 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get0_param 147 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_info_callback 148 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get0_privatekey 149 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_alpn_protos 150 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_sigalgs 151 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_digest_nid 152 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_current_cipher 153 1_1_0d EXIST::FUNCTION:
|
||||
SSL_connect 154 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_default_passwd_cb_userdata 155 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_client_random 156 1_1_0d EXIST::FUNCTION:
|
||||
TLS_method 157 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_purpose 158 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_certificate_ASN1 159 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_add_client_CA 160 1_1_0d EXIST::FUNCTION:
|
||||
PEM_write_bio_SSL_SESSION 161 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_shared_ciphers 162 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_default_read_buffer_len 163 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_free 164 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_time 165 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set0_wbio 166 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_2_server_method 167 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
|
||||
SSL_CTX_get_options 168 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_ssl_version 169 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_default_passwd_cb_userdata 170 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_security_level 171 1_1_0d EXIST::FUNCTION:
|
||||
SSL_is_dtls 172 1_1_0d EXIST::FUNCTION:
|
||||
SSL_use_certificate_ASN1 173 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_print_fp 174 1_1_0d EXIST::FUNCTION:STDIO
|
||||
SSL_use_PrivateKey_file 175 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_client_pwd_callback 176 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_get_client_cert_cb 177 1_1_0d EXIST::FUNCTION:
|
||||
SSL_in_before 178 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_quiet_shutdown 179 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_ciphers 180 1_1_0d EXIST::FUNCTION:
|
||||
SSL_read 181 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_security_callback 182 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_description 183 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_clear_options 184 1_1_0d EXIST::FUNCTION:
|
||||
SSLv3_client_method 185 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
|
||||
SSL_CTX_set_srp_strength 186 1_1_0d EXIST::FUNCTION:SRP
|
||||
TLS_server_method 187 1_1_0d EXIST::FUNCTION:
|
||||
SSL_dup 188 1_1_0d EXIST::FUNCTION:
|
||||
SSL_alert_type_string_long 189 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_cert_cb 190 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_generate_session_id 191 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_certificate_chain_file 192 1_1_0d EXIST::FUNCTION:
|
||||
SSL_dane_enable 193 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_verify_depth 194 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_sess_get_new_cb 195 1_1_0d EXIST::FUNCTION:
|
||||
SSL_clear_options 196 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_verify_depth 197 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_SRP_CTX_init 198 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_set_read_ahead 199 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_default_passwd_cb 200 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_session_id_context 201 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_shutdown 202 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set_flags 203 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_is_aead 204 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_ex_data 205 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_default_passwd_cb 206 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_name 207 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_cert_store 208 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_1_client_method 209 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
|
||||
SSL_use_psk_identity_hint 210 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_renegotiate_abbreviated 211 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_alpn_selected 212 1_1_0d EXIST::FUNCTION:
|
||||
SSL_callback_ctrl 213 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_dane_authority 214 1_1_0d EXIST::FUNCTION:
|
||||
SSL_dane_tlsa_add 215 1_1_0d EXIST::FUNCTION:
|
||||
SSL_use_RSAPrivateKey_file 216 1_1_0d EXIST::FUNCTION:RSA
|
||||
SSL_CIPHER_get_version 217 1_1_0d EXIST::FUNCTION:
|
||||
SSL_client_version 218 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_check_private_key 219 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_set_ex_data 220 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_psk_server_callback 221 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_CTX_set_default_verify_paths 222 1_1_0d EXIST::FUNCTION:
|
||||
SSL_dane_set_flags 223 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_ex_data_X509_STORE_CTX_idx 224 1_1_0d EXIST::FUNCTION:
|
||||
SSL_state_string_long 225 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_accept_state 226 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_wbio 227 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_session_ticket_ext_cb 228 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_find 229 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CIPHER_standard_name 230 1_1_0d EXIST::FUNCTION:SSL_TRACE
|
||||
SSL_accept 231 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_sess_set_remove_cb 232 1_1_0d EXIST::FUNCTION:
|
||||
SSL_in_init 233 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_servername 234 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_set1_id 235 1_1_0d EXIST::FUNCTION:
|
||||
SSL_rstate_string 236 1_1_0d EXIST::FUNCTION:
|
||||
SSL_use_certificate_chain_file 237 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_srp_server_param_pw 238 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_ctlog_list_file 239 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_CONF_CTX_set1_prefix 240 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_1_method 241 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
|
||||
SSL_CTX_use_serverinfo_file 242 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_new 243 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_tlsext_use_srtp 244 1_1_0d EXIST::FUNCTION:SRTP
|
||||
SSL_copy_session_id 245 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_callback_ctrl 246 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_certificate 247 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get0_ctlog_store 248 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_extension_supported 249 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_cipher 250 1_1_0d EXIST::FUNCTION:
|
||||
PEM_read_bio_SSL_SESSION 251 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_psk_client_callback 252 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_CTX_load_verify_locations 253 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_free 254 1_1_0d EXIST::FUNCTION:
|
||||
ERR_load_SSL_strings 255 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_remove_session 256 1_1_0d EXIST::FUNCTION:
|
||||
GMTLS_server_method 257 1_1_0d EXIST::FUNCTION:GMTLS
|
||||
SSL_CTX_set_ex_data 258 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_read_ahead 259 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_RSAPrivateKey 260 1_1_0d EXIST::FUNCTION:RSA
|
||||
SSL_CTX_set_default_verify_file 261 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_add_client_custom_ext 262 1_1_0d EXIST::FUNCTION:
|
||||
SSL_alert_desc_string 263 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_set1_id_context 264 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_cipher_list 265 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_options 266 1_1_0d EXIST::FUNCTION:
|
||||
SSL_add_client_CA 267 1_1_0d EXIST::FUNCTION:
|
||||
SSL_pending 268 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_client_CA_list 269 1_1_0d EXIST::FUNCTION:
|
||||
DTLS_server_method 270 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_psk_server_callback 271 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_CIPHER_get_id 272 1_1_0d EXIST::FUNCTION:
|
||||
i2d_SSL_SESSION 273 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_verify_result 274 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_session 275 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_quiet_shutdown 276 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_cookie_generate_cb 277 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_peer 278 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_peer_certificate 279 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_state 280 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_session 281 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_shared_sigalgs 282 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_tmp_dh_callback 283 1_1_0d EXIST::FUNCTION:DH
|
||||
SSL_get_changed_async_fds 284 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_wfd 285 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_peername 286 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_client_cert_cb 287 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_ctlog_list_file 288 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_SESSION_get_ticket_lifetime_hint 289 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_rbio 290 1_1_0d EXIST::FUNCTION:
|
||||
SSL_ct_is_enabled 291 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_get_srp_userinfo 292 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_get_verify_mode 293 1_1_0d EXIST::FUNCTION:
|
||||
SSL_COMP_get_name 294 1_1_0d EXIST::FUNCTION:
|
||||
SSL_select_next_proto 295 1_1_0d EXIST::FUNCTION:
|
||||
BIO_new_buffer_ssl_connect 296 1_1_0d EXIST::FUNCTION:
|
||||
DTLSv1_2_method 297 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
|
||||
SSL_CIPHER_get_kx_nid 298 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_ticket 299 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_session_secret_cb 300 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_SRP_CTX_free 301 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_timeout 302 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_has_ticket 303 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_default_passwd_cb_userdata 304 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_add_session 305 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_verify_dir 306 1_1_0d EXIST::FUNCTION:
|
||||
BIO_new_ssl_connect 307 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_server_method 308 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
|
||||
SSL_CTX_get_info_callback 309 1_1_0d EXIST::FUNCTION:
|
||||
SSL_add_dir_cert_subjects_to_stack 310 1_1_0d EXIST::FUNCTION:
|
||||
SSL_up_ref 311 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_add_server_custom_ext 312 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_verify 313 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_dane_enable 314 1_1_0d EXIST::FUNCTION:
|
||||
BIO_ssl_copy_session_id 315 1_1_0d EXIST::FUNCTION:
|
||||
SSL_COMP_get0_name 316 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_client_CA_list 317 1_1_0d EXIST::FUNCTION:
|
||||
SSL_rstate_string_long 318 1_1_0d EXIST::FUNCTION:
|
||||
SSL_dane_clear_flags 319 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_security_level 320 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_srp_g 321 1_1_0d EXIST::FUNCTION:SRP
|
||||
OPENSSL_init_ssl 322 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_flush_sessions 323 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_peer_cert_chain 324 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_ex_data 325 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_print 326 1_1_0d EXIST::FUNCTION:
|
||||
SSL_COMP_get_compression_methods 327 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_method 328 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
|
||||
TLS_client_method 329 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_security_callback 330 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_dane_mtype_set 331 1_1_0d EXIST::FUNCTION:
|
||||
SSL_load_client_CA_file 332 1_1_0d EXIST::FUNCTION:
|
||||
DTLSv1_method 333 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
|
||||
SSL_COMP_add_compression_method 334 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_serverinfo 335 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_ssl_method 336 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_cb_arg 337 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_set_tlsext_use_srtp 338 1_1_0d EXIST::FUNCTION:SRTP
|
||||
SSL_set_cipher_list 339 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_peer_finished 340 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_dane_tlsa 341 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_fd 342 1_1_0d EXIST::FUNCTION:SOCK
|
||||
SSL_CTX_set_srp_password 343 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_use_certificate_file 344 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_config 345 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_new 346 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_verify_depth 347 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_cmd_value_type 348 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_next_protos_advertised_cb 349 1_1_0d EXIST::FUNCTION:NEXTPROTONEG
|
||||
SSL_SESSION_free 350 1_1_0d EXIST::FUNCTION:
|
||||
SSL_COMP_set0_compression_methods 351 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_srp_N 352 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_sess_set_get_cb 353 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_generate_session_id 354 1_1_0d EXIST::FUNCTION:
|
||||
SSL_SESSION_get_id 355 1_1_0d EXIST::FUNCTION:
|
||||
SSLv3_server_method 356 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
|
||||
SSL_config 357 1_1_0d EXIST::FUNCTION:
|
||||
SSL_has_matching_session_id 358 1_1_0d EXIST::FUNCTION:
|
||||
SSL_is_init_finished 359 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_sess_set_new_cb 360 1_1_0d EXIST::FUNCTION:
|
||||
SSL_add_file_cert_subjects_to_stack 361 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_clear_flags 362 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_up_ref 363 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_client_method 364 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
|
||||
SSL_get_srp_username 365 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_get_info_callback 366 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_cert_verify_callback 367 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_enable_ct 368 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_CTX_set_session_id_context 369 1_1_0d EXIST::FUNCTION:
|
||||
SSL_want 370 1_1_0d EXIST::FUNCTION:
|
||||
SSL_do_handshake 371 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_passwd_cb_userdata 372 1_1_0d EXIST::FUNCTION:
|
||||
SSL_state_string 373 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_ssl_method 374 1_1_0d EXIST::FUNCTION:
|
||||
TLSv1_2_method 375 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
|
||||
SSL_get_psk_identity 376 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_get_default_timeout 377 1_1_0d EXIST::FUNCTION:
|
||||
SSL_add_ssl_module 378 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get1_session 379 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_default_passwd_cb 380 1_1_0d EXIST::FUNCTION:
|
||||
SSL_use_certificate 381 1_1_0d EXIST::FUNCTION:
|
||||
PEM_write_SSL_SESSION 382 1_1_0d EXIST::FUNCTION:STDIO
|
||||
SSL_use_RSAPrivateKey_ASN1 383 1_1_0d EXIST::FUNCTION:RSA
|
||||
SSL_set_trust 384 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_timeout 385 1_1_0d EXIST::FUNCTION:
|
||||
DTLS_method 386 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get0_peer_scts 387 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_CIPHER_get_cipher_nid 388 1_1_0d EXIST::FUNCTION:
|
||||
SRP_Calc_A_param 389 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_CTX_use_RSAPrivateKey_ASN1 390 1_1_0d EXIST::FUNCTION:RSA
|
||||
SSL_set_session_ticket_ext 391 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_not_resumable_session_callback 392 1_1_0d EXIST::FUNCTION:
|
||||
d2i_SSL_SESSION 393 1_1_0d EXIST::FUNCTION:
|
||||
SSL_add1_host 394 1_1_0d EXIST::FUNCTION:
|
||||
SSL_is_gmtls 395 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_options 396 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_use_psk_identity_hint 397 1_1_0d EXIST::FUNCTION:PSK
|
||||
SSL_waiting_for_async 398 1_1_0d EXIST::FUNCTION:
|
||||
DTLSv1_client_method 399 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
|
||||
SSL_SRP_CTX_free 400 1_1_0d EXIST::FUNCTION:SRP
|
||||
SSL_enable_ct 401 1_1_0d EXIST::FUNCTION:CT
|
||||
SSL_use_RSAPrivateKey 402 1_1_0d EXIST::FUNCTION:RSA
|
||||
SSL_set_hostflags 403 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_get_verify_mode 404 1_1_0d EXIST::FUNCTION:
|
||||
SSL_use_PrivateKey 405 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_current_expansion 406 1_1_0d EXIST::FUNCTION:
|
||||
SSL_CTX_has_client_custom_ext 407 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_security_level 408 1_1_0d EXIST::FUNCTION:
|
||||
SSL_set_verify_result 409 1_1_0d EXIST::FUNCTION:
|
||||
SSL_get_fd 410 1_1_0d EXIST::FUNCTION:
|
||||
SSL_free 411 1_1_0d EXIST::FUNCTION:
|
||||
|
||||
Reference in New Issue
Block a user