mirror of https://github.com/lukechilds/node.git
Browse Source
All sources are just extracted from tarball into deps/openssl/openssl. change all openssl/include/openssl/*.h to include resolved symbolic links and openssl/crypto/opensslconf.h to refer config/opensslconf.h sha256-x86_64.pl does not exist in the origin openssl distribution. It was copied from sha512-x86_64.pl and both sha256/sha512 scripts were modified so as to generates only one asm file specified as its key hash length. `x86masm.pl` was mistakenly using .486 instruction set, why `cpuid` (and perhaps others) are requiring .686. removed vpaesni-x86_64.asm in x64-win32-masm - it is no longer used. Fixes: https://github.com/iojs/io.js/issues/1186 PR-URL: https://github.com/iojs/io.js/pull/1206 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>v1.8.0-commit
Shigeki Ohtsu
10 years ago
committed by
Chris Dickinson
1143 changed files with 285018 additions and 295831 deletions
@ -1,235 +0,0 @@ |
|||
OPTION DOTNAME |
|||
EXTERN OPENSSL_cpuid_setup:NEAR |
|||
<<<<<<< HEAD |
|||
======= |
|||
|
|||
>>>>>>> openssl: regenerate asm files for openssl 1.0.1 |
|||
.CRT$XCU SEGMENT READONLY ALIGN(8) |
|||
DQ OPENSSL_cpuid_setup |
|||
|
|||
|
|||
.CRT$XCU ENDS |
|||
_DATA SEGMENT |
|||
COMM OPENSSL_ia32cap_P:DWORD:2 |
|||
|
|||
_DATA ENDS |
|||
.text$ SEGMENT ALIGN(64) 'CODE' |
|||
|
|||
PUBLIC OPENSSL_atomic_add |
|||
|
|||
ALIGN 16 |
|||
OPENSSL_atomic_add PROC PUBLIC |
|||
mov eax,DWORD PTR[rcx] |
|||
$L$spin:: lea r8,QWORD PTR[rax*1+rdx] |
|||
DB 0f0h |
|||
|
|||
cmpxchg DWORD PTR[rcx],r8d |
|||
jne $L$spin |
|||
mov eax,r8d |
|||
DB 048h,098h |
|||
|
|||
DB 0F3h,0C3h ;repret |
|||
OPENSSL_atomic_add ENDP |
|||
|
|||
PUBLIC OPENSSL_rdtsc |
|||
|
|||
ALIGN 16 |
|||
OPENSSL_rdtsc PROC PUBLIC |
|||
rdtsc |
|||
shl rdx,32 |
|||
or rax,rdx |
|||
DB 0F3h,0C3h ;repret |
|||
OPENSSL_rdtsc ENDP |
|||
|
|||
PUBLIC OPENSSL_ia32_cpuid |
|||
|
|||
ALIGN 16 |
|||
OPENSSL_ia32_cpuid PROC PUBLIC |
|||
mov r8,rbx |
|||
|
|||
xor eax,eax |
|||
cpuid |
|||
mov r11d,eax |
|||
|
|||
xor eax,eax |
|||
cmp ebx,0756e6547h |
|||
setne al |
|||
mov r9d,eax |
|||
cmp edx,049656e69h |
|||
setne al |
|||
or r9d,eax |
|||
cmp ecx,06c65746eh |
|||
setne al |
|||
or r9d,eax |
|||
jz $L$intel |
|||
|
|||
cmp ebx,068747541h |
|||
setne al |
|||
mov r10d,eax |
|||
cmp edx,069746E65h |
|||
setne al |
|||
or r10d,eax |
|||
cmp ecx,0444D4163h |
|||
setne al |
|||
or r10d,eax |
|||
jnz $L$intel |
|||
|
|||
|
|||
mov eax,080000000h |
|||
cpuid |
|||
cmp eax,080000001h |
|||
jb $L$intel |
|||
mov r10d,eax |
|||
mov eax,080000001h |
|||
cpuid |
|||
or r9d,ecx |
|||
and r9d,000000801h |
|||
|
|||
cmp r10d,080000008h |
|||
jb $L$intel |
|||
|
|||
mov eax,080000008h |
|||
cpuid |
|||
movzx r10,cl |
|||
inc r10 |
|||
|
|||
mov eax,1 |
|||
cpuid |
|||
bt edx,28 |
|||
jnc $L$generic |
|||
shr ebx,16 |
|||
cmp bl,r10b |
|||
ja $L$generic |
|||
and edx,0efffffffh |
|||
jmp $L$generic |
|||
|
|||
$L$intel:: |
|||
cmp r11d,4 |
|||
mov r10d,-1 |
|||
jb $L$nocacheinfo |
|||
|
|||
mov eax,4 |
|||
mov ecx,0 |
|||
cpuid |
|||
mov r10d,eax |
|||
shr r10d,14 |
|||
and r10d,0fffh |
|||
|
|||
$L$nocacheinfo:: |
|||
mov eax,1 |
|||
cpuid |
|||
and edx,0bfefffffh |
|||
cmp r9d,0 |
|||
jne $L$notintel |
|||
or edx,040000000h |
|||
and ah,15 |
|||
cmp ah,15 |
|||
jne $L$notintel |
|||
or edx,000100000h |
|||
$L$notintel:: |
|||
bt edx,28 |
|||
jnc $L$generic |
|||
and edx,0efffffffh |
|||
cmp r10d,0 |
|||
je $L$generic |
|||
|
|||
or edx,010000000h |
|||
shr ebx,16 |
|||
cmp bl,1 |
|||
ja $L$generic |
|||
and edx,0efffffffh |
|||
$L$generic:: |
|||
and r9d,000000800h |
|||
and ecx,0fffff7ffh |
|||
or r9d,ecx |
|||
|
|||
mov r10d,edx |
|||
bt r9d,27 |
|||
jnc $L$clear_avx |
|||
xor ecx,ecx |
|||
DB 00fh,001h,0d0h |
|||
|
|||
and eax,6 |
|||
cmp eax,6 |
|||
je $L$done |
|||
$L$clear_avx:: |
|||
mov eax,0efffe7ffh |
|||
and r9d,eax |
|||
$L$done:: |
|||
shl r9,32 |
|||
mov eax,r10d |
|||
mov rbx,r8 |
|||
or rax,r9 |
|||
DB 0F3h,0C3h ;repret |
|||
OPENSSL_ia32_cpuid ENDP |
|||
|
|||
PUBLIC OPENSSL_cleanse |
|||
|
|||
ALIGN 16 |
|||
OPENSSL_cleanse PROC PUBLIC |
|||
xor rax,rax |
|||
cmp rdx,15 |
|||
jae $L$ot |
|||
cmp rdx,0 |
|||
je $L$ret |
|||
$L$ittle:: |
|||
mov BYTE PTR[rcx],al |
|||
sub rdx,1 |
|||
lea rcx,QWORD PTR[1+rcx] |
|||
jnz $L$ittle |
|||
$L$ret:: |
|||
DB 0F3h,0C3h ;repret |
|||
ALIGN 16 |
|||
$L$ot:: |
|||
test rcx,7 |
|||
jz $L$aligned |
|||
mov BYTE PTR[rcx],al |
|||
lea rdx,QWORD PTR[((-1))+rdx] |
|||
lea rcx,QWORD PTR[1+rcx] |
|||
jmp $L$ot |
|||
$L$aligned:: |
|||
mov QWORD PTR[rcx],rax |
|||
lea rdx,QWORD PTR[((-8))+rdx] |
|||
test rdx,-8 |
|||
lea rcx,QWORD PTR[8+rcx] |
|||
jnz $L$aligned |
|||
cmp rdx,0 |
|||
jne $L$ittle |
|||
DB 0F3h,0C3h ;repret |
|||
OPENSSL_cleanse ENDP |
|||
PUBLIC OPENSSL_wipe_cpu |
|||
|
|||
ALIGN 16 |
|||
OPENSSL_wipe_cpu PROC PUBLIC |
|||
pxor xmm0,xmm0 |
|||
pxor xmm1,xmm1 |
|||
pxor xmm2,xmm2 |
|||
pxor xmm3,xmm3 |
|||
pxor xmm4,xmm4 |
|||
pxor xmm5,xmm5 |
|||
xor rcx,rcx |
|||
xor rdx,rdx |
|||
xor r8,r8 |
|||
xor r9,r9 |
|||
xor r10,r10 |
|||
xor r11,r11 |
|||
lea rax,QWORD PTR[8+rsp] |
|||
DB 0F3h,0C3h ;repret |
|||
OPENSSL_wipe_cpu ENDP |
|||
PUBLIC OPENSSL_ia32_rdrand |
|||
|
|||
ALIGN 16 |
|||
OPENSSL_ia32_rdrand PROC PUBLIC |
|||
mov ecx,8 |
|||
$L$oop_rdrand:: |
|||
DB 72,15,199,240 |
|||
jc $L$break_rdrand |
|||
loop $L$oop_rdrand |
|||
$L$break_rdrand:: |
|||
cmp rax,0 |
|||
cmove rax,rcx |
|||
DB 0F3h,0C3h ;repret |
|||
OPENSSL_ia32_rdrand ENDP |
|||
|
|||
.text$ ENDS |
|||
END |
@ -1,43 +1,42 @@ |
|||
|
|||
// Gathers unpredictable system data to be used for generating
|
|||
// random bits
|
|||
// Gathers unpredictable system data to be used for generating
|
|||
// random bits
|
|||
|
|||
#include <MacTypes.h> |
|||
|
|||
class CRandomizer |
|||
{ |
|||
public: |
|||
CRandomizer (void); |
|||
void PeriodicAction (void); |
|||
|
|||
private: |
|||
|
|||
// Private calls
|
|||
|
|||
void AddTimeSinceMachineStartup (void); |
|||
void AddAbsoluteSystemStartupTime (void); |
|||
void AddAppRunningTime (void); |
|||
void AddStartupVolumeInfo (void); |
|||
void AddFiller (void); |
|||
|
|||
void AddCurrentMouse (void); |
|||
void AddNow (double millisecondUncertainty); |
|||
void AddBytes (void *data, long size, double entropy); |
|||
|
|||
void GetTimeBaseResolution (void); |
|||
unsigned long SysTimer (void); |
|||
|
|||
// System Info
|
|||
bool mSupportsLargeVolumes; |
|||
bool mIsPowerPC; |
|||
bool mIs601; |
|||
|
|||
// Time info
|
|||
double mTimebaseTicksPerMillisec; |
|||
unsigned long mLastPeriodicTicks; |
|||
|
|||
// Mouse info
|
|||
long mSamplePeriod; |
|||
Point mLastMouse; |
|||
long mMouseStill; |
|||
class CRandomizer { |
|||
public: |
|||
CRandomizer(void); |
|||
void PeriodicAction(void); |
|||
|
|||
private: |
|||
|
|||
// Private calls
|
|||
|
|||
void AddTimeSinceMachineStartup(void); |
|||
void AddAbsoluteSystemStartupTime(void); |
|||
void AddAppRunningTime(void); |
|||
void AddStartupVolumeInfo(void); |
|||
void AddFiller(void); |
|||
|
|||
void AddCurrentMouse(void); |
|||
void AddNow(double millisecondUncertainty); |
|||
void AddBytes(void *data, long size, double entropy); |
|||
|
|||
void GetTimeBaseResolution(void); |
|||
unsigned long SysTimer(void); |
|||
|
|||
// System Info
|
|||
bool mSupportsLargeVolumes; |
|||
bool mIsPowerPC; |
|||
bool mIs601; |
|||
|
|||
// Time info
|
|||
double mTimebaseTicksPerMillisec; |
|||
unsigned long mLastPeriodicTicks; |
|||
|
|||
// Mouse info
|
|||
long mSamplePeriod; |
|||
Point mLastMouse; |
|||
long mMouseStill; |
|||
}; |
|||
|
@ -1,9 +1,9 @@ |
|||
#include <MacHeaders.h> |
|||
#define B_ENDIAN |
|||
#ifdef __POWERPC__ |
|||
#pragma longlong on |
|||
# pragma longlong on |
|||
#endif |
|||
#if 1 |
|||
#define MAC_OS_GUSI_SOURCE |
|||
# define MAC_OS_GUSI_SOURCE |
|||
#endif |
|||
#define MONOLITH |
|||
|
@ -1,9 +1,9 @@ |
|||
#include <MacHeaders.h> |
|||
#define B_ENDIAN |
|||
#ifdef __POWERPC__ |
|||
#pragma longlong on |
|||
# pragma longlong on |
|||
#endif |
|||
#if 0 |
|||
#define MAC_OS_GUSI_SOURCE |
|||
# define MAC_OS_GUSI_SOURCE |
|||
#endif |
|||
#define MONOLITH |
|||
|
@ -1,5 +1,5 @@ |
|||
#ifndef MK1MF_BUILD |
|||
# define CFLAGS "-DB_ENDIAN" |
|||
# define PLATFORM "macos" |
|||
# define DATE "Sun Feb 27 19:44:16 MET 2000" |
|||
# define CFLAGS "-DB_ENDIAN" |
|||
# define PLATFORM "macos" |
|||
# define DATE "Sun Feb 27 19:44:16 MET 2000" |
|||
#endif |
|||
|
@ -1,116 +1,126 @@ |
|||
/* MacOS/opensslconf.h */ |
|||
|
|||
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ |
|||
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) |
|||
#define OPENSSLDIR "/usr/local/ssl" |
|||
#endif |
|||
# if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) |
|||
# define OPENSSLDIR "/usr/local/ssl" |
|||
# endif |
|||
#endif |
|||
|
|||
#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) |
|||
#define IDEA_INT unsigned int |
|||
# define IDEA_INT unsigned int |
|||
#endif |
|||
|
|||
#if defined(HEADER_MD2_H) && !defined(MD2_INT) |
|||
#define MD2_INT unsigned int |
|||
# define MD2_INT unsigned int |
|||
#endif |
|||
|
|||
#if defined(HEADER_RC2_H) && !defined(RC2_INT) |
|||
/* I need to put in a mod for the alpha - eay */ |
|||
#define RC2_INT unsigned int |
|||
# define RC2_INT unsigned int |
|||
#endif |
|||
|
|||
#if defined(HEADER_RC4_H) |
|||
#if !defined(RC4_INT) |
|||
/* using int types make the structure larger but make the code faster
|
|||
* on most boxes I have tested - up to %20 faster. */ |
|||
# if !defined(RC4_INT) |
|||
/*
|
|||
* using int types make the structure larger but make the code faster on most |
|||
* boxes I have tested - up to %20 faster. |
|||
*/ |
|||
/*-
|
|||
* I don't know what does "most" mean, but declaring "int" is a must on: |
|||
* - Intel P6 because partial register stalls are very expensive; |
|||
* - elder Alpha because it lacks byte load/store instructions; |
|||
*/ |
|||
#define RC4_INT unsigned char |
|||
#endif |
|||
#if !defined(RC4_CHUNK) |
|||
# define RC4_INT unsigned char |
|||
# endif |
|||
# if !defined(RC4_CHUNK) |
|||
/*
|
|||
* This enables code handling data aligned at natural CPU word |
|||
* boundary. See crypto/rc4/rc4_enc.c for further details. |
|||
*/ |
|||
#define RC4_CHUNK unsigned long |
|||
#endif |
|||
# define RC4_CHUNK unsigned long |
|||
# endif |
|||
#endif |
|||
|
|||
#if defined(HEADER_DES_H) && !defined(DES_LONG) |
|||
/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
|
|||
* %20 speed up (longs are 8 bytes, int's are 4). */ |
|||
#ifndef DES_LONG |
|||
#define DES_LONG unsigned long |
|||
#endif |
|||
/*
|
|||
* If this is set to 'unsigned int' on a DEC Alpha, this gives about a %20 |
|||
* speed up (longs are 8 bytes, int's are 4). |
|||
*/ |
|||
# ifndef DES_LONG |
|||
# define DES_LONG unsigned long |
|||
# endif |
|||
#endif |
|||
|
|||
#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) |
|||
#define CONFIG_HEADER_BN_H |
|||
#if __option(longlong) |
|||
# define CONFIG_HEADER_BN_H |
|||
# if __option(longlong) |
|||
# define BN_LLONG |
|||
#else |
|||
# else |
|||
# undef BN_LLONG |
|||
#endif |
|||
# endif |
|||
|
|||
/* Should we define BN_DIV2W here? */ |
|||
|
|||
/* Only one for the following should be defined */ |
|||
/* The prime number generation stuff may not work when
|
|||
* EIGHT_BIT but I don't care since I've only used this mode |
|||
* for debuging the bignum libraries */ |
|||
#undef SIXTY_FOUR_BIT_LONG |
|||
#undef SIXTY_FOUR_BIT |
|||
#define THIRTY_TWO_BIT |
|||
#undef SIXTEEN_BIT |
|||
#undef EIGHT_BIT |
|||
/*
|
|||
* The prime number generation stuff may not work when EIGHT_BIT but I don't |
|||
* care since I've only used this mode for debuging the bignum libraries |
|||
*/ |
|||
# undef SIXTY_FOUR_BIT_LONG |
|||
# undef SIXTY_FOUR_BIT |
|||
# define THIRTY_TWO_BIT |
|||
# undef SIXTEEN_BIT |
|||
# undef EIGHT_BIT |
|||
#endif |
|||
|
|||
#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) |
|||
#define CONFIG_HEADER_RC4_LOCL_H |
|||
/* if this is defined data[i] is used instead of *data, this is a %20
|
|||
* speedup on x86 */ |
|||
#undef RC4_INDEX |
|||
# define CONFIG_HEADER_RC4_LOCL_H |
|||
/*
|
|||
* if this is defined data[i] is used instead of *data, this is a %20 speedup |
|||
* on x86 |
|||
*/ |
|||
# undef RC4_INDEX |
|||
#endif |
|||
|
|||
#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) |
|||
#define CONFIG_HEADER_BF_LOCL_H |
|||
#define BF_PTR |
|||
#endif /* HEADER_BF_LOCL_H */ |
|||
# define CONFIG_HEADER_BF_LOCL_H |
|||
# define BF_PTR |
|||
#endif /* HEADER_BF_LOCL_H */ |
|||
|
|||
#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) |
|||
#define CONFIG_HEADER_DES_LOCL_H |
|||
/* the following is tweaked from a config script, that is why it is a
|
|||
* protected undef/define */ |
|||
#ifndef DES_PTR |
|||
#define DES_PTR |
|||
#endif |
|||
# define CONFIG_HEADER_DES_LOCL_H |
|||
/*
|
|||
* the following is tweaked from a config script, that is why it is a |
|||
* protected undef/define |
|||
*/ |
|||
# ifndef DES_PTR |
|||
# define DES_PTR |
|||
# endif |
|||
|
|||
/* This helps C compiler generate the correct code for multiple functional
|
|||
/*
|
|||
* This helps C compiler generate the correct code for multiple functional |
|||
* units. It reduces register dependancies at the expense of 2 more |
|||
* registers */ |
|||
#ifndef DES_RISC1 |
|||
#define DES_RISC1 |
|||
#endif |
|||
|
|||
#ifndef DES_RISC2 |
|||
#undef DES_RISC2 |
|||
#endif |
|||
|
|||
#if defined(DES_RISC1) && defined(DES_RISC2) |
|||
YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! |
|||
#endif |
|||
|
|||
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
|
|||
* Very mucy CPU dependant */ |
|||
#ifndef DES_UNROLL |
|||
#define DES_UNROLL |
|||
#endif |
|||
* registers |
|||
*/ |
|||
# ifndef DES_RISC1 |
|||
# define DES_RISC1 |
|||
# endif |
|||
|
|||
#endif /* HEADER_DES_LOCL_H */ |
|||
# ifndef DES_RISC2 |
|||
# undef DES_RISC2 |
|||
# endif |
|||
|
|||
# if defined(DES_RISC1) && defined(DES_RISC2) |
|||
YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED ! !!!! |
|||
# endif |
|||
/*
|
|||
* Unroll the inner loop, this sometimes helps, sometimes hinders. Very mucy |
|||
* CPU dependant |
|||
*/ |
|||
# ifndef DES_UNROLL |
|||
# define DES_UNROLL |
|||
# endif |
|||
#endif /* HEADER_DES_LOCL_H */ |
|||
#ifndef __POWERPC__ |
|||
#define MD32_XARRAY |
|||
# define MD32_XARRAY |
|||
#endif |
|||
|
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,127 +0,0 @@ |
|||
/* crypto/md4/md4.c */ |
|||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
|||
* All rights reserved. |
|||
* |
|||
* This package is an SSL implementation written |
|||
* by Eric Young (eay@cryptsoft.com). |
|||
* The implementation was written so as to conform with Netscapes SSL. |
|||
* |
|||
* This library is free for commercial and non-commercial use as long as |
|||
* the following conditions are aheared to. The following conditions |
|||
* apply to all code found in this distribution, be it the RC4, RSA, |
|||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation |
|||
* included with this distribution is covered by the same copyright terms |
|||
* except that the holder is Tim Hudson (tjh@cryptsoft.com). |
|||
* |
|||
* Copyright remains Eric Young's, and as such any Copyright notices in |
|||
* the code are not to be removed. |
|||
* If this package is used in a product, Eric Young should be given attribution |
|||
* as the author of the parts of the library used. |
|||
* This can be in the form of a textual message at program startup or |
|||
* in documentation (online or textual) provided with the package. |
|||
* |
|||
* 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 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 acknowledgement: |
|||
* "This product includes cryptographic software written by |
|||
* Eric Young (eay@cryptsoft.com)" |
|||
* The word 'cryptographic' can be left out if the rouines from the library |
|||
* being used are not cryptographic related :-). |
|||
* 4. If you include any Windows specific code (or a derivative thereof) from |
|||
* the apps directory (application code) you must include an acknowledgement: |
|||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
|||
* |
|||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
|||
* ANY EXPRESS 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 AUTHOR OR 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. |
|||
* |
|||
* The licence and distribution terms for any publically available version or |
|||
* derivative of this code cannot be changed. i.e. this code cannot simply be |
|||
* copied and put under another distribution licence |
|||
* [including the GNU Public Licence.] |
|||
*/ |
|||
|
|||
#include <stdio.h> |
|||
#include <stdlib.h> |
|||
#include <openssl/md4.h> |
|||
|
|||
#define BUFSIZE 1024*16 |
|||
|
|||
void do_fp(FILE *f); |
|||
void pt(unsigned char *md); |
|||
#if !defined(_OSD_POSIX) && !defined(__DJGPP__) |
|||
int read(int, void *, unsigned int); |
|||
#endif |
|||
|
|||
int main(int argc, char **argv) |
|||
{ |
|||
int i,err=0; |
|||
FILE *IN; |
|||
|
|||
if (argc == 1) |
|||
{ |
|||
do_fp(stdin); |
|||
} |
|||
else |
|||
{ |
|||
for (i=1; i<argc; i++) |
|||
{ |
|||
IN=fopen(argv[i],"r"); |
|||
if (IN == NULL) |
|||
{ |
|||
perror(argv[i]); |
|||
err++; |
|||
continue; |
|||
} |
|||
printf("MD4(%s)= ",argv[i]); |
|||
do_fp(IN); |
|||
fclose(IN); |
|||
} |
|||
} |
|||
exit(err); |
|||
} |
|||
|
|||
void do_fp(FILE *f) |
|||
{ |
|||
MD4_CTX c; |
|||
unsigned char md[MD4_DIGEST_LENGTH]; |
|||
int fd; |
|||
int i; |
|||
static unsigned char buf[BUFSIZE]; |
|||
|
|||
fd=fileno(f); |
|||
MD4_Init(&c); |
|||
for (;;) |
|||
{ |
|||
i=read(fd,buf,sizeof buf); |
|||
if (i <= 0) break; |
|||
MD4_Update(&c,buf,(unsigned long)i); |
|||
} |
|||
MD4_Final(&(md[0]),&c); |
|||
pt(md); |
|||
} |
|||
|
|||
void pt(unsigned char *md) |
|||
{ |
|||
int i; |
|||
|
|||
for (i=0; i<MD4_DIGEST_LENGTH; i++) |
|||
printf("%02x",md[i]); |
|||
printf("\n"); |
|||
} |
|||
|
@ -0,0 +1 @@ |
|||
../crypto/md4/md4.c |
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,366 +1,366 @@ |
|||
/* apps/progs.h */ |
|||
/* automatically generated by progs.pl for openssl.c */ |
|||
|
|||
extern int verify_main(int argc,char *argv[]); |
|||
extern int asn1parse_main(int argc,char *argv[]); |
|||
extern int req_main(int argc,char *argv[]); |
|||
extern int dgst_main(int argc,char *argv[]); |
|||
extern int dh_main(int argc,char *argv[]); |
|||
extern int dhparam_main(int argc,char *argv[]); |
|||
extern int enc_main(int argc,char *argv[]); |
|||
extern int passwd_main(int argc,char *argv[]); |
|||
extern int gendh_main(int argc,char *argv[]); |
|||
extern int errstr_main(int argc,char *argv[]); |
|||
extern int ca_main(int argc,char *argv[]); |
|||
extern int crl_main(int argc,char *argv[]); |
|||
extern int rsa_main(int argc,char *argv[]); |
|||
extern int rsautl_main(int argc,char *argv[]); |
|||
extern int dsa_main(int argc,char *argv[]); |
|||
extern int dsaparam_main(int argc,char *argv[]); |
|||
extern int ec_main(int argc,char *argv[]); |
|||
extern int ecparam_main(int argc,char *argv[]); |
|||
extern int x509_main(int argc,char *argv[]); |
|||
extern int genrsa_main(int argc,char *argv[]); |
|||
extern int gendsa_main(int argc,char *argv[]); |
|||
extern int genpkey_main(int argc,char *argv[]); |
|||
extern int s_server_main(int argc,char *argv[]); |
|||
extern int s_client_main(int argc,char *argv[]); |
|||
extern int speed_main(int argc,char *argv[]); |
|||
extern int s_time_main(int argc,char *argv[]); |
|||
extern int version_main(int argc,char *argv[]); |
|||
extern int pkcs7_main(int argc,char *argv[]); |
|||
extern int cms_main(int argc,char *argv[]); |
|||
extern int crl2pkcs7_main(int argc,char *argv[]); |
|||
extern int sess_id_main(int argc,char *argv[]); |
|||
extern int ciphers_main(int argc,char *argv[]); |
|||
extern int nseq_main(int argc,char *argv[]); |
|||
extern int pkcs12_main(int argc,char *argv[]); |
|||
extern int pkcs8_main(int argc,char *argv[]); |
|||
extern int pkey_main(int argc,char *argv[]); |
|||
extern int pkeyparam_main(int argc,char *argv[]); |
|||
extern int pkeyutl_main(int argc,char *argv[]); |
|||
extern int spkac_main(int argc,char *argv[]); |
|||
extern int smime_main(int argc,char *argv[]); |
|||
extern int rand_main(int argc,char *argv[]); |
|||
extern int engine_main(int argc,char *argv[]); |
|||
extern int ocsp_main(int argc,char *argv[]); |
|||
extern int prime_main(int argc,char *argv[]); |
|||
extern int ts_main(int argc,char *argv[]); |
|||
extern int srp_main(int argc,char *argv[]); |
|||
extern int verify_main(int argc, char *argv[]); |
|||
extern int asn1parse_main(int argc, char *argv[]); |
|||
extern int req_main(int argc, char *argv[]); |
|||
extern int dgst_main(int argc, char *argv[]); |
|||
extern int dh_main(int argc, char *argv[]); |
|||
extern int dhparam_main(int argc, char *argv[]); |
|||
extern int enc_main(int argc, char *argv[]); |
|||
extern int passwd_main(int argc, char *argv[]); |
|||
extern int gendh_main(int argc, char *argv[]); |
|||
extern int errstr_main(int argc, char *argv[]); |
|||
extern int ca_main(int argc, char *argv[]); |
|||
extern int crl_main(int argc, char *argv[]); |
|||
extern int rsa_main(int argc, char *argv[]); |
|||
extern int rsautl_main(int argc, char *argv[]); |
|||
extern int dsa_main(int argc, char *argv[]); |
|||
extern int dsaparam_main(int argc, char *argv[]); |
|||
extern int ec_main(int argc, char *argv[]); |
|||
extern int ecparam_main(int argc, char *argv[]); |
|||
extern int x509_main(int argc, char *argv[]); |
|||
extern int genrsa_main(int argc, char *argv[]); |
|||
extern int gendsa_main(int argc, char *argv[]); |
|||
extern int genpkey_main(int argc, char *argv[]); |
|||
extern int s_server_main(int argc, char *argv[]); |
|||
extern int s_client_main(int argc, char *argv[]); |
|||
extern int speed_main(int argc, char *argv[]); |
|||
extern int s_time_main(int argc, char *argv[]); |
|||
extern int version_main(int argc, char *argv[]); |
|||
extern int pkcs7_main(int argc, char *argv[]); |
|||
extern int cms_main(int argc, char *argv[]); |
|||
extern int crl2pkcs7_main(int argc, char *argv[]); |
|||
extern int sess_id_main(int argc, char *argv[]); |
|||
extern int ciphers_main(int argc, char *argv[]); |
|||
extern int nseq_main(int argc, char *argv[]); |
|||
extern int pkcs12_main(int argc, char *argv[]); |
|||
extern int pkcs8_main(int argc, char *argv[]); |
|||
extern int pkey_main(int argc, char *argv[]); |
|||
extern int pkeyparam_main(int argc, char *argv[]); |
|||
extern int pkeyutl_main(int argc, char *argv[]); |
|||
extern int spkac_main(int argc, char *argv[]); |
|||
extern int smime_main(int argc, char *argv[]); |
|||
extern int rand_main(int argc, char *argv[]); |
|||
extern int engine_main(int argc, char *argv[]); |
|||
extern int ocsp_main(int argc, char *argv[]); |
|||
extern int prime_main(int argc, char *argv[]); |
|||
extern int ts_main(int argc, char *argv[]); |
|||
extern int srp_main(int argc, char *argv[]); |
|||
|
|||
#define FUNC_TYPE_GENERAL 1 |
|||
#define FUNC_TYPE_MD 2 |
|||
#define FUNC_TYPE_CIPHER 3 |
|||
#define FUNC_TYPE_PKEY 4 |
|||
#define FUNC_TYPE_MD_ALG 5 |
|||
#define FUNC_TYPE_CIPHER_ALG 6 |
|||
#define FUNC_TYPE_GENERAL 1 |
|||
#define FUNC_TYPE_MD 2 |
|||
#define FUNC_TYPE_CIPHER 3 |
|||
#define FUNC_TYPE_PKEY 4 |
|||
#define FUNC_TYPE_MD_ALG 5 |
|||
#define FUNC_TYPE_CIPHER_ALG 6 |
|||
|
|||
typedef struct { |
|||
int type; |
|||
const char *name; |
|||
int (*func)(int argc,char *argv[]); |
|||
} FUNCTION; |
|||
int type; |
|||
const char *name; |
|||
int (*func) (int argc, char *argv[]); |
|||
} FUNCTION; |
|||
DECLARE_LHASH_OF(FUNCTION); |
|||
|
|||
FUNCTION functions[] = { |
|||
{FUNC_TYPE_GENERAL,"verify",verify_main}, |
|||
{FUNC_TYPE_GENERAL,"asn1parse",asn1parse_main}, |
|||
{FUNC_TYPE_GENERAL,"req",req_main}, |
|||
{FUNC_TYPE_GENERAL,"dgst",dgst_main}, |
|||
{FUNC_TYPE_GENERAL, "verify", verify_main}, |
|||
{FUNC_TYPE_GENERAL, "asn1parse", asn1parse_main}, |
|||
{FUNC_TYPE_GENERAL, "req", req_main}, |
|||
{FUNC_TYPE_GENERAL, "dgst", dgst_main}, |
|||
#ifndef OPENSSL_NO_DH |
|||
{FUNC_TYPE_GENERAL,"dh",dh_main}, |
|||
{FUNC_TYPE_GENERAL, "dh", dh_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DH |
|||
{FUNC_TYPE_GENERAL,"dhparam",dhparam_main}, |
|||
{FUNC_TYPE_GENERAL, "dhparam", dhparam_main}, |
|||
#endif |
|||
{FUNC_TYPE_GENERAL,"enc",enc_main}, |
|||
{FUNC_TYPE_GENERAL,"passwd",passwd_main}, |
|||
{FUNC_TYPE_GENERAL, "enc", enc_main}, |
|||
{FUNC_TYPE_GENERAL, "passwd", passwd_main}, |
|||
#ifndef OPENSSL_NO_DH |
|||
{FUNC_TYPE_GENERAL,"gendh",gendh_main}, |
|||
{FUNC_TYPE_GENERAL, "gendh", gendh_main}, |
|||
#endif |
|||
{FUNC_TYPE_GENERAL,"errstr",errstr_main}, |
|||
{FUNC_TYPE_GENERAL,"ca",ca_main}, |
|||
{FUNC_TYPE_GENERAL,"crl",crl_main}, |
|||
{FUNC_TYPE_GENERAL, "errstr", errstr_main}, |
|||
{FUNC_TYPE_GENERAL, "ca", ca_main}, |
|||
{FUNC_TYPE_GENERAL, "crl", crl_main}, |
|||
#ifndef OPENSSL_NO_RSA |
|||
{FUNC_TYPE_GENERAL,"rsa",rsa_main}, |
|||
{FUNC_TYPE_GENERAL, "rsa", rsa_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RSA |
|||
{FUNC_TYPE_GENERAL,"rsautl",rsautl_main}, |
|||
{FUNC_TYPE_GENERAL, "rsautl", rsautl_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DSA |
|||
{FUNC_TYPE_GENERAL,"dsa",dsa_main}, |
|||
{FUNC_TYPE_GENERAL, "dsa", dsa_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DSA |
|||
{FUNC_TYPE_GENERAL,"dsaparam",dsaparam_main}, |
|||
{FUNC_TYPE_GENERAL, "dsaparam", dsaparam_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_EC |
|||
{FUNC_TYPE_GENERAL,"ec",ec_main}, |
|||
{FUNC_TYPE_GENERAL, "ec", ec_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_EC |
|||
{FUNC_TYPE_GENERAL,"ecparam",ecparam_main}, |
|||
{FUNC_TYPE_GENERAL, "ecparam", ecparam_main}, |
|||
#endif |
|||
{FUNC_TYPE_GENERAL,"x509",x509_main}, |
|||
{FUNC_TYPE_GENERAL, "x509", x509_main}, |
|||
#ifndef OPENSSL_NO_RSA |
|||
{FUNC_TYPE_GENERAL,"genrsa",genrsa_main}, |
|||
{FUNC_TYPE_GENERAL, "genrsa", genrsa_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DSA |
|||
{FUNC_TYPE_GENERAL,"gendsa",gendsa_main}, |
|||
{FUNC_TYPE_GENERAL, "gendsa", gendsa_main}, |
|||
#endif |
|||
{FUNC_TYPE_GENERAL,"genpkey",genpkey_main}, |
|||
{FUNC_TYPE_GENERAL, "genpkey", genpkey_main}, |
|||
#if !defined(OPENSSL_NO_SOCK) |
|||
{FUNC_TYPE_GENERAL,"s_server",s_server_main}, |
|||
{FUNC_TYPE_GENERAL, "s_server", s_server_main}, |
|||
#endif |
|||
#if !defined(OPENSSL_NO_SOCK) |
|||
{FUNC_TYPE_GENERAL,"s_client",s_client_main}, |
|||
{FUNC_TYPE_GENERAL, "s_client", s_client_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_SPEED |
|||
{FUNC_TYPE_GENERAL,"speed",speed_main}, |
|||
{FUNC_TYPE_GENERAL, "speed", speed_main}, |
|||
#endif |
|||
#if !defined(OPENSSL_NO_SOCK) |
|||
{FUNC_TYPE_GENERAL,"s_time",s_time_main}, |
|||
{FUNC_TYPE_GENERAL, "s_time", s_time_main}, |
|||
#endif |
|||
{FUNC_TYPE_GENERAL,"version",version_main}, |
|||
{FUNC_TYPE_GENERAL,"pkcs7",pkcs7_main}, |
|||
{FUNC_TYPE_GENERAL, "version", version_main}, |
|||
{FUNC_TYPE_GENERAL, "pkcs7", pkcs7_main}, |
|||
#ifndef OPENSSL_NO_CMS |
|||
{FUNC_TYPE_GENERAL,"cms",cms_main}, |
|||
{FUNC_TYPE_GENERAL, "cms", cms_main}, |
|||
#endif |
|||
{FUNC_TYPE_GENERAL,"crl2pkcs7",crl2pkcs7_main}, |
|||
{FUNC_TYPE_GENERAL,"sess_id",sess_id_main}, |
|||
{FUNC_TYPE_GENERAL, "crl2pkcs7", crl2pkcs7_main}, |
|||
{FUNC_TYPE_GENERAL, "sess_id", sess_id_main}, |
|||
#if !defined(OPENSSL_NO_SOCK) |
|||
{FUNC_TYPE_GENERAL,"ciphers",ciphers_main}, |
|||
{FUNC_TYPE_GENERAL, "ciphers", ciphers_main}, |
|||
#endif |
|||
{FUNC_TYPE_GENERAL,"nseq",nseq_main}, |
|||
{FUNC_TYPE_GENERAL, "nseq", nseq_main}, |
|||
#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1) |
|||
{FUNC_TYPE_GENERAL,"pkcs12",pkcs12_main}, |
|||
#endif |
|||
{FUNC_TYPE_GENERAL,"pkcs8",pkcs8_main}, |
|||
{FUNC_TYPE_GENERAL,"pkey",pkey_main}, |
|||
{FUNC_TYPE_GENERAL,"pkeyparam",pkeyparam_main}, |
|||
{FUNC_TYPE_GENERAL,"pkeyutl",pkeyutl_main}, |
|||
{FUNC_TYPE_GENERAL,"spkac",spkac_main}, |
|||
{FUNC_TYPE_GENERAL,"smime",smime_main}, |
|||
{FUNC_TYPE_GENERAL,"rand",rand_main}, |
|||
{FUNC_TYPE_GENERAL, "pkcs12", pkcs12_main}, |
|||
#endif |
|||
{FUNC_TYPE_GENERAL, "pkcs8", pkcs8_main}, |
|||
{FUNC_TYPE_GENERAL, "pkey", pkey_main}, |
|||
{FUNC_TYPE_GENERAL, "pkeyparam", pkeyparam_main}, |
|||
{FUNC_TYPE_GENERAL, "pkeyutl", pkeyutl_main}, |
|||
{FUNC_TYPE_GENERAL, "spkac", spkac_main}, |
|||
{FUNC_TYPE_GENERAL, "smime", smime_main}, |
|||
{FUNC_TYPE_GENERAL, "rand", rand_main}, |
|||
#ifndef OPENSSL_NO_ENGINE |
|||
{FUNC_TYPE_GENERAL,"engine",engine_main}, |
|||
{FUNC_TYPE_GENERAL, "engine", engine_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_OCSP |
|||
{FUNC_TYPE_GENERAL,"ocsp",ocsp_main}, |
|||
{FUNC_TYPE_GENERAL, "ocsp", ocsp_main}, |
|||
#endif |
|||
{FUNC_TYPE_GENERAL,"prime",prime_main}, |
|||
{FUNC_TYPE_GENERAL,"ts",ts_main}, |
|||
{FUNC_TYPE_GENERAL, "prime", prime_main}, |
|||
{FUNC_TYPE_GENERAL, "ts", ts_main}, |
|||
#ifndef OPENSSL_NO_SRP |
|||
{FUNC_TYPE_GENERAL,"srp",srp_main}, |
|||
{FUNC_TYPE_GENERAL, "srp", srp_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_MD2 |
|||
{FUNC_TYPE_MD,"md2",dgst_main}, |
|||
{FUNC_TYPE_MD, "md2", dgst_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_MD4 |
|||
{FUNC_TYPE_MD,"md4",dgst_main}, |
|||
{FUNC_TYPE_MD, "md4", dgst_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_MD5 |
|||
{FUNC_TYPE_MD,"md5",dgst_main}, |
|||
{FUNC_TYPE_MD, "md5", dgst_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_SHA |
|||
{FUNC_TYPE_MD,"sha",dgst_main}, |
|||
{FUNC_TYPE_MD, "sha", dgst_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_SHA1 |
|||
{FUNC_TYPE_MD,"sha1",dgst_main}, |
|||
{FUNC_TYPE_MD, "sha1", dgst_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_MDC2 |
|||
{FUNC_TYPE_MD,"mdc2",dgst_main}, |
|||
{FUNC_TYPE_MD, "mdc2", dgst_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RMD160 |
|||
{FUNC_TYPE_MD,"rmd160",dgst_main}, |
|||
{FUNC_TYPE_MD, "rmd160", dgst_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_AES |
|||
{FUNC_TYPE_CIPHER,"aes-128-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "aes-128-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_AES |
|||
{FUNC_TYPE_CIPHER,"aes-128-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "aes-128-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_AES |
|||
{FUNC_TYPE_CIPHER,"aes-192-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "aes-192-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_AES |
|||
{FUNC_TYPE_CIPHER,"aes-192-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "aes-192-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_AES |
|||
{FUNC_TYPE_CIPHER,"aes-256-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "aes-256-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_AES |
|||
{FUNC_TYPE_CIPHER,"aes-256-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "aes-256-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAMELLIA |
|||
{FUNC_TYPE_CIPHER,"camellia-128-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "camellia-128-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAMELLIA |
|||
{FUNC_TYPE_CIPHER,"camellia-128-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "camellia-128-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAMELLIA |
|||
{FUNC_TYPE_CIPHER,"camellia-192-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "camellia-192-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAMELLIA |
|||
{FUNC_TYPE_CIPHER,"camellia-192-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "camellia-192-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAMELLIA |
|||
{FUNC_TYPE_CIPHER,"camellia-256-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "camellia-256-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAMELLIA |
|||
{FUNC_TYPE_CIPHER,"camellia-256-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "camellia-256-ecb", enc_main}, |
|||
#endif |
|||
{FUNC_TYPE_CIPHER,"base64",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "base64", enc_main}, |
|||
#ifdef ZLIB |
|||
{FUNC_TYPE_CIPHER,"zlib",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "zlib", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des3",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des3", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"desx",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "desx", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_IDEA |
|||
{FUNC_TYPE_CIPHER,"idea",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "idea", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_SEED |
|||
{FUNC_TYPE_CIPHER,"seed",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "seed", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC4 |
|||
{FUNC_TYPE_CIPHER,"rc4",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc4", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC4 |
|||
{FUNC_TYPE_CIPHER,"rc4-40",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc4-40", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC2 |
|||
{FUNC_TYPE_CIPHER,"rc2",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc2", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_BF |
|||
{FUNC_TYPE_CIPHER,"bf",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "bf", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAST |
|||
{FUNC_TYPE_CIPHER,"cast",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "cast", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC5 |
|||
{FUNC_TYPE_CIPHER,"rc5",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc5", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-ede",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-ede", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-ede3",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-ede3", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-ede-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-ede-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-ede3-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-ede3-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-cfb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-cfb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-ede-cfb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-ede-cfb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-ede3-cfb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-ede3-cfb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-ofb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-ofb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-ede-ofb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-ede-ofb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_DES |
|||
{FUNC_TYPE_CIPHER,"des-ede3-ofb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "des-ede3-ofb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_IDEA |
|||
{FUNC_TYPE_CIPHER,"idea-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "idea-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_IDEA |
|||
{FUNC_TYPE_CIPHER,"idea-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "idea-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_IDEA |
|||
{FUNC_TYPE_CIPHER,"idea-cfb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "idea-cfb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_IDEA |
|||
{FUNC_TYPE_CIPHER,"idea-ofb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "idea-ofb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_SEED |
|||
{FUNC_TYPE_CIPHER,"seed-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "seed-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_SEED |
|||
{FUNC_TYPE_CIPHER,"seed-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "seed-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_SEED |
|||
{FUNC_TYPE_CIPHER,"seed-cfb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "seed-cfb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_SEED |
|||
{FUNC_TYPE_CIPHER,"seed-ofb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "seed-ofb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC2 |
|||
{FUNC_TYPE_CIPHER,"rc2-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc2-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC2 |
|||
{FUNC_TYPE_CIPHER,"rc2-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc2-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC2 |
|||
{FUNC_TYPE_CIPHER,"rc2-cfb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc2-cfb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC2 |
|||
{FUNC_TYPE_CIPHER,"rc2-ofb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc2-ofb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC2 |
|||
{FUNC_TYPE_CIPHER,"rc2-64-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc2-64-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC2 |
|||
{FUNC_TYPE_CIPHER,"rc2-40-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc2-40-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_BF |
|||
{FUNC_TYPE_CIPHER,"bf-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "bf-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_BF |
|||
{FUNC_TYPE_CIPHER,"bf-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "bf-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_BF |
|||
{FUNC_TYPE_CIPHER,"bf-cfb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "bf-cfb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_BF |
|||
{FUNC_TYPE_CIPHER,"bf-ofb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "bf-ofb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAST |
|||
{FUNC_TYPE_CIPHER,"cast5-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "cast5-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAST |
|||
{FUNC_TYPE_CIPHER,"cast5-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "cast5-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAST |
|||
{FUNC_TYPE_CIPHER,"cast5-cfb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "cast5-cfb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAST |
|||
{FUNC_TYPE_CIPHER,"cast5-ofb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "cast5-ofb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_CAST |
|||
{FUNC_TYPE_CIPHER,"cast-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "cast-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC5 |
|||
{FUNC_TYPE_CIPHER,"rc5-cbc",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc5-cbc", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC5 |
|||
{FUNC_TYPE_CIPHER,"rc5-ecb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc5-ecb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC5 |
|||
{FUNC_TYPE_CIPHER,"rc5-cfb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc5-cfb", enc_main}, |
|||
#endif |
|||
#ifndef OPENSSL_NO_RC5 |
|||
{FUNC_TYPE_CIPHER,"rc5-ofb",enc_main}, |
|||
{FUNC_TYPE_CIPHER, "rc5-ofb", enc_main}, |
|||
#endif |
|||
{0,NULL,NULL} |
|||
}; |
|||
{0, NULL, NULL} |
|||
}; |
|||
|
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,217 +1,233 @@ |
|||
/* NOCW */ |
|||
/* used by apps/speed.c */ |
|||
DSA *get_dsa512(void ); |
|||
DSA *get_dsa1024(void ); |
|||
DSA *get_dsa2048(void ); |
|||
DSA *get_dsa512(void); |
|||
DSA *get_dsa1024(void); |
|||
DSA *get_dsa2048(void); |
|||
static unsigned char dsa512_priv[] = { |
|||
0x65,0xe5,0xc7,0x38,0x60,0x24,0xb5,0x89,0xd4,0x9c,0xeb,0x4c, |
|||
0x9c,0x1d,0x7a,0x22,0xbd,0xd1,0xc2,0xd2, |
|||
}; |
|||
0x65, 0xe5, 0xc7, 0x38, 0x60, 0x24, 0xb5, 0x89, 0xd4, 0x9c, 0xeb, 0x4c, |
|||
0x9c, 0x1d, 0x7a, 0x22, 0xbd, 0xd1, 0xc2, 0xd2, |
|||
}; |
|||
|
|||
static unsigned char dsa512_pub[] = { |
|||
0x00,0x95,0xa7,0x0d,0xec,0x93,0x68,0xba,0x5f,0xf7,0x5f,0x07, |
|||
0xf2,0x3b,0xad,0x6b,0x01,0xdc,0xbe,0xec,0xde,0x04,0x7a,0x3a, |
|||
0x27,0xb3,0xec,0x49,0xfd,0x08,0x43,0x3d,0x7e,0xa8,0x2c,0x5e, |
|||
0x7b,0xbb,0xfc,0xf4,0x6e,0xeb,0x6c,0xb0,0x6e,0xf8,0x02,0x12, |
|||
0x8c,0x38,0x5d,0x83,0x56,0x7d,0xee,0x53,0x05,0x3e,0x24,0x84, |
|||
0xbe,0xba,0x0a,0x6b,0xc8, |
|||
}; |
|||
static unsigned char dsa512_p[]={ |
|||
0x9D,0x1B,0x69,0x8E,0x26,0xDB,0xF2,0x2B,0x11,0x70,0x19,0x86, |
|||
0xF6,0x19,0xC8,0xF8,0x19,0xF2,0x18,0x53,0x94,0x46,0x06,0xD0, |
|||
0x62,0x50,0x33,0x4B,0x02,0x3C,0x52,0x30,0x03,0x8B,0x3B,0xF9, |
|||
0x5F,0xD1,0x24,0x06,0x4F,0x7B,0x4C,0xBA,0xAA,0x40,0x9B,0xFD, |
|||
0x96,0xE4,0x37,0x33,0xBB,0x2D,0x5A,0xD7,0x5A,0x11,0x40,0x66, |
|||
0xA2,0x76,0x7D,0x31, |
|||
}; |
|||
static unsigned char dsa512_q[]={ |
|||
0xFB,0x53,0xEF,0x50,0xB4,0x40,0x92,0x31,0x56,0x86,0x53,0x7A, |
|||
0xE8,0x8B,0x22,0x9A,0x49,0xFB,0x71,0x8F, |
|||
}; |
|||
static unsigned char dsa512_g[]={ |
|||
0x83,0x3E,0x88,0xE5,0xC5,0x89,0x73,0xCE,0x3B,0x6C,0x01,0x49, |
|||
0xBF,0xB3,0xC7,0x9F,0x0A,0xEA,0x44,0x91,0xE5,0x30,0xAA,0xD9, |
|||
0xBE,0x5B,0x5F,0xB7,0x10,0xD7,0x89,0xB7,0x8E,0x74,0xFB,0xCF, |
|||
0x29,0x1E,0xEB,0xA8,0x2C,0x54,0x51,0xB8,0x10,0xDE,0xA0,0xCE, |
|||
0x2F,0xCC,0x24,0x6B,0x90,0x77,0xDE,0xA2,0x68,0xA6,0x52,0x12, |
|||
0xA2,0x03,0x9D,0x20, |
|||
}; |
|||
0x00, 0x95, 0xa7, 0x0d, 0xec, 0x93, 0x68, 0xba, 0x5f, 0xf7, 0x5f, 0x07, |
|||
0xf2, 0x3b, 0xad, 0x6b, 0x01, 0xdc, 0xbe, 0xec, 0xde, 0x04, 0x7a, 0x3a, |
|||
0x27, 0xb3, 0xec, 0x49, 0xfd, 0x08, 0x43, 0x3d, 0x7e, 0xa8, 0x2c, 0x5e, |
|||
0x7b, 0xbb, 0xfc, 0xf4, 0x6e, 0xeb, 0x6c, 0xb0, 0x6e, 0xf8, 0x02, 0x12, |
|||
0x8c, 0x38, 0x5d, 0x83, 0x56, 0x7d, 0xee, 0x53, 0x05, 0x3e, 0x24, 0x84, |
|||
0xbe, 0xba, 0x0a, 0x6b, 0xc8, |
|||
}; |
|||
|
|||
static unsigned char dsa512_p[] = { |
|||
0x9D, 0x1B, 0x69, 0x8E, 0x26, 0xDB, 0xF2, 0x2B, 0x11, 0x70, 0x19, 0x86, |
|||
0xF6, 0x19, 0xC8, 0xF8, 0x19, 0xF2, 0x18, 0x53, 0x94, 0x46, 0x06, 0xD0, |
|||
0x62, 0x50, 0x33, 0x4B, 0x02, 0x3C, 0x52, 0x30, 0x03, 0x8B, 0x3B, 0xF9, |
|||
0x5F, 0xD1, 0x24, 0x06, 0x4F, 0x7B, 0x4C, 0xBA, 0xAA, 0x40, 0x9B, 0xFD, |
|||
0x96, 0xE4, 0x37, 0x33, 0xBB, 0x2D, 0x5A, 0xD7, 0x5A, 0x11, 0x40, 0x66, |
|||
0xA2, 0x76, 0x7D, 0x31, |
|||
}; |
|||
|
|||
static unsigned char dsa512_q[] = { |
|||
0xFB, 0x53, 0xEF, 0x50, 0xB4, 0x40, 0x92, 0x31, 0x56, 0x86, 0x53, 0x7A, |
|||
0xE8, 0x8B, 0x22, 0x9A, 0x49, 0xFB, 0x71, 0x8F, |
|||
}; |
|||
|
|||
static unsigned char dsa512_g[] = { |
|||
0x83, 0x3E, 0x88, 0xE5, 0xC5, 0x89, 0x73, 0xCE, 0x3B, 0x6C, 0x01, 0x49, |
|||
0xBF, 0xB3, 0xC7, 0x9F, 0x0A, 0xEA, 0x44, 0x91, 0xE5, 0x30, 0xAA, 0xD9, |
|||
0xBE, 0x5B, 0x5F, 0xB7, 0x10, 0xD7, 0x89, 0xB7, 0x8E, 0x74, 0xFB, 0xCF, |
|||
0x29, 0x1E, 0xEB, 0xA8, 0x2C, 0x54, 0x51, 0xB8, 0x10, 0xDE, 0xA0, 0xCE, |
|||
0x2F, 0xCC, 0x24, 0x6B, 0x90, 0x77, 0xDE, 0xA2, 0x68, 0xA6, 0x52, 0x12, |
|||
0xA2, 0x03, 0x9D, 0x20, |
|||
}; |
|||
|
|||
DSA *get_dsa512() |
|||
{ |
|||
DSA *dsa; |
|||
|
|||
if ((dsa=DSA_new()) == NULL) return(NULL); |
|||
dsa->priv_key=BN_bin2bn(dsa512_priv,sizeof(dsa512_priv),NULL); |
|||
dsa->pub_key=BN_bin2bn(dsa512_pub,sizeof(dsa512_pub),NULL); |
|||
dsa->p=BN_bin2bn(dsa512_p,sizeof(dsa512_p),NULL); |
|||
dsa->q=BN_bin2bn(dsa512_q,sizeof(dsa512_q),NULL); |
|||
dsa->g=BN_bin2bn(dsa512_g,sizeof(dsa512_g),NULL); |
|||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) || |
|||
(dsa->q == NULL) || (dsa->g == NULL)) |
|||
return(NULL); |
|||
return(dsa); |
|||
} |
|||
|
|||
static unsigned char dsa1024_priv[]={ |
|||
0x7d,0x21,0xda,0xbb,0x62,0x15,0x47,0x36,0x07,0x67,0x12,0xe8, |
|||
0x8c,0xaa,0x1c,0xcd,0x38,0x12,0x61,0x18, |
|||
}; |
|||
static unsigned char dsa1024_pub[]={ |
|||
0x3c,0x4e,0x9c,0x2a,0x7f,0x16,0xc1,0x25,0xeb,0xac,0x78,0x63, |
|||
0x90,0x14,0x8c,0x8b,0xf4,0x68,0x43,0x3c,0x2d,0xee,0x65,0x50, |
|||
0x7d,0x9c,0x8f,0x8c,0x8a,0x51,0xd6,0x11,0x2b,0x99,0xaf,0x1e, |
|||
0x90,0x97,0xb5,0xd3,0xa6,0x20,0x25,0xd6,0xfe,0x43,0x02,0xd5, |
|||
0x91,0x7d,0xa7,0x8c,0xdb,0xc9,0x85,0xa3,0x36,0x48,0xf7,0x68, |
|||
0xaa,0x60,0xb1,0xf7,0x05,0x68,0x3a,0xa3,0x3f,0xd3,0x19,0x82, |
|||
0xd8,0x82,0x7a,0x77,0xfb,0xef,0xf4,0x15,0x0a,0xeb,0x06,0x04, |
|||
0x7f,0x53,0x07,0x0c,0xbc,0xcb,0x2d,0x83,0xdb,0x3e,0xd1,0x28, |
|||
0xa5,0xa1,0x31,0xe0,0x67,0xfa,0x50,0xde,0x9b,0x07,0x83,0x7e, |
|||
0x2c,0x0b,0xc3,0x13,0x50,0x61,0xe5,0xad,0xbd,0x36,0xb8,0x97, |
|||
0x4e,0x40,0x7d,0xe8,0x83,0x0d,0xbc,0x4b |
|||
}; |
|||
static unsigned char dsa1024_p[]={ |
|||
0xA7,0x3F,0x6E,0x85,0xBF,0x41,0x6A,0x29,0x7D,0xF0,0x9F,0x47, |
|||
0x19,0x30,0x90,0x9A,0x09,0x1D,0xDA,0x6A,0x33,0x1E,0xC5,0x3D, |
|||
0x86,0x96,0xB3,0x15,0xE0,0x53,0x2E,0x8F,0xE0,0x59,0x82,0x73, |
|||
0x90,0x3E,0x75,0x31,0x99,0x47,0x7A,0x52,0xFB,0x85,0xE4,0xD9, |
|||
0xA6,0x7B,0x38,0x9B,0x68,0x8A,0x84,0x9B,0x87,0xC6,0x1E,0xB5, |
|||
0x7E,0x86,0x4B,0x53,0x5B,0x59,0xCF,0x71,0x65,0x19,0x88,0x6E, |
|||
0xCE,0x66,0xAE,0x6B,0x88,0x36,0xFB,0xEC,0x28,0xDC,0xC2,0xD7, |
|||
0xA5,0xBB,0xE5,0x2C,0x39,0x26,0x4B,0xDA,0x9A,0x70,0x18,0x95, |
|||
0x37,0x95,0x10,0x56,0x23,0xF6,0x15,0xED,0xBA,0x04,0x5E,0xDE, |
|||
0x39,0x4F,0xFD,0xB7,0x43,0x1F,0xB5,0xA4,0x65,0x6F,0xCD,0x80, |
|||
0x11,0xE4,0x70,0x95,0x5B,0x50,0xCD,0x49, |
|||
}; |
|||
static unsigned char dsa1024_q[]={ |
|||
0xF7,0x07,0x31,0xED,0xFA,0x6C,0x06,0x03,0xD5,0x85,0x8A,0x1C, |
|||
0xAC,0x9C,0x65,0xE7,0x50,0x66,0x65,0x6F, |
|||
}; |
|||
static unsigned char dsa1024_g[]={ |
|||
0x4D,0xDF,0x4C,0x03,0xA6,0x91,0x8A,0xF5,0x19,0x6F,0x50,0x46, |
|||
0x25,0x99,0xE5,0x68,0x6F,0x30,0xE3,0x69,0xE1,0xE5,0xB3,0x5D, |
|||
0x98,0xBB,0x28,0x86,0x48,0xFC,0xDE,0x99,0x04,0x3F,0x5F,0x88, |
|||
0x0C,0x9C,0x73,0x24,0x0D,0x20,0x5D,0xB9,0x2A,0x9A,0x3F,0x18, |
|||
0x96,0x27,0xE4,0x62,0x87,0xC1,0x7B,0x74,0x62,0x53,0xFC,0x61, |
|||
0x27,0xA8,0x7A,0x91,0x09,0x9D,0xB6,0xF1,0x4D,0x9C,0x54,0x0F, |
|||
0x58,0x06,0xEE,0x49,0x74,0x07,0xCE,0x55,0x7E,0x23,0xCE,0x16, |
|||
0xF6,0xCA,0xDC,0x5A,0x61,0x01,0x7E,0xC9,0x71,0xB5,0x4D,0xF6, |
|||
0xDC,0x34,0x29,0x87,0x68,0xF6,0x5E,0x20,0x93,0xB3,0xDB,0xF5, |
|||
0xE4,0x09,0x6C,0x41,0x17,0x95,0x92,0xEB,0x01,0xB5,0x73,0xA5, |
|||
0x6A,0x7E,0xD8,0x32,0xED,0x0E,0x02,0xB8, |
|||
}; |
|||
{ |
|||
DSA *dsa; |
|||
|
|||
if ((dsa = DSA_new()) == NULL) |
|||
return (NULL); |
|||
dsa->priv_key = BN_bin2bn(dsa512_priv, sizeof(dsa512_priv), NULL); |
|||
dsa->pub_key = BN_bin2bn(dsa512_pub, sizeof(dsa512_pub), NULL); |
|||
dsa->p = BN_bin2bn(dsa512_p, sizeof(dsa512_p), NULL); |
|||
dsa->q = BN_bin2bn(dsa512_q, sizeof(dsa512_q), NULL); |
|||
dsa->g = BN_bin2bn(dsa512_g, sizeof(dsa512_g), NULL); |
|||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) |
|||
|| (dsa->q == NULL) || (dsa->g == NULL)) |
|||
return (NULL); |
|||
return (dsa); |
|||
} |
|||
|
|||
static unsigned char dsa1024_priv[] = { |
|||
0x7d, 0x21, 0xda, 0xbb, 0x62, 0x15, 0x47, 0x36, 0x07, 0x67, 0x12, 0xe8, |
|||
0x8c, 0xaa, 0x1c, 0xcd, 0x38, 0x12, 0x61, 0x18, |
|||
}; |
|||
|
|||
static unsigned char dsa1024_pub[] = { |
|||
0x3c, 0x4e, 0x9c, 0x2a, 0x7f, 0x16, 0xc1, 0x25, 0xeb, 0xac, 0x78, 0x63, |
|||
0x90, 0x14, 0x8c, 0x8b, 0xf4, 0x68, 0x43, 0x3c, 0x2d, 0xee, 0x65, 0x50, |
|||
0x7d, 0x9c, 0x8f, 0x8c, 0x8a, 0x51, 0xd6, 0x11, 0x2b, 0x99, 0xaf, 0x1e, |
|||
0x90, 0x97, 0xb5, 0xd3, 0xa6, 0x20, 0x25, 0xd6, 0xfe, 0x43, 0x02, 0xd5, |
|||
0x91, 0x7d, 0xa7, 0x8c, 0xdb, 0xc9, 0x85, 0xa3, 0x36, 0x48, 0xf7, 0x68, |
|||
0xaa, 0x60, 0xb1, 0xf7, 0x05, 0x68, 0x3a, 0xa3, 0x3f, 0xd3, 0x19, 0x82, |
|||
0xd8, 0x82, 0x7a, 0x77, 0xfb, 0xef, 0xf4, 0x15, 0x0a, 0xeb, 0x06, 0x04, |
|||
0x7f, 0x53, 0x07, 0x0c, 0xbc, 0xcb, 0x2d, 0x83, 0xdb, 0x3e, 0xd1, 0x28, |
|||
0xa5, 0xa1, 0x31, 0xe0, 0x67, 0xfa, 0x50, 0xde, 0x9b, 0x07, 0x83, 0x7e, |
|||
0x2c, 0x0b, 0xc3, 0x13, 0x50, 0x61, 0xe5, 0xad, 0xbd, 0x36, 0xb8, 0x97, |
|||
0x4e, 0x40, 0x7d, 0xe8, 0x83, 0x0d, 0xbc, 0x4b |
|||
}; |
|||
|
|||
static unsigned char dsa1024_p[] = { |
|||
0xA7, 0x3F, 0x6E, 0x85, 0xBF, 0x41, 0x6A, 0x29, 0x7D, 0xF0, 0x9F, 0x47, |
|||
0x19, 0x30, 0x90, 0x9A, 0x09, 0x1D, 0xDA, 0x6A, 0x33, 0x1E, 0xC5, 0x3D, |
|||
0x86, 0x96, 0xB3, 0x15, 0xE0, 0x53, 0x2E, 0x8F, 0xE0, 0x59, 0x82, 0x73, |
|||
0x90, 0x3E, 0x75, 0x31, 0x99, 0x47, 0x7A, 0x52, 0xFB, 0x85, 0xE4, 0xD9, |
|||
0xA6, 0x7B, 0x38, 0x9B, 0x68, 0x8A, 0x84, 0x9B, 0x87, 0xC6, 0x1E, 0xB5, |
|||
0x7E, 0x86, 0x4B, 0x53, 0x5B, 0x59, 0xCF, 0x71, 0x65, 0x19, 0x88, 0x6E, |
|||
0xCE, 0x66, 0xAE, 0x6B, 0x88, 0x36, 0xFB, 0xEC, 0x28, 0xDC, 0xC2, 0xD7, |
|||
0xA5, 0xBB, 0xE5, 0x2C, 0x39, 0x26, 0x4B, 0xDA, 0x9A, 0x70, 0x18, 0x95, |
|||
0x37, 0x95, 0x10, 0x56, 0x23, 0xF6, 0x15, 0xED, 0xBA, 0x04, 0x5E, 0xDE, |
|||
0x39, 0x4F, 0xFD, 0xB7, 0x43, 0x1F, 0xB5, 0xA4, 0x65, 0x6F, 0xCD, 0x80, |
|||
0x11, 0xE4, 0x70, 0x95, 0x5B, 0x50, 0xCD, 0x49, |
|||
}; |
|||
|
|||
static unsigned char dsa1024_q[] = { |
|||
0xF7, 0x07, 0x31, 0xED, 0xFA, 0x6C, 0x06, 0x03, 0xD5, 0x85, 0x8A, 0x1C, |
|||
0xAC, 0x9C, 0x65, 0xE7, 0x50, 0x66, 0x65, 0x6F, |
|||
}; |
|||
|
|||
static unsigned char dsa1024_g[] = { |
|||
0x4D, 0xDF, 0x4C, 0x03, 0xA6, 0x91, 0x8A, 0xF5, 0x19, 0x6F, 0x50, 0x46, |
|||
0x25, 0x99, 0xE5, 0x68, 0x6F, 0x30, 0xE3, 0x69, 0xE1, 0xE5, 0xB3, 0x5D, |
|||
0x98, 0xBB, 0x28, 0x86, 0x48, 0xFC, 0xDE, 0x99, 0x04, 0x3F, 0x5F, 0x88, |
|||
0x0C, 0x9C, 0x73, 0x24, 0x0D, 0x20, 0x5D, 0xB9, 0x2A, 0x9A, 0x3F, 0x18, |
|||
0x96, 0x27, 0xE4, 0x62, 0x87, 0xC1, 0x7B, 0x74, 0x62, 0x53, 0xFC, 0x61, |
|||
0x27, 0xA8, 0x7A, 0x91, 0x09, 0x9D, 0xB6, 0xF1, 0x4D, 0x9C, 0x54, 0x0F, |
|||
0x58, 0x06, 0xEE, 0x49, 0x74, 0x07, 0xCE, 0x55, 0x7E, 0x23, 0xCE, 0x16, |
|||
0xF6, 0xCA, 0xDC, 0x5A, 0x61, 0x01, 0x7E, 0xC9, 0x71, 0xB5, 0x4D, 0xF6, |
|||
0xDC, 0x34, 0x29, 0x87, 0x68, 0xF6, 0x5E, 0x20, 0x93, 0xB3, 0xDB, 0xF5, |
|||
0xE4, 0x09, 0x6C, 0x41, 0x17, 0x95, 0x92, 0xEB, 0x01, 0xB5, 0x73, 0xA5, |
|||
0x6A, 0x7E, 0xD8, 0x32, 0xED, 0x0E, 0x02, 0xB8, |
|||
}; |
|||
|
|||
DSA *get_dsa1024() |
|||
{ |
|||
DSA *dsa; |
|||
|
|||
if ((dsa=DSA_new()) == NULL) return(NULL); |
|||
dsa->priv_key=BN_bin2bn(dsa1024_priv,sizeof(dsa1024_priv),NULL); |
|||
dsa->pub_key=BN_bin2bn(dsa1024_pub,sizeof(dsa1024_pub),NULL); |
|||
dsa->p=BN_bin2bn(dsa1024_p,sizeof(dsa1024_p),NULL); |
|||
dsa->q=BN_bin2bn(dsa1024_q,sizeof(dsa1024_q),NULL); |
|||
dsa->g=BN_bin2bn(dsa1024_g,sizeof(dsa1024_g),NULL); |
|||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) || |
|||
(dsa->q == NULL) || (dsa->g == NULL)) |
|||
return(NULL); |
|||
return(dsa); |
|||
} |
|||
|
|||
static unsigned char dsa2048_priv[]={ |
|||
0x32,0x67,0x92,0xf6,0xc4,0xe2,0xe2,0xe8,0xa0,0x8b,0x6b,0x45, |
|||
0x0c,0x8a,0x76,0xb0,0xee,0xcf,0x91,0xa7, |
|||
}; |
|||
static unsigned char dsa2048_pub[]={ |
|||
0x17,0x8f,0xa8,0x11,0x84,0x92,0xec,0x83,0x47,0xc7,0x6a,0xb0, |
|||
0x92,0xaf,0x5a,0x20,0x37,0xa3,0x64,0x79,0xd2,0xd0,0x3d,0xcd, |
|||
0xe0,0x61,0x88,0x88,0x21,0xcc,0x74,0x5d,0xce,0x4c,0x51,0x47, |
|||
0xf0,0xc5,0x5c,0x4c,0x82,0x7a,0xaf,0x72,0xad,0xb9,0xe0,0x53, |
|||
0xf2,0x78,0xb7,0xf0,0xb5,0x48,0x7f,0x8a,0x3a,0x18,0xd1,0x9f, |
|||
0x8b,0x7d,0xa5,0x47,0xb7,0x95,0xab,0x98,0xf8,0x7b,0x74,0x50, |
|||
0x56,0x8e,0x57,0xf0,0xee,0xf5,0xb7,0xba,0xab,0x85,0x86,0xf9, |
|||
0x2b,0xef,0x41,0x56,0xa0,0xa4,0x9f,0xb7,0x38,0x00,0x46,0x0a, |
|||
0xa6,0xf1,0xfc,0x1f,0xd8,0x4e,0x85,0x44,0x92,0x43,0x21,0x5d, |
|||
0x6e,0xcc,0xc2,0xcb,0x26,0x31,0x0d,0x21,0xc4,0xbd,0x8d,0x24, |
|||
0xbc,0xd9,0x18,0x19,0xd7,0xdc,0xf1,0xe7,0x93,0x50,0x48,0x03, |
|||
0x2c,0xae,0x2e,0xe7,0x49,0x88,0x5f,0x93,0x57,0x27,0x99,0x36, |
|||
0xb4,0x20,0xab,0xfc,0xa7,0x2b,0xf2,0xd9,0x98,0xd7,0xd4,0x34, |
|||
0x9d,0x96,0x50,0x58,0x9a,0xea,0x54,0xf3,0xee,0xf5,0x63,0x14, |
|||
0xee,0x85,0x83,0x74,0x76,0xe1,0x52,0x95,0xc3,0xf7,0xeb,0x04, |
|||
0x04,0x7b,0xa7,0x28,0x1b,0xcc,0xea,0x4a,0x4e,0x84,0xda,0xd8, |
|||
0x9c,0x79,0xd8,0x9b,0x66,0x89,0x2f,0xcf,0xac,0xd7,0x79,0xf9, |
|||
0xa9,0xd8,0x45,0x13,0x78,0xb9,0x00,0x14,0xc9,0x7e,0x22,0x51, |
|||
0x86,0x67,0xb0,0x9f,0x26,0x11,0x23,0xc8,0x38,0xd7,0x70,0x1d, |
|||
0x15,0x8e,0x4d,0x4f,0x95,0x97,0x40,0xa1,0xc2,0x7e,0x01,0x18, |
|||
0x72,0xf4,0x10,0xe6,0x8d,0x52,0x16,0x7f,0xf2,0xc9,0xf8,0x33, |
|||
0x8b,0x33,0xb7,0xce, |
|||
}; |
|||
static unsigned char dsa2048_p[]={ |
|||
0xA0,0x25,0xFA,0xAD,0xF4,0x8E,0xB9,0xE5,0x99,0xF3,0x5D,0x6F, |
|||
0x4F,0x83,0x34,0xE2,0x7E,0xCF,0x6F,0xBF,0x30,0xAF,0x6F,0x81, |
|||
0xEB,0xF8,0xC4,0x13,0xD9,0xA0,0x5D,0x8B,0x5C,0x8E,0xDC,0xC2, |
|||
0x1D,0x0B,0x41,0x32,0xB0,0x1F,0xFE,0xEF,0x0C,0xC2,0xA2,0x7E, |
|||
0x68,0x5C,0x28,0x21,0xE9,0xF5,0xB1,0x58,0x12,0x63,0x4C,0x19, |
|||
0x4E,0xFF,0x02,0x4B,0x92,0xED,0xD2,0x07,0x11,0x4D,0x8C,0x58, |
|||
0x16,0x5C,0x55,0x8E,0xAD,0xA3,0x67,0x7D,0xB9,0x86,0x6E,0x0B, |
|||
0xE6,0x54,0x6F,0x40,0xAE,0x0E,0x67,0x4C,0xF9,0x12,0x5B,0x3C, |
|||
0x08,0x7A,0xF7,0xFC,0x67,0x86,0x69,0xE7,0x0A,0x94,0x40,0xBF, |
|||
0x8B,0x76,0xFE,0x26,0xD1,0xF2,0xA1,0x1A,0x84,0xA1,0x43,0x56, |
|||
0x28,0xBC,0x9A,0x5F,0xD7,0x3B,0x69,0x89,0x8A,0x36,0x2C,0x51, |
|||
0xDF,0x12,0x77,0x2F,0x57,0x7B,0xA0,0xAA,0xDD,0x7F,0xA1,0x62, |
|||
0x3B,0x40,0x7B,0x68,0x1A,0x8F,0x0D,0x38,0xBB,0x21,0x5D,0x18, |
|||
0xFC,0x0F,0x46,0xF7,0xA3,0xB0,0x1D,0x23,0xC3,0xD2,0xC7,0x72, |
|||
0x51,0x18,0xDF,0x46,0x95,0x79,0xD9,0xBD,0xB5,0x19,0x02,0x2C, |
|||
0x87,0xDC,0xE7,0x57,0x82,0x7E,0xF1,0x8B,0x06,0x3D,0x00,0xA5, |
|||
0x7B,0x6B,0x26,0x27,0x91,0x0F,0x6A,0x77,0xE4,0xD5,0x04,0xE4, |
|||
0x12,0x2C,0x42,0xFF,0xD2,0x88,0xBB,0xD3,0x92,0xA0,0xF9,0xC8, |
|||
0x51,0x64,0x14,0x5C,0xD8,0xF9,0x6C,0x47,0x82,0xB4,0x1C,0x7F, |
|||
0x09,0xB8,0xF0,0x25,0x83,0x1D,0x3F,0x3F,0x05,0xB3,0x21,0x0A, |
|||
0x5D,0xA7,0xD8,0x54,0xC3,0x65,0x7D,0xC3,0xB0,0x1D,0xBF,0xAE, |
|||
0xF8,0x68,0xCF,0x9B, |
|||
}; |
|||
static unsigned char dsa2048_q[]={ |
|||
0x97,0xE7,0x33,0x4D,0xD3,0x94,0x3E,0x0B,0xDB,0x62,0x74,0xC6, |
|||
0xA1,0x08,0xDD,0x19,0xA3,0x75,0x17,0x1B, |
|||
}; |
|||
static unsigned char dsa2048_g[]={ |
|||
0x2C,0x78,0x16,0x59,0x34,0x63,0xF4,0xF3,0x92,0xFC,0xB5,0xA5, |
|||
0x4F,0x13,0xDE,0x2F,0x1C,0xA4,0x3C,0xAE,0xAD,0x38,0x3F,0x7E, |
|||
0x90,0xBF,0x96,0xA6,0xAE,0x25,0x90,0x72,0xF5,0x8E,0x80,0x0C, |
|||
0x39,0x1C,0xD9,0xEC,0xBA,0x90,0x5B,0x3A,0xE8,0x58,0x6C,0x9E, |
|||
0x30,0x42,0x37,0x02,0x31,0x82,0xBC,0x6A,0xDF,0x6A,0x09,0x29, |
|||
0xE3,0xC0,0x46,0xD1,0xCB,0x85,0xEC,0x0C,0x30,0x5E,0xEA,0xC8, |
|||
0x39,0x8E,0x22,0x9F,0x22,0x10,0xD2,0x34,0x61,0x68,0x37,0x3D, |
|||
0x2E,0x4A,0x5B,0x9A,0xF5,0xC1,0x48,0xC6,0xF6,0xDC,0x63,0x1A, |
|||
0xD3,0x96,0x64,0xBA,0x34,0xC9,0xD1,0xA0,0xD1,0xAE,0x6C,0x2F, |
|||
0x48,0x17,0x93,0x14,0x43,0xED,0xF0,0x21,0x30,0x19,0xC3,0x1B, |
|||
0x5F,0xDE,0xA3,0xF0,0x70,0x78,0x18,0xE1,0xA8,0xE4,0xEE,0x2E, |
|||
0x00,0xA5,0xE4,0xB3,0x17,0xC8,0x0C,0x7D,0x6E,0x42,0xDC,0xB7, |
|||
0x46,0x00,0x36,0x4D,0xD4,0x46,0xAA,0x3D,0x3C,0x46,0x89,0x40, |
|||
0xBF,0x1D,0x84,0x77,0x0A,0x75,0xF3,0x87,0x1D,0x08,0x4C,0xA6, |
|||
0xD1,0xA9,0x1C,0x1E,0x12,0x1E,0xE1,0xC7,0x30,0x28,0x76,0xA5, |
|||
0x7F,0x6C,0x85,0x96,0x2B,0x6F,0xDB,0x80,0x66,0x26,0xAE,0xF5, |
|||
0x93,0xC7,0x8E,0xAE,0x9A,0xED,0xE4,0xCA,0x04,0xEA,0x3B,0x72, |
|||
0xEF,0xDC,0x87,0xED,0x0D,0xA5,0x4C,0x4A,0xDD,0x71,0x22,0x64, |
|||
0x59,0x69,0x4E,0x8E,0xBF,0x43,0xDC,0xAB,0x8E,0x66,0xBB,0x01, |
|||
0xB6,0xF4,0xE7,0xFD,0xD2,0xAD,0x9F,0x36,0xC1,0xA0,0x29,0x99, |
|||
0xD1,0x96,0x70,0x59,0x06,0x78,0x35,0xBD,0x65,0x55,0x52,0x9E, |
|||
0xF8,0xB2,0xE5,0x38, |
|||
}; |
|||
|
|||
{ |
|||
DSA *dsa; |
|||
|
|||
if ((dsa = DSA_new()) == NULL) |
|||
return (NULL); |
|||
dsa->priv_key = BN_bin2bn(dsa1024_priv, sizeof(dsa1024_priv), NULL); |
|||
dsa->pub_key = BN_bin2bn(dsa1024_pub, sizeof(dsa1024_pub), NULL); |
|||
dsa->p = BN_bin2bn(dsa1024_p, sizeof(dsa1024_p), NULL); |
|||
dsa->q = BN_bin2bn(dsa1024_q, sizeof(dsa1024_q), NULL); |
|||
dsa->g = BN_bin2bn(dsa1024_g, sizeof(dsa1024_g), NULL); |
|||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) |
|||
|| (dsa->q == NULL) || (dsa->g == NULL)) |
|||
return (NULL); |
|||
return (dsa); |
|||
} |
|||
|
|||
static unsigned char dsa2048_priv[] = { |
|||
0x32, 0x67, 0x92, 0xf6, 0xc4, 0xe2, 0xe2, 0xe8, 0xa0, 0x8b, 0x6b, 0x45, |
|||
0x0c, 0x8a, 0x76, 0xb0, 0xee, 0xcf, 0x91, 0xa7, |
|||
}; |
|||
|
|||
static unsigned char dsa2048_pub[] = { |
|||
0x17, 0x8f, 0xa8, 0x11, 0x84, 0x92, 0xec, 0x83, 0x47, 0xc7, 0x6a, 0xb0, |
|||
0x92, 0xaf, 0x5a, 0x20, 0x37, 0xa3, 0x64, 0x79, 0xd2, 0xd0, 0x3d, 0xcd, |
|||
0xe0, 0x61, 0x88, 0x88, 0x21, 0xcc, 0x74, 0x5d, 0xce, 0x4c, 0x51, 0x47, |
|||
0xf0, 0xc5, 0x5c, 0x4c, 0x82, 0x7a, 0xaf, 0x72, 0xad, 0xb9, 0xe0, 0x53, |
|||
0xf2, 0x78, 0xb7, 0xf0, 0xb5, 0x48, 0x7f, 0x8a, 0x3a, 0x18, 0xd1, 0x9f, |
|||
0x8b, 0x7d, 0xa5, 0x47, 0xb7, 0x95, 0xab, 0x98, 0xf8, 0x7b, 0x74, 0x50, |
|||
0x56, 0x8e, 0x57, 0xf0, 0xee, 0xf5, 0xb7, 0xba, 0xab, 0x85, 0x86, 0xf9, |
|||
0x2b, 0xef, 0x41, 0x56, 0xa0, 0xa4, 0x9f, 0xb7, 0x38, 0x00, 0x46, 0x0a, |
|||
0xa6, 0xf1, 0xfc, 0x1f, 0xd8, 0x4e, 0x85, 0x44, 0x92, 0x43, 0x21, 0x5d, |
|||
0x6e, 0xcc, 0xc2, 0xcb, 0x26, 0x31, 0x0d, 0x21, 0xc4, 0xbd, 0x8d, 0x24, |
|||
0xbc, 0xd9, 0x18, 0x19, 0xd7, 0xdc, 0xf1, 0xe7, 0x93, 0x50, 0x48, 0x03, |
|||
0x2c, 0xae, 0x2e, 0xe7, 0x49, 0x88, 0x5f, 0x93, 0x57, 0x27, 0x99, 0x36, |
|||
0xb4, 0x20, 0xab, 0xfc, 0xa7, 0x2b, 0xf2, 0xd9, 0x98, 0xd7, 0xd4, 0x34, |
|||
0x9d, 0x96, 0x50, 0x58, 0x9a, 0xea, 0x54, 0xf3, 0xee, 0xf5, 0x63, 0x14, |
|||
0xee, 0x85, 0x83, 0x74, 0x76, 0xe1, 0x52, 0x95, 0xc3, 0xf7, 0xeb, 0x04, |
|||
0x04, 0x7b, 0xa7, 0x28, 0x1b, 0xcc, 0xea, 0x4a, 0x4e, 0x84, 0xda, 0xd8, |
|||
0x9c, 0x79, 0xd8, 0x9b, 0x66, 0x89, 0x2f, 0xcf, 0xac, 0xd7, 0x79, 0xf9, |
|||
0xa9, 0xd8, 0x45, 0x13, 0x78, 0xb9, 0x00, 0x14, 0xc9, 0x7e, 0x22, 0x51, |
|||
0x86, 0x67, 0xb0, 0x9f, 0x26, 0x11, 0x23, 0xc8, 0x38, 0xd7, 0x70, 0x1d, |
|||
0x15, 0x8e, 0x4d, 0x4f, 0x95, 0x97, 0x40, 0xa1, 0xc2, 0x7e, 0x01, 0x18, |
|||
0x72, 0xf4, 0x10, 0xe6, 0x8d, 0x52, 0x16, 0x7f, 0xf2, 0xc9, 0xf8, 0x33, |
|||
0x8b, 0x33, 0xb7, 0xce, |
|||
}; |
|||
|
|||
static unsigned char dsa2048_p[] = { |
|||
0xA0, 0x25, 0xFA, 0xAD, 0xF4, 0x8E, 0xB9, 0xE5, 0x99, 0xF3, 0x5D, 0x6F, |
|||
0x4F, 0x83, 0x34, 0xE2, 0x7E, 0xCF, 0x6F, 0xBF, 0x30, 0xAF, 0x6F, 0x81, |
|||
0xEB, 0xF8, 0xC4, 0x13, 0xD9, 0xA0, 0x5D, 0x8B, 0x5C, 0x8E, 0xDC, 0xC2, |
|||
0x1D, 0x0B, 0x41, 0x32, 0xB0, 0x1F, 0xFE, 0xEF, 0x0C, 0xC2, 0xA2, 0x7E, |
|||
0x68, 0x5C, 0x28, 0x21, 0xE9, 0xF5, 0xB1, 0x58, 0x12, 0x63, 0x4C, 0x19, |
|||
0x4E, 0xFF, 0x02, 0x4B, 0x92, 0xED, 0xD2, 0x07, 0x11, 0x4D, 0x8C, 0x58, |
|||
0x16, 0x5C, 0x55, 0x8E, 0xAD, 0xA3, 0x67, 0x7D, 0xB9, 0x86, 0x6E, 0x0B, |
|||
0xE6, 0x54, 0x6F, 0x40, 0xAE, 0x0E, 0x67, 0x4C, 0xF9, 0x12, 0x5B, 0x3C, |
|||
0x08, 0x7A, 0xF7, 0xFC, 0x67, 0x86, 0x69, 0xE7, 0x0A, 0x94, 0x40, 0xBF, |
|||
0x8B, 0x76, 0xFE, 0x26, 0xD1, 0xF2, 0xA1, 0x1A, 0x84, 0xA1, 0x43, 0x56, |
|||
0x28, 0xBC, 0x9A, 0x5F, 0xD7, 0x3B, 0x69, 0x89, 0x8A, 0x36, 0x2C, 0x51, |
|||
0xDF, 0x12, 0x77, 0x2F, 0x57, 0x7B, 0xA0, 0xAA, 0xDD, 0x7F, 0xA1, 0x62, |
|||
0x3B, 0x40, 0x7B, 0x68, 0x1A, 0x8F, 0x0D, 0x38, 0xBB, 0x21, 0x5D, 0x18, |
|||
0xFC, 0x0F, 0x46, 0xF7, 0xA3, 0xB0, 0x1D, 0x23, 0xC3, 0xD2, 0xC7, 0x72, |
|||
0x51, 0x18, 0xDF, 0x46, 0x95, 0x79, 0xD9, 0xBD, 0xB5, 0x19, 0x02, 0x2C, |
|||
0x87, 0xDC, 0xE7, 0x57, 0x82, 0x7E, 0xF1, 0x8B, 0x06, 0x3D, 0x00, 0xA5, |
|||
0x7B, 0x6B, 0x26, 0x27, 0x91, 0x0F, 0x6A, 0x77, 0xE4, 0xD5, 0x04, 0xE4, |
|||
0x12, 0x2C, 0x42, 0xFF, 0xD2, 0x88, 0xBB, 0xD3, 0x92, 0xA0, 0xF9, 0xC8, |
|||
0x51, 0x64, 0x14, 0x5C, 0xD8, 0xF9, 0x6C, 0x47, 0x82, 0xB4, 0x1C, 0x7F, |
|||
0x09, 0xB8, 0xF0, 0x25, 0x83, 0x1D, 0x3F, 0x3F, 0x05, 0xB3, 0x21, 0x0A, |
|||
0x5D, 0xA7, 0xD8, 0x54, 0xC3, 0x65, 0x7D, 0xC3, 0xB0, 0x1D, 0xBF, 0xAE, |
|||
0xF8, 0x68, 0xCF, 0x9B, |
|||
}; |
|||
|
|||
static unsigned char dsa2048_q[] = { |
|||
0x97, 0xE7, 0x33, 0x4D, 0xD3, 0x94, 0x3E, 0x0B, 0xDB, 0x62, 0x74, 0xC6, |
|||
0xA1, 0x08, 0xDD, 0x19, 0xA3, 0x75, 0x17, 0x1B, |
|||
}; |
|||
|
|||
static unsigned char dsa2048_g[] = { |
|||
0x2C, 0x78, 0x16, 0x59, 0x34, 0x63, 0xF4, 0xF3, 0x92, 0xFC, 0xB5, 0xA5, |
|||
0x4F, 0x13, 0xDE, 0x2F, 0x1C, 0xA4, 0x3C, 0xAE, 0xAD, 0x38, 0x3F, 0x7E, |
|||
0x90, 0xBF, 0x96, 0xA6, 0xAE, 0x25, 0x90, 0x72, 0xF5, 0x8E, 0x80, 0x0C, |
|||
0x39, 0x1C, 0xD9, 0xEC, 0xBA, 0x90, 0x5B, 0x3A, 0xE8, 0x58, 0x6C, 0x9E, |
|||
0x30, 0x42, 0x37, 0x02, 0x31, 0x82, 0xBC, 0x6A, 0xDF, 0x6A, 0x09, 0x29, |
|||
0xE3, 0xC0, 0x46, 0xD1, 0xCB, 0x85, 0xEC, 0x0C, 0x30, 0x5E, 0xEA, 0xC8, |
|||
0x39, 0x8E, 0x22, 0x9F, 0x22, 0x10, 0xD2, 0x34, 0x61, 0x68, 0x37, 0x3D, |
|||
0x2E, 0x4A, 0x5B, 0x9A, 0xF5, 0xC1, 0x48, 0xC6, 0xF6, 0xDC, 0x63, 0x1A, |
|||
0xD3, 0x96, 0x64, 0xBA, 0x34, 0xC9, 0xD1, 0xA0, 0xD1, 0xAE, 0x6C, 0x2F, |
|||
0x48, 0x17, 0x93, 0x14, 0x43, 0xED, 0xF0, 0x21, 0x30, 0x19, 0xC3, 0x1B, |
|||
0x5F, 0xDE, 0xA3, 0xF0, 0x70, 0x78, 0x18, 0xE1, 0xA8, 0xE4, 0xEE, 0x2E, |
|||
0x00, 0xA5, 0xE4, 0xB3, 0x17, 0xC8, 0x0C, 0x7D, 0x6E, 0x42, 0xDC, 0xB7, |
|||
0x46, 0x00, 0x36, 0x4D, 0xD4, 0x46, 0xAA, 0x3D, 0x3C, 0x46, 0x89, 0x40, |
|||
0xBF, 0x1D, 0x84, 0x77, 0x0A, 0x75, 0xF3, 0x87, 0x1D, 0x08, 0x4C, 0xA6, |
|||
0xD1, 0xA9, 0x1C, 0x1E, 0x12, 0x1E, 0xE1, 0xC7, 0x30, 0x28, 0x76, 0xA5, |
|||
0x7F, 0x6C, 0x85, 0x96, 0x2B, 0x6F, 0xDB, 0x80, 0x66, 0x26, 0xAE, 0xF5, |
|||
0x93, 0xC7, 0x8E, 0xAE, 0x9A, 0xED, 0xE4, 0xCA, 0x04, 0xEA, 0x3B, 0x72, |
|||
0xEF, 0xDC, 0x87, 0xED, 0x0D, 0xA5, 0x4C, 0x4A, 0xDD, 0x71, 0x22, 0x64, |
|||
0x59, 0x69, 0x4E, 0x8E, 0xBF, 0x43, 0xDC, 0xAB, 0x8E, 0x66, 0xBB, 0x01, |
|||
0xB6, 0xF4, 0xE7, 0xFD, 0xD2, 0xAD, 0x9F, 0x36, 0xC1, 0xA0, 0x29, 0x99, |
|||
0xD1, 0x96, 0x70, 0x59, 0x06, 0x78, 0x35, 0xBD, 0x65, 0x55, 0x52, 0x9E, |
|||
0xF8, 0xB2, 0xE5, 0x38, |
|||
}; |
|||
|
|||
DSA *get_dsa2048() |
|||
{ |
|||
DSA *dsa; |
|||
|
|||
if ((dsa=DSA_new()) == NULL) return(NULL); |
|||
dsa->priv_key=BN_bin2bn(dsa2048_priv,sizeof(dsa2048_priv),NULL); |
|||
dsa->pub_key=BN_bin2bn(dsa2048_pub,sizeof(dsa2048_pub),NULL); |
|||
dsa->p=BN_bin2bn(dsa2048_p,sizeof(dsa2048_p),NULL); |
|||
dsa->q=BN_bin2bn(dsa2048_q,sizeof(dsa2048_q),NULL); |
|||
dsa->g=BN_bin2bn(dsa2048_g,sizeof(dsa2048_g),NULL); |
|||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) || |
|||
(dsa->q == NULL) || (dsa->g == NULL)) |
|||
return(NULL); |
|||
return(dsa); |
|||
} |
|||
|
|||
static const char rnd_seed[] = "string to make the random number generator think it has entropy"; |
|||
{ |
|||
DSA *dsa; |
|||
|
|||
if ((dsa = DSA_new()) == NULL) |
|||
return (NULL); |
|||
dsa->priv_key = BN_bin2bn(dsa2048_priv, sizeof(dsa2048_priv), NULL); |
|||
dsa->pub_key = BN_bin2bn(dsa2048_pub, sizeof(dsa2048_pub), NULL); |
|||
dsa->p = BN_bin2bn(dsa2048_p, sizeof(dsa2048_p), NULL); |
|||
dsa->q = BN_bin2bn(dsa2048_q, sizeof(dsa2048_q), NULL); |
|||
dsa->g = BN_bin2bn(dsa2048_g, sizeof(dsa2048_g), NULL); |
|||
if ((dsa->priv_key == NULL) || (dsa->pub_key == NULL) || (dsa->p == NULL) |
|||
|| (dsa->q == NULL) || (dsa->g == NULL)) |
|||
return (NULL); |
|||
return (dsa); |
|||
} |
|||
|
|||
static const char rnd_seed[] = |
|||
"string to make the random number generator think it has entropy"; |
|||
static int rnd_fake = 0; |
|||
|
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,51 +1,51 @@ |
|||
#ifndef __ARM_ARCH_H__ |
|||
#define __ARM_ARCH_H__ |
|||
# define __ARM_ARCH_H__ |
|||
|
|||
#if !defined(__ARM_ARCH__) |
|||
# if defined(__CC_ARM) |
|||
# define __ARM_ARCH__ __TARGET_ARCH_ARM |
|||
# if defined(__BIG_ENDIAN) |
|||
# define __ARMEB__ |
|||
# else |
|||
# define __ARMEL__ |
|||
# endif |
|||
# elif defined(__GNUC__) |
|||
# if !defined(__ARM_ARCH__) |
|||
# if defined(__CC_ARM) |
|||
# define __ARM_ARCH__ __TARGET_ARCH_ARM |
|||
# if defined(__BIG_ENDIAN) |
|||
# define __ARMEB__ |
|||
# else |
|||
# define __ARMEL__ |
|||
# endif |
|||
# elif defined(__GNUC__) |
|||
/*
|
|||
* Why doesn't gcc define __ARM_ARCH__? Instead it defines |
|||
* bunch of below macros. See all_architectires[] table in |
|||
* gcc/config/arm/arm.c. On a side note it defines |
|||
* __ARMEL__/__ARMEB__ for little-/big-endian. |
|||
*/ |
|||
# if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \ |
|||
defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__) || \ |
|||
defined(__ARM_ARCH_7EM__) |
|||
# define __ARM_ARCH__ 7 |
|||
# elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \ |
|||
defined(__ARM_ARCH_6K__)|| defined(__ARM_ARCH_6M__) || \ |
|||
defined(__ARM_ARCH_6Z__)|| defined(__ARM_ARCH_6ZK__) || \ |
|||
defined(__ARM_ARCH_6T2__) |
|||
# define __ARM_ARCH__ 6 |
|||
# elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \ |
|||
defined(__ARM_ARCH_5E__)|| defined(__ARM_ARCH_5TE__) || \ |
|||
defined(__ARM_ARCH_5TEJ__) |
|||
# define __ARM_ARCH__ 5 |
|||
# elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) |
|||
# define __ARM_ARCH__ 4 |
|||
# else |
|||
# error "unsupported ARM architecture" |
|||
# if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \ |
|||
defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__) || \ |
|||
defined(__ARM_ARCH_7EM__) |
|||
# define __ARM_ARCH__ 7 |
|||
# elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \ |
|||
defined(__ARM_ARCH_6K__)|| defined(__ARM_ARCH_6M__) || \ |
|||
defined(__ARM_ARCH_6Z__)|| defined(__ARM_ARCH_6ZK__) || \ |
|||
defined(__ARM_ARCH_6T2__) |
|||
# define __ARM_ARCH__ 6 |
|||
# elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \ |
|||
defined(__ARM_ARCH_5E__)|| defined(__ARM_ARCH_5TE__) || \ |
|||
defined(__ARM_ARCH_5TEJ__) |
|||
# define __ARM_ARCH__ 5 |
|||
# elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) |
|||
# define __ARM_ARCH__ 4 |
|||
# else |
|||
# error "unsupported ARM architecture" |
|||
# endif |
|||
# endif |
|||
# endif |
|||
#endif |
|||
|
|||
#ifdef OPENSSL_FIPSCANISTER |
|||
#include <openssl/fipssyms.h> |
|||
#endif |
|||
# ifdef OPENSSL_FIPSCANISTER |
|||
# include <openssl/fipssyms.h> |
|||
# endif |
|||
|
|||
#if !__ASSEMBLER__ |
|||
# if !__ASSEMBLER__ |
|||
extern unsigned int OPENSSL_armcap_P; |
|||
|
|||
#define ARMV7_NEON (1<<0) |
|||
#define ARMV7_TICK (1<<1) |
|||
#endif |
|||
|
|||
# define ARMV7_NEON (1<<0) |
|||
# define ARMV7_TICK (1<<1) |
|||
# endif |
|||
|
|||
#endif |
|||
|
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue