亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ecdhtest.c

?? OpenSSL 0.9.8k 最新版OpenSSL
?? C
字號:
/* crypto/ecdh/ecdhtest.c *//* ==================================================================== * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. * * The Elliptic Curve Public-Key Crypto Library (ECC Code) included * herein is developed by SUN MICROSYSTEMS, INC., and is contributed * to the OpenSSL project. * * The ECC Code is licensed pursuant to the OpenSSL open source * license provided below. * * The ECDH software is originally written by Douglas Stebila of * Sun Microsystems Laboratories. * *//* ==================================================================== * Copyright (c) 1998-2003 The OpenSSL 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 OpenSSL Project *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)" * * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to *    endorse or promote products derived from this software without *    prior written permission. For written permission, please contact *    openssl-core@openssl.org. * * 5. Products derived from this software may not be called "OpenSSL" *    nor may "OpenSSL" appear in their names without prior written *    permission of the OpenSSL Project. * * 6. Redistributions of any form whatsoever must retain the following *    acknowledgment: *    "This product includes software developed by the OpenSSL Project *    for use in the OpenSSL Toolkit (http://www.openssl.org/)" * * THIS SOFTWARE IS PROVIDED BY THE OpenSSL 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 OpenSSL 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. * ==================================================================== * * This product includes cryptographic software written by Eric Young * (eay@cryptsoft.com).  This product includes software written by Tim * Hudson (tjh@cryptsoft.com). * */#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../e_os.h"#include <openssl/opensslconf.h>	/* for OPENSSL_NO_ECDH */#include <openssl/crypto.h>#include <openssl/bio.h>#include <openssl/bn.h>#include <openssl/objects.h>#include <openssl/rand.h>#include <openssl/sha.h>#include <openssl/err.h>#ifdef OPENSSL_NO_ECDHint main(int argc, char *argv[]){    printf("No ECDH support\n");    return(0);}#else#include <openssl/ec.h>#include <openssl/ecdh.h>#ifdef OPENSSL_SYS_WIN16#define MS_CALLBACK	_far _loadds#else#define MS_CALLBACK#endif#if 0static void MS_CALLBACK cb(int p, int n, void *arg);#endifstatic const char rnd_seed[] = "string to make the random number generator think it has entropy";static const int KDF1_SHA1_len = 20;static void *KDF1_SHA1(const void *in, size_t inlen, void *out, size_t *outlen)	{#ifndef OPENSSL_NO_SHA	if (*outlen < SHA_DIGEST_LENGTH)		return NULL;	else		*outlen = SHA_DIGEST_LENGTH;	return SHA1(in, inlen, out);#else	return NULL;#endif	}static int test_ecdh_curve(int nid, const char *text, BN_CTX *ctx, BIO *out)	{	EC_KEY *a=NULL;	EC_KEY *b=NULL;	BIGNUM *x_a=NULL, *y_a=NULL,	       *x_b=NULL, *y_b=NULL;	char buf[12];	unsigned char *abuf=NULL,*bbuf=NULL;	int i,alen,blen,aout,bout,ret=0;	const EC_GROUP *group;	a = EC_KEY_new_by_curve_name(nid);	b = EC_KEY_new_by_curve_name(nid);	if (a == NULL || b == NULL)		goto err;	group = EC_KEY_get0_group(a);	if ((x_a=BN_new()) == NULL) goto err;	if ((y_a=BN_new()) == NULL) goto err;	if ((x_b=BN_new()) == NULL) goto err;	if ((y_b=BN_new()) == NULL) goto err;	BIO_puts(out,"Testing key generation with ");	BIO_puts(out,text);#ifdef NOISY	BIO_puts(out,"\n");#else	(void)BIO_flush(out);#endif	if (!EC_KEY_generate_key(a)) goto err;		if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) 		{		if (!EC_POINT_get_affine_coordinates_GFp(group,			EC_KEY_get0_public_key(a), x_a, y_a, ctx)) goto err;		}	else		{		if (!EC_POINT_get_affine_coordinates_GF2m(group,			EC_KEY_get0_public_key(a), x_a, y_a, ctx)) goto err;		}#ifdef NOISY	BIO_puts(out,"  pri 1=");	BN_print(out,a->priv_key);	BIO_puts(out,"\n  pub 1=");	BN_print(out,x_a);	BIO_puts(out,",");	BN_print(out,y_a);	BIO_puts(out,"\n");#else	BIO_printf(out," .");	(void)BIO_flush(out);#endif	if (!EC_KEY_generate_key(b)) goto err;	if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) 		{		if (!EC_POINT_get_affine_coordinates_GFp(group, 			EC_KEY_get0_public_key(b), x_b, y_b, ctx)) goto err;		}	else		{		if (!EC_POINT_get_affine_coordinates_GF2m(group, 			EC_KEY_get0_public_key(b), x_b, y_b, ctx)) goto err;		}#ifdef NOISY	BIO_puts(out,"  pri 2=");	BN_print(out,b->priv_key);	BIO_puts(out,"\n  pub 2=");	BN_print(out,x_b);	BIO_puts(out,",");	BN_print(out,y_b);	BIO_puts(out,"\n");#else	BIO_printf(out,".");	(void)BIO_flush(out);#endif	alen=KDF1_SHA1_len;	abuf=(unsigned char *)OPENSSL_malloc(alen);	aout=ECDH_compute_key(abuf,alen,EC_KEY_get0_public_key(b),a,KDF1_SHA1);#ifdef NOISY	BIO_puts(out,"  key1 =");	for (i=0; i<aout; i++)		{		sprintf(buf,"%02X",abuf[i]);		BIO_puts(out,buf);		}	BIO_puts(out,"\n");#else	BIO_printf(out,".");	(void)BIO_flush(out);#endif	blen=KDF1_SHA1_len;	bbuf=(unsigned char *)OPENSSL_malloc(blen);	bout=ECDH_compute_key(bbuf,blen,EC_KEY_get0_public_key(a),b,KDF1_SHA1);#ifdef NOISY	BIO_puts(out,"  key2 =");	for (i=0; i<bout; i++)		{		sprintf(buf,"%02X",bbuf[i]);		BIO_puts(out,buf);		}	BIO_puts(out,"\n");#else	BIO_printf(out,".");	(void)BIO_flush(out);#endif	if ((aout < 4) || (bout != aout) || (memcmp(abuf,bbuf,aout) != 0))		{#ifndef NOISY		BIO_printf(out, " failed\n\n");		BIO_printf(out, "key a:\n");		BIO_printf(out, "private key: ");		BN_print(out, EC_KEY_get0_private_key(a));		BIO_printf(out, "\n");		BIO_printf(out, "public key (x,y): ");		BN_print(out, x_a);		BIO_printf(out, ",");		BN_print(out, y_a);		BIO_printf(out, "\nkey b:\n");		BIO_printf(out, "private key: ");		BN_print(out, EC_KEY_get0_private_key(b));		BIO_printf(out, "\n");		BIO_printf(out, "public key (x,y): ");		BN_print(out, x_b);		BIO_printf(out, ",");		BN_print(out, y_b);		BIO_printf(out, "\n");		BIO_printf(out, "generated key a: ");		for (i=0; i<bout; i++)			{			sprintf(buf, "%02X", bbuf[i]);			BIO_puts(out, buf);			}		BIO_printf(out, "\n");		BIO_printf(out, "generated key b: ");		for (i=0; i<aout; i++)			{			sprintf(buf, "%02X", abuf[i]);			BIO_puts(out,buf);			}		BIO_printf(out, "\n");#endif		fprintf(stderr,"Error in ECDH routines\n");		ret=0;		}	else		{#ifndef NOISY		BIO_printf(out, " ok\n");#endif		ret=1;		}err:	ERR_print_errors_fp(stderr);	if (abuf != NULL) OPENSSL_free(abuf);	if (bbuf != NULL) OPENSSL_free(bbuf);	if (x_a) BN_free(x_a);	if (y_a) BN_free(y_a);	if (x_b) BN_free(x_b);	if (y_b) BN_free(y_b);	if (b) EC_KEY_free(b);	if (a) EC_KEY_free(a);	return(ret);	}int main(int argc, char *argv[])	{	BN_CTX *ctx=NULL;	int ret=1;	BIO *out;	CRYPTO_malloc_debug_init();	CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL);	CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);#ifdef OPENSSL_SYS_WIN32	CRYPTO_malloc_init();#endif	RAND_seed(rnd_seed, sizeof rnd_seed);	out=BIO_new(BIO_s_file());	if (out == NULL) EXIT(1);	BIO_set_fp(out,stdout,BIO_NOCLOSE);	if ((ctx=BN_CTX_new()) == NULL) goto err;	/* NIST PRIME CURVES TESTS */	if (!test_ecdh_curve(NID_X9_62_prime192v1, "NIST Prime-Curve P-192", ctx, out)) goto err;	if (!test_ecdh_curve(NID_secp224r1, "NIST Prime-Curve P-224", ctx, out)) goto err;	if (!test_ecdh_curve(NID_X9_62_prime256v1, "NIST Prime-Curve P-256", ctx, out)) goto err;	if (!test_ecdh_curve(NID_secp384r1, "NIST Prime-Curve P-384", ctx, out)) goto err;	if (!test_ecdh_curve(NID_secp521r1, "NIST Prime-Curve P-521", ctx, out)) goto err;	/* NIST BINARY CURVES TESTS */	if (!test_ecdh_curve(NID_sect163k1, "NIST Binary-Curve K-163", ctx, out)) goto err;	if (!test_ecdh_curve(NID_sect163r2, "NIST Binary-Curve B-163", ctx, out)) goto err;	if (!test_ecdh_curve(NID_sect233k1, "NIST Binary-Curve K-233", ctx, out)) goto err;	if (!test_ecdh_curve(NID_sect233r1, "NIST Binary-Curve B-233", ctx, out)) goto err;	if (!test_ecdh_curve(NID_sect283k1, "NIST Binary-Curve K-283", ctx, out)) goto err;	if (!test_ecdh_curve(NID_sect283r1, "NIST Binary-Curve B-283", ctx, out)) goto err;	if (!test_ecdh_curve(NID_sect409k1, "NIST Binary-Curve K-409", ctx, out)) goto err;	if (!test_ecdh_curve(NID_sect409r1, "NIST Binary-Curve B-409", ctx, out)) goto err;	if (!test_ecdh_curve(NID_sect571k1, "NIST Binary-Curve K-571", ctx, out)) goto err;	if (!test_ecdh_curve(NID_sect571r1, "NIST Binary-Curve B-571", ctx, out)) goto err;	ret = 0;err:	ERR_print_errors_fp(stderr);	if (ctx) BN_CTX_free(ctx);	BIO_free(out);	CRYPTO_cleanup_all_ex_data();	ERR_remove_state(0);	CRYPTO_mem_leaks_fp(stderr);	EXIT(ret);	return(ret);	}#if 0static void MS_CALLBACK cb(int p, int n, void *arg)	{	char c='*';	if (p == 0) c='.';	if (p == 1) c='+';	if (p == 2) c='*';	if (p == 3) c='\n';	BIO_write((BIO *)arg,&c,1);	(void)BIO_flush((BIO *)arg);#ifdef LINT	p=n;#endif	}#endif#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色乱码一区二区三区88| 亚洲人123区| 国产精品久久久久久久久免费樱桃| 一区二区三区在线视频观看58| 青青草精品视频| 在线观看国产日韩| 国产女同互慰高潮91漫画| 黑人巨大精品欧美黑白配亚洲| 欧美性xxxxxxxx| 中文字幕在线不卡视频| 国内精品久久久久影院一蜜桃| 欧美日韩在线综合| 成人免费在线播放视频| 国产成人综合在线观看| 91精品福利在线一区二区三区| 亚洲免费在线观看| 成a人片亚洲日本久久| 欧美精品一区二区三区蜜桃 | 国产精品素人一区二区| 美女视频黄a大片欧美| 欧美日韩亚洲国产综合| 亚洲精品日产精品乱码不卡| 成人教育av在线| 久久精品夜色噜噜亚洲a∨| 麻豆91在线播放| 日韩欧美国产一区二区在线播放| 亚洲国产美女搞黄色| 欧美主播一区二区三区美女| 国产精品久久久久久久浪潮网站 | 午夜视频在线观看一区二区三区| 99re在线精品| 成人欧美一区二区三区| 99久久er热在这里只有精品66| 亚洲国产精品传媒在线观看| 色www精品视频在线观看| 国产精品夫妻自拍| 色偷偷久久人人79超碰人人澡| 亚洲免费观看高清完整版在线| 不卡视频一二三四| 亚洲一区二区高清| 在线播放日韩导航| 日av在线不卡| 国产午夜精品理论片a级大结局| 国产精品系列在线播放| 国产精品毛片无遮挡高清| av资源网一区| 亚洲动漫第一页| 日韩一区二区三区免费看 | 国产91精品一区二区麻豆亚洲| 国产亚洲综合性久久久影院| 成人小视频免费在线观看| 国产精品久久久99| 欧美色手机在线观看| 日本人妖一区二区| 欧美国产精品一区二区| 99国产精品99久久久久久| 一区二区三区欧美在线观看| 欧美一区二区久久久| 国模一区二区三区白浆| 亚洲欧美日韩一区二区| 91精品啪在线观看国产60岁| 国产美女视频一区| 日韩—二三区免费观看av| 日韩一级大片在线| 成人精品视频一区| 天堂成人免费av电影一区| 久久久久成人黄色影片| 欧美亚州韩日在线看免费版国语版| 玖玖九九国产精品| 亚洲欧美日韩中文播放| 精品国产髙清在线看国产毛片| 成人一区二区在线观看| 肉肉av福利一精品导航| 中文字幕不卡在线| 欧美蜜桃一区二区三区| 成人午夜在线视频| 麻豆91免费观看| 亚洲国产综合91精品麻豆| 国产日韩综合av| 91精品国产手机| 日本韩国精品一区二区在线观看| 精品制服美女丁香| 亚洲欧美乱综合| 亚洲国产精品国自产拍av| 日韩一区二区在线观看| 欧美在线啊v一区| 成人激情免费网站| 老司机免费视频一区二区三区| 自拍偷拍亚洲综合| 久久一日本道色综合| 欧美乱妇15p| 色一情一伦一子一伦一区| 国产精品中文字幕日韩精品 | 欧美精品黑人性xxxx| k8久久久一区二区三区| 国产麻豆精品一区二区| 日韩在线一区二区| 国产91色综合久久免费分享| 免费欧美高清视频| 亚洲国产日韩综合久久精品| 国产精品国产三级国产aⅴ入口| 2021中文字幕一区亚洲| 日韩一区二区三区高清免费看看| 欧美探花视频资源| 日本韩国精品在线| 97久久精品人人做人人爽50路 | 五月天久久比比资源色| 一区二区三区日韩在线观看| 国产精品美女久久久久久2018| 久久蜜桃av一区精品变态类天堂| 日韩欧美的一区二区| 日韩欧美一二区| 欧美不卡一区二区| 精品久久国产老人久久综合| 日韩精品专区在线影院重磅| 日韩一区二区高清| 精品成人一区二区三区| 久久久久久综合| 久久精品一区蜜桃臀影院| 国产亚洲婷婷免费| 欧美激情综合在线| 国产精品二三区| 亚洲欧美日韩在线不卡| 亚洲一区二区三区四区五区黄| 亚洲高清视频在线| 免费黄网站欧美| 国产精品99久久久久久久vr | 亚洲人精品午夜| 一区二区三区在线视频免费| 亚洲成av人片在线| 久久精品国产免费看久久精品| 韩国三级在线一区| 成人网在线播放| 一本大道久久a久久精品综合| 欧美天天综合网| 精品免费视频.| 国产精品福利一区| 丝瓜av网站精品一区二区| 蜜桃视频一区二区三区| 国产精品一区一区三区| 97se亚洲国产综合自在线不卡| 欧美色大人视频| 精品久久久三级丝袜| 中文字幕乱码一区二区免费| 一区二区三区蜜桃网| 麻豆免费精品视频| 国产成a人亚洲| 欧美日韩精品二区第二页| 欧美精品一区男女天堂| 亚洲天堂久久久久久久| 蜜桃精品视频在线观看| 99精品国产99久久久久久白柏| 欧美三电影在线| 国产午夜精品一区二区| 午夜精品久久久久久久蜜桃app| 国产一区二区三区久久悠悠色av| 91丝袜美女网| 欧美成人性战久久| 综合精品久久久| 久久se这里有精品| 欧美性做爰猛烈叫床潮| 国产精品视频麻豆| 麻豆久久久久久久| 欧美日免费三级在线| 国产精品夫妻自拍| 国产一区 二区 三区一级| 欧美日韩一区在线观看| 亚洲国产成人私人影院tom| 日本不卡123| 欧美色综合天天久久综合精品| 久久久久久久免费视频了| 日本人妖一区二区| 91久久精品国产91性色tv| 中文字幕欧美日本乱码一线二线| 美女视频黄a大片欧美| 欧美三级资源在线| 蜜臀av亚洲一区中文字幕| 在线观看一区二区精品视频| 国产精品高清亚洲| 国产福利一区在线观看| 91精品婷婷国产综合久久性色| 一区二区三区四区不卡在线| 成人黄色小视频在线观看| 久久综合久久综合九色| 久久国产精品第一页| 91精品国产综合久久久久久久| 亚洲mv大片欧洲mv大片精品| 91黄视频在线| 夜夜精品视频一区二区| 99精品黄色片免费大全| 国产精品美女视频| 成人av在线一区二区三区| 国产精品色眯眯| 成人短视频下载| 国产精品久久久久一区二区三区 | 亚洲综合色区另类av| 一本大道久久精品懂色aⅴ| 亚洲欧美日韩中文播放| 91一区二区三区在线观看| 自拍偷拍国产亚洲|