Fourth phase EVP revision.

Declare ciphers in terms of macros. This reduces
the amount of code and places each block cipher EVP
definition in a single file instead of being spread
over 4 files.
This commit is contained in:
Dr. Stephen Henson 2000-05-30 02:10:57 +00:00
parent 380d3aa6be
commit 57ae2e2428
32 changed files with 318 additions and 3104 deletions

View File

@ -9,6 +9,9 @@
cipher mode. They also all do nothing if the 'key' parameter is NULL and
for CFB and OFB modes they zero ctx->num.
Most of the routines have the same form and so can be declared in terms
of macros.
By shifting this to the top level EVP_CipherInit() it can be removed from
all individual ciphers. If the cipher wants to handle IVs or keys
differently it can set the EVP_CIPH_CUSTOM_IV or EVP_CIPH_ALWAYS_CALL_INIT

View File

@ -23,14 +23,9 @@ APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC= encode.c digest.c evp_enc.c evp_key.c \
e_ecb_d.c e_cbc_d.c e_cfb_d.c e_ofb_d.c \
e_ecb_i.c e_cbc_i.c e_cfb_i.c e_ofb_i.c \
e_ecb_3d.c e_cbc_3d.c e_rc4.c names.c \
e_cfb_3d.c e_ofb_3d.c e_xcbc_d.c \
e_ecb_r2.c e_cbc_r2.c e_cfb_r2.c e_ofb_r2.c \
e_ecb_bf.c e_cbc_bf.c e_cfb_bf.c e_ofb_bf.c \
e_ecb_c.c e_cbc_c.c e_cfb_c.c e_ofb_c.c \
e_ecb_r5.c e_cbc_r5.c e_cfb_r5.c e_ofb_r5.c \
e_des.c e_bf.c e_idea.c e_des3.c \
e_rc4.c names.c \
e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c \
m_null.c m_md2.c m_md5.c m_sha.c m_sha1.c m_dss.c m_dss1.c m_mdc2.c \
m_ripemd.c \
p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c p_dec.c \
@ -39,14 +34,9 @@ LIBSRC= encode.c digest.c evp_enc.c evp_key.c \
evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c
LIBOBJ= encode.o digest.o evp_enc.o evp_key.o \
e_ecb_d.o e_cbc_d.o e_cfb_d.o e_ofb_d.o \
e_ecb_i.o e_cbc_i.o e_cfb_i.o e_ofb_i.o \
e_ecb_3d.o e_cbc_3d.o e_rc4.o names.o \
e_cfb_3d.o e_ofb_3d.o e_xcbc_d.o \
e_ecb_r2.o e_cbc_r2.o e_cfb_r2.o e_ofb_r2.o \
e_ecb_bf.o e_cbc_bf.o e_cfb_bf.o e_ofb_bf.o \
e_ecb_c.o e_cbc_c.o e_cfb_c.o e_ofb_c.o \
e_ecb_r5.o e_cbc_r5.o e_cfb_r5.o e_ofb_r5.o \
e_des.o e_bf.o e_idea.o e_des3.o \
e_rc4.o names.o \
e_xcbc_d.o e_rc2.o e_cast.o e_rc5.o \
m_null.o m_md2.o m_md5.o m_sha.o m_sha1.o m_dss.o m_dss1.o m_mdc2.o \
m_ripemd.o \
p_open.o p_seal.o p_sign.o p_verify.o p_lib.o p_enc.o p_dec.o \
@ -232,321 +222,81 @@ digest.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
digest.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
digest.o: ../../include/openssl/stack.h ../cryptlib.h
e_cbc_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cbc_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cbc_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cbc_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cbc_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cbc_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cbc_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cbc_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cbc_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cbc_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cbc_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cbc_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cbc_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cbc_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cbc_3d.o: ../../include/openssl/stack.h ../cryptlib.h
e_cbc_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cbc_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cbc_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cbc_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cbc_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cbc_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cbc_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cbc_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cbc_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cbc_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cbc_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cbc_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cbc_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cbc_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cbc_bf.o: ../../include/openssl/stack.h ../cryptlib.h
e_cbc_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cbc_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cbc_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cbc_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cbc_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cbc_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cbc_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cbc_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cbc_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cbc_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cbc_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cbc_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cbc_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cbc_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cbc_c.o: ../../include/openssl/stack.h ../cryptlib.h
e_cbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cbc_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cbc_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cbc_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cbc_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cbc_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cbc_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cbc_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cbc_d.o: ../../include/openssl/stack.h ../cryptlib.h
e_cbc_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cbc_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cbc_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cbc_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cbc_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cbc_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cbc_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cbc_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cbc_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cbc_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cbc_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cbc_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cbc_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cbc_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cbc_i.o: ../../include/openssl/stack.h ../cryptlib.h
e_cbc_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cbc_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cbc_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cbc_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cbc_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cbc_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cbc_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cbc_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cbc_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cbc_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cbc_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cbc_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cbc_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cbc_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cbc_r2.o: ../../include/openssl/stack.h ../cryptlib.h
e_cbc_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cbc_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cbc_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cbc_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cbc_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cbc_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cbc_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cbc_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cbc_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cbc_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cbc_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cbc_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cbc_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cbc_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cbc_r5.o: ../../include/openssl/stack.h ../cryptlib.h
e_cfb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cfb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cfb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cfb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cfb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cfb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cfb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cfb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cfb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cfb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cfb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cfb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cfb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cfb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cfb_3d.o: ../../include/openssl/stack.h ../cryptlib.h
e_cfb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cfb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cfb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cfb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cfb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cfb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cfb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cfb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cfb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cfb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cfb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cfb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cfb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cfb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cfb_bf.o: ../../include/openssl/stack.h ../cryptlib.h
e_cfb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cfb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cfb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cfb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cfb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cfb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cfb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cfb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cfb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cfb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cfb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cfb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cfb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cfb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cfb_c.o: ../../include/openssl/stack.h ../cryptlib.h
e_cfb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cfb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cfb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cfb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cfb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cfb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cfb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cfb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cfb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cfb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cfb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cfb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cfb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cfb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cfb_d.o: ../../include/openssl/stack.h ../cryptlib.h
e_cfb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cfb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cfb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cfb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cfb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cfb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cfb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cfb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cfb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cfb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cfb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cfb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cfb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cfb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cfb_i.o: ../../include/openssl/stack.h ../cryptlib.h
e_cfb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cfb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cfb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cfb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cfb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cfb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cfb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cfb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cfb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cfb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cfb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cfb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cfb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cfb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cfb_r2.o: ../../include/openssl/stack.h ../cryptlib.h
e_cfb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cfb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cfb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cfb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cfb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cfb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cfb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cfb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cfb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cfb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cfb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cfb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cfb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cfb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cfb_r5.o: ../../include/openssl/stack.h ../cryptlib.h
e_ecb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ecb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ecb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ecb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ecb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ecb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ecb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ecb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ecb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ecb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ecb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ecb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ecb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ecb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ecb_3d.o: ../../include/openssl/stack.h ../cryptlib.h
e_ecb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ecb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ecb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ecb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ecb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ecb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ecb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ecb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ecb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ecb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ecb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ecb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ecb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ecb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ecb_bf.o: ../../include/openssl/stack.h ../cryptlib.h
e_ecb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ecb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ecb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ecb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ecb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ecb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ecb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ecb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ecb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ecb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ecb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ecb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ecb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ecb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ecb_c.o: ../../include/openssl/stack.h ../cryptlib.h
e_ecb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ecb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ecb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ecb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ecb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ecb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ecb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ecb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ecb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ecb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ecb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ecb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ecb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ecb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ecb_d.o: ../../include/openssl/stack.h ../cryptlib.h
e_ecb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ecb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ecb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ecb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ecb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ecb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ecb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ecb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ecb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ecb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ecb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ecb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ecb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ecb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ecb_i.o: ../../include/openssl/stack.h ../cryptlib.h
e_ecb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ecb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ecb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ecb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ecb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ecb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ecb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ecb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ecb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ecb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ecb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ecb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ecb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ecb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ecb_r2.o: ../../include/openssl/stack.h ../cryptlib.h
e_ecb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ecb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ecb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ecb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ecb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ecb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ecb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ecb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ecb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ecb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ecb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ecb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ecb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ecb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ecb_r5.o: ../../include/openssl/stack.h ../cryptlib.h
e_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_bf.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h
e_cast.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_cast.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_cast.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_cast.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_cast.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_cast.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_cast.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_cast.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_cast.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_cast.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_cast.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_cast.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_cast.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_cast.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_cast.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h
e_des.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_des.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_des.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_des.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_des.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_des.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_des.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_des.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_des.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_des.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_des.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_des.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_des.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_des.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_des.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h
e_des3.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_des3.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_des3.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_des3.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_des3.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_des3.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_des3.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_des3.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_des3.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_des3.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_des3.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_des3.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_des3.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_des3.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_des3.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h
e_idea.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_idea.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_idea.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_idea.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_idea.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_idea.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_idea.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_idea.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_idea.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_idea.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_idea.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_idea.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_idea.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_idea.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_idea.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h
e_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_null.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@ -562,111 +312,21 @@ e_null.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_null.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_null.o: ../../include/openssl/stack.h ../cryptlib.h
e_ofb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ofb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ofb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ofb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ofb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ofb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ofb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ofb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ofb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ofb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ofb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ofb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ofb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ofb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ofb_3d.o: ../../include/openssl/stack.h ../cryptlib.h
e_ofb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ofb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ofb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ofb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ofb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ofb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ofb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ofb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ofb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ofb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ofb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ofb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ofb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ofb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ofb_bf.o: ../../include/openssl/stack.h ../cryptlib.h
e_ofb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ofb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ofb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ofb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ofb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ofb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ofb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ofb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ofb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ofb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ofb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ofb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ofb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ofb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ofb_c.o: ../../include/openssl/stack.h ../cryptlib.h
e_ofb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ofb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ofb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ofb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ofb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ofb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ofb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ofb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ofb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ofb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ofb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ofb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ofb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ofb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ofb_d.o: ../../include/openssl/stack.h ../cryptlib.h
e_ofb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ofb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ofb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ofb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ofb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ofb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ofb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ofb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ofb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ofb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ofb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ofb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ofb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ofb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ofb_i.o: ../../include/openssl/stack.h ../cryptlib.h
e_ofb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ofb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ofb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ofb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ofb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ofb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ofb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ofb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ofb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ofb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ofb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ofb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ofb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ofb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ofb_r2.o: ../../include/openssl/stack.h ../cryptlib.h
e_ofb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_ofb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_ofb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_ofb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_ofb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_ofb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_ofb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_ofb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_ofb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_ofb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_ofb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_ofb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_ofb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_ofb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_ofb_r5.o: ../../include/openssl/stack.h ../cryptlib.h
e_rc2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_rc2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_rc2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_rc2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_rc2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_rc2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_rc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_rc2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_rc2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_rc2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_rc2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_rc2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_rc2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_rc2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_rc2.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h
e_rc4.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_rc4.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_rc4.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@ -682,6 +342,21 @@ e_rc4.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_rc4.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_rc4.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_rc4.o: ../../include/openssl/stack.h ../cryptlib.h
e_rc5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_rc5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_rc5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
e_rc5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
e_rc5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
e_rc5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
e_rc5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
e_rc5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
e_rc5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
e_rc5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_rc5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
e_rc5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
e_rc5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
e_rc5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
e_rc5.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h
e_xcbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_xcbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
e_xcbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@ -726,7 +401,7 @@ evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
evp_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
evp_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
evp_enc.o: ../../include/openssl/stack.h ../cryptlib.h
evp_enc.o: ../../include/openssl/stack.h ../cryptlib.h evp_locl.h
evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
evp_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
evp_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h

View File

@ -1,4 +1,4 @@
/* crypto/evp/e_cbc_bf.c */
/* crypto/evp/e_bf.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -60,47 +60,21 @@
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include "evp_locl.h"
#include <openssl/objects.h>
static int bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
static int bf_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER bfish_cbc_cipher=
{
NID_bf_cbc,
8,EVP_BLOWFISH_KEY_SIZE,8,
EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH,
bf_cbc_init_key,
bf_cbc_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_bf_cbc(void)
{
return(&bfish_cbc_cipher);
}
IMPLEMENT_BLOCK_CIPHER(bf, bf_ks, BF, bf_ks, NID_bf, 8, 16, 8,
0, bf_init_key, NULL,
EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)
static int bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
static int bf_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
BF_set_key(&(ctx->c.bf_ks),EVP_CIPHER_CTX_key_length(ctx),key);
return 1;
}
static int bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
BF_cbc_encrypt(
in,out,(long)inl,
&(ctx->c.bf_ks),&(ctx->iv[0]),
ctx->encrypt);
return 1;
}
#endif

View File

@ -1,4 +1,4 @@
/* crypto/evp/e_cbc_c.c */
/* crypto/evp/e_cast.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -62,46 +62,21 @@
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
#include "evp_locl.h"
static int cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
static int cast_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER cast5_cbc_cipher=
{
NID_cast5_cbc,
8,EVP_CAST5_KEY_SIZE,8,
EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH,
cast_cbc_init_key,
cast_cbc_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_cast5_cbc(void)
{
return(&cast5_cbc_cipher);
}
IMPLEMENT_BLOCK_CIPHER(cast5, cast_ks, CAST, cast_ks,
NID_cast5, 8, EVP_CAST5_KEY_SIZE, 8,
EVP_CIPH_VARIABLE_LENGTH, cast_init_key, NULL,
EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)
static int cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
static int cast_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
CAST_set_key(&(ctx->c.cast_ks),EVP_CIPHER_CTX_key_length(ctx),key);
return 1;
}
static int cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
CAST_cbc_encrypt(
in,out,(long)inl,
&(ctx->c.cast_ks),&(ctx->iv[0]),
ctx->encrypt);
return 1;
}
#endif

View File

@ -1,145 +0,0 @@
/* crypto/evp/e_cbc_3d.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.]
*/
#ifndef NO_DES
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER d_cbc_ede_cipher2=
{
NID_des_ede_cbc,
8,16,8,
EVP_CIPH_CBC_MODE,
des_cbc_ede_init_key,
des_cbc_ede_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
static EVP_CIPHER d_cbc_ede_cipher3=
{
NID_des_ede3_cbc,
8,24,8,
EVP_CIPH_CBC_MODE,
des_cbc_ede3_init_key,
des_cbc_ede_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_des_ede_cbc(void)
{
return(&d_cbc_ede_cipher2);
}
EVP_CIPHER *EVP_des_ede3_cbc(void)
{
return(&d_cbc_ede_cipher3);
}
static int des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
des_cblock *deskey = (des_cblock *)key;
des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
memcpy( (char *)ctx->c.des_ede.ks3,
(char *)ctx->c.des_ede.ks1,
sizeof(ctx->c.des_ede.ks1));
return 1;
}
static int des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
des_cblock *deskey = (des_cblock *)key;
des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3);
return 1;
}
static int des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
des_ede3_cbc_encrypt(in,out,inl, ctx->c.des_ede.ks1,
ctx->c.des_ede.ks2,ctx->c.des_ede.ks3,
(des_cblock *) &(ctx->iv[0]),
ctx->encrypt);
return 1;
}
#endif

View File

@ -1,106 +0,0 @@
/* crypto/evp/e_cbc_d.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.]
*/
#ifndef NO_DES
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER d_cbc_cipher=
{
NID_des_cbc,
8,8,8,
EVP_CIPH_CBC_MODE,
des_cbc_init_key,
des_cbc_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_des_cbc(void)
{
return(&d_cbc_cipher);
}
static int des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
des_cblock *deskey = (des_cblock *)key;
des_set_key_unchecked(deskey,ctx->c.des_ks);
return 1;
}
static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
des_ncbc_encrypt(in,out,inl,ctx->c.des_ks,
(des_cblock *)&(ctx->iv[0]),
ctx->encrypt);
return 1;
}
#endif

View File

@ -1,146 +0,0 @@
/* crypto/evp/e_cfb_3d.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.]
*/
#ifndef NO_DES
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER d_ede_cfb_cipher2=
{
NID_des_ede_cfb64,
1,16,8,
EVP_CIPH_CFB_MODE,
des_ede_cfb_init_key,
des_ede_cfb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
static EVP_CIPHER d_ede3_cfb_cipher3=
{
NID_des_ede3_cfb64,
1,24,8,
EVP_CIPH_CFB_MODE,
des_ede3_cfb_init_key,
des_ede_cfb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_des_ede_cfb(void)
{
return(&d_ede_cfb_cipher2);
}
EVP_CIPHER *EVP_des_ede3_cfb(void)
{
return(&d_ede3_cfb_cipher3);
}
static int des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
des_cblock *deskey = (des_cblock *)key;
des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
memcpy( (char *)ctx->c.des_ede.ks3,
(char *)ctx->c.des_ede.ks1,
sizeof(ctx->c.des_ede.ks1));
return 1;
}
static int des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
des_cblock *deskey = (des_cblock *)key;
des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3);
return 1;
}
static int des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
des_ede3_cfb64_encrypt(in,out,(long)inl,
ctx->c.des_ede.ks1,
ctx->c.des_ede.ks2,
ctx->c.des_ede.ks3,
(des_cblock*)&(ctx->iv[0]),
&ctx->num,ctx->encrypt);
return 1;
}
#endif

View File

@ -1,106 +0,0 @@
/* crypto/evp/e_cfb_bf.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.]
*/
#ifndef NO_BF
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER bfish_cfb_cipher=
{
NID_bf_cfb64,
1,EVP_BLOWFISH_KEY_SIZE,8,
EVP_CIPH_CFB_MODE | EVP_CIPH_VARIABLE_LENGTH,
bf_cfb_init_key,
bf_cfb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_bf_cfb(void)
{
return(&bfish_cfb_cipher);
}
static int bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
BF_set_key(&(ctx->c.bf_ks),EVP_CIPHER_CTX_key_length(ctx),key);
return 1;
}
static int bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
BF_cfb64_encrypt(
in,out,
(long)inl, &(ctx->c.bf_ks),
&(ctx->iv[0]),
&ctx->num,ctx->encrypt);
return 1;
}
#endif

View File

@ -1,107 +0,0 @@
/* crypto/evp/e_cfb_c.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.]
*/
#ifndef NO_CAST
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER cast5_cfb_cipher=
{
NID_cast5_cfb64,
1,EVP_CAST5_KEY_SIZE,8,
EVP_CIPH_CFB_MODE | EVP_CIPH_VARIABLE_LENGTH,
cast_cfb_init_key,
cast_cfb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_cast5_cfb(void)
{
return(&cast5_cfb_cipher);
}
static int cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
CAST_set_key(&(ctx->c.cast_ks),EVP_CIPHER_CTX_key_length(ctx),key);
return 1;
}
static int cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
CAST_cfb64_encrypt(
in,out,
(long)inl, &(ctx->c.cast_ks),
&(ctx->iv[0]),
&ctx->num,ctx->encrypt);
return 1;
}
#endif

View File

@ -1,108 +0,0 @@
/* crypto/evp/e_cfb_d.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 "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
#ifndef NO_DES
static int des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER d_cfb_cipher=
{
NID_des_cfb64,
1,8,8,
EVP_CIPH_CFB_MODE,
des_cfb_init_key,
des_cfb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_des_cfb(void)
{
return(&d_cfb_cipher);
}
static int des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
des_cblock *deskey = (des_cblock *)key;
des_set_key_unchecked(deskey,ctx->c.des_ks);
return 1;
}
static int des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
des_cfb64_encrypt(
in,out,
(long)inl, ctx->c.des_ks,
(des_cblock *)&(ctx->iv[0]),
&ctx->num,ctx->encrypt);
return 1;
}
#endif

View File

@ -1,107 +0,0 @@
/* crypto/evp/e_cfb_i.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.]
*/
#ifndef NO_IDEA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER i_cfb_cipher=
{
NID_idea_cfb64,
1,IDEA_KEY_LENGTH,IDEA_BLOCK,
EVP_CIPH_CFB_MODE,
idea_cfb_init_key,
idea_cfb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_idea_cfb(void)
{
return(&i_cfb_cipher);
}
static int idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
idea_set_encrypt_key(key,&(ctx->c.idea_ks));
return 1;
}
static int idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
idea_cfb64_encrypt(
in,out,(long)inl,
&(ctx->c.idea_ks),&(ctx->iv[0]),
&ctx->num,ctx->encrypt);
return 1;
}
#endif

View File

@ -1,108 +0,0 @@
/* crypto/evp/e_cfb_r2.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.]
*/
#ifndef NO_RC2
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER r2_cfb_cipher=
{
NID_rc2_cfb64,
1,EVP_RC2_KEY_SIZE,8,
EVP_CIPH_CFB_MODE | EVP_CIPH_VARIABLE_LENGTH,
rc2_cfb_init_key,
rc2_cfb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_rc2_cfb(void)
{
return(&r2_cfb_cipher);
}
static int rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx),
key,EVP_CIPHER_key_length(ctx->cipher)*8);
return 1;
}
static int rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
RC2_cfb64_encrypt(
in,out,
(long)inl, &(ctx->c.rc2_ks),
&(ctx->iv[0]),
&ctx->num,ctx->encrypt);
return 1;
}
#endif

View File

@ -1,108 +0,0 @@
/* crypto/evp/e_cfb_r5.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.]
*/
#ifndef NO_RC5
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER rc5_cfb_cipher=
{
NID_rc5_cfb64,
1,EVP_RC5_32_12_16_KEY_SIZE,8,
EVP_CIPH_CFB_MODE,
rc5_32_12_16_cfb_init_key,
rc5_32_12_16_cfb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_rc5_32_12_16_cfb(void)
{
return(&rc5_cfb_cipher);
}
static int rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key,
RC5_12_ROUNDS);
return 1;
}
static int rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
RC5_32_cfb64_encrypt(
in,out,
(long)inl, &(ctx->c.rc5_ks),
&(ctx->iv[0]),
&ctx->num,ctx->encrypt);
return 1;
}
#endif

View File

@ -1,4 +1,4 @@
/* crypto/evp/e_ecb_d.c */
/* crypto/evp/e_des.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -61,32 +61,46 @@
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
#include "evp_locl.h"
static int des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
static int des_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER d_ecb_cipher=
{
NID_des_ecb,
8,8,0,
EVP_CIPH_ECB_MODE,
des_ecb_init_key,
des_ecb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)),
NULL,
NULL,
NULL
};
EVP_CIPHER *EVP_des_ecb(void)
/* Because of various casts and different names can't use IMPLEMENT_BLOCK_CIPHER */
static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
{
return(&d_ecb_cipher);
BLOCK_CIPHER_ecb_loop()
des_ecb_encrypt((des_cblock *)(in + i), (des_cblock *)(out + i), ctx->c.des_ks, ctx->encrypt);
return 1;
}
static int des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
{
des_ofb64_encrypt(in, out, (long)inl, ctx->c.des_ks, (des_cblock *)ctx->iv, &ctx->num);
return 1;
}
static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
{
des_ncbc_encrypt(in, out, (long)inl, ctx->c.des_ks, (des_cblock *)ctx->iv, ctx->encrypt);
return 1;
}
static int des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
{
des_cfb64_encrypt(in, out, (long)inl, ctx->c.des_ks, (des_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
return 1;
}
BLOCK_CIPHER_defs(des, des_ks, NID_des, 8, 8, 8,
0, des_init_key, NULL,
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL)
static int des_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
des_cblock *deskey = (des_cblock *)key;
@ -95,27 +109,4 @@ static int des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
return 1;
}
static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
unsigned int i;
des_cblock *output /* = (des_cblock *)out */;
des_cblock *input /* = (des_cblock *)in */;
if (inl < 8) return 1;
inl-=8;
for (i=0; i<=inl; i+=8)
{
/* Either this ... */
output = (des_cblock *)(out + i);
input = (des_cblock *)(in + i);
des_ecb_encrypt(input,output,ctx->c.des_ks,ctx->encrypt);
/* ... or this. */
/* output++; */
/* input++; */
}
return 1;
}
#endif

View File

@ -1,4 +1,4 @@
/* crypto/evp/e_ecb_3d.c */
/* crypto/evp/e_des3.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -61,53 +61,69 @@
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
#include "evp_locl.h"
static int des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER d_ede_cipher2=
{
NID_des_ede,
8,16,0,
EVP_CIPH_ECB_MODE,
des_ede_init_key,
des_ede_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
NULL,
NULL,
NULL
};
static EVP_CIPHER d_ede3_cipher3=
{
NID_des_ede3,
8,24,0,
EVP_CIPH_ECB_MODE,
des_ede3_init_key,
des_ede_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
NULL,
NULL,
NULL
};
/* Because of various casts and different args can't use IMPLEMENT_BLOCK_CIPHER */
EVP_CIPHER *EVP_des_ede(void)
static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
{
return(&d_ede_cipher2);
BLOCK_CIPHER_ecb_loop()
des_ecb3_encrypt((des_cblock *)(in + i), (des_cblock *)(out + i),
ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3,
ctx->encrypt);
return 1;
}
EVP_CIPHER *EVP_des_ede3(void)
static int des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
{
return(&d_ede3_cipher3);
des_ede3_ofb64_encrypt(in, out, (long)inl,
ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3,
(des_cblock *)ctx->iv, &ctx->num);
return 1;
}
static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
{
des_ede3_cbc_encrypt(in, out, (long)inl,
ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3,
(des_cblock *)ctx->iv, ctx->encrypt);
return 1;
}
static int des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
{
des_ede3_cfb64_encrypt(in, out, (long)inl,
ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3,
(des_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
return 1;
}
#define NID_des_ede_ecb NID_des_ede
BLOCK_CIPHER_defs(des_ede, des_ede, NID_des_ede, 8, 16, 8,
0, des_ede_init_key, NULL,
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL)
#define NID_des_ede3_ecb NID_des_ede3
#define des_ede3_cfb_cipher des_ede_cfb_cipher
#define des_ede3_ofb_cipher des_ede_ofb_cipher
#define des_ede3_cbc_cipher des_ede_cbc_cipher
#define des_ede3_ecb_cipher des_ede_ecb_cipher
BLOCK_CIPHER_defs(des_ede3, des_ede, NID_des_ede3, 8, 24, 8,
0, des_ede3_init_key, NULL,
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL)
static int des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
@ -129,32 +145,17 @@ static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3);
return 1;
}
static int des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
EVP_CIPHER *EVP_des_ede(void)
{
unsigned int i;
des_cblock *output /* = (des_cblock *)out */;
des_cblock *input /* = (des_cblock *)in */;
if (inl < 8) return 1;
inl-=8;
for (i=0; i<=inl; i+=8)
{
output = (des_cblock *)(out + i);
input = (des_cblock *)(in + i);
des_ecb3_encrypt(input,output,
ctx->c.des_ede.ks1,
ctx->c.des_ede.ks2,
ctx->c.des_ede.ks3,
ctx->encrypt);
/* output++; */
/* input++; */
return &des_ede_ecb;
}
return 1;
EVP_CIPHER *EVP_des_ede3(void)
{
return &des_ede3_ecb;
}
#endif

View File

@ -1,112 +0,0 @@
/* crypto/evp/e_ecb_bf.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.]
*/
#ifndef NO_BF
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER bfish_ecb_cipher=
{
NID_bf_ecb,
8,EVP_BLOWFISH_KEY_SIZE,0,
EVP_CIPH_ECB_MODE | EVP_CIPH_VARIABLE_LENGTH,
bf_ecb_init_key,
bf_ecb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)),
NULL,
NULL,
NULL
};
EVP_CIPHER *EVP_bf_ecb(void)
{
return(&bfish_ecb_cipher);
}
static int bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
BF_set_key(&(ctx->c.bf_ks),EVP_CIPHER_CTX_key_length(ctx),key);
return 1;
}
static int bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
unsigned int i;
if (inl < 8) return 1;
inl-=8;
for (i=0; i<=inl; i+=8)
{
BF_ecb_encrypt(
&(in[i]),&(out[i]),
&(ctx->c.bf_ks),ctx->encrypt);
}
return 1;
}
#endif

View File

@ -1,113 +0,0 @@
/* crypto/evp/e_ecb_c.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.]
*/
#ifndef NO_CAST
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER cast5_ecb_cipher=
{
NID_cast5_ecb,
8,EVP_CAST5_KEY_SIZE,0,
EVP_CIPH_ECB_MODE | EVP_CIPH_VARIABLE_LENGTH,
cast_ecb_init_key,
cast_ecb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)),
NULL,
NULL,
NULL
};
EVP_CIPHER *EVP_cast5_ecb(void)
{
return(&cast5_ecb_cipher);
}
static int cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
CAST_set_key(&(ctx->c.cast_ks),EVP_CIPHER_CTX_key_length(ctx),key);
return 1;
}
static int cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
unsigned int i;
if (inl < 8) return 1;
inl-=8;
for (i=0; i<=inl; i+=8)
{
CAST_ecb_encrypt(
&(in[i]),&(out[i]),
&(ctx->c.cast_ks),ctx->encrypt);
}
return 1;
}
#endif

