Commit dfb56425 authored by Rich Salz's avatar Rich Salz
Browse files

Dead code: crypto/dh,modes,pkcs12,ripemd,rsa,srp



And an uncompiled C++ test file.
Also remove srp_lcl.h, with help from Richard.

Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
parent 156a8722
Loading
Loading
Loading
Loading
+1 −9
Original line number Original line Diff line number Diff line
@@ -116,15 +116,7 @@ int DH_check(const DH *dh, int *ret)
        l = BN_mod_word(dh->p, 24);
        l = BN_mod_word(dh->p, 24);
        if (l != 11)
        if (l != 11)
            *ret |= DH_NOT_SUITABLE_GENERATOR;
            *ret |= DH_NOT_SUITABLE_GENERATOR;
    }
    } else if (BN_is_word(dh->g, DH_GENERATOR_5)) {
#if 0
    else if (BN_is_word(dh->g, DH_GENERATOR_3)) {
        l = BN_mod_word(dh->p, 12);
        if (l != 5)
            *ret |= DH_NOT_SUITABLE_GENERATOR;
    }
#endif
    else if (BN_is_word(dh->g, DH_GENERATOR_5)) {
        l = BN_mod_word(dh->p, 10);
        l = BN_mod_word(dh->p, 10);
        if ((l != 3) && (l != 7))
        if ((l != 3) && (l != 7))
            *ret |= DH_NOT_SUITABLE_GENERATOR;
            *ret |= DH_NOT_SUITABLE_GENERATOR;
+1 −11
Original line number Original line Diff line number Diff line
@@ -136,17 +136,7 @@ static int dh_builtin_genparams(DH *ret, int prime_len, int generator,
        if (!BN_set_word(t2, 11))
        if (!BN_set_word(t2, 11))
            goto err;
            goto err;
        g = 2;
        g = 2;
    }
    } else if (generator == DH_GENERATOR_5) {
#if 0                           /* does not work for safe primes */
    else if (generator == DH_GENERATOR_3) {
        if (!BN_set_word(t1, 12))
            goto err;
        if (!BN_set_word(t2, 5))
            goto err;
        g = 3;
    }
#endif
    else if (generator == DH_GENERATOR_5) {
        if (!BN_set_word(t1, 10))
        if (!BN_set_word(t1, 10))
            goto err;
            goto err;
        if (!BN_set_word(t2, 3))
        if (!BN_set_word(t2, 3))
+0 −3
Original line number Original line Diff line number Diff line
@@ -1036,9 +1036,6 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
# endif
# endif
#endif
#endif


#if 0
    n = (unsigned int)mlen % 16; /* alternative to ctx->mres */
#endif
    mlen += len;
    mlen += len;
    if (mlen > ((U64(1) << 36) - 32) || (sizeof(len) == 8 && mlen < len))
    if (mlen > ((U64(1) << 36) - 32) || (sizeof(len) == 8 && mlen < len))
        return -1;
        return -1;
+0 −7
Original line number Original line Diff line number Diff line
@@ -118,13 +118,6 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
    int tmpn = n;
    int tmpn = n;
#endif
#endif


#if 0
    if (!pass) {
        PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI, ERR_R_PASSED_NULL_PARAMETER);
        return 0;
    }
#endif

    EVP_MD_CTX_init(&ctx);
    EVP_MD_CTX_init(&ctx);
#ifdef  DEBUG_KEYGEN
#ifdef  DEBUG_KEYGEN
    fprintf(stderr, "KEYGEN DEBUG\n");
    fprintf(stderr, "KEYGEN DEBUG\n");

crypto/ripemd/asm/rips.cpp

deleted100644 → 0
+0 −82
Original line number Original line Diff line number Diff line
//
// gettsc.inl
//
// gives access to the Pentium's (secret) cycle counter
//
// This software was written by Leonard Janke (janke@unixg.ubc.ca)
// in 1996-7 and is entered, by him, into the public domain.

#if defined(__WATCOMC__)
void GetTSC(unsigned long&);
#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
#elif defined(__GNUC__)
inline
void GetTSC(unsigned long& tsc)
{
  asm volatile(".byte 15, 49\n\t"
	       : "=eax" (tsc)
	       :
	       : "%edx", "%eax");
}
#elif defined(_MSC_VER)
inline
void GetTSC(unsigned long& tsc)
{
  unsigned long a;
  __asm _emit 0fh
  __asm _emit 31h
  __asm mov a, eax;
  tsc=a;
}
#endif      

#include <stdio.h>
#include <stdlib.h>
#include <openssl/ripemd.h>

#define ripemd160_block_x86 ripemd160_block_asm_host_order

extern "C" {
void ripemd160_block_x86(RIPEMD160_CTX *ctx, unsigned char *buffer,int num);
}

void main(int argc,char *argv[])
	{
	unsigned char buffer[64*256];
	RIPEMD160_CTX ctx;
	unsigned long s1,s2,e1,e2;
	unsigned char k[16];
	unsigned long data[2];
	unsigned char iv[8];
	int i,num=0,numm;
	int j=0;

	if (argc >= 2)
		num=atoi(argv[1]);

	if (num == 0) num=16;
	if (num > 250) num=16;
	numm=num+2;
#if 0
	num*=64;
	numm*=64;
#endif

	for (j=0; j<6; j++)
		{
		for (i=0; i<10; i++) /**/
			{
			ripemd160_block_x86(&ctx,buffer,numm);
			GetTSC(s1);
			ripemd160_block_x86(&ctx,buffer,numm);
			GetTSC(e1);
			GetTSC(s2);
			ripemd160_block_x86(&ctx,buffer,num);
			GetTSC(e2);
			ripemd160_block_x86(&ctx,buffer,num);
			}
		printf("ripemd160 (%d bytes) %d %d (%.2f)\n",num*64,
			e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2);
		}
	}
Loading