~andersk/ubuntu/oneiric/openssl/spurious-reboot

« back to all changes in this revision

Viewing changes to crypto/des/ecb_enc.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2010-12-12 15:37:21 UTC
  • mto: (1.2.1 upstream) (11.2.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 55.
  • Revision ID: james.westby@ubuntu.com-20101212153721-mfw51stum5hwztpd
Tags: upstream-1.0.0c
ImportĀ upstreamĀ versionĀ 1.0.0c

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
 */
58
58
 
59
59
#include "des_locl.h"
60
 
#include "spr.h"
 
60
#include "des_ver.h"
 
61
#include <openssl/opensslv.h>
 
62
#include <openssl/bio.h>
 
63
 
 
64
OPENSSL_GLOBAL const char libdes_version[]="libdes" OPENSSL_VERSION_PTEXT;
 
65
OPENSSL_GLOBAL const char DES_version[]="DES" OPENSSL_VERSION_PTEXT;
 
66
 
 
67
const char *DES_options(void)
 
68
        {
 
69
        static int init=1;
 
70
        static char buf[32];
 
71
 
 
72
        if (init)
 
73
                {
 
74
                const char *ptr,*unroll,*risc,*size;
 
75
 
 
76
#ifdef DES_PTR
 
77
                ptr="ptr";
 
78
#else
 
79
                ptr="idx";
 
80
#endif
 
81
#if defined(DES_RISC1) || defined(DES_RISC2)
 
82
#ifdef DES_RISC1
 
83
                risc="risc1";
 
84
#endif
 
85
#ifdef DES_RISC2
 
86
                risc="risc2";
 
87
#endif
 
88
#else
 
89
                risc="cisc";
 
90
#endif
 
91
#ifdef DES_UNROLL
 
92
                unroll="16";
 
93
#else
 
94
                unroll="2";
 
95
#endif
 
96
                if (sizeof(DES_LONG) != sizeof(long))
 
97
                        size="int";
 
98
                else
 
99
                        size="long";
 
100
                BIO_snprintf(buf,sizeof buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,
 
101
                             size);
 
102
                init=0;
 
103
                }
 
104
        return(buf);
 
105
        }
 
106
                
61
107
 
62
108
void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
63
109
                     DES_key_schedule *ks, int enc)