View File

@ -1,122 +0,0 @@
/* crypto/evp/e_ecb_i.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.]
*/
#ifndef NO_IDEA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER i_ecb_cipher=
{
NID_idea_ecb,
8,16,0,
EVP_CIPH_ECB_MODE,
idea_ecb_init_key,
idea_ecb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)),
NULL,
NULL,
NULL
};
EVP_CIPHER *EVP_idea_ecb(void)
{
return(&i_ecb_cipher);
}
static int idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
if (enc)
idea_set_encrypt_key(key,&(ctx->c.idea_ks));
else
{
IDEA_KEY_SCHEDULE tmp;
idea_set_encrypt_key(key,&tmp);
idea_set_decrypt_key(&tmp, &(ctx->c.idea_ks));
memset((unsigned char *)&tmp,0,
sizeof(IDEA_KEY_SCHEDULE));
}
return 1;
}
static int idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
unsigned int i;
if (inl < 8) return 1;
inl-=8;
for (i=0; i<=inl; i+=8)
{
idea_ecb_encrypt(
&(in[i]),&(out[i]),&(ctx->c.idea_ks));
}
return 1;
}
#endif

View File

@ -1,114 +0,0 @@
/* crypto/evp/e_ecb_r2.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.]
*/
#ifndef NO_RC2
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER r2_ecb_cipher=
{
NID_rc2_ecb,
8,EVP_RC2_KEY_SIZE,0,
EVP_CIPH_ECB_MODE | EVP_CIPH_VARIABLE_LENGTH,
rc2_ecb_init_key,
rc2_ecb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
NULL,
NULL,
NULL
};
EVP_CIPHER *EVP_rc2_ecb(void)
{
return(&r2_ecb_cipher);
}
static int rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx),
key,EVP_CIPHER_key_length(ctx->cipher)*8);
return 1;
}
static int rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
unsigned int i;
if (inl < 8) return 1;
inl-=8;
for (i=0; i<=inl; i+=8)
{
RC2_ecb_encrypt(
&(in[i]),&(out[i]),
&(ctx->c.rc2_ks),ctx->encrypt);
}
return 1;
}
#endif

View File

@ -1,114 +0,0 @@
/* crypto/evp/e_ecb_r5.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.]
*/
#ifndef NO_RC5
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER rc5_ecb_cipher=
{
NID_rc5_ecb,
8,EVP_RC5_32_12_16_KEY_SIZE,0,
EVP_CIPH_ECB_MODE,
rc5_32_12_16_ecb_init_key,
rc5_32_12_16_ecb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)),
NULL,
NULL,
NULL
};
EVP_CIPHER *EVP_rc5_32_12_16_ecb(void)
{
return(&rc5_ecb_cipher);
}
static int rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key,
RC5_12_ROUNDS);
return 1;
}
static int rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
unsigned int i;
if (inl < 8) return 1;
inl-=8;
for (i=0; i<=inl; i+=8)
{
RC5_32_ecb_encrypt(
&(in[i]),&(out[i]),
&(ctx->c.rc5_ks),ctx->encrypt);
}
return 1;
}
#endif

View File

@ -1,4 +1,4 @@
/* crypto/evp/e_cbc_i.c */
/* crypto/evp/e_idea.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -62,34 +62,39 @@
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
#include "evp_locl.h"
static int idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
static int idea_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER i_cbc_cipher=
{
NID_idea_cbc,
8,16,8,
EVP_CIPH_CBC_MODE,
idea_cbc_init_key,
idea_cbc_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_idea_cbc(void)
/* NB idea_ecb_encrypt doesn't take an 'encrypt' argument so we treat it as a special
* case
*/
static int idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl)
{
return(&i_cbc_cipher);
BLOCK_CIPHER_ecb_loop()
idea_ecb_encrypt(in + i, out + i, &ctx->c.idea_ks);
return 1;
}
static int idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
/* Can't use IMPLEMENT_BLOCK_CIPHER because idea_ecb_encrypt is different */
BLOCK_CIPHER_func_cbc(idea, idea, idea_ks)
BLOCK_CIPHER_func_ofb(idea, idea, idea_ks)
BLOCK_CIPHER_func_cfb(idea, idea, idea_ks)
BLOCK_CIPHER_defs(idea, idea_ks, NID_idea, 8, 16, 8,
0, idea_init_key, NULL,
EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)
static int idea_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
if(!enc) {
if (EVP_CIPHER_CTX_mode(ctx) == EVP_CIPH_OFB_MODE) enc = 1;
else if (EVP_CIPHER_CTX_mode(ctx) == EVP_CIPH_CFB_MODE) enc = 1;
}
if (enc) idea_set_encrypt_key(key,&(ctx->c.idea_ks));
else
{
@ -103,14 +108,4 @@ static int idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
return 1;
}
static int idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
idea_cbc_encrypt(
in,out,(long)inl,
&(ctx->c.idea_ks),&(ctx->iv[0]),
ctx->encrypt);
return 1;
}
#endif

View File

@ -1,145 +0,0 @@
/* crypto/evp/e_ofb_3d.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.]
*/
#ifndef NO_DES
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER d_ede_ofb_cipher2=
{
NID_des_ede_ofb64,
1,16,8,
EVP_CIPH_OFB_MODE,
des_ede_ofb_init_key,
des_ede_ofb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
static EVP_CIPHER d_ede3_ofb_cipher3=
{
NID_des_ede3_ofb64,
1,24,8,
EVP_CIPH_OFB_MODE,
des_ede3_ofb_init_key,
des_ede_ofb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_des_ede_ofb(void)
{
return(&d_ede_ofb_cipher2);
}
EVP_CIPHER *EVP_des_ede3_ofb(void)
{
return(&d_ede3_ofb_cipher3);
}
static int des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
des_cblock *deskey = (des_cblock *)key;
des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
memcpy( (char *)ctx->c.des_ede.ks3,
(char *)ctx->c.des_ede.ks1,
sizeof(ctx->c.des_ede.ks1));
return 1;
}
static int des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
des_cblock *deskey = (des_cblock *)key;
des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3);
return 1;
}
static int des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
des_ede3_ofb64_encrypt(in,out,inl,ctx->c.des_ede.ks1,
ctx->c.des_ede.ks2, ctx->c.des_ede.ks3,
(des_cblock *)&(ctx->iv[0]),&ctx->num);
return 1;
}
#endif

View File

@ -1,107 +0,0 @@
/* crypto/evp/e_ofb_bf.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.]
*/
#ifndef NO_BF
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER bfish_ofb_cipher=
{
NID_bf_ofb64,
1,EVP_BLOWFISH_KEY_SIZE,8,
EVP_CIPH_OFB_MODE | EVP_CIPH_VARIABLE_LENGTH,
bf_ofb_init_key,
bf_ofb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_bf_ofb(void)
{
return(&bfish_ofb_cipher);
}
static int bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
BF_set_key(&(ctx->c.bf_ks),EVP_CIPHER_CTX_key_length(ctx),key);
return 1;
}
static int bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
BF_ofb64_encrypt(
in,out,
(long)inl, &(ctx->c.bf_ks),
&(ctx->iv[0]),
&ctx->num);
return 1;
}
#endif

View File

@ -1,108 +0,0 @@
/* crypto/evp/e_ofb_c.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.]
*/
#ifndef NO_CAST
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER cast5_ofb_cipher=
{
NID_cast5_ofb64,
1,EVP_CAST5_KEY_SIZE,8,
EVP_CIPH_OFB_MODE | EVP_CIPH_VARIABLE_LENGTH,
cast_ofb_init_key,
cast_ofb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_cast5_ofb(void)
{
return(&cast5_ofb_cipher);
}
static int cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
CAST_set_key(&(ctx->c.cast_ks),EVP_CIPHER_CTX_key_length(ctx),key);
return 1;
}
static int cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
CAST_ofb64_encrypt(
in,out,
(long)inl, &(ctx->c.cast_ks),
&(ctx->iv[0]),
&ctx->num);
return 1;
}
#endif

View File

@ -1,104 +0,0 @@
/* crypto/evp/e_ofb_d.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.]
*/
#ifndef NO_DES
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER d_ofb_cipher=
{
NID_des_ofb64,
1,8,8,
EVP_CIPH_OFB_MODE,
des_ofb_init_key,
des_ofb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_des_ofb(void)
{
return(&d_ofb_cipher);
}
static int des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
des_cblock *deskey = (des_cblock *)key;
des_set_key_unchecked(deskey,ctx->c.des_ks);
return 1;
}
static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
des_ofb64_encrypt(in,out,inl,ctx->c.des_ks,
(des_cblock *)&(ctx->iv[0]),&ctx->num);
return 1;
}
#endif

View File

@ -1,107 +0,0 @@
/* crypto/evp/e_ofb_i.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.]
*/
#ifndef NO_IDEA
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER i_ofb_cipher=
{
NID_idea_ofb64,
1,IDEA_KEY_LENGTH,IDEA_BLOCK,
EVP_CIPH_OFB_MODE,
idea_ofb_init_key,
idea_ofb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_idea_ofb(void)
{
return(&i_ofb_cipher);
}
static int idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
idea_set_encrypt_key(key,&(ctx->c.idea_ks));
return 1;
}
static int idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
idea_ofb64_encrypt(
in,out,(long)inl,
&(ctx->c.idea_ks),&(ctx->iv[0]),
&ctx->num);
return 1;
}
#endif

View File

@ -1,109 +0,0 @@
/* crypto/evp/e_ofb_r2.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.]
*/
#ifndef NO_RC2
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER r2_ofb_cipher=
{
NID_rc2_ofb64,
1,EVP_RC2_KEY_SIZE,8,
EVP_CIPH_OFB_MODE | EVP_CIPH_VARIABLE_LENGTH,
rc2_ofb_init_key,
rc2_ofb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_rc2_ofb(void)
{
return(&r2_ofb_cipher);
}
static int rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx),
key,EVP_CIPHER_key_length(ctx->cipher)*8);
return 1;
}
static int rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
RC2_ofb64_encrypt(
in,out,
(long)inl, &(ctx->c.rc2_ks),
&(ctx->iv[0]),
&ctx->num);
return 1;
}
#endif

View File

@ -1,109 +0,0 @@
/* crypto/evp/e_ofb_r5.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.]
*/
#ifndef NO_RC5
#include <stdio.h>
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
static int rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER rc5_ofb_cipher=
{
NID_rc5_ofb64,
1,EVP_RC5_32_12_16_KEY_SIZE,8,
EVP_CIPH_OFB_MODE,
rc5_32_12_16_ofb_init_key,
rc5_32_12_16_ofb_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)),
EVP_CIPHER_set_asn1_iv,
EVP_CIPHER_get_asn1_iv,
NULL
};
EVP_CIPHER *EVP_rc5_32_12_16_ofb(void)
{
return(&rc5_ofb_cipher);
}
static int rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key,
RC5_12_ROUNDS);
return 1;
}
static int rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
RC5_32_ofb64_encrypt(
in,out,
(long)inl, &(ctx->c.rc5_ks),
&(ctx->iv[0]),
&ctx->num);
return 1;
}
#endif

View File

@ -1,4 +1,4 @@
/* crypto/evp/e_cbc_r2.c */
/* crypto/evp/e_rc2.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -62,47 +62,38 @@
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
#include "evp_locl.h"
static int rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
static int rc2_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
static int rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static int rc2_meth_to_magic(const EVP_CIPHER *e);
static EVP_CIPHER *rc2_magic_to_meth(int i);
static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
IMPLEMENT_BLOCK_CIPHER(rc2, rc2.ks, RC2, rc2, NID_rc2,
8,
EVP_RC2_KEY_SIZE, 8,
EVP_CIPH_VARIABLE_LENGTH, rc2_init_key, NULL,
rc2_set_asn1_type_and_iv, rc2_get_asn1_type_and_iv, NULL)
#define RC2_40_MAGIC 0xa0
#define RC2_64_MAGIC 0x78
#define RC2_128_MAGIC 0x3a
static EVP_CIPHER r2_cbc_cipher=
{
NID_rc2_cbc,
8,EVP_RC2_KEY_SIZE,8,
EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH,
rc2_cbc_init_key,
rc2_cbc_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
rc2_set_asn1_type_and_iv,
rc2_get_asn1_type_and_iv,
NULL
};
static EVP_CIPHER r2_64_cbc_cipher=
{
NID_rc2_64_cbc,
8,8 /* 64 bit */,8,
EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH,
rc2_cbc_init_key,
rc2_init_key,
rc2_cbc_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2)),
rc2_set_asn1_type_and_iv,
rc2_get_asn1_type_and_iv,
NULL,
NULL
};
@ -111,21 +102,17 @@ static EVP_CIPHER r2_40_cbc_cipher=
NID_rc2_40_cbc,
8,5 /* 40 bit */,8,
EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH,
rc2_cbc_init_key,
rc2_init_key,
rc2_cbc_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2)),
rc2_set_asn1_type_and_iv,
rc2_get_asn1_type_and_iv,
NULL,
NULL
};
EVP_CIPHER *EVP_rc2_cbc(void)
{
return(&r2_cbc_cipher);
}
EVP_CIPHER *EVP_rc2_64_cbc(void)
{
return(&r2_64_cbc_cipher);
@ -136,24 +123,14 @@ EVP_CIPHER *EVP_rc2_40_cbc(void)
return(&r2_40_cbc_cipher);
}
static int rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
static int rc2_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx),
RC2_set_key(&(ctx->c.rc2.ks),EVP_CIPHER_CTX_key_length(ctx),
key,EVP_CIPHER_key_length(ctx->cipher)*8);
return 1;
}
static int rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
RC2_cbc_encrypt(
in,out,(long)inl,
&(ctx->c.rc2_ks),&(ctx->iv[0]),
ctx->encrypt);
return 1;
}
static int rc2_meth_to_magic(const EVP_CIPHER *e)
{
int i;
@ -198,7 +175,7 @@ static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
{
EVP_CIPHER_CTX_cipher(c)=e;
EVP_CIPHER_CTX_set_key_length(c, EVP_CIPHER_key_length(c));
rc2_cbc_init_key(c,NULL,NULL,1);
rc2_init_key(c,NULL,NULL,1);
}
}
return(i);

View File

@ -1,4 +1,4 @@
/* crypto/evp/e_cbc_r5.c */
/* crypto/evp/e_rc5.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -62,9 +62,17 @@
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/objects.h>
#include "evp_locl.h"
static int r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
IMPLEMENT_BLOCK_CIPHER(rc5_32_12_16, rc5.ks, RC5_32, rc5, NID_rc5,
8, EVP_RC5_32_12_16_KEY_SIZE, 8,
0, r_32_12_16_init_key, NULL,
NULL, NULL, NULL)
#if 0
static int r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER rc5_32_12_16_cbc_cipher=
@ -76,7 +84,7 @@ static EVP_CIPHER rc5_32_12_16_cbc_cipher=
r_32_12_16_cbc_cipher,
NULL,
sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)),
sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5)),
NULL,
NULL,
NULL
@ -86,23 +94,25 @@ EVP_CIPHER *EVP_rc5_32_12_16_cbc(void)
{
return(&rc5_32_12_16_cbc_cipher);
}
#endif
static int r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,
RC5_32_set_key(&(ctx->c.rc5.ks),EVP_RC5_32_12_16_KEY_SIZE,
key,RC5_12_ROUNDS);
return 1;
}
#if 0
static int r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
RC5_32_cbc_encrypt(
in,out,(long)inl,
&(ctx->c.rc5_ks),&(ctx->iv[0]),
&(ctx->c.rc5.ks),&(ctx->iv[0]),
ctx->encrypt);
return 1;
}
#endif
#endif

View File

@ -354,7 +354,19 @@ struct evp_cipher_st
#define EVP_CIPH_CUSTOM_IV 0x10
/* Set if the cipher's init() function should be called if key is NULL */
#define EVP_CIPH_ALWAYS_CALL_INIT 0x20
/* Call ctrl() to init cipher parameters */
#define EVP_CIPH_CTRL_INIT 0x40
/* Don't use standard key length function */
#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80
/* ctrl() values */
#define EVP_CTRL_INIT 0x0
#define EVP_CTRL_SET_KEY_LENGTH 0x1
#define EVP_CTRL_GET_RC2_KEY_BITS 0x2
#define EVP_CTRL_SET_RC2_KEY_BITS 0x3
#define EVP_CTRL_GET_RC5_ROUNDS 0x4
#define EVP_CTRL_SET_RC5_ROUNDS 0x5
typedef struct evp_cipher_info_st
{
@ -402,10 +414,16 @@ struct evp_cipher_ctx_st
IDEA_KEY_SCHEDULE idea_ks;/* key schedule */
#endif
#ifndef NO_RC2
RC2_KEY rc2_ks;/* key schedule */
struct {
int key_bits; /* effective key bits */
RC2_KEY ks;/* key schedule */
} rc2;
#endif
#ifndef NO_RC5
RC5_32_KEY rc5_ks;/* key schedule */
struct {
int rounds; /* number of rounds */
RC5_32_KEY ks;/* key schedule */
} rc5;
#endif
#ifndef NO_BF
BF_KEY bf_ks;/* key schedule */

View File

@ -60,6 +60,7 @@
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/err.h>
#include "evp_locl.h"
const char *EVP_version="EVP" OPENSSL_VERSION_PTEXT;
@ -309,4 +310,3 @@ int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen)
EVPerr(EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH,EVP_R_INVALID_KEY_LENGTH);
return 0;
}