├── ACKNOWLEDGMENTS ├── Android.mk ├── AndroidManifest.xml ├── MODULE_LICENSE_BSD_LIKE ├── NOTICE ├── README.ANDROID.txt ├── README.md ├── android-config.mk ├── apps ├── Android.mk ├── CA.com ├── CA.pl ├── CA.pl.in ├── CA.sh ├── Makefile ├── app_rand.c ├── apps.c ├── apps.h ├── asn1pars.c ├── ca-cert.srl ├── ca-key.pem ├── ca-req.pem ├── ca.c ├── cert.pem ├── ciphers.c ├── client.pem ├── cms.c ├── crl.c ├── crl2p7.c ├── dgst.c ├── dh.c ├── dh1024.pem ├── dh2048.pem ├── dh4096.pem ├── dh512.pem ├── dhparam.c ├── dsa-ca.pem ├── dsa-pca.pem ├── dsa.c ├── dsa1024.pem ├── dsa512.pem ├── dsap.pem ├── dsaparam.c ├── ec.c ├── ecparam.c ├── enc.c ├── engine.c ├── errstr.c ├── gendh.c ├── gendsa.c ├── genpkey.c ├── genrsa.c ├── install-apps.com ├── makeapps.com ├── md4.c ├── nseq.c ├── ocsp.c ├── oid.cnf ├── openssl-vms.cnf ├── openssl.c ├── openssl.cnf ├── passwd.c ├── pca-cert.srl ├── pca-key.pem ├── pca-req.pem ├── pkcs12.c ├── pkcs7.c ├── pkcs8.c ├── pkey.c ├── pkeyparam.c ├── pkeyutl.c ├── prime.c ├── privkey.pem ├── progs.h ├── progs.pl ├── rand.c ├── req.c ├── req.pem ├── rsa.c ├── rsa8192.pem ├── rsautl.c ├── s1024key.pem ├── s1024req.pem ├── s512-key.pem ├── s512-req.pem ├── s_apps.h ├── s_cb.c ├── s_client.c ├── s_server.c ├── s_socket.c ├── s_time.c ├── server.pem ├── server.srl ├── server2.pem ├── sess_id.c ├── smime.c ├── speed.c ├── spkac.c ├── srp.c ├── testCA.pem ├── testdsa.h ├── testrsa.h ├── timeouts.h ├── ts.c ├── tsget ├── verify.c ├── version.c ├── vms_decc_init.c ├── winrand.c └── x509.c ├── crypto ├── Android.mk ├── LPdir_nyi.c ├── LPdir_unix.c ├── LPdir_vms.c ├── LPdir_win.c ├── LPdir_win32.c ├── LPdir_wince.c ├── Makefile ├── aes │ ├── Makefile │ ├── README │ ├── aes.h │ ├── aes_cbc.c │ ├── aes_cfb.c │ ├── aes_core.c │ ├── aes_ctr.c │ ├── aes_ecb.c │ ├── aes_ige.c │ ├── aes_locl.h │ ├── aes_misc.c │ ├── aes_ofb.c │ ├── aes_wrap.c │ ├── aes_x86core.c │ └── asm │ │ ├── aes-586.pl │ │ ├── aes-armv4.S │ │ ├── aes-armv4.pl │ │ ├── aes-ia64.S │ │ ├── aes-mips.pl │ │ ├── aes-parisc.pl │ │ ├── aes-ppc.pl │ │ ├── aes-s390x.pl │ │ ├── aes-sparcv9.pl │ │ ├── aes-x86_64.pl │ │ ├── aesni-sha1-x86_64.pl │ │ ├── aesni-x86.pl │ │ ├── aesni-x86_64.pl │ │ ├── bsaes-x86_64.pl │ │ ├── vpaes-x86.pl │ │ └── vpaes-x86_64.pl ├── alphacpuid.pl ├── arm_arch.h ├── armcap.c ├── armv4cpuid.S ├── asn1 │ ├── Makefile │ ├── a_bitstr.c │ ├── a_bool.c │ ├── a_bytes.c │ ├── a_d2i_fp.c │ ├── a_digest.c │ ├── a_dup.c │ ├── a_enum.c │ ├── a_gentm.c │ ├── a_i2d_fp.c │ ├── a_int.c │ ├── a_mbstr.c │ ├── a_object.c │ ├── a_octet.c │ ├── a_print.c │ ├── a_set.c │ ├── a_sign.c │ ├── a_strex.c │ ├── a_strnid.c │ ├── a_time.c │ ├── a_type.c │ ├── a_utctm.c │ ├── a_utf8.c │ ├── a_verify.c │ ├── ameth_lib.c │ ├── asn1.h │ ├── asn1_err.c │ ├── asn1_gen.c │ ├── asn1_lib.c │ ├── asn1_locl.h │ ├── asn1_mac.h │ ├── asn1_par.c │ ├── asn1t.h │ ├── asn_mime.c │ ├── asn_moid.c │ ├── asn_pack.c │ ├── bio_asn1.c │ ├── bio_ndef.c │ ├── charmap.h │ ├── charmap.pl │ ├── d2i_pr.c │ ├── d2i_pu.c │ ├── evp_asn1.c │ ├── f_enum.c │ ├── f_int.c │ ├── f_string.c │ ├── i2d_pr.c │ ├── i2d_pu.c │ ├── n_pkey.c │ ├── nsseq.c │ ├── p5_pbe.c │ ├── p5_pbev2.c │ ├── p8_pkey.c │ ├── t_bitst.c │ ├── t_crl.c │ ├── t_pkey.c │ ├── t_req.c │ ├── t_spki.c │ ├── t_x509.c │ ├── t_x509a.c │ ├── tasn_dec.c │ ├── tasn_enc.c │ ├── tasn_fre.c │ ├── tasn_new.c │ ├── tasn_prn.c │ ├── tasn_typ.c │ ├── tasn_utl.c │ ├── x_algor.c │ ├── x_attrib.c │ ├── x_bignum.c │ ├── x_crl.c │ ├── x_exten.c │ ├── x_info.c │ ├── x_long.c │ ├── x_name.c │ ├── x_nx509.c │ ├── x_pkey.c │ ├── x_pubkey.c │ ├── x_req.c │ ├── x_sig.c │ ├── x_spki.c │ ├── x_val.c │ ├── x_x509.c │ └── x_x509a.c ├── bf │ ├── COPYRIGHT │ ├── INSTALL │ ├── Makefile │ ├── README │ ├── VERSION │ ├── asm │ │ ├── bf-586.pl │ │ ├── bf-686.pl │ │ └── readme │ ├── bf_cbc.c │ ├── bf_cfb64.c │ ├── bf_ecb.c │ ├── bf_enc.c │ ├── bf_locl.h │ ├── bf_ofb64.c │ ├── bf_opts.c │ ├── bf_pi.h │ ├── bf_skey.c │ ├── bfs.cpp │ ├── bfspeed.c │ ├── bftest.c │ └── blowfish.h ├── bio │ ├── Makefile │ ├── b_dump.c │ ├── b_print.c │ ├── b_sock.c │ ├── bf_buff.c │ ├── bf_lbuf.c │ ├── bf_nbio.c │ ├── bf_null.c │ ├── bio.h │ ├── bio_cb.c │ ├── bio_err.c │ ├── bio_lcl.h │ ├── bio_lib.c │ ├── bss_acpt.c │ ├── bss_bio.c │ ├── bss_conn.c │ ├── bss_dgram.c │ ├── bss_fd.c │ ├── bss_file.c │ ├── bss_log.c │ ├── bss_mem.c │ ├── bss_null.c │ ├── bss_rtcp.c │ └── bss_sock.c ├── bn │ ├── Makefile │ ├── asm │ │ ├── README │ │ ├── alpha-mont.pl │ │ ├── armv4-gf2m.pl │ │ ├── armv4-mont.S │ │ ├── armv4-mont.pl │ │ ├── bn-586.pl │ │ ├── co-586.pl │ │ ├── ia64-mont.pl │ │ ├── ia64.S │ │ ├── mips-mont.pl │ │ ├── mips.pl │ │ ├── mips3-mont.pl │ │ ├── mips3.s │ │ ├── modexp512-x86_64.pl │ │ ├── pa-risc2.s │ │ ├── pa-risc2W.s │ │ ├── parisc-mont.pl │ │ ├── ppc-mont.pl │ │ ├── ppc.pl │ │ ├── ppc64-mont.pl │ │ ├── s390x-gf2m.pl │ │ ├── s390x-mont.pl │ │ ├── s390x.S │ │ ├── sparcv8.S │ │ ├── sparcv8plus.S │ │ ├── sparcv9-mont.pl │ │ ├── sparcv9a-mont.pl │ │ ├── via-mont.pl │ │ ├── vms.mar │ │ ├── x86-gf2m.pl │ │ ├── x86-mont.pl │ │ ├── x86.pl │ │ ├── x86 │ │ │ ├── add.pl │ │ │ ├── comba.pl │ │ │ ├── div.pl │ │ │ ├── f │ │ │ ├── mul.pl │ │ │ ├── mul_add.pl │ │ │ ├── sqr.pl │ │ │ └── sub.pl │ │ ├── x86_64-gcc.c │ │ ├── x86_64-gf2m.pl │ │ ├── x86_64-mont.pl │ │ └── x86_64-mont5.pl │ ├── bn.h │ ├── bn.mul │ ├── bn_add.c │ ├── bn_asm.c │ ├── bn_blind.c │ ├── bn_const.c │ ├── bn_ctx.c │ ├── bn_depr.c │ ├── bn_div.c │ ├── bn_err.c │ ├── bn_exp.c │ ├── bn_exp2.c │ ├── bn_gcd.c │ ├── bn_gf2m.c │ ├── bn_kron.c │ ├── bn_lcl.h │ ├── bn_lib.c │ ├── bn_mod.c │ ├── bn_mont.c │ ├── bn_mpi.c │ ├── bn_mul.c │ ├── bn_nist.c │ ├── bn_prime.c │ ├── bn_prime.h │ ├── bn_prime.pl │ ├── bn_print.c │ ├── bn_rand.c │ ├── bn_recp.c │ ├── bn_shift.c │ ├── bn_sqr.c │ ├── bn_sqrt.c │ ├── bn_word.c │ ├── bn_x931p.c │ ├── bnspeed.c │ ├── bntest.c │ ├── divtest.c │ ├── exp.c │ ├── expspeed.c │ ├── exptest.c │ ├── todo │ └── vms-helper.c ├── buffer │ ├── Makefile │ ├── buf_err.c │ ├── buf_str.c │ ├── buffer.c │ └── buffer.h ├── camellia │ ├── Makefile │ ├── asm │ │ ├── cmll-x86.pl │ │ └── cmll-x86_64.pl │ ├── camellia.c │ ├── camellia.h │ ├── cmll_cbc.c │ ├── cmll_cfb.c │ ├── cmll_ctr.c │ ├── cmll_ecb.c │ ├── cmll_locl.h │ ├── cmll_misc.c │ ├── cmll_ofb.c │ └── cmll_utl.c ├── cmac │ ├── Makefile │ ├── cm_ameth.c │ ├── cm_pmeth.c │ ├── cmac.c │ └── cmac.h ├── comp │ ├── Makefile │ ├── c_rle.c │ ├── c_zlib.c │ ├── comp.h │ ├── comp_err.c │ └── comp_lib.c ├── conf │ ├── Makefile │ ├── README │ ├── cnf_save.c │ ├── conf.h │ ├── conf_api.c │ ├── conf_api.h │ ├── conf_def.c │ ├── conf_def.h │ ├── conf_err.c │ ├── conf_lib.c │ ├── conf_mall.c │ ├── conf_mod.c │ ├── conf_sap.c │ ├── keysets.pl │ ├── ssleay.cnf │ └── test.c ├── cpt_err.c ├── cryptlib.c ├── cryptlib.h ├── crypto-lib.com ├── crypto.h ├── cversion.c ├── des │ ├── COPYRIGHT │ ├── DES.pm │ ├── DES.xs │ ├── FILES0 │ ├── INSTALL │ ├── Imakefile │ ├── KERBEROS │ ├── Makefile │ ├── README │ ├── VERSION │ ├── asm │ │ ├── crypt586.pl │ │ ├── des-586.pl │ │ ├── des_enc.m4 │ │ ├── desboth.pl │ │ └── readme │ ├── cbc3_enc.c │ ├── cbc_cksm.c │ ├── cbc_enc.c │ ├── cfb64ede.c │ ├── cfb64enc.c │ ├── cfb_enc.c │ ├── des-lib.com │ ├── des.c │ ├── des.h │ ├── des.pod │ ├── des3s.cpp │ ├── des_enc.c │ ├── des_locl.h │ ├── des_old.c │ ├── des_old.h │ ├── des_old2.c │ ├── des_opts.c │ ├── des_ver.h │ ├── dess.cpp │ ├── destest.c │ ├── ecb3_enc.c │ ├── ecb_enc.c │ ├── ede_cbcm_enc.c │ ├── enc_read.c │ ├── enc_writ.c │ ├── fcrypt.c │ ├── fcrypt_b.c │ ├── makefile.bc │ ├── ncbc_enc.c │ ├── ofb64ede.c │ ├── ofb64enc.c │ ├── ofb_enc.c │ ├── options.txt │ ├── pcbc_enc.c │ ├── qud_cksm.c │ ├── rand_key.c │ ├── read2pwd.c │ ├── read_pwd.c │ ├── rpc_des.h │ ├── rpc_enc.c │ ├── rpw.c │ ├── set_key.c │ ├── speed.c │ ├── spr.h │ ├── str2key.c │ ├── t │ │ └── test │ ├── times │ │ ├── 486-50.sol │ │ ├── 586-100.lnx │ │ ├── 686-200.fre │ │ ├── aix.cc │ │ ├── alpha.cc │ │ ├── hpux.cc │ │ ├── sparc.gcc │ │ └── usparc.cc │ ├── typemap │ └── xcbc_enc.c ├── dh │ ├── Makefile │ ├── dh.h │ ├── dh1024.pem │ ├── dh192.pem │ ├── dh2048.pem │ ├── dh4096.pem │ ├── dh512.pem │ ├── dh_ameth.c │ ├── dh_asn1.c │ ├── dh_check.c │ ├── dh_depr.c │ ├── dh_err.c │ ├── dh_gen.c │ ├── dh_key.c │ ├── dh_lib.c │ ├── dh_pmeth.c │ ├── dh_prn.c │ ├── dhtest.c │ ├── example │ ├── generate │ ├── p1024.c │ ├── p192.c │ └── p512.c ├── dsa │ ├── Makefile │ ├── README │ ├── dsa.h │ ├── dsa_ameth.c │ ├── dsa_asn1.c │ ├── dsa_depr.c │ ├── dsa_err.c │ ├── dsa_gen.c │ ├── dsa_key.c │ ├── dsa_lib.c │ ├── dsa_locl.h │ ├── dsa_ossl.c │ ├── dsa_pmeth.c │ ├── dsa_prn.c │ ├── dsa_sign.c │ ├── dsa_vrf.c │ ├── dsagen.c │ ├── dsatest.c │ └── fips186a.txt ├── dso │ ├── Makefile │ ├── README │ ├── dso.h │ ├── dso_beos.c │ ├── dso_dl.c │ ├── dso_dlfcn.c │ ├── dso_err.c │ ├── dso_lib.c │ ├── dso_null.c │ ├── dso_openssl.c │ ├── dso_vms.c │ └── dso_win32.c ├── ebcdic.c ├── ebcdic.h ├── ec │ ├── Makefile │ ├── ec.h │ ├── ec2_mult.c │ ├── ec2_oct.c │ ├── ec2_smpl.c │ ├── ec_ameth.c │ ├── ec_asn1.c │ ├── ec_check.c │ ├── ec_curve.c │ ├── ec_cvt.c │ ├── ec_err.c │ ├── ec_key.c │ ├── ec_lcl.h │ ├── ec_lib.c │ ├── ec_mult.c │ ├── ec_oct.c │ ├── ec_pmeth.c │ ├── ec_print.c │ ├── eck_prn.c │ ├── ecp_mont.c │ ├── ecp_nist.c │ ├── ecp_nistp224.c │ ├── ecp_nistp256.c │ ├── ecp_nistp521.c │ ├── ecp_nistputil.c │ ├── ecp_oct.c │ ├── ecp_smpl.c │ └── ectest.c ├── ecdh │ ├── Makefile │ ├── ecdh.h │ ├── ecdhtest.c │ ├── ech_err.c │ ├── ech_key.c │ ├── ech_lib.c │ ├── ech_locl.h │ └── ech_ossl.c ├── ecdsa │ ├── Makefile │ ├── ecdsa.h │ ├── ecdsatest.c │ ├── ecs_asn1.c │ ├── ecs_err.c │ ├── ecs_lib.c │ ├── ecs_locl.h │ ├── ecs_ossl.c │ ├── ecs_sign.c │ └── ecs_vrf.c ├── engine │ ├── Makefile │ ├── README │ ├── eng_all.c │ ├── eng_cnf.c │ ├── eng_cryptodev.c │ ├── eng_ctrl.c │ ├── eng_dyn.c │ ├── eng_err.c │ ├── eng_fat.c │ ├── eng_init.c │ ├── eng_int.h │ ├── eng_lib.c │ ├── eng_list.c │ ├── eng_openssl.c │ ├── eng_pkey.c │ ├── eng_rdrand.c │ ├── eng_rsax.c │ ├── eng_table.c │ ├── engine.h │ ├── enginetest.c │ ├── tb_asnmth.c │ ├── tb_cipher.c │ ├── tb_dh.c │ ├── tb_digest.c │ ├── tb_dsa.c │ ├── tb_ecdh.c │ ├── tb_ecdsa.c │ ├── tb_pkmeth.c │ ├── tb_rand.c │ ├── tb_rsa.c │ └── tb_store.c ├── err │ ├── Makefile │ ├── err.c │ ├── err.h │ ├── err_all.c │ ├── err_prn.c │ └── openssl.ec ├── evp │ ├── Makefile │ ├── bio_b64.c │ ├── bio_enc.c │ ├── bio_md.c │ ├── bio_ok.c │ ├── c_all.c │ ├── c_allc.c │ ├── c_alld.c │ ├── digest.c │ ├── e_aes.c │ ├── e_aes_cbc_hmac_sha1.c │ ├── e_bf.c │ ├── e_camellia.c │ ├── e_cast.c │ ├── e_des.c │ ├── e_des3.c │ ├── e_dsa.c │ ├── e_idea.c │ ├── e_null.c │ ├── e_old.c │ ├── e_rc2.c │ ├── e_rc4.c │ ├── e_rc4_hmac_md5.c │ ├── e_rc5.c │ ├── e_seed.c │ ├── e_xcbc_d.c │ ├── encode.c │ ├── evp.h │ ├── evp_acnf.c │ ├── evp_enc.c │ ├── evp_err.c │ ├── evp_fips.c │ ├── evp_key.c │ ├── evp_lib.c │ ├── evp_locl.h │ ├── evp_pbe.c │ ├── evp_pkey.c │ ├── evp_test.c │ ├── evptests.txt │ ├── m_dss.c │ ├── m_dss1.c │ ├── m_ecdsa.c │ ├── m_md2.c │ ├── m_md4.c │ ├── m_md5.c │ ├── m_mdc2.c │ ├── m_null.c │ ├── m_ripemd.c │ ├── m_sha.c │ ├── m_sha1.c │ ├── m_sigver.c │ ├── m_wp.c │ ├── names.c │ ├── openbsd_hw.c │ ├── p5_crpt.c │ ├── p5_crpt2.c │ ├── p_dec.c │ ├── p_enc.c │ ├── p_lib.c │ ├── p_open.c │ ├── p_seal.c │ ├── p_sign.c │ ├── p_verify.c │ ├── pmeth_fn.c │ ├── pmeth_gn.c │ └── pmeth_lib.c ├── ex_data.c ├── fips_err.h ├── fips_ers.c ├── hmac │ ├── Makefile │ ├── hm_ameth.c │ ├── hm_pmeth.c │ ├── hmac.c │ ├── hmac.h │ └── hmactest.c ├── ia64cpuid.S ├── install-crypto.com ├── jpake │ ├── Makefile │ ├── jpake.c │ ├── jpake.h │ ├── jpake_err.c │ └── jpaketest.c ├── krb5 │ ├── Makefile │ ├── krb5_asn.c │ └── krb5_asn.h ├── lhash │ ├── Makefile │ ├── lh_stats.c │ ├── lh_test.c │ ├── lhash.c │ ├── lhash.h │ └── num.pl ├── md32_common.h ├── md4 │ ├── Makefile │ ├── md4.c │ ├── md4.h │ ├── md4_dgst.c │ ├── md4_locl.h │ ├── md4_one.c │ ├── md4s.cpp │ └── md4test.c ├── md5 │ ├── Makefile │ ├── asm │ │ ├── md5-586.pl │ │ ├── md5-ia64.S │ │ └── md5-x86_64.pl │ ├── md5.c │ ├── md5.h │ ├── md5_dgst.c │ ├── md5_locl.h │ ├── md5_one.c │ ├── md5s.cpp │ └── md5test.c ├── mdc2 │ ├── Makefile │ ├── mdc2.h │ ├── mdc2_one.c │ ├── mdc2dgst.c │ └── mdc2test.c ├── mem.c ├── mem_clr.c ├── mem_dbg.c ├── modes │ ├── Makefile │ ├── asm │ │ ├── ghash-alpha.pl │ │ ├── ghash-armv4.pl │ │ ├── ghash-ia64.pl │ │ ├── ghash-parisc.pl │ │ ├── ghash-s390x.pl │ │ ├── ghash-sparcv9.pl │ │ ├── ghash-x86.pl │ │ └── ghash-x86_64.pl │ ├── cbc128.c │ ├── ccm128.c │ ├── cfb128.c │ ├── ctr128.c │ ├── cts128.c │ ├── gcm128.c │ ├── modes.h │ ├── modes_lcl.h │ ├── ofb128.c │ └── xts128.c ├── o_dir.c ├── o_dir.h ├── o_dir_test.c ├── o_fips.c ├── o_init.c ├── o_str.c ├── o_str.h ├── o_time.c ├── o_time.h ├── objects │ ├── Makefile │ ├── o_names.c │ ├── obj_dat.c │ ├── obj_dat.h │ ├── obj_dat.pl │ ├── obj_err.c │ ├── obj_lib.c │ ├── obj_mac.h │ ├── obj_mac.num │ ├── obj_xref.c │ ├── obj_xref.h │ ├── obj_xref.txt │ ├── objects.README │ ├── objects.h │ ├── objects.pl │ ├── objects.txt │ └── objxref.pl ├── ocsp │ ├── Makefile │ ├── ocsp.h │ ├── ocsp_asn.c │ ├── ocsp_cl.c │ ├── ocsp_err.c │ ├── ocsp_ext.c │ ├── ocsp_ht.c │ ├── ocsp_lib.c │ ├── ocsp_prn.c │ ├── ocsp_srv.c │ └── ocsp_vfy.c ├── opensslconf.h ├── opensslconf.h.in ├── opensslv.h ├── ossl_typ.h ├── pariscid.pl ├── pem │ ├── Makefile │ ├── message │ ├── pem.h │ ├── pem2.h │ ├── pem_all.c │ ├── pem_err.c │ ├── pem_info.c │ ├── pem_lib.c │ ├── pem_oth.c │ ├── pem_pk8.c │ ├── pem_pkey.c │ ├── pem_seal.c │ ├── pem_sign.c │ ├── pem_x509.c │ ├── pem_xaux.c │ ├── pkcs7.lis │ └── pvkfmt.c ├── perlasm │ ├── cbc.pl │ ├── ppc-xlate.pl │ ├── readme │ ├── x86_64-xlate.pl │ ├── x86asm.pl │ ├── x86gas.pl │ ├── x86masm.pl │ └── x86nasm.pl ├── pkcs12 │ ├── Makefile │ ├── p12_add.c │ ├── p12_asn.c │ ├── p12_attr.c │ ├── p12_crpt.c │ ├── p12_crt.c │ ├── p12_decr.c │ ├── p12_init.c │ ├── p12_key.c │ ├── p12_kiss.c │ ├── p12_mutl.c │ ├── p12_npas.c │ ├── p12_p8d.c │ ├── p12_p8e.c │ ├── p12_utl.c │ ├── pk12err.c │ └── pkcs12.h ├── pkcs7 │ ├── Makefile │ ├── bio_ber.c │ ├── bio_pk7.c │ ├── dec.c │ ├── des.pem │ ├── doc │ ├── enc.c │ ├── es1.pem │ ├── example.c │ ├── example.h │ ├── info.pem │ ├── infokey.pem │ ├── p7 │ │ ├── a1 │ │ ├── a2 │ │ ├── cert.p7c │ │ ├── smime.p7m │ │ └── smime.p7s │ ├── pk7_asn1.c │ ├── pk7_attr.c │ ├── pk7_dgst.c │ ├── pk7_doit.c │ ├── pk7_enc.c │ ├── pk7_lib.c │ ├── pk7_mime.c │ ├── pk7_smime.c │ ├── pkcs7.h │ ├── pkcs7err.c │ ├── server.pem │ ├── sign.c │ ├── t │ │ ├── 3des.pem │ │ ├── 3dess.pem │ │ ├── c.pem │ │ ├── ff │ │ ├── msie-e │ │ ├── msie-e.pem │ │ ├── msie-enc-01 │ │ ├── msie-enc-01.pem │ │ ├── msie-enc-02 │ │ ├── msie-enc-02.pem │ │ ├── msie-s-a-e │ │ ├── msie-s-a-e.pem │ │ ├── nav-smime │ │ ├── s.pem │ │ └── server.pem │ └── verify.c ├── ppccap.c ├── ppccpuid.pl ├── pqueue │ ├── Makefile │ ├── pq_test.c │ ├── pqueue.c │ └── pqueue.h ├── rand │ ├── Makefile │ ├── md_rand.c │ ├── rand.h │ ├── rand_egd.c │ ├── rand_err.c │ ├── rand_lcl.h │ ├── rand_lib.c │ ├── rand_nw.c │ ├── rand_os2.c │ ├── rand_unix.c │ ├── rand_vms.c │ ├── rand_win.c │ ├── randfile.c │ └── randtest.c ├── rc2 │ ├── Makefile │ ├── rc2.h │ ├── rc2_cbc.c │ ├── rc2_ecb.c │ ├── rc2_locl.h │ ├── rc2_skey.c │ ├── rc2cfb64.c │ ├── rc2ofb64.c │ ├── rc2speed.c │ ├── rc2test.c │ ├── rrc2.doc │ ├── tab.c │ └── version ├── rc4 │ ├── Makefile │ ├── asm │ │ ├── rc4-586.pl │ │ ├── rc4-ia64.pl │ │ ├── rc4-md5-x86_64.pl │ │ ├── rc4-parisc.pl │ │ ├── rc4-s390x.pl │ │ └── rc4-x86_64.pl │ ├── rc4.c │ ├── rc4.h │ ├── rc4_enc.c │ ├── rc4_locl.h │ ├── rc4_skey.c │ ├── rc4_utl.c │ ├── rc4s.cpp │ ├── rc4speed.c │ ├── rc4test.c │ └── rrc4.doc ├── ripemd │ ├── Makefile │ ├── README │ ├── asm │ │ ├── rips.cpp │ │ └── rmd-586.pl │ ├── ripemd.h │ ├── rmd160.c │ ├── rmd_dgst.c │ ├── rmd_locl.h │ ├── rmd_one.c │ ├── rmdconst.h │ └── rmdtest.c ├── rsa │ ├── Makefile │ ├── rsa.h │ ├── rsa_ameth.c │ ├── rsa_asn1.c │ ├── rsa_chk.c │ ├── rsa_crpt.c │ ├── rsa_depr.c │ ├── rsa_eay.c │ ├── rsa_err.c │ ├── rsa_gen.c │ ├── rsa_lib.c │ ├── rsa_locl.h │ ├── rsa_none.c │ ├── rsa_null.c │ ├── rsa_oaep.c │ ├── rsa_pk1.c │ ├── rsa_pmeth.c │ ├── rsa_prn.c │ ├── rsa_pss.c │ ├── rsa_saos.c │ ├── rsa_sign.c │ ├── rsa_ssl.c │ ├── rsa_test.c │ └── rsa_x931.c ├── s390xcap.c ├── s390xcpuid.S ├── sha │ ├── Makefile │ ├── asm │ │ ├── README │ │ ├── sha1-586.pl │ │ ├── sha1-alpha.pl │ │ ├── sha1-armv4-large.S │ │ ├── sha1-armv4-large.pl │ │ ├── sha1-ia64.pl │ │ ├── sha1-mips.pl │ │ ├── sha1-parisc.pl │ │ ├── sha1-ppc.pl │ │ ├── sha1-s390x.pl │ │ ├── sha1-sparcv9.pl │ │ ├── sha1-sparcv9a.pl │ │ ├── sha1-thumb.pl │ │ ├── sha1-x86_64.pl │ │ ├── sha256-586.pl │ │ ├── sha256-armv4.S │ │ ├── sha256-armv4.pl │ │ ├── sha512-586.pl │ │ ├── sha512-armv4.S │ │ ├── sha512-armv4.pl │ │ ├── sha512-ia64.pl │ │ ├── sha512-mips.pl │ │ ├── sha512-parisc.pl │ │ ├── sha512-ppc.pl │ │ ├── sha512-s390x.pl │ │ ├── sha512-sparcv9.pl │ │ └── sha512-x86_64.pl │ ├── sha.c │ ├── sha.h │ ├── sha1.c │ ├── sha1_one.c │ ├── sha1dgst.c │ ├── sha1test.c │ ├── sha256.c │ ├── sha256t.c │ ├── sha512.c │ ├── sha512t.c │ ├── sha_dgst.c │ ├── sha_locl.h │ ├── sha_one.c │ └── shatest.c ├── sparccpuid.S ├── sparcv9cap.c ├── srp │ ├── Makefile │ ├── srp.h │ ├── srp_grps.h │ ├── srp_lcl.h │ ├── srp_lib.c │ ├── srp_vfy.c │ └── srptest.c ├── stack │ ├── Makefile │ ├── safestack.h │ ├── stack.c │ └── stack.h ├── store │ ├── Makefile │ ├── README │ ├── store.h │ ├── str_err.c │ ├── str_lib.c │ ├── str_locl.h │ ├── str_mem.c │ └── str_meth.c ├── symhacks.h ├── threads │ ├── README │ ├── mttest.c │ ├── netware.bat │ ├── profile.sh │ ├── ptest.bat │ ├── pthread.sh │ ├── pthread2.sh │ ├── pthreads-vms.com │ ├── purify.sh │ ├── solaris.sh │ ├── th-lock.c │ └── win32.bat ├── ts │ ├── Makefile │ ├── ts.h │ ├── ts_asn1.c │ ├── ts_conf.c │ ├── ts_err.c │ ├── ts_lib.c │ ├── ts_req_print.c │ ├── ts_req_utils.c │ ├── ts_rsp_print.c │ ├── ts_rsp_sign.c │ ├── ts_rsp_utils.c │ ├── ts_rsp_verify.c │ └── ts_verify_ctx.c ├── txt_db │ ├── Makefile │ ├── txt_db.c │ └── txt_db.h ├── ui │ ├── Makefile │ ├── ui.h │ ├── ui_compat.c │ ├── ui_compat.h │ ├── ui_err.c │ ├── ui_lib.c │ ├── ui_locl.h │ ├── ui_openssl.c │ └── ui_util.c ├── uid.c ├── vms_rms.h ├── whrlpool │ ├── Makefile │ ├── asm │ │ ├── wp-mmx.pl │ │ └── wp-x86_64.pl │ ├── whrlpool.h │ ├── wp_block.c │ ├── wp_dgst.c │ ├── wp_locl.h │ └── wp_test.c ├── x509 │ ├── Makefile │ ├── by_dir.c │ ├── by_file.c │ ├── x509.h │ ├── x509_att.c │ ├── x509_cmp.c │ ├── x509_d2.c │ ├── x509_def.c │ ├── x509_err.c │ ├── x509_ext.c │ ├── x509_lu.c │ ├── x509_obj.c │ ├── x509_r2x.c │ ├── x509_req.c │ ├── x509_set.c │ ├── x509_trs.c │ ├── x509_txt.c │ ├── x509_v3.c │ ├── x509_vfy.c │ ├── x509_vfy.h │ ├── x509_vpm.c │ ├── x509cset.c │ ├── x509name.c │ ├── x509rset.c │ ├── x509spki.c │ ├── x509type.c │ └── x_all.c ├── x509v3 │ ├── Makefile │ ├── ext_dat.h │ ├── pcy_cache.c │ ├── pcy_data.c │ ├── pcy_int.h │ ├── pcy_lib.c │ ├── pcy_map.c │ ├── pcy_node.c │ ├── pcy_tree.c │ ├── tabtest.c │ ├── v3_addr.c │ ├── v3_akey.c │ ├── v3_akeya.c │ ├── v3_alt.c │ ├── v3_asid.c │ ├── v3_bcons.c │ ├── v3_bitst.c │ ├── v3_conf.c │ ├── v3_cpols.c │ ├── v3_crld.c │ ├── v3_enum.c │ ├── v3_extku.c │ ├── v3_genn.c │ ├── v3_ia5.c │ ├── v3_info.c │ ├── v3_int.c │ ├── v3_lib.c │ ├── v3_ncons.c │ ├── v3_ocsp.c │ ├── v3_pci.c │ ├── v3_pcia.c │ ├── v3_pcons.c │ ├── v3_pku.c │ ├── v3_pmaps.c │ ├── v3_prn.c │ ├── v3_purp.c │ ├── v3_skey.c │ ├── v3_sxnet.c │ ├── v3_utl.c │ ├── v3conf.c │ ├── v3err.c │ ├── v3prin.c │ └── x509v3.h ├── x86_64cpuid.pl └── x86cpuid.pl ├── e_os.h ├── e_os2.h ├── include └── openssl │ ├── aes.h │ ├── asn1.h │ ├── asn1_mac.h │ ├── asn1t.h │ ├── bio.h │ ├── blowfish.h │ ├── bn.h │ ├── buffer.h │ ├── camellia.h │ ├── cast.h │ ├── cmac.h │ ├── comp.h │ ├── conf.h │ ├── conf_api.h │ ├── crypto.h │ ├── des.h │ ├── des_old.h │ ├── dh.h │ ├── dsa.h │ ├── dso.h │ ├── dtls1.h │ ├── e_os2.h │ ├── ebcdic.h │ ├── ec.h │ ├── ecdh.h │ ├── ecdsa.h │ ├── engine.h │ ├── err.h │ ├── evp.h │ ├── hmac.h │ ├── idea.h │ ├── krb5_asn.h │ ├── kssl.h │ ├── lhash.h │ ├── md4.h │ ├── md5.h │ ├── mdc2.h │ ├── modes.h │ ├── obj_mac.h │ ├── objects.h │ ├── ocsp.h │ ├── opensslconf.h │ ├── opensslv.h │ ├── ossl_typ.h │ ├── pem.h │ ├── pem2.h │ ├── pkcs12.h │ ├── pkcs7.h │ ├── pqueue.h │ ├── rand.h │ ├── rc2.h │ ├── rc4.h │ ├── ripemd.h │ ├── rsa.h │ ├── safestack.h │ ├── seed.h │ ├── sha.h │ ├── srp.h │ ├── srtp.h │ ├── ssl.h │ ├── ssl2.h │ ├── ssl23.h │ ├── ssl3.h │ ├── stack.h │ ├── symhacks.h │ ├── tls1.h │ ├── ts.h │ ├── txt_db.h │ ├── ui.h │ ├── ui_compat.h │ ├── whrlpool.h │ ├── x509.h │ ├── x509_vfy.h │ └── x509v3.h ├── jni └── Application.mk └── ssl ├── Android.mk ├── Makefile ├── bio_ssl.c ├── d1_both.c ├── d1_clnt.c ├── d1_enc.c ├── d1_lib.c ├── d1_meth.c ├── d1_pkt.c ├── d1_srtp.c ├── d1_srvr.c ├── dtls1.h ├── install-ssl.com ├── kssl.c ├── kssl.h ├── kssl_lcl.h ├── s23_clnt.c ├── s23_lib.c ├── s23_meth.c ├── s23_pkt.c ├── s23_srvr.c ├── s2_clnt.c ├── s2_enc.c ├── s2_lib.c ├── s2_meth.c ├── s2_pkt.c ├── s2_srvr.c ├── s3_both.c ├── s3_clnt.c ├── s3_enc.c ├── s3_lib.c ├── s3_meth.c ├── s3_pkt.c ├── s3_srvr.c ├── srtp.h ├── ssl-lib.com ├── ssl.h ├── ssl2.h ├── ssl23.h ├── ssl3.h ├── ssl_algs.c ├── ssl_asn1.c ├── ssl_cert.c ├── ssl_ciph.c ├── ssl_err.c ├── ssl_err2.c ├── ssl_lib.c ├── ssl_locl.h ├── ssl_rsa.c ├── ssl_sess.c ├── ssl_stat.c ├── ssl_task.c ├── ssl_txt.c ├── ssltest.c ├── t1_clnt.c ├── t1_enc.c ├── t1_lib.c ├── t1_meth.c ├── t1_reneg.c ├── t1_srvr.c ├── tls1.h └── tls_srp.c /ACKNOWLEDGMENTS: -------------------------------------------------------------------------------- 1 | The OpenSSL project depends on volunteer efforts and financial support from 2 | the end user community. That support comes in the form of donations and paid 3 | sponsorships, software support contracts, paid consulting services 4 | and commissioned software development. 5 | 6 | Since all these activities support the continued development and improvement 7 | of OpenSSL we consider all these clients and customers as sponsors of the 8 | OpenSSL project. 9 | 10 | We would like to identify and thank the following such sponsors for their past 11 | or current significant support of the OpenSSL project: 12 | 13 | Very significant support: 14 | 15 | OpenGear: www.opengear.com 16 | 17 | Significant support: 18 | 19 | PSW Group: www.psw.net 20 | 21 | Please note that we ask permission to identify sponsors and that some sponsors 22 | we consider eligible for inclusion here have requested to remain anonymous. 23 | 24 | Additional sponsorship or financial support is always welcome: for more 25 | information please contact the OpenSSL Software Foundation. 26 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \ 4 | crypto \ 5 | ssl \ 6 | apps \ 7 | )) 8 | 9 | include $(subdirs) 10 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/AndroidManifest.xml -------------------------------------------------------------------------------- /MODULE_LICENSE_BSD_LIKE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/MODULE_LICENSE_BSD_LIKE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OpenSSL1.0.1cForAndroid 2 | ======================= 3 | 4 | OpenSSL 1.0.1c For Android -------------------------------------------------------------------------------- /android-config.mk: -------------------------------------------------------------------------------- 1 | # 2 | # These flags represent the build-time configuration of openssl for android 3 | # 4 | # They were pruned from the "Makefile" generated by running ./Configure from import_openssl.sh 5 | # 6 | 7 | # From CLFAG= 8 | LOCAL_CFLAGS += -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -O3 -fomit-frame-pointer -Wall #-DTERMIO 9 | 10 | # From DEPFLAG= 11 | LOCAL_CFLAGS += -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_SCTP \ 12 | -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CAST -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_IDEA -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_SHA0 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED -DOPENSSL_NO_STORE -DOPENSSL_NO_WHIRLPOOL 13 | 14 | #Copied by seaching for the OPENSSL_NO_ 15 | LOCAL_CFLAGS += -DOPENSSL_NO_DEPRECATED 16 | 17 | # Extra 18 | LOCAL_CFLAGS += -DOPENSSL_NO_HW -DOPENSSL_NO_ENGINE -DZLIB 19 | 20 | # Debug 21 | # LOCAL_CFLAGS += -DCIPHER_DEBUG 22 | -------------------------------------------------------------------------------- /apps/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2006 The Android Open Source Project 2 | 3 | LOCAL_PATH:= $(call my-dir) 4 | include $(CLEAR_VARS) 5 | 6 | LOCAL_SRC_FILES:= \ 7 | app_rand.c \ 8 | apps.c \ 9 | asn1pars.c \ 10 | ca.c \ 11 | ciphers.c \ 12 | crl.c \ 13 | crl2p7.c \ 14 | dgst.c \ 15 | dh.c \ 16 | dhparam.c \ 17 | dsa.c \ 18 | dsaparam.c \ 19 | ecparam.c \ 20 | ec.c \ 21 | enc.c \ 22 | engine.c \ 23 | errstr.c \ 24 | gendh.c \ 25 | gendsa.c \ 26 | genpkey.c \ 27 | genrsa.c \ 28 | nseq.c \ 29 | ocsp.c \ 30 | openssl.c \ 31 | passwd.c \ 32 | pkcs12.c \ 33 | pkcs7.c \ 34 | pkcs8.c \ 35 | pkey.c \ 36 | pkeyparam.c \ 37 | pkeyutl.c \ 38 | prime.c \ 39 | rand.c \ 40 | req.c \ 41 | rsa.c \ 42 | rsautl.c \ 43 | s_cb.c \ 44 | s_client.c \ 45 | s_server.c \ 46 | s_socket.c \ 47 | s_time.c \ 48 | sess_id.c \ 49 | smime.c \ 50 | speed.c \ 51 | spkac.c \ 52 | srp.c \ 53 | verify.c \ 54 | version.c \ 55 | x509.c 56 | 57 | # cms.c ec.c s_server.c 58 | 59 | LOCAL_SHARED_LIBRARIES := \ 60 | libssl \ 61 | libcrypto 62 | 63 | LOCAL_C_INCLUDES := \ 64 | $(NDK_PROJECT_PATH) \ 65 | $(NDK_PROJECT_PATH)/include \ 66 | $(NDK_PROJECT_PATH)/../include 67 | 68 | LOCAL_CFLAGS := -DMONOLITH 69 | 70 | include $(LOCAL_PATH)/../android-config.mk 71 | 72 | # These flags omit whole features from the commandline "openssl". 73 | # However, portions of these features are actually turned on. 74 | LOCAL_CFLAGS += -DOPENSSL_NO_DTLS1 75 | 76 | 77 | LOCAL_MODULE:= openssl 78 | 79 | LOCAL_MODULE_TAGS := tests 80 | 81 | include $(BUILD_EXECUTABLE) 82 | -------------------------------------------------------------------------------- /apps/ca-cert.srl: -------------------------------------------------------------------------------- 1 | 07 2 | -------------------------------------------------------------------------------- /apps/ca-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425 3 | gxSK4jqhhT62UPpqDBEwvQ+fYkVv3RV0r9ReuZGv12NoS4fXsQgqO17lHA7Od0Kd 4 | 2yNwJjKh44MxPKDt2o8iQMyZE0zlHnEFNpsP4COLTDNC6ljEEu5bk8uPsQIDAQAB 5 | AoGAVZmpFZsDZfr0l2S9tLLwpjRWNOlKATQkno6q2WesT0eGLQufTciY+c8ypfU6 6 | hyio8r5iUl/VhhdjhAtKx1mRpiotftHo/eYf8rtsrnprOnWG0bWjLjtIoMbcxGn2 7 | J3bN6LJmbJMjDs0eJ3KnTu646F3nDUw2oGAwmpzKXA1KAP0CQQDRvQhxk2D3Pehs 8 | HvG665u2pB5ipYQngEFlZO7RHJZzJOZEWSLuuMqaF/7pTfA5jiBvWqCgJeCRRInL 9 | 21ru4dlPAkEAx9jj7BgKn5TYnMoBSSe0afjsV9oApVpN1Nacb1YDtCwy+scp3++s 10 | nFxlv98wxIlSdpwMUn+AUWfjiWR7Tu/G/wJBAJ/KjwZIrFVxewP0x2ILYsTRYLzz 11 | MS4PDsO7FB+I0i7DbBOifXS2oNSpd3I0CNMwrxFnUHzynpbOStVfN3ZL5w0CQQCa 12 | pwFahxBRhkJKsxhjoFJBX9yl75JoY4Wvm5Tbo9ih6UJaRx3kqfkN14L2BKYcsZgb 13 | KY9vmDOYy6iNfjDeWTfJAkBkfPUb8oTJ/nSP5zN6sqGxSY4krc4xLxpRmxoJ8HL2 14 | XfhqXkTzbU13RX9JJ/NZ8vQN9Vm2NhxRGJocQkmcdVtJ 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /apps/ca-req.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIBmTCCAQICAQAwWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQx 3 | GjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDExJUZXN0IENBICgx 4 | MDI0IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKO7o8t116VP6cgy 5 | bTsZDCZhr95nYlZuya3aCi1IKoztqwWnjbmDFIriOqGFPrZQ+moMETC9D59iRW/d 6 | FXSv1F65ka/XY2hLh9exCCo7XuUcDs53Qp3bI3AmMqHjgzE8oO3ajyJAzJkTTOUe 7 | cQU2mw/gI4tMM0LqWMQS7luTy4+xAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAKlk7 8 | cxu9gCJN3/iQFyJXQ6YphaiQAT5VBXTx9ftRrQIjA3vxlDzPWGDy+V5Tqa7h8PtR 9 | 5Bn00JShII2zf0hjyjKils6x/UkWmjEiwSiFp4hR70iE8XwSNEHY2P6j6nQEIpgW 10 | kbfgmmUqk7dl2V+ossTJ80B8SBpEhrn81V/cHxA= 11 | -----END CERTIFICATE REQUEST----- 12 | -------------------------------------------------------------------------------- /apps/cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBoDCCAUoCAQAwDQYJKoZIhvcNAQEEBQAwYzELMAkGA1UEBhMCQVUxEzARBgNV 3 | BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMSMwIQYD 4 | VQQDExpTZXJ2ZXIgdGVzdCBjZXJ0ICg1MTIgYml0KTAeFw05NzA5MDkwMzQxMjZa 5 | Fw05NzEwMDkwMzQxMjZaMF4xCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0 6 | YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxFzAVBgNVBAMT 7 | DkVyaWMgdGhlIFlvdW5nMFEwCQYFKw4DAgwFAANEAAJBALVEqPODnpI4rShlY8S7 8 | tB713JNvabvn6Gned7zylwLLiXQAo/PAT6mfdWPTyCX9RlId/Aroh1ou893BA32Q 9 | sggwDQYJKoZIhvcNAQEEBQADQQCU5SSgapJSdRXJoX+CpCvFy+JVh9HpSjCpSNKO 10 | 19raHv98hKAUJuP9HyM+SUsffO6mAIgitUaqW8/wDMePhEC3 11 | -----END CERTIFICATE----- 12 | -------------------------------------------------------------------------------- /apps/dh1024.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIGHAoGBAPSI/VhOSdvNILSd5JEHNmszbDgNRR0PfIizHHxbLY7288kjwEPwpVsY 3 | jY67VYy4XTjTNP18F1dDox0YbN4zISy1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6 4 | ypUM2Zafq9AKUJsCRtMIPWakXUGfnHy9iUsiGSa6q6Jew1XpL3jHAgEC 5 | -----END DH PARAMETERS----- 6 | 7 | These are the 1024 bit DH parameters from "Assigned Number for SKIP Protocols" 8 | (http://www.skip-vpn.org/spec/numbers.html). 9 | See there for how they were generated. 10 | Note that g is not a generator, but this is not a problem since p is a safe prime. 11 | -------------------------------------------------------------------------------- /apps/dh2048.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEA9kJXtwh/CBdyorrWqULzBej5UxE5T7bxbrlLOCDaAadWoxTpj0BV 3 | 89AHxstDqZSt90xkhkn4DIO9ZekX1KHTUPj1WV/cdlJPPT2N286Z4VeSWc39uK50 4 | T8X8dryDxUcwYc58yWb/Ffm7/ZFexwGq01uejaClcjrUGvC/RgBYK+X0iP1YTknb 5 | zSC0neSRBzZrM2w4DUUdD3yIsxx8Wy2O9vPJI8BD8KVbGI2Ou1WMuF040zT9fBdX 6 | Q6MdGGzeMyEstSr/POGxKUAYEY18hKcKctaGxAMZyAcpesqVDNmWn6vQClCbAkbT 7 | CD1mpF1Bn5x8vYlLIhkmuquiXsNV6TILOwIBAg== 8 | -----END DH PARAMETERS----- 9 | 10 | These are the 2048 bit DH parameters from "Assigned Number for SKIP Protocols" 11 | (http://www.skip-vpn.org/spec/numbers.html). 12 | See there for how they were generated. 13 | -------------------------------------------------------------------------------- /apps/dh4096.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIICCAKCAgEA+hRyUsFN4VpJ1O8JLcCo/VWr19k3BCgJ4uk+d+KhehjdRqNDNyOQ 3 | l/MOyQNQfWXPeGKmOmIig6Ev/nm6Nf9Z2B1h3R4hExf+zTiHnvVPeRBhjdQi81rt 4 | Xeoh6TNrSBIKIHfUJWBh3va0TxxjQIs6IZOLeVNRLMqzeylWqMf49HsIXqbcokUS 5 | Vt1BkvLdW48j8PPv5DsKRN3tloTxqDJGo9tKvj1Fuk74A+Xda1kNhB7KFlqMyN98 6 | VETEJ6c7KpfOo30mnK30wqw3S8OtaIR/maYX72tGOno2ehFDkq3pnPtEbD2CScxc 7 | alJC+EL7RPk5c/tgeTvCngvc1KZn92Y//EI7G9tPZtylj2b56sHtMftIoYJ9+ODM 8 | sccD5Piz/rejE3Ome8EOOceUSCYAhXn8b3qvxVI1ddd1pED6FHRhFvLrZxFvBEM9 9 | ERRMp5QqOaHJkM+Dxv8Cj6MqrCbfC4u+ZErxodzuusgDgvZiLF22uxMZbobFWyte 10 | OvOzKGtwcTqO/1wV5gKkzu1ZVswVUQd5Gg8lJicwqRWyyNRczDDoG9jVDxmogKTH 11 | AaqLulO7R8Ifa1SwF2DteSGVtgWEN8gDpN3RBmmPTDngyF2DHb5qmpnznwtFKdTL 12 | KWbuHn491xNO25CQWMtem80uKw+pTnisBRF/454n1Jnhub144YRBoN8CAQI= 13 | -----END DH PARAMETERS----- 14 | 15 | These are the 4096 bit DH parameters from "Assigned Number for SKIP Protocols" 16 | (http://www.skip-vpn.org/spec/numbers.html). 17 | See there for how they were generated. 18 | Note that g is not a generator, but this is not a problem since p is a safe prime. 19 | -------------------------------------------------------------------------------- /apps/dh512.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MEYCQQD1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM2Zafq9AKUJsCRtMIPWak 3 | XUGfnHy9iUsiGSa6q6Jew1XpKgVfAgEC 4 | -----END DH PARAMETERS----- 5 | 6 | These are the 512 bit DH parameters from "Assigned Number for SKIP Protocols" 7 | (http://www.skip-vpn.org/spec/numbers.html). 8 | See there for how they were generated. 9 | Note that g is not a generator, but this is not a problem since p is a safe prime. 10 | -------------------------------------------------------------------------------- /apps/dsa-ca.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DSA PRIVATE KEY----- 2 | MIIBugIBAAKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2GlrMV4FMuj+BZgnOQ 3 | PnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7OZq5riDb77Cjcwtel 4 | u+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR5HCVW1DNSQIVAPcH 5 | Me36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnlaG8w42nh5bNdmLso 6 | hkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6kQmdtvFNnFQPWAbu 7 | SXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15AlsQReVkusBtXOlan7Y 8 | Mu0OArgCgYAapll6iqz9XrZFlk2GCVcB+KihxWnH7IuHvSLw9YUrJahcBHmbpvt4 9 | 94lF4gC5w3WPM+vXJofbusk4GoQEEsQNMDaah4m49uUqAylOVFJJJXuirVJ+o+0T 10 | tOFDITEAl+YZZariXOD7tdOSOl9RLMPC6+daHKS9e68u3enxhqnDGQIUB78dhW77 11 | J6zsFbSEHaQGUmfSeoM= 12 | -----END DSA PRIVATE KEY----- 13 | -----BEGIN CERTIFICATE REQUEST----- 14 | MIICUjCCAhECAQAwUjELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx 15 | ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDELMAkGA1UEAxMCQ0Ew 16 | ggG0MIIBKQYFKw4DAgwwggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaW 17 | sxXgUy6P4FmCc5A+dTGZR3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5m 18 | rmuINvvsKNzC16W75Sw5JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHk 19 | cJVbUM1JAhUA9wcx7fpsBgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVo 20 | bzDjaeHls12YuyiGSPzemQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqR 21 | CZ228U2cVA9YBu5JdAfOVX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxB 22 | F5WS6wG1c6Vqftgy7Q4CuAOBhAACgYAapll6iqz9XrZFlk2GCVcB+KihxWnH7IuH 23 | vSLw9YUrJahcBHmbpvt494lF4gC5w3WPM+vXJofbusk4GoQEEsQNMDaah4m49uUq 24 | AylOVFJJJXuirVJ+o+0TtOFDITEAl+YZZariXOD7tdOSOl9RLMPC6+daHKS9e68u 25 | 3enxhqnDGaAAMAkGBSsOAwIbBQADMAAwLQIVAJGVuFsG/0DBuSZ0jF7ypdU0/G0v 26 | AhQfeF5BoMMDbX/kidUVpQ6gadPlZA== 27 | -----END CERTIFICATE REQUEST----- 28 | -----BEGIN CERTIFICATE----- 29 | MIIBrjCCAWwCAQswCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK 30 | U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww 31 | CgYDVQQDEwNQQ0EwHhcNOTcwNjE1MDIxNDI5WhcNOTcwNzE1MDIxNDI5WjBSMQsw 32 | CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu 33 | ZXQgV2lkZ2l0cyBQdHkgTHRkMQswCQYDVQQDEwJDQTCBkjAJBgUrDgMCDAUAA4GE 34 | AAKBgBqmWXqKrP1etkWWTYYJVwH4qKHFacfsi4e9IvD1hSslqFwEeZum+3j3iUXi 35 | ALnDdY8z69cmh9u6yTgahAQSxA0wNpqHibj25SoDKU5UUkkle6KtUn6j7RO04UMh 36 | MQCX5hllquJc4Pu105I6X1Esw8Lr51ocpL17ry7d6fGGqcMZMAkGBSsOAwIbBQAD 37 | MQAwLgIVAJ4wtQsANPxHo7Q4IQZYsL12SKdbAhUAjJ9n38zxT+iai2164xS+LIfa 38 | C1Q= 39 | -----END CERTIFICATE----- 40 | 41 | -------------------------------------------------------------------------------- /apps/dsa-pca.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DSA PRIVATE KEY----- 2 | MIIBvAIBAAKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2GlrMV4FMuj+BZgnOQ 3 | PnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7OZq5riDb77Cjcwtel 4 | u+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR5HCVW1DNSQIVAPcH 5 | Me36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnlaG8w42nh5bNdmLso 6 | hkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6kQmdtvFNnFQPWAbu 7 | SXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15AlsQReVkusBtXOlan7Y 8 | Mu0OArgCgYEApu25HkB1b4gKMIV7aLGNSIknMzYgrB7o1kQxeDf34dDVRM9OZ8tk 9 | umz6tl+iUcNe5EoxdsYV1IXSddjOi08LOLsZq7AQlNnKvbtlmMDULpqkZJD0bO7A 10 | 29nisJfKy1URqABLw5DgfcPh1ZLXtmDfUgJvmjgTmvTPT2j9TPjq7RUCFQDNvrBz 11 | 6TicfImU7UFRn9h00j0lJQ== 12 | -----END DSA PRIVATE KEY----- 13 | -----BEGIN CERTIFICATE REQUEST----- 14 | MIICVTCCAhMCAQAwUzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx 15 | ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEMMAoGA1UEAxMDUENB 16 | MIIBtTCCASkGBSsOAwIMMIIBHgKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2G 17 | lrMV4FMuj+BZgnOQPnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7O 18 | Zq5riDb77Cjcwtelu+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR 19 | 5HCVW1DNSQIVAPcHMe36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnl 20 | aG8w42nh5bNdmLsohkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6 21 | kQmdtvFNnFQPWAbuSXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15Als 22 | QReVkusBtXOlan7YMu0OArgDgYUAAoGBAKbtuR5AdW+ICjCFe2ixjUiJJzM2IKwe 23 | 6NZEMXg39+HQ1UTPTmfLZLps+rZfolHDXuRKMXbGFdSF0nXYzotPCzi7GauwEJTZ 24 | yr27ZZjA1C6apGSQ9GzuwNvZ4rCXystVEagAS8OQ4H3D4dWS17Zg31ICb5o4E5r0 25 | z09o/Uz46u0VoAAwCQYFKw4DAhsFAAMxADAuAhUArRubTxsbIXy3AhtjQ943AbNB 26 | nSICFQCu+g1iW3jwF+gOcbroD4S/ZcvB3w== 27 | -----END CERTIFICATE REQUEST----- 28 | -----BEGIN CERTIFICATE----- 29 | MIIC0zCCApECAQAwCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK 30 | U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww 31 | CgYDVQQDEwNQQ0EwHhcNOTcwNjE0MjI1NDQ1WhcNOTcwNzE0MjI1NDQ1WjBTMQsw 32 | CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu 33 | ZXQgV2lkZ2l0cyBQdHkgTHRkMQwwCgYDVQQDEwNQQ0EwggG1MIIBKQYFKw4DAgww 34 | ggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaWsxXgUy6P4FmCc5A+dTGZ 35 | R3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5mrmuINvvsKNzC16W75Sw5 36 | JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHkcJVbUM1JAhUA9wcx7fps 37 | BgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVobzDjaeHls12YuyiGSPze 38 | mQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqRCZ228U2cVA9YBu5JdAfO 39 | VX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxBF5WS6wG1c6Vqftgy7Q4C 40 | uAOBhQACgYEApu25HkB1b4gKMIV7aLGNSIknMzYgrB7o1kQxeDf34dDVRM9OZ8tk 41 | umz6tl+iUcNe5EoxdsYV1IXSddjOi08LOLsZq7AQlNnKvbtlmMDULpqkZJD0bO7A 42 | 29nisJfKy1URqABLw5DgfcPh1ZLXtmDfUgJvmjgTmvTPT2j9TPjq7RUwCQYFKw4D 43 | AhsFAAMxADAuAhUAvtv6AkMolix1Jvy3UnVEIUqdCUICFQC+jq8P49mwrY9oJ24n 44 | 5rKUjNBhSg== 45 | -----END CERTIFICATE----- 46 | 47 | -------------------------------------------------------------------------------- /apps/dsa1024.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DSA PARAMETERS----- 2 | MIIBHgKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2GlrMV4FMuj+BZgnOQPnUx 3 | mUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7OZq5riDb77Cjcwtelu+Us 4 | OSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR5HCVW1DNSQIVAPcHMe36 5 | bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnlaG8w42nh5bNdmLsohkj8 6 | 3pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6kQmdtvFNnFQPWAbuSXQH 7 | zlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15AlsQReVkusBtXOlan7YMu0O 8 | Arg= 9 | -----END DSA PARAMETERS----- 10 | -------------------------------------------------------------------------------- /apps/dsa512.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DSA PARAMETERS----- 2 | MIGdAkEAnRtpjibb8isRcBmG9hnI+BnyGFOURgbQYlAzSwI8UjADizv5X9EkBk97 3 | TLqqQJv9luQ3M7stWtdaEUBmonZ9MQIVAPtT71C0QJIxVoZTeuiLIppJ+3GPAkEA 4 | gz6I5cWJc847bAFJv7PHnwrqRJHlMKrZvltftxDXibeOdPvPKR7rqCxUUbgQ3qDO 5 | L8wka5B33qJoplISogOdIA== 6 | -----END DSA PARAMETERS----- 7 | -------------------------------------------------------------------------------- /apps/dsap.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DSA PARAMETERS----- 2 | MIGcAkEA+ZiKEvZmc9MtnaFZh4NiZ3oZS4J1PHvPrm9MXj5ntVheDPkdmBDTncya 3 | GAJcMjwsyB/GvLDGd6yGCw/8eF+09wIVAK3VagOxGd/Q4Af5NbxR5FB7CXEjAkA2 4 | t/q7HgVLi0KeKvcDG8BRl3wuy7bCvpjgtWiJc/tpvcuzeuAayH89UofjAGueKjXD 5 | ADiRffvSdhrNw5dkqdql 6 | -----END DSA PARAMETERS----- 7 | -------------------------------------------------------------------------------- /apps/install-apps.com: -------------------------------------------------------------------------------- 1 | $! INSTALL.COM -- Installs the files in a given directory tree 2 | $! 3 | $! Author: Richard Levitte 4 | $! Time of creation: 22-MAY-1998 10:13 5 | $! 6 | $! P1 root of the directory tree 7 | $! P2 "64" for 64-bit pointers. 8 | $! 9 | $! 10 | $! Announce/identify. 11 | $! 12 | $ proc = f$environment( "procedure") 13 | $ write sys$output "@@@ "+ - 14 | f$parse( proc, , , "name")+ f$parse( proc, , , "type") 15 | $! 16 | $ on error then goto tidy 17 | $ on control_c then goto tidy 18 | $! 19 | $ if (p1 .eqs. "") 20 | $ then 21 | $ write sys$output "First argument missing." 22 | $ write sys$output - 23 | "It should be the directory where you want things installed." 24 | $ exit 25 | $ endif 26 | $! 27 | $ if (f$getsyi("cpu") .lt. 128) 28 | $ then 29 | $ arch = "VAX" 30 | $ else 31 | $ arch = f$edit( f$getsyi( "arch_name"), "upcase") 32 | $ if (arch .eqs. "") then arch = "UNK" 33 | $ endif 34 | $! 35 | $ archd = arch 36 | $! 37 | $ if (p2 .nes. "") 38 | $ then 39 | $ if (p2 .eqs. "64") 40 | $ then 41 | $ archd = arch+ "_64" 42 | $ else 43 | $ if (p2 .nes. "32") 44 | $ then 45 | $ write sys$output "Second argument invalid." 46 | $ write sys$output "It should be "32", "64", or nothing." 47 | $ exit 48 | $ endif 49 | $ endif 50 | $ endif 51 | $! 52 | $ root = f$parse( p1, "[]A.;0", , , "syntax_only, no_conceal") - "A.;0" 53 | $ root_dev = f$parse(root,,,"device","syntax_only") 54 | $ root_dir = f$parse(root,,,"directory","syntax_only") - - 55 | "[000000." - "][" - "[" - "]" 56 | $ root = root_dev + "[" + root_dir 57 | $! 58 | $ define /nolog wrk_sslroot 'root'.] /trans=conc 59 | $ define /nolog wrk_sslxexe wrk_sslroot:['archd'_exe] 60 | $! 61 | $ if f$parse("wrk_sslroot:[000000]") .eqs. "" then - 62 | create /directory /log wrk_sslroot:[000000] 63 | $ if f$parse("wrk_sslxexe:") .eqs. "" then - 64 | create /directory /log wrk_sslxexe: 65 | $! 66 | $ exe := openssl 67 | $! 68 | $ exe_dir := [-.'archd'.exe.apps] 69 | $! 70 | $! Executables. 71 | $! 72 | $ i = 0 73 | $ loop_exe: 74 | $ e = f$edit(f$element( i, ",", exe), "trim") 75 | $ i = i + 1 76 | $ if e .eqs. "," then goto loop_exe_end 77 | $ set noon 78 | $ file = exe_dir+ e+ ".exe" 79 | $ if f$search( file) .nes. "" 80 | $ then 81 | $ copy /protection = w:re 'file' wrk_sslxexe: /log 82 | $ endif 83 | $ set on 84 | $ goto loop_exe 85 | $ loop_exe_end: 86 | $! 87 | $! Miscellaneous. 88 | $! 89 | $ set noon 90 | $ copy /protection = w:re ca.com wrk_sslxexe:ca.com /log 91 | $ copy /protection = w:re openssl-vms.cnf wrk_sslroot:[000000]openssl.cnf /log 92 | $ set on 93 | $! 94 | $ tidy: 95 | $! 96 | $ call deass wrk_sslroot 97 | $ call deass wrk_sslxexe 98 | $! 99 | $ exit 100 | $! 101 | $ deass: subroutine 102 | $ if (f$trnlnm( p1, "LNM$PROCESS") .nes. "") 103 | $ then 104 | $ deassign /process 'p1' 105 | $ endif 106 | $ endsubroutine 107 | $! 108 | -------------------------------------------------------------------------------- /apps/md4.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/apps/md4.c -------------------------------------------------------------------------------- /apps/oid.cnf: -------------------------------------------------------------------------------- 1 | 2.99999.1 SET.ex1 SET x509v3 extension 1 2 | 2.99999.2 SET.ex2 SET x509v3 extension 2 3 | 2.99999.3 SET.ex3 SET x509v3 extension 3 4 | 2.99999.4 SET.ex4 SET x509v3 extension 4 5 | 2.99999.5 SET.ex5 SET x509v3 extension 5 6 | 2.99999.6 SET.ex6 SET x509v3 extension 6 7 | -------------------------------------------------------------------------------- /apps/pca-cert.srl: -------------------------------------------------------------------------------- 1 | 07 2 | -------------------------------------------------------------------------------- /apps/pca-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg 3 | wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ 4 | vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB 5 | AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc 6 | z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz 7 | xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7 8 | HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD 9 | yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS 10 | xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj 11 | 7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG 12 | h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL 13 | QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q 14 | hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc= 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /apps/pca-req.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIBmjCCAQMCAQAwXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQx 3 | GjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAo 4 | MTAyNCBiaXQpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdoWk/3+WcMlfj 5 | Irkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPgwgsabJ/wn8TxA1yy3eKJbFl3OiUX 6 | MRsp22Jp85PmemiDzyUIStwk72qhp1imbANZvlmlCFKiQrjUyuDfu4TABmn+kkt3 7 | vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAEzz 8 | IG8NnfpnPTQSCN5zJhOfy6p9AcDyQzuJirYv1HR/qoYWalPh/U2uiK0lAim7qMcv 9 | wOlK3I7A8B7/4dLqvIqgtUj9b1WT8zIrnwdvJI4osLI2BY+c1pVlp174DHLMol1L 10 | Cl1e3N5BTm7lCitTYjuUhsw6hiA8IcdNKDo6sktV 11 | -----END CERTIFICATE REQUEST----- 12 | -------------------------------------------------------------------------------- /apps/privkey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: DES-EDE3-CBC,BA26229A1653B7FF 4 | 5 | 6nhWG8PKhTPO/s3ZvjUa6226NlKdvPDZFsNXOOoSUs9ejxpb/aj5huhs6qRYzsz9 6 | Year47uaAZYhGD0vAagnNiBnYmjWEpN9G/wQxG7pgZThK1ZxDi63qn8aQ8UjuGHo 7 | F6RpnnBQIAnWTWqr/Qsybtc5EoNkrj/Cpx0OfbSr6gZsFBCxwX1R1hT3/mhJ45f3 8 | XMofY32Vdfx9/vtw1O7HmlHXQnXaqnbd9/nn1EpvFJG9+UjPoW7gV4jCOLuR4deE 9 | jS8hm+cpkwXmFtk3VGjT9tQXPpMv3JpYfBqgGQoMAJ5Toq0DWcHi6Wg08PsD8lgy 10 | vmTioPsRg+JGkJkJ8GnusgLpQdlQJbjzd7wGE6ElUFLfOxLo8bLlRHoriHNdWYhh 11 | JjY0LyeTkovcmWxVjImc6ZyBz5Ly4t0BYf1gq3OkjsV91Q1taBxnhiavfizqMCAf 12 | PPB3sLQnlXG77TOXkNxpqbZfEYrVZW2Nsqqdn8s07Uj4IMONZyq2odYKWFPMJBiM 13 | POYwXjMAOcmFMTHYsVlhcUJuV6LOuipw/FEbTtPH/MYMxLe4zx65dYo1rb4iLKLS 14 | gMtB0o/Wl4Xno3ZXh1ucicYnV2J7NpVcjVq+3SFiCRu2SrSkZHZ23EPS13Ec6fcz 15 | 8X/YGA2vTJ8MAOozAzQUwHQYvLk7bIoQVekqDq4p0AZQbhdspHpArCk0Ifqqzg/v 16 | Uyky/zZiQYanzDenTSRVI/8wac3olxpU8QvbySxYqmbkgq6bTpXJfYFQfnAttEsC 17 | dA4S5UFgyOPZluxCAM4yaJF3Ft6neutNwftuJQMbgCUi9vYg2tGdSw== 18 | -----END RSA PRIVATE KEY----- 19 | -------------------------------------------------------------------------------- /apps/req.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIBlzCCAVcCAQAwXjELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx 3 | ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEXMBUGA1UEAxMORXJp 4 | YyB0aGUgWW91bmcwge8wgaYGBSsOAwIMMIGcAkEA+ZiKEvZmc9MtnaFZh4NiZ3oZ 5 | S4J1PHvPrm9MXj5ntVheDPkdmBDTncyaGAJcMjwsyB/GvLDGd6yGCw/8eF+09wIV 6 | AK3VagOxGd/Q4Af5NbxR5FB7CXEjAkA2t/q7HgVLi0KeKvcDG8BRl3wuy7bCvpjg 7 | tWiJc/tpvcuzeuAayH89UofjAGueKjXDADiRffvSdhrNw5dkqdqlA0QAAkEAtUSo 8 | 84OekjitKGVjxLu0HvXck29pu+foad53vPKXAsuJdACj88BPqZ91Y9PIJf1GUh38 9 | CuiHWi7z3cEDfZCyCKAAMAkGBSsOAwIbBQADLwAwLAIUTg8amKVBE9oqC5B75dDQ 10 | Chy3LdQCFHKodGEj3LjuTzdm/RTe2KZL9Uzf 11 | -----END CERTIFICATE REQUEST----- 12 | -------------------------------------------------------------------------------- /apps/s1024key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXgIBAAKBgQCzEfU8E+ZGTGtHXV5XhvM2Lg32fXUIjydXb34BGVPX6oN7+aNV 3 | S9eWayvW/+9/vUb0aCqilJrpFesgItV2T8VhhjOE++XUz46uNpcMU7wHMEAXUufP 4 | pztpFm8ZEk2tFKvadkSSoN8lb11juvZVkSkPlB65pFhSe4QKSp6J4HrkYwIDAQAB 5 | AoGBAKy8jvb0Lzby8q11yNLf7+78wCVdYi7ugMHcYA1JVFK8+zb1WfSm44FLQo/0 6 | dSChAjgz36TTexeLODPYxleJndjVcOMVzsLJjSM8dLpXsTS4FCeMbhw2s2u+xqKY 7 | bbPWfk+HOTyJjfnkcC5Nbg44eOmruq0gSmBeUXVM5UntlTnxAkEA7TGCA3h7kx5E 8 | Bl4zl2pc3gPAGt+dyfk5Po9mGJUUXhF5p2zueGmYWW74TmOWB1kzt4QRdYMzFePq 9 | zfDNXEa1CwJBAMFErdY0xp0UJ13WwBbUTk8rujqQdHtjw0klhpbuKkjxu2hN0wwM 10 | 6p0D9qxF7JHaghqVRI0fAW/EE0OzdHMR9QkCQQDNR26dMFXKsoPu+vItljj/UEGf 11 | QG7gERiQ4yxaFBPHgdpGo0kT31eh9x9hQGDkxTe0GNG/YSgCRvm8+C3TMcKXAkBD 12 | dhGn36wkUFCddMSAM4NSJ1VN8/Z0y5HzCmI8dM3VwGtGMUQlxKxwOl30LEQzdS5M 13 | 0SWojNYXiT2gOBfBwtbhAkEAhafl5QEOIgUz+XazS/IlZ8goNKdDVfYgK3mHHjvv 14 | nY5G+AuGebdNkXJr4KSWxDcN+C2i47zuj4QXA16MAOandA== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /apps/s1024req.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIBojCCAQsCAQAwZDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQx 3 | GjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMSQwIgYDVQQDExtTZXJ2ZXIgdGVz 4 | dCBjZXJ0ICgxMDI0IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALMR 5 | 9TwT5kZMa0ddXleG8zYuDfZ9dQiPJ1dvfgEZU9fqg3v5o1VL15ZrK9b/73+9RvRo 6 | KqKUmukV6yAi1XZPxWGGM4T75dTPjq42lwxTvAcwQBdS58+nO2kWbxkSTa0Uq9p2 7 | RJKg3yVvXWO69lWRKQ+UHrmkWFJ7hApKnongeuRjAgMBAAEwDQYJKoZIhvcNAQEE 8 | BQADgYEAStHlk4pBbwiNeQ2/PKTPPXzITYC8Gn0XMbrU94e/6JIKiO7aArq9Espq 9 | nrBSvC14dHcNl6NNvnkEKdQ7hAkcACfBbnOXA/oQvMBd4GD78cH3k0jVDoVUEjil 10 | frLfWlckW6WzpTktt0ZPDdAjJCmKVh0ABHimi7Bo9FC3wIGIe5M= 11 | -----END CERTIFICATE REQUEST----- 12 | -------------------------------------------------------------------------------- /apps/s512-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIBPAIBAAJBAJ+zw4Qnlf8SMVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVD 3 | TGiXav6ooKXfX3j/7tdkuD8Ey2//Kv7+ue0CAwEAAQJAN6W31vDEP2DjdqhzCDDu 4 | OA4NACqoiFqyblo7yc2tM4h4xMbC3Yx5UKMN9ZkCtX0gzrz6DyF47bdKcWBzNWCj 5 | gQIhANEoojVt7hq+SQ6MCN6FTAysGgQf56Q3TYoJMoWvdiXVAiEAw3e3rc+VJpOz 6 | rHuDo6bgpjUAAXM+v3fcpsfZSNO6V7kCIQCtbVjanpUwvZkMI9by02oUk9taki3b 7 | PzPfAfNPYAbCJQIhAJXNQDWyqwn/lGmR11cqY2y9nZ1+5w3yHGatLrcDnQHxAiEA 8 | vnlEGo8K85u+KwIOimM48ZG8oTk7iFdkqLJR1utT3aU= 9 | -----END RSA PRIVATE KEY----- 10 | -------------------------------------------------------------------------------- /apps/s512-req.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIBGzCBxgIBADBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEa 3 | MBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGlNlcnZlciB0ZXN0 4 | IGNlcnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ+zw4Qnlf8S 5 | MVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVDTGiXav6ooKXfX3j/7tdkuD8E 6 | y2//Kv7+ue0CAwEAATANBgkqhkiG9w0BAQQFAANBAAB+uQi+qwn6qRSHB8EUTvsm 7 | 5TNTHzYDeN39nyIbZNX2s0se3Srn2Bxft5YCwD3moFZ9QoyDHxE0h6qLX5yjD+8= 8 | -----END CERTIFICATE REQUEST----- 9 | -------------------------------------------------------------------------------- /apps/server.srl: -------------------------------------------------------------------------------- 1 | 01 2 | -------------------------------------------------------------------------------- /apps/testCA.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIBBzCBsgIBADBNMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEX 3 | MBUGA1UEChMOTWluY29tIFB0eSBMdGQxEDAOBgNVBAMTB1RFU1QgQ0EwXDANBgkq 4 | hkiG9w0BAQEFAANLADBIAkEAzW9brgA8efT2ODB+NrsflJZj3KKqKsm4OrXTRqfL 5 | VETj1ws/zCXl42XJAxdWQMCP0liKfc9Ut4xi1qCVI7N07wIDAQABoAAwDQYJKoZI 6 | hvcNAQEEBQADQQBjZZ42Det9Uw0AFwJy4ufUEy5Cv74pxBp5SZnljgHY+Az0Hs2S 7 | uNkIegr2ITX5azKi9nOkg9ZmsmGG13FIjiC/ 8 | -----END CERTIFICATE REQUEST----- 9 | -------------------------------------------------------------------------------- /crypto/LPdir_nyi.c: -------------------------------------------------------------------------------- 1 | /* $LP: LPlib/source/LPdir_win.c,v 1.1 2004/06/14 10:07:56 _cvs_levitte Exp $ */ 2 | /* 3 | * Copyright (c) 2004, Richard Levitte 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 | * SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef LPDIR_H 29 | #include "LPdir.h" 30 | #endif 31 | 32 | struct LP_dir_context_st { void *dummy; }; 33 | const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) 34 | { 35 | errno = EINVAL; 36 | return 0; 37 | } 38 | int LP_find_file_end(LP_DIR_CTX **ctx) 39 | { 40 | errno = EINVAL; 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /crypto/LPdir_win32.c: -------------------------------------------------------------------------------- 1 | /* $LP: LPlib/source/LPdir_win32.c,v 1.3 2004/08/26 13:36:05 _cvs_levitte Exp $ */ 2 | /* 3 | * Copyright (c) 2004, Richard Levitte 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define LP_SYS_WIN32 29 | #define LP_MULTIBYTE_AVAILABLE 30 | #include "LPdir_win.c" 31 | -------------------------------------------------------------------------------- /crypto/LPdir_wince.c: -------------------------------------------------------------------------------- 1 | /* $LP: LPlib/source/LPdir_wince.c,v 1.3 2004/08/26 13:36:05 _cvs_levitte Exp $ */ 2 | /* 3 | * Copyright (c) 2004, Richard Levitte 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define LP_SYS_WINCE 29 | /* We might want to define LP_MULTIBYTE_AVAILABLE here. It's currently 30 | under investigation what the exact conditions would be */ 31 | #include "LPdir_win.c" 32 | -------------------------------------------------------------------------------- /crypto/aes/README: -------------------------------------------------------------------------------- 1 | This is an OpenSSL-compatible version of AES (also called Rijndael). 2 | aes_core.c is basically the same as rijndael-alg-fst.c but with an 3 | API that looks like the rest of the OpenSSL symmetric cipher suite. 4 | -------------------------------------------------------------------------------- /crypto/aes/aes_ofb.c: -------------------------------------------------------------------------------- 1 | /* crypto/aes/aes_ofb.c -*- mode:C; c-file-style: "eay" -*- */ 2 | /* ==================================================================== 3 | * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in 14 | * the documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * 3. All advertising materials mentioning features or use of this 18 | * software must display the following acknowledgment: 19 | * "This product includes software developed by the OpenSSL Project 20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 21 | * 22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 23 | * endorse or promote products derived from this software without 24 | * prior written permission. For written permission, please contact 25 | * openssl-core@openssl.org. 26 | * 27 | * 5. Products derived from this software may not be called "OpenSSL" 28 | * nor may "OpenSSL" appear in their names without prior written 29 | * permission of the OpenSSL Project. 30 | * 31 | * 6. Redistributions of any form whatsoever must retain the following 32 | * acknowledgment: 33 | * "This product includes software developed by the OpenSSL Project 34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 35 | * 36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 47 | * OF THE POSSIBILITY OF SUCH DAMAGE. 48 | * ==================================================================== 49 | * 50 | */ 51 | 52 | #include 53 | #include 54 | 55 | void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, 56 | size_t length, const AES_KEY *key, 57 | unsigned char *ivec, int *num) 58 | { 59 | CRYPTO_ofb128_encrypt(in,out,length,key,ivec,num,(block128_f)AES_encrypt); 60 | } 61 | -------------------------------------------------------------------------------- /crypto/aes/asm/aes-586.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/aes/asm/aes-586.pl -------------------------------------------------------------------------------- /crypto/alphacpuid.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | print <<'___'; 3 | .text 4 | 5 | .set noat 6 | 7 | .globl OPENSSL_cpuid_setup 8 | .ent OPENSSL_cpuid_setup 9 | OPENSSL_cpuid_setup: 10 | .frame $30,0,$26 11 | .prologue 0 12 | ret ($26) 13 | .end OPENSSL_cpuid_setup 14 | 15 | .globl OPENSSL_wipe_cpu 16 | .ent OPENSSL_wipe_cpu 17 | OPENSSL_wipe_cpu: 18 | .frame $30,0,$26 19 | .prologue 0 20 | clr $1 21 | clr $2 22 | clr $3 23 | clr $4 24 | clr $5 25 | clr $6 26 | clr $7 27 | clr $8 28 | clr $16 29 | clr $17 30 | clr $18 31 | clr $19 32 | clr $20 33 | clr $21 34 | clr $22 35 | clr $23 36 | clr $24 37 | clr $25 38 | clr $27 39 | clr $at 40 | clr $29 41 | fclr $f0 42 | fclr $f1 43 | fclr $f10 44 | fclr $f11 45 | fclr $f12 46 | fclr $f13 47 | fclr $f14 48 | fclr $f15 49 | fclr $f16 50 | fclr $f17 51 | fclr $f18 52 | fclr $f19 53 | fclr $f20 54 | fclr $f21 55 | fclr $f22 56 | fclr $f23 57 | fclr $f24 58 | fclr $f25 59 | fclr $f26 60 | fclr $f27 61 | fclr $f28 62 | fclr $f29 63 | fclr $f30 64 | mov $sp,$0 65 | ret ($26) 66 | .end OPENSSL_wipe_cpu 67 | 68 | .globl OPENSSL_atomic_add 69 | .ent OPENSSL_atomic_add 70 | OPENSSL_atomic_add: 71 | .frame $30,0,$26 72 | .prologue 0 73 | 1: ldl_l $0,0($16) 74 | addl $0,$17,$1 75 | stl_c $1,0($16) 76 | beq $1,1b 77 | addl $0,$17,$0 78 | ret ($26) 79 | .end OPENSSL_atomic_add 80 | 81 | .globl OPENSSL_rdtsc 82 | .ent OPENSSL_rdtsc 83 | OPENSSL_rdtsc: 84 | .frame $30,0,$26 85 | .prologue 0 86 | rpcc $0 87 | ret ($26) 88 | .end OPENSSL_rdtsc 89 | 90 | .globl OPENSSL_cleanse 91 | .ent OPENSSL_cleanse 92 | OPENSSL_cleanse: 93 | .frame $30,0,$26 94 | .prologue 0 95 | beq $17,.Ldone 96 | and $16,7,$0 97 | bic $17,7,$at 98 | beq $at,.Little 99 | beq $0,.Laligned 100 | 101 | .Little: 102 | subq $0,8,$0 103 | ldq_u $1,0($16) 104 | mov $16,$2 105 | .Lalign: 106 | mskbl $1,$16,$1 107 | lda $16,1($16) 108 | subq $17,1,$17 109 | addq $0,1,$0 110 | beq $17,.Lout 111 | bne $0,.Lalign 112 | .Lout: stq_u $1,0($2) 113 | beq $17,.Ldone 114 | bic $17,7,$at 115 | beq $at,.Little 116 | 117 | .Laligned: 118 | stq $31,0($16) 119 | subq $17,8,$17 120 | lda $16,8($16) 121 | bic $17,7,$at 122 | bne $at,.Laligned 123 | bne $17,.Little 124 | .Ldone: ret ($26) 125 | .end OPENSSL_cleanse 126 | ___ 127 | -------------------------------------------------------------------------------- /crypto/arm_arch.h: -------------------------------------------------------------------------------- 1 | #ifndef __ARM_ARCH_H__ 2 | #define __ARM_ARCH_H__ 3 | 4 | #if !defined(__ARM_ARCH__) 5 | # if defined(__CC_ARM) 6 | # define __ARM_ARCH__ __TARGET_ARCH_ARM 7 | # if defined(__BIG_ENDIAN) 8 | # define __ARMEB__ 9 | # else 10 | # define __ARMEL__ 11 | # endif 12 | # elif defined(__GNUC__) 13 | /* 14 | * Why doesn't gcc define __ARM_ARCH__? Instead it defines 15 | * bunch of below macros. See all_architectires[] table in 16 | * gcc/config/arm/arm.c. On a side note it defines 17 | * __ARMEL__/__ARMEB__ for little-/big-endian. 18 | */ 19 | # if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \ 20 | defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__) || \ 21 | defined(__ARM_ARCH_7EM__) 22 | # define __ARM_ARCH__ 7 23 | # elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \ 24 | defined(__ARM_ARCH_6K__)|| defined(__ARM_ARCH_6M__) || \ 25 | defined(__ARM_ARCH_6Z__)|| defined(__ARM_ARCH_6ZK__) || \ 26 | defined(__ARM_ARCH_6T2__) 27 | # define __ARM_ARCH__ 6 28 | # elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \ 29 | defined(__ARM_ARCH_5E__)|| defined(__ARM_ARCH_5TE__) || \ 30 | defined(__ARM_ARCH_5TEJ__) 31 | # define __ARM_ARCH__ 5 32 | # elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) 33 | # define __ARM_ARCH__ 4 34 | # else 35 | # error "unsupported ARM architecture" 36 | # endif 37 | # endif 38 | #endif 39 | 40 | #ifdef OPENSSL_FIPSCANISTER 41 | #include 42 | #endif 43 | 44 | #if !__ASSEMBLER__ 45 | extern unsigned int OPENSSL_armcap_P; 46 | 47 | #define ARMV7_NEON (1<<0) 48 | #define ARMV7_TICK (1<<1) 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /crypto/armcap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "arm_arch.h" 9 | 10 | unsigned int OPENSSL_armcap_P; 11 | 12 | static sigset_t all_masked; 13 | 14 | static sigjmp_buf ill_jmp; 15 | static void ill_handler (int sig) { siglongjmp(ill_jmp,sig); } 16 | 17 | /* 18 | * Following subroutines could have been inlined, but it's not all 19 | * ARM compilers support inline assembler... 20 | */ 21 | void _armv7_neon_probe(void); 22 | unsigned int _armv7_tick(void); 23 | 24 | unsigned int OPENSSL_rdtsc(void) 25 | { 26 | if (OPENSSL_armcap_P|ARMV7_TICK) 27 | return _armv7_tick(); 28 | else 29 | return 0; 30 | } 31 | 32 | #if defined(__GNUC__) && __GNUC__>=2 33 | void OPENSSL_cpuid_setup(void) __attribute__((constructor)); 34 | #endif 35 | void OPENSSL_cpuid_setup(void) 36 | { 37 | char *e; 38 | struct sigaction ill_oact,ill_act; 39 | sigset_t oset; 40 | static int trigger=0; 41 | 42 | if (trigger) return; 43 | trigger=1; 44 | 45 | if ((e=getenv("OPENSSL_armcap"))) 46 | { 47 | OPENSSL_armcap_P=strtoul(e,NULL,0); 48 | return; 49 | } 50 | 51 | sigfillset(&all_masked); 52 | sigdelset(&all_masked,SIGILL); 53 | sigdelset(&all_masked,SIGTRAP); 54 | sigdelset(&all_masked,SIGFPE); 55 | sigdelset(&all_masked,SIGBUS); 56 | sigdelset(&all_masked,SIGSEGV); 57 | 58 | OPENSSL_armcap_P = 0; 59 | 60 | memset(&ill_act,0,sizeof(ill_act)); 61 | ill_act.sa_handler = ill_handler; 62 | ill_act.sa_mask = all_masked; 63 | 64 | sigprocmask(SIG_SETMASK,&ill_act.sa_mask,&oset); 65 | sigaction(SIGILL,&ill_act,&ill_oact); 66 | 67 | if (sigsetjmp(ill_jmp,1) == 0) 68 | { 69 | _armv7_neon_probe(); 70 | OPENSSL_armcap_P |= ARMV7_NEON; 71 | } 72 | if (sigsetjmp(ill_jmp,1) == 0) 73 | { 74 | _armv7_tick(); 75 | OPENSSL_armcap_P |= ARMV7_TICK; 76 | } 77 | 78 | sigaction (SIGILL,&ill_oact,NULL); 79 | sigprocmask(SIG_SETMASK,&oset,NULL); 80 | } 81 | -------------------------------------------------------------------------------- /crypto/asn1/charmap.h: -------------------------------------------------------------------------------- 1 | /* Auto generated with chartype.pl script. 2 | * Mask of various character properties 3 | */ 4 | 5 | static const unsigned char char_type[] = { 6 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 7 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 8 | 120, 0, 1,40, 0, 0, 0,16,16,16, 0,25,25,16,16,16, 9 | 16,16,16,16,16,16,16,16,16,16,16, 9, 9,16, 9,16, 10 | 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 11 | 16,16,16,16,16,16,16,16,16,16,16, 0, 1, 0, 0, 0, 12 | 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 13 | 16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0, 2 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /crypto/asn1/charmap.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl -w 2 | 3 | use strict; 4 | 5 | my ($i, @arr); 6 | 7 | # Set up an array with the type of ASCII characters 8 | # Each set bit represents a character property. 9 | 10 | # RFC2253 character properties 11 | my $RFC2253_ESC = 1; # Character escaped with \ 12 | my $ESC_CTRL = 2; # Escaped control character 13 | # These are used with RFC1779 quoting using " 14 | my $NOESC_QUOTE = 8; # Not escaped if quoted 15 | my $PSTRING_CHAR = 0x10; # Valid PrintableString character 16 | my $RFC2253_FIRST_ESC = 0x20; # Escaped with \ if first character 17 | my $RFC2253_LAST_ESC = 0x40; # Escaped with \ if last character 18 | 19 | for($i = 0; $i < 128; $i++) { 20 | # Set the RFC2253 escape characters (control) 21 | $arr[$i] = 0; 22 | if(($i < 32) || ($i > 126)) { 23 | $arr[$i] |= $ESC_CTRL; 24 | } 25 | 26 | # Some PrintableString characters 27 | if( ( ( $i >= ord("a")) && ( $i <= ord("z")) ) 28 | || ( ( $i >= ord("A")) && ( $i <= ord("Z")) ) 29 | || ( ( $i >= ord("0")) && ( $i <= ord("9")) ) ) { 30 | $arr[$i] |= $PSTRING_CHAR; 31 | } 32 | } 33 | 34 | # Now setup the rest 35 | 36 | # Remaining RFC2253 escaped characters 37 | 38 | $arr[ord(" ")] |= $NOESC_QUOTE | $RFC2253_FIRST_ESC | $RFC2253_LAST_ESC; 39 | $arr[ord("#")] |= $NOESC_QUOTE | $RFC2253_FIRST_ESC; 40 | 41 | $arr[ord(",")] |= $NOESC_QUOTE | $RFC2253_ESC; 42 | $arr[ord("+")] |= $NOESC_QUOTE | $RFC2253_ESC; 43 | $arr[ord("\"")] |= $RFC2253_ESC; 44 | $arr[ord("\\")] |= $RFC2253_ESC; 45 | $arr[ord("<")] |= $NOESC_QUOTE | $RFC2253_ESC; 46 | $arr[ord(">")] |= $NOESC_QUOTE | $RFC2253_ESC; 47 | $arr[ord(";")] |= $NOESC_QUOTE | $RFC2253_ESC; 48 | 49 | # Remaining PrintableString characters 50 | 51 | $arr[ord(" ")] |= $PSTRING_CHAR; 52 | $arr[ord("'")] |= $PSTRING_CHAR; 53 | $arr[ord("(")] |= $PSTRING_CHAR; 54 | $arr[ord(")")] |= $PSTRING_CHAR; 55 | $arr[ord("+")] |= $PSTRING_CHAR; 56 | $arr[ord(",")] |= $PSTRING_CHAR; 57 | $arr[ord("-")] |= $PSTRING_CHAR; 58 | $arr[ord(".")] |= $PSTRING_CHAR; 59 | $arr[ord("/")] |= $PSTRING_CHAR; 60 | $arr[ord(":")] |= $PSTRING_CHAR; 61 | $arr[ord("=")] |= $PSTRING_CHAR; 62 | $arr[ord("?")] |= $PSTRING_CHAR; 63 | 64 | # Now generate the C code 65 | 66 | print < 5 | 6 | 0.7.2m - the first release 7 | -------------------------------------------------------------------------------- /crypto/bf/asm/bf-686.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | 3 | push(@INC,"perlasm","../../perlasm"); 4 | require "x86asm.pl"; 5 | require "cbc.pl"; 6 | 7 | &asm_init($ARGV[0],"bf-686.pl"); 8 | 9 | $BF_ROUNDS=16; 10 | $BF_OFF=($BF_ROUNDS+2)*4; 11 | $L="ecx"; 12 | $R="edx"; 13 | $P="edi"; 14 | $tot="esi"; 15 | $tmp1="eax"; 16 | $tmp2="ebx"; 17 | $tmp3="ebp"; 18 | 19 | &des_encrypt("BF_encrypt",1); 20 | &des_encrypt("BF_decrypt",0); 21 | &cbc("BF_cbc_encrypt","BF_encrypt","BF_decrypt",1,4,5,3,-1,-1); 22 | 23 | &asm_finish(); 24 | 25 | &file_end(); 26 | 27 | sub des_encrypt 28 | { 29 | local($name,$enc)=@_; 30 | 31 | &function_begin($name,""); 32 | 33 | &comment(""); 34 | &comment("Load the 2 words"); 35 | &mov("eax",&wparam(0)); 36 | &mov($L,&DWP(0,"eax","",0)); 37 | &mov($R,&DWP(4,"eax","",0)); 38 | 39 | &comment(""); 40 | &comment("P pointer, s and enc flag"); 41 | &mov($P,&wparam(1)); 42 | 43 | &xor( $tmp1, $tmp1); 44 | &xor( $tmp2, $tmp2); 45 | 46 | # encrypting part 47 | 48 | if ($enc) 49 | { 50 | &xor($L,&DWP(0,$P,"",0)); 51 | for ($i=0; $i<$BF_ROUNDS; $i+=2) 52 | { 53 | &comment(""); 54 | &comment("Round $i"); 55 | &BF_ENCRYPT($i+1,$R,$L,$P,$tot,$tmp1,$tmp2,$tmp3); 56 | 57 | &comment(""); 58 | &comment("Round ".sprintf("%d",$i+1)); 59 | &BF_ENCRYPT($i+2,$L,$R,$P,$tot,$tmp1,$tmp2,$tmp3); 60 | } 61 | &xor($R,&DWP(($BF_ROUNDS+1)*4,$P,"",0)); 62 | 63 | &mov("eax",&wparam(0)); 64 | &mov(&DWP(0,"eax","",0),$R); 65 | &mov(&DWP(4,"eax","",0),$L); 66 | &function_end_A($name); 67 | } 68 | else 69 | { 70 | &xor($L,&DWP(($BF_ROUNDS+1)*4,$P,"",0)); 71 | for ($i=$BF_ROUNDS; $i>0; $i-=2) 72 | { 73 | &comment(""); 74 | &comment("Round $i"); 75 | &BF_ENCRYPT($i,$R,$L,$P,$tot,$tmp1,$tmp2,$tmp3); 76 | &comment(""); 77 | &comment("Round ".sprintf("%d",$i-1)); 78 | &BF_ENCRYPT($i-1,$L,$R,$P,$tot,$tmp1,$tmp2,$tmp3); 79 | } 80 | &xor($R,&DWP(0,$P,"",0)); 81 | 82 | &mov("eax",&wparam(0)); 83 | &mov(&DWP(0,"eax","",0),$R); 84 | &mov(&DWP(4,"eax","",0),$L); 85 | &function_end_A($name); 86 | } 87 | 88 | &function_end_B($name); 89 | } 90 | 91 | sub BF_ENCRYPT 92 | { 93 | local($i,$L,$R,$P,$tot,$tmp1,$tmp2,$tmp3)=@_; 94 | 95 | &rotr( $R, 16); 96 | &mov( $tot, &DWP(&n2a($i*4),$P,"",0)); 97 | 98 | &movb( &LB($tmp1), &HB($R)); 99 | &movb( &LB($tmp2), &LB($R)); 100 | 101 | &rotr( $R, 16); 102 | &xor( $L, $tot); 103 | 104 | &mov( $tot, &DWP(&n2a($BF_OFF+0x0000),$P,$tmp1,4)); 105 | &mov( $tmp3, &DWP(&n2a($BF_OFF+0x0400),$P,$tmp2,4)); 106 | 107 | &movb( &LB($tmp1), &HB($R)); 108 | &movb( &LB($tmp2), &LB($R)); 109 | 110 | &add( $tot, $tmp3); 111 | &mov( $tmp1, &DWP(&n2a($BF_OFF+0x0800),$P,$tmp1,4)); # delay 112 | 113 | &xor( $tot, $tmp1); 114 | &mov( $tmp3, &DWP(&n2a($BF_OFF+0x0C00),$P,$tmp2,4)); 115 | 116 | &add( $tot, $tmp3); 117 | &xor( $tmp1, $tmp1); 118 | 119 | &xor( $L, $tot); 120 | # delay 121 | } 122 | 123 | sub n2a 124 | { 125 | sprintf("%d",$_[0]); 126 | } 127 | 128 | -------------------------------------------------------------------------------- /crypto/bf/asm/readme: -------------------------------------------------------------------------------- 1 | There are blowfish assembler generation scripts. 2 | bf-586.pl version is for the pentium and 3 | bf-686.pl is my original version, which is faster on the pentium pro. 4 | 5 | When using a bf-586.pl, the pentium pro/II is %8 slower than using 6 | bf-686.pl. When using a bf-686.pl, the pentium is %16 slower 7 | than bf-586.pl 8 | 9 | So the default is bf-586.pl 10 | 11 | -------------------------------------------------------------------------------- /crypto/bf/bfs.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // gettsc.inl 3 | // 4 | // gives access to the Pentium's (secret) cycle counter 5 | // 6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca) 7 | // in 1996-7 and is entered, by him, into the public domain. 8 | 9 | #if defined(__WATCOMC__) 10 | void GetTSC(unsigned long&); 11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; 12 | #elif defined(__GNUC__) 13 | inline 14 | void GetTSC(unsigned long& tsc) 15 | { 16 | asm volatile(".byte 15, 49\n\t" 17 | : "=eax" (tsc) 18 | : 19 | : "%edx", "%eax"); 20 | } 21 | #elif defined(_MSC_VER) 22 | inline 23 | void GetTSC(unsigned long& tsc) 24 | { 25 | unsigned long a; 26 | __asm _emit 0fh 27 | __asm _emit 31h 28 | __asm mov a, eax; 29 | tsc=a; 30 | } 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | void main(int argc,char *argv[]) 38 | { 39 | BF_KEY key; 40 | unsigned long s1,s2,e1,e2; 41 | unsigned long data[2]; 42 | int i,j; 43 | 44 | for (j=0; j<6; j++) 45 | { 46 | for (i=0; i<1000; i++) /**/ 47 | { 48 | BF_encrypt(&data[0],&key); 49 | GetTSC(s1); 50 | BF_encrypt(&data[0],&key); 51 | BF_encrypt(&data[0],&key); 52 | BF_encrypt(&data[0],&key); 53 | GetTSC(e1); 54 | GetTSC(s2); 55 | BF_encrypt(&data[0],&key); 56 | BF_encrypt(&data[0],&key); 57 | BF_encrypt(&data[0],&key); 58 | BF_encrypt(&data[0],&key); 59 | GetTSC(e2); 60 | BF_encrypt(&data[0],&key); 61 | } 62 | 63 | printf("blowfish %d %d (%d)\n", 64 | e1-s1,e2-s2,((e2-s2)-(e1-s1))); 65 | } 66 | } 67 | 68 | -------------------------------------------------------------------------------- /crypto/bio/bio_lcl.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #if BIO_FLAGS_UPLINK==0 4 | /* Shortcut UPLINK calls on most platforms... */ 5 | #define UP_stdin stdin 6 | #define UP_stdout stdout 7 | #define UP_stderr stderr 8 | #define UP_fprintf fprintf 9 | #define UP_fgets fgets 10 | #define UP_fread fread 11 | #define UP_fwrite fwrite 12 | #undef UP_fsetmod 13 | #define UP_feof feof 14 | #define UP_fclose fclose 15 | 16 | #define UP_fopen fopen 17 | #define UP_fseek fseek 18 | #define UP_ftell ftell 19 | #define UP_fflush fflush 20 | #define UP_ferror ferror 21 | #ifdef _WIN32 22 | #define UP_fileno _fileno 23 | #define UP_open _open 24 | #define UP_read _read 25 | #define UP_write _write 26 | #define UP_lseek _lseek 27 | #define UP_close _close 28 | #else 29 | #define UP_fileno fileno 30 | #define UP_open open 31 | #define UP_read read 32 | #define UP_write write 33 | #define UP_lseek lseek 34 | #define UP_close close 35 | #endif 36 | #endif 37 | -------------------------------------------------------------------------------- /crypto/bn/asm/README: -------------------------------------------------------------------------------- 1 | 2 | 3 | All assember in this directory are just version of the file 4 | crypto/bn/bn_asm.c. 5 | 6 | Quite a few of these files are just the assember output from gcc since on 7 | quite a few machines they are 2 times faster than the system compiler. 8 | 9 | For the x86, I have hand written assember because of the bad job all 10 | compilers seem to do on it. This normally gives a 2 time speed up in the RSA 11 | routines. 12 | 13 | For the DEC alpha, I also hand wrote the assember (except the division which 14 | is just the output from the C compiler pasted on the end of the file). 15 | On the 2 alpha C compilers I had access to, it was not possible to do 16 | 64b x 64b -> 128b calculations (both long and the long long data types 17 | were 64 bits). So the hand assember gives access to the 128 bit result and 18 | a 2 times speedup :-). 19 | 20 | There are 3 versions of assember for the HP PA-RISC. 21 | 22 | pa-risc.s is the origional one which works fine and generated using gcc :-) 23 | 24 | pa-risc2W.s and pa-risc2.s are 64 and 32-bit PA-RISC 2.0 implementations 25 | by Chris Ruemmler from HP (with some help from the HP C compiler). 26 | 27 | 28 | -------------------------------------------------------------------------------- /crypto/bn/asm/armv4-gf2m.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/bn/asm/armv4-gf2m.pl -------------------------------------------------------------------------------- /crypto/bn/asm/ia64.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/bn/asm/ia64.S -------------------------------------------------------------------------------- /crypto/bn/asm/s390x-gf2m.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/bn/asm/s390x-gf2m.pl -------------------------------------------------------------------------------- /crypto/bn/asm/x86-gf2m.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/bn/asm/x86-gf2m.pl -------------------------------------------------------------------------------- /crypto/bn/asm/x86.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | 3 | push(@INC,"perlasm","../../perlasm"); 4 | require "x86asm.pl"; 5 | 6 | require("x86/mul_add.pl"); 7 | require("x86/mul.pl"); 8 | require("x86/sqr.pl"); 9 | require("x86/div.pl"); 10 | require("x86/add.pl"); 11 | require("x86/sub.pl"); 12 | require("x86/comba.pl"); 13 | 14 | &asm_init($ARGV[0],$0); 15 | 16 | &bn_mul_add_words("bn_mul_add_words"); 17 | &bn_mul_words("bn_mul_words"); 18 | &bn_sqr_words("bn_sqr_words"); 19 | &bn_div_words("bn_div_words"); 20 | &bn_add_words("bn_add_words"); 21 | &bn_sub_words("bn_sub_words"); 22 | &bn_mul_comba("bn_mul_comba8",8); 23 | &bn_mul_comba("bn_mul_comba4",4); 24 | &bn_sqr_comba("bn_sqr_comba8",8); 25 | &bn_sqr_comba("bn_sqr_comba4",4); 26 | 27 | &asm_finish(); 28 | 29 | -------------------------------------------------------------------------------- /crypto/bn/asm/x86/add.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | # x86 assember 3 | 4 | sub bn_add_words 5 | { 6 | local($name)=@_; 7 | 8 | &function_begin($name,""); 9 | 10 | &comment(""); 11 | $a="esi"; 12 | $b="edi"; 13 | $c="eax"; 14 | $r="ebx"; 15 | $tmp1="ecx"; 16 | $tmp2="edx"; 17 | $num="ebp"; 18 | 19 | &mov($r,&wparam(0)); # get r 20 | &mov($a,&wparam(1)); # get a 21 | &mov($b,&wparam(2)); # get b 22 | &mov($num,&wparam(3)); # get num 23 | &xor($c,$c); # clear carry 24 | &and($num,0xfffffff8); # num / 8 25 | 26 | &jz(&label("aw_finish")); 27 | 28 | &set_label("aw_loop",0); 29 | for ($i=0; $i<8; $i++) 30 | { 31 | &comment("Round $i"); 32 | 33 | &mov($tmp1,&DWP($i*4,$a,"",0)); # *a 34 | &mov($tmp2,&DWP($i*4,$b,"",0)); # *b 35 | &add($tmp1,$c); 36 | &mov($c,0); 37 | &adc($c,$c); 38 | &add($tmp1,$tmp2); 39 | &adc($c,0); 40 | &mov(&DWP($i*4,$r,"",0),$tmp1); # *r 41 | } 42 | 43 | &comment(""); 44 | &add($a,32); 45 | &add($b,32); 46 | &add($r,32); 47 | &sub($num,8); 48 | &jnz(&label("aw_loop")); 49 | 50 | &set_label("aw_finish",0); 51 | &mov($num,&wparam(3)); # get num 52 | &and($num,7); 53 | &jz(&label("aw_end")); 54 | 55 | for ($i=0; $i<7; $i++) 56 | { 57 | &comment("Tail Round $i"); 58 | &mov($tmp1,&DWP($i*4,$a,"",0)); # *a 59 | &mov($tmp2,&DWP($i*4,$b,"",0));# *b 60 | &add($tmp1,$c); 61 | &mov($c,0); 62 | &adc($c,$c); 63 | &add($tmp1,$tmp2); 64 | &adc($c,0); 65 | &dec($num) if ($i != 6); 66 | &mov(&DWP($i*4,$r,"",0),$tmp1); # *a 67 | &jz(&label("aw_end")) if ($i != 6); 68 | } 69 | &set_label("aw_end",0); 70 | 71 | # &mov("eax",$c); # $c is "eax" 72 | 73 | &function_end($name); 74 | } 75 | 76 | 1; 77 | -------------------------------------------------------------------------------- /crypto/bn/asm/x86/div.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | # x86 assember 3 | 4 | sub bn_div_words 5 | { 6 | local($name)=@_; 7 | 8 | &function_begin($name,""); 9 | &mov("edx",&wparam(0)); # 10 | &mov("eax",&wparam(1)); # 11 | &mov("ebx",&wparam(2)); # 12 | &div("ebx"); 13 | &function_end($name); 14 | } 15 | 1; 16 | -------------------------------------------------------------------------------- /crypto/bn/asm/x86/f: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | # x86 assember 3 | 4 | -------------------------------------------------------------------------------- /crypto/bn/asm/x86/mul.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | # x86 assember 3 | 4 | sub bn_mul_words 5 | { 6 | local($name)=@_; 7 | 8 | &function_begin($name,""); 9 | 10 | &comment(""); 11 | $Low="eax"; 12 | $High="edx"; 13 | $a="ebx"; 14 | $w="ecx"; 15 | $r="edi"; 16 | $c="esi"; 17 | $num="ebp"; 18 | 19 | &xor($c,$c); # clear carry 20 | &mov($r,&wparam(0)); # 21 | &mov($a,&wparam(1)); # 22 | &mov($num,&wparam(2)); # 23 | &mov($w,&wparam(3)); # 24 | 25 | &and($num,0xfffffff8); # num / 8 26 | &jz(&label("mw_finish")); 27 | 28 | &set_label("mw_loop",0); 29 | for ($i=0; $i<32; $i+=4) 30 | { 31 | &comment("Round $i"); 32 | 33 | &mov("eax",&DWP($i,$a,"",0)); # *a 34 | &mul($w); # *a * w 35 | &add("eax",$c); # L(t)+=c 36 | # XXX 37 | 38 | &adc("edx",0); # H(t)+=carry 39 | &mov(&DWP($i,$r,"",0),"eax"); # *r= L(t); 40 | 41 | &mov($c,"edx"); # c= H(t); 42 | } 43 | 44 | &comment(""); 45 | &add($a,32); 46 | &add($r,32); 47 | &sub($num,8); 48 | &jz(&label("mw_finish")); 49 | &jmp(&label("mw_loop")); 50 | 51 | &set_label("mw_finish",0); 52 | &mov($num,&wparam(2)); # get num 53 | &and($num,7); 54 | &jnz(&label("mw_finish2")); 55 | &jmp(&label("mw_end")); 56 | 57 | &set_label("mw_finish2",1); 58 | for ($i=0; $i<7; $i++) 59 | { 60 | &comment("Tail Round $i"); 61 | &mov("eax",&DWP($i*4,$a,"",0));# *a 62 | &mul($w); # *a * w 63 | &add("eax",$c); # L(t)+=c 64 | # XXX 65 | &adc("edx",0); # H(t)+=carry 66 | &mov(&DWP($i*4,$r,"",0),"eax");# *r= L(t); 67 | &mov($c,"edx"); # c= H(t); 68 | &dec($num) if ($i != 7-1); 69 | &jz(&label("mw_end")) if ($i != 7-1); 70 | } 71 | &set_label("mw_end",0); 72 | &mov("eax",$c); 73 | 74 | &function_end($name); 75 | } 76 | 77 | 1; 78 | -------------------------------------------------------------------------------- /crypto/bn/asm/x86/mul_add.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | # x86 assember 3 | 4 | sub bn_mul_add_words 5 | { 6 | local($name)=@_; 7 | 8 | &function_begin($name,""); 9 | 10 | &comment(""); 11 | $Low="eax"; 12 | $High="edx"; 13 | $a="ebx"; 14 | $w="ebp"; 15 | $r="edi"; 16 | $c="esi"; 17 | 18 | &xor($c,$c); # clear carry 19 | &mov($r,&wparam(0)); # 20 | 21 | &mov("ecx",&wparam(2)); # 22 | &mov($a,&wparam(1)); # 23 | 24 | &and("ecx",0xfffffff8); # num / 8 25 | &mov($w,&wparam(3)); # 26 | 27 | &push("ecx"); # Up the stack for a tmp variable 28 | 29 | &jz(&label("maw_finish")); 30 | 31 | &set_label("maw_loop",0); 32 | 33 | &mov(&swtmp(0),"ecx"); # 34 | 35 | for ($i=0; $i<32; $i+=4) 36 | { 37 | &comment("Round $i"); 38 | 39 | &mov("eax",&DWP($i,$a,"",0)); # *a 40 | &mul($w); # *a * w 41 | &add("eax",$c); # L(t)+= *r 42 | &mov($c,&DWP($i,$r,"",0)); # L(t)+= *r 43 | &adc("edx",0); # H(t)+=carry 44 | &add("eax",$c); # L(t)+=c 45 | &adc("edx",0); # H(t)+=carry 46 | &mov(&DWP($i,$r,"",0),"eax"); # *r= L(t); 47 | &mov($c,"edx"); # c= H(t); 48 | } 49 | 50 | &comment(""); 51 | &mov("ecx",&swtmp(0)); # 52 | &add($a,32); 53 | &add($r,32); 54 | &sub("ecx",8); 55 | &jnz(&label("maw_loop")); 56 | 57 | &set_label("maw_finish",0); 58 | &mov("ecx",&wparam(2)); # get num 59 | &and("ecx",7); 60 | &jnz(&label("maw_finish2")); # helps branch prediction 61 | &jmp(&label("maw_end")); 62 | 63 | &set_label("maw_finish2",1); 64 | for ($i=0; $i<7; $i++) 65 | { 66 | &comment("Tail Round $i"); 67 | &mov("eax",&DWP($i*4,$a,"",0));# *a 68 | &mul($w); # *a * w 69 | &add("eax",$c); # L(t)+=c 70 | &mov($c,&DWP($i*4,$r,"",0)); # L(t)+= *r 71 | &adc("edx",0); # H(t)+=carry 72 | &add("eax",$c); 73 | &adc("edx",0); # H(t)+=carry 74 | &dec("ecx") if ($i != 7-1); 75 | &mov(&DWP($i*4,$r,"",0),"eax"); # *r= L(t); 76 | &mov($c,"edx"); # c= H(t); 77 | &jz(&label("maw_end")) if ($i != 7-1); 78 | } 79 | &set_label("maw_end",0); 80 | &mov("eax",$c); 81 | 82 | &pop("ecx"); # clear variable from 83 | 84 | &function_end($name); 85 | } 86 | 87 | 1; 88 | -------------------------------------------------------------------------------- /crypto/bn/asm/x86/sqr.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | # x86 assember 3 | 4 | sub bn_sqr_words 5 | { 6 | local($name)=@_; 7 | 8 | &function_begin($name,""); 9 | 10 | &comment(""); 11 | $r="esi"; 12 | $a="edi"; 13 | $num="ebx"; 14 | 15 | &mov($r,&wparam(0)); # 16 | &mov($a,&wparam(1)); # 17 | &mov($num,&wparam(2)); # 18 | 19 | &and($num,0xfffffff8); # num / 8 20 | &jz(&label("sw_finish")); 21 | 22 | &set_label("sw_loop",0); 23 | for ($i=0; $i<32; $i+=4) 24 | { 25 | &comment("Round $i"); 26 | &mov("eax",&DWP($i,$a,"",0)); # *a 27 | # XXX 28 | &mul("eax"); # *a * *a 29 | &mov(&DWP($i*2,$r,"",0),"eax"); # 30 | &mov(&DWP($i*2+4,$r,"",0),"edx");# 31 | } 32 | 33 | &comment(""); 34 | &add($a,32); 35 | &add($r,64); 36 | &sub($num,8); 37 | &jnz(&label("sw_loop")); 38 | 39 | &set_label("sw_finish",0); 40 | &mov($num,&wparam(2)); # get num 41 | &and($num,7); 42 | &jz(&label("sw_end")); 43 | 44 | for ($i=0; $i<7; $i++) 45 | { 46 | &comment("Tail Round $i"); 47 | &mov("eax",&DWP($i*4,$a,"",0)); # *a 48 | # XXX 49 | &mul("eax"); # *a * *a 50 | &mov(&DWP($i*8,$r,"",0),"eax"); # 51 | &dec($num) if ($i != 7-1); 52 | &mov(&DWP($i*8+4,$r,"",0),"edx"); 53 | &jz(&label("sw_end")) if ($i != 7-1); 54 | } 55 | &set_label("sw_end",0); 56 | 57 | &function_end($name); 58 | } 59 | 60 | 1; 61 | -------------------------------------------------------------------------------- /crypto/bn/asm/x86/sub.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | # x86 assember 3 | 4 | sub bn_sub_words 5 | { 6 | local($name)=@_; 7 | 8 | &function_begin($name,""); 9 | 10 | &comment(""); 11 | $a="esi"; 12 | $b="edi"; 13 | $c="eax"; 14 | $r="ebx"; 15 | $tmp1="ecx"; 16 | $tmp2="edx"; 17 | $num="ebp"; 18 | 19 | &mov($r,&wparam(0)); # get r 20 | &mov($a,&wparam(1)); # get a 21 | &mov($b,&wparam(2)); # get b 22 | &mov($num,&wparam(3)); # get num 23 | &xor($c,$c); # clear carry 24 | &and($num,0xfffffff8); # num / 8 25 | 26 | &jz(&label("aw_finish")); 27 | 28 | &set_label("aw_loop",0); 29 | for ($i=0; $i<8; $i++) 30 | { 31 | &comment("Round $i"); 32 | 33 | &mov($tmp1,&DWP($i*4,$a,"",0)); # *a 34 | &mov($tmp2,&DWP($i*4,$b,"",0)); # *b 35 | &sub($tmp1,$c); 36 | &mov($c,0); 37 | &adc($c,$c); 38 | &sub($tmp1,$tmp2); 39 | &adc($c,0); 40 | &mov(&DWP($i*4,$r,"",0),$tmp1); # *r 41 | } 42 | 43 | &comment(""); 44 | &add($a,32); 45 | &add($b,32); 46 | &add($r,32); 47 | &sub($num,8); 48 | &jnz(&label("aw_loop")); 49 | 50 | &set_label("aw_finish",0); 51 | &mov($num,&wparam(3)); # get num 52 | &and($num,7); 53 | &jz(&label("aw_end")); 54 | 55 | for ($i=0; $i<7; $i++) 56 | { 57 | &comment("Tail Round $i"); 58 | &mov($tmp1,&DWP($i*4,$a,"",0)); # *a 59 | &mov($tmp2,&DWP($i*4,$b,"",0));# *b 60 | &sub($tmp1,$c); 61 | &mov($c,0); 62 | &adc($c,$c); 63 | &sub($tmp1,$tmp2); 64 | &adc($c,0); 65 | &dec($num) if ($i != 6); 66 | &mov(&DWP($i*4,$r,"",0),$tmp1); # *a 67 | &jz(&label("aw_end")) if ($i != 6); 68 | } 69 | &set_label("aw_end",0); 70 | 71 | # &mov("eax",$c); # $c is "eax" 72 | 73 | &function_end($name); 74 | } 75 | 76 | 1; 77 | -------------------------------------------------------------------------------- /crypto/bn/asm/x86_64-gcc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/bn/asm/x86_64-gcc.c -------------------------------------------------------------------------------- /crypto/bn/asm/x86_64-gf2m.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/bn/asm/x86_64-gf2m.pl -------------------------------------------------------------------------------- /crypto/bn/bn.mul: -------------------------------------------------------------------------------- 1 | We need 2 | 3 | * bn_mul_comba8 4 | * bn_mul_comba4 5 | * bn_mul_normal 6 | * bn_mul_recursive 7 | 8 | * bn_sqr_comba8 9 | * bn_sqr_comba4 10 | bn_sqr_normal -> BN_sqr 11 | * bn_sqr_recursive 12 | 13 | * bn_mul_low_recursive 14 | * bn_mul_low_normal 15 | * bn_mul_high 16 | 17 | * bn_mul_part_recursive # symetric but not power of 2 18 | 19 | bn_mul_asymetric_recursive # uneven, but do the chop up. 20 | -------------------------------------------------------------------------------- /crypto/bn/divtest.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static int Rand(n) 5 | { 6 | unsigned char x[2]; 7 | RAND_pseudo_bytes(x,2); 8 | return (x[0] + 2*x[1]); 9 | } 10 | 11 | static void bug(char *m, BIGNUM *a, BIGNUM *b) 12 | { 13 | printf("%s!\na=",m); 14 | BN_print_fp(stdout, a); 15 | printf("\nb="); 16 | BN_print_fp(stdout, b); 17 | printf("\n"); 18 | fflush(stdout); 19 | } 20 | 21 | main() 22 | { 23 | BIGNUM *a=BN_new(), *b=BN_new(), *c=BN_new(), *d=BN_new(), 24 | *C=BN_new(), *D=BN_new(); 25 | BN_RECP_CTX *recp=BN_RECP_CTX_new(); 26 | BN_CTX *ctx=BN_CTX_new(); 27 | 28 | for(;;) { 29 | BN_pseudo_rand(a,Rand(),0,0); 30 | BN_pseudo_rand(b,Rand(),0,0); 31 | if (BN_is_zero(b)) continue; 32 | 33 | BN_RECP_CTX_set(recp,b,ctx); 34 | if (BN_div(C,D,a,b,ctx) != 1) 35 | bug("BN_div failed",a,b); 36 | if (BN_div_recp(c,d,a,recp,ctx) != 1) 37 | bug("BN_div_recp failed",a,b); 38 | else if (BN_cmp(c,C) != 0 || BN_cmp(c,C) != 0) 39 | bug("mismatch",a,b); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /crypto/bn/exp.c: -------------------------------------------------------------------------------- 1 | /* unused */ 2 | 3 | #include 4 | #include 5 | #include "bn_lcl.h" 6 | 7 | #define SIZE 256 8 | #define NUM (8*8*8) 9 | #define MOD (8*8*8*8*8) 10 | 11 | main(argc,argv) 12 | int argc; 13 | char *argv[]; 14 | { 15 | BN_CTX ctx; 16 | BIGNUM a,b,c,r,rr,t,l; 17 | int j,i,size=SIZE,num=NUM,mod=MOD; 18 | char *start,*end; 19 | BN_MONT_CTX mont; 20 | double d,md; 21 | 22 | BN_MONT_CTX_init(&mont); 23 | BN_CTX_init(&ctx); 24 | BN_init(&a); 25 | BN_init(&b); 26 | BN_init(&c); 27 | BN_init(&r); 28 | 29 | start=ms_time_new(); 30 | end=ms_time_new(); 31 | while (size <= 1024*8) 32 | { 33 | BN_rand(&a,size,0,0); 34 | BN_rand(&b,size,1,0); 35 | BN_rand(&c,size,0,1); 36 | 37 | BN_mod(&a,&a,&c,&ctx); 38 | 39 | ms_time_get(start); 40 | for (i=0; i<10; i++) 41 | BN_MONT_CTX_set(&mont,&c,&ctx); 42 | ms_time_get(end); 43 | md=ms_time_diff(start,end); 44 | 45 | ms_time_get(start); 46 | for (i=0; i 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | static int rle_compress_block(COMP_CTX *ctx, unsigned char *out, 8 | unsigned int olen, unsigned char *in, unsigned int ilen); 9 | static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, 10 | unsigned int olen, unsigned char *in, unsigned int ilen); 11 | 12 | static COMP_METHOD rle_method={ 13 | NID_rle_compression, 14 | LN_rle_compression, 15 | NULL, 16 | NULL, 17 | rle_compress_block, 18 | rle_expand_block, 19 | NULL, 20 | NULL, 21 | }; 22 | 23 | COMP_METHOD *COMP_rle(void) 24 | { 25 | return(&rle_method); 26 | } 27 | 28 | static int rle_compress_block(COMP_CTX *ctx, unsigned char *out, 29 | unsigned int olen, unsigned char *in, unsigned int ilen) 30 | { 31 | /* int i; */ 32 | 33 | if (ilen == 0 || olen < (ilen-1)) 34 | { 35 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ 36 | return(-1); 37 | } 38 | 39 | *(out++)=0; 40 | memcpy(out,in,ilen); 41 | return(ilen+1); 42 | } 43 | 44 | static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, 45 | unsigned int olen, unsigned char *in, unsigned int ilen) 46 | { 47 | int i; 48 | 49 | if (olen < (ilen-1)) 50 | { 51 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ 52 | return(-1); 53 | } 54 | 55 | i= *(in++); 56 | if (i == 0) 57 | { 58 | memcpy(out,in,ilen-1); 59 | } 60 | return(ilen-1); 61 | } 62 | -------------------------------------------------------------------------------- /crypto/comp/comp.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER_COMP_H 3 | #define HEADER_COMP_H 4 | 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef struct comp_ctx_st COMP_CTX; 12 | 13 | typedef struct comp_method_st 14 | { 15 | int type; /* NID for compression library */ 16 | const char *name; /* A text string to identify the library */ 17 | int (*init)(COMP_CTX *ctx); 18 | void (*finish)(COMP_CTX *ctx); 19 | int (*compress)(COMP_CTX *ctx, 20 | unsigned char *out, unsigned int olen, 21 | unsigned char *in, unsigned int ilen); 22 | int (*expand)(COMP_CTX *ctx, 23 | unsigned char *out, unsigned int olen, 24 | unsigned char *in, unsigned int ilen); 25 | /* The following two do NOTHING, but are kept for backward compatibility */ 26 | long (*ctrl)(void); 27 | long (*callback_ctrl)(void); 28 | } COMP_METHOD; 29 | 30 | struct comp_ctx_st 31 | { 32 | COMP_METHOD *meth; 33 | unsigned long compress_in; 34 | unsigned long compress_out; 35 | unsigned long expand_in; 36 | unsigned long expand_out; 37 | 38 | CRYPTO_EX_DATA ex_data; 39 | }; 40 | 41 | 42 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 43 | void COMP_CTX_free(COMP_CTX *ctx); 44 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 45 | unsigned char *in, int ilen); 46 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 47 | unsigned char *in, int ilen); 48 | COMP_METHOD *COMP_rle(void ); 49 | COMP_METHOD *COMP_zlib(void ); 50 | void COMP_zlib_cleanup(void); 51 | 52 | #ifdef HEADER_BIO_H 53 | #ifdef ZLIB 54 | BIO_METHOD *BIO_f_zlib(void); 55 | #endif 56 | #endif 57 | 58 | /* BEGIN ERROR CODES */ 59 | /* The following lines are auto generated by the script mkerr.pl. Any changes 60 | * made after this point may be overwritten when the script is next run. 61 | */ 62 | void ERR_load_COMP_strings(void); 63 | 64 | /* Error codes for the COMP functions. */ 65 | 66 | /* Function codes. */ 67 | #define COMP_F_BIO_ZLIB_FLUSH 99 68 | #define COMP_F_BIO_ZLIB_NEW 100 69 | #define COMP_F_BIO_ZLIB_READ 101 70 | #define COMP_F_BIO_ZLIB_WRITE 102 71 | 72 | /* Reason codes. */ 73 | #define COMP_R_ZLIB_DEFLATE_ERROR 99 74 | #define COMP_R_ZLIB_INFLATE_ERROR 100 75 | #define COMP_R_ZLIB_NOT_SUPPORTED 101 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | #endif 81 | -------------------------------------------------------------------------------- /crypto/comp/comp_lib.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth) 8 | { 9 | COMP_CTX *ret; 10 | 11 | if ((ret=(COMP_CTX *)OPENSSL_malloc(sizeof(COMP_CTX))) == NULL) 12 | { 13 | /* ZZZZZZZZZZZZZZZZ */ 14 | return(NULL); 15 | } 16 | memset(ret,0,sizeof(COMP_CTX)); 17 | ret->meth=meth; 18 | if ((ret->meth->init != NULL) && !ret->meth->init(ret)) 19 | { 20 | OPENSSL_free(ret); 21 | ret=NULL; 22 | } 23 | return(ret); 24 | } 25 | 26 | void COMP_CTX_free(COMP_CTX *ctx) 27 | { 28 | if(ctx == NULL) 29 | return; 30 | 31 | if (ctx->meth->finish != NULL) 32 | ctx->meth->finish(ctx); 33 | 34 | OPENSSL_free(ctx); 35 | } 36 | 37 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 38 | unsigned char *in, int ilen) 39 | { 40 | int ret; 41 | if (ctx->meth->compress == NULL) 42 | { 43 | /* ZZZZZZZZZZZZZZZZZ */ 44 | return(-1); 45 | } 46 | ret=ctx->meth->compress(ctx,out,olen,in,ilen); 47 | if (ret > 0) 48 | { 49 | ctx->compress_in+=ilen; 50 | ctx->compress_out+=ret; 51 | } 52 | return(ret); 53 | } 54 | 55 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 56 | unsigned char *in, int ilen) 57 | { 58 | int ret; 59 | 60 | if (ctx->meth->expand == NULL) 61 | { 62 | /* ZZZZZZZZZZZZZZZZZ */ 63 | return(-1); 64 | } 65 | ret=ctx->meth->expand(ctx,out,olen,in,ilen); 66 | if (ret > 0) 67 | { 68 | ctx->expand_in+=ilen; 69 | ctx->expand_out+=ret; 70 | } 71 | return(ret); 72 | } 73 | -------------------------------------------------------------------------------- /crypto/conf/README: -------------------------------------------------------------------------------- 1 | Configuration modules. These are a set of modules which can perform 2 | various configuration functions. 3 | 4 | Currently the routines should be called at most once when an application 5 | starts up: that is before it starts any threads. 6 | 7 | The routines read a configuration file set up like this: 8 | 9 | ----- 10 | #default section 11 | openssl_conf=init_section 12 | 13 | [init_section] 14 | 15 | module1=value1 16 | #Second instance of module1 17 | module1.1=valueX 18 | module2=value2 19 | module3=dso_literal 20 | module4=dso_section 21 | 22 | [dso_section] 23 | 24 | path=/some/path/to/some/dso.so 25 | other_stuff=other_value 26 | ---- 27 | 28 | When this file is loaded a configuration module with the specified string 29 | (module* in the above example) is looked up and its init function called as: 30 | 31 | int conf_init_func(CONF_IMODULE *md, CONF *cnf); 32 | 33 | The function can then take whatever action is appropriate, for example further 34 | lookups based on the value. Multiple instances of the same config module can be 35 | loaded. 36 | 37 | When the application closes down the modules are cleaned up by calling an 38 | optional finish function: 39 | 40 | void conf_finish_func(CONF_IMODULE *md); 41 | 42 | The finish functions are called in reverse order: that is the last module 43 | loaded is the first one cleaned up. 44 | 45 | If no module exists with a given name then an attempt is made to load a DSO 46 | with the supplied name. This might mean that "module3" attempts to load a DSO 47 | called libmodule3.so or module3.dll for example. An explicit DSO name can be 48 | given by including a separate section as in the module4 example above. 49 | 50 | The DSO is expected to at least contain an initialization function: 51 | 52 | int OPENSSL_init(CONF_IMODULE *md, CONF *cnf); 53 | 54 | and may also include a finish function: 55 | 56 | void OPENSSL_finish(CONF_IMODULE *md); 57 | 58 | Static modules can also be added using, 59 | 60 | int CONF_module_add(char *name, dso_mod_init_func *ifunc, dso_mod_finish_func 61 | *ffunc); 62 | 63 | where "name" is the name in the configuration file this function corresponds 64 | to. 65 | 66 | A set of builtin modules (currently only an ASN1 non functional test module) 67 | can be added by calling OPENSSL_load_builtin_modules(). 68 | 69 | The function OPENSSL_config() is intended as a simple configuration function 70 | that any application can call to perform various default configuration tasks. 71 | It uses the file openssl.cnf in the usual locations. 72 | 73 | 74 | -------------------------------------------------------------------------------- /crypto/conf/ssleay.cnf: -------------------------------------------------------------------------------- 1 | # 2 | # This is a test configuration file for use in SSLeay etc... 3 | # 4 | 5 | init = 5 6 | in\#it1 =10 7 | init2='10' 8 | init3='10\'' 9 | init4="10'" 10 | init5='='10\'' again' 11 | 12 | SSLeay::version = 0.5.0 13 | 14 | [genrsa] 15 | default_bits = 512 16 | SSLEAY::version = 0.5.0 17 | 18 | [gendh] 19 | default_bits = 512 20 | def_generator = 2 21 | 22 | [s_client] 23 | cipher1 = DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5\ 24 | cipher2 = 'DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5' 25 | cipher3 = "DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5" 26 | cipher4 = DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5 27 | 28 | [ default ] 29 | cert_dir = $ENV::HOME/.ca_certs 30 | 31 | HOME = /tmp/eay 32 | 33 | tmp_cert_dir = $HOME/.ca_certs 34 | tmp2_cert_dir = thisis$(HOME)stuff 35 | 36 | LOGNAME = Eric Young (home=$HOME) 37 | 38 | [ special ] 39 | 40 | H=$HOME 41 | H=$default::HOME 42 | H=$ENV::HOME 43 | # 44 | # SSLeay example configuration file. 45 | # This is mostly being used for generation of certificate requests. 46 | # 47 | 48 | RANDFILE = $HOME/.rand 49 | 50 | [ req ] 51 | default_bits = 512 52 | default_keyfile = privkey.pem 53 | 54 | Attribute_type_1 = countryName 55 | Attribute_text_1 = Country Name (2 letter code) 56 | Attribute_default_1 = AU 57 | 58 | Attribute_type_2 = stateOrProvinceName 59 | Attribute_text_2 = State or Province Name (full name) 60 | Attribute_default_2 = Queensland 61 | 62 | Attribute_type_3 = localityName 63 | Attribute_text_3 = Locality Name (eg, city) 64 | 65 | Attribute_type_4 = organizationName 66 | Attribute_text_4 = Organization Name (eg, company) 67 | Attribute_default_4 = Mincom Pty Ltd 68 | 69 | Attribute_type_5 = organizationalUnitName 70 | Attribute_text_5 = Organizational Unit Name (eg, section) 71 | Attribute_default_5 = TR 72 | 73 | Attribute_type_6 = commonName 74 | Attribute_text_6 = Common Name (eg, YOUR name) 75 | 76 | Attribute_type_7 = emailAddress 77 | Attribute_text_7 = Email Address 78 | 79 | -------------------------------------------------------------------------------- /crypto/des/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 2 | All rights reserved. 3 | 4 | This package is an DES implementation written by Eric Young (eay@cryptsoft.com). 5 | The implementation was written so as to conform with MIT's libdes. 6 | 7 | This library is free for commercial and non-commercial use as long as 8 | the following conditions are aheared to. The following conditions 9 | apply to all code found in this distribution. 10 | 11 | Copyright remains Eric Young's, and as such any Copyright notices in 12 | the code are not to be removed. 13 | If this package is used in a product, Eric Young should be given attribution 14 | as the author of that the SSL library. This can be in the form of a textual 15 | message at program startup or in documentation (online or textual) provided 16 | with the package. 17 | 18 | Redistribution and use in source and binary forms, with or without 19 | modification, are permitted provided that the following conditions 20 | are met: 21 | 1. Redistributions of source code must retain the copyright 22 | notice, this list of conditions and the following disclaimer. 23 | 2. Redistributions in binary form must reproduce the above copyright 24 | notice, this list of conditions and the following disclaimer in the 25 | documentation and/or other materials provided with the distribution. 26 | 3. All advertising materials mentioning features or use of this software 27 | must display the following acknowledgement: 28 | This product includes software developed by Eric Young (eay@cryptsoft.com) 29 | 30 | THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 31 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 32 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 33 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 34 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 35 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 36 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 39 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 40 | SUCH DAMAGE. 41 | 42 | The license and distribution terms for any publically available version or 43 | derivative of this code cannot be changed. i.e. this code cannot simply be 44 | copied and put under another distrubution license 45 | [including the GNU Public License.] 46 | 47 | The reason behind this being stated in this direct manner is past 48 | experience in code simply being copied and the attribution removed 49 | from it and then being distributed as part of other packages. This 50 | implementation was a non-trivial and unpaid effort. 51 | -------------------------------------------------------------------------------- /crypto/des/DES.pm: -------------------------------------------------------------------------------- 1 | package DES; 2 | 3 | require Exporter; 4 | require DynaLoader; 5 | @ISA = qw(Exporter DynaLoader); 6 | # Items to export into callers namespace by default 7 | # (move infrequently used names to @EXPORT_OK below) 8 | @EXPORT = qw( 9 | ); 10 | # Other items we are prepared to export if requested 11 | @EXPORT_OK = qw( 12 | crypt 13 | ); 14 | 15 | # Preloaded methods go here. Autoload methods go after __END__, and are 16 | # processed by the autosplit program. 17 | bootstrap DES; 18 | 1; 19 | __END__ 20 | -------------------------------------------------------------------------------- /crypto/des/INSTALL: -------------------------------------------------------------------------------- 1 | Check the CC and CFLAGS lines in the makefile 2 | 3 | If your C library does not support the times(3) function, change the 4 | #define TIMES to 5 | #undef TIMES in speed.c 6 | If it does, check the HZ value for the times(3) function. 7 | If your system does not define CLK_TCK it will be assumed to 8 | be 100.0. 9 | 10 | If possible use gcc v 2.7.? 11 | Turn on the maximum optimising (normally '-O3 -fomit-frame-pointer' for gcc) 12 | In recent times, some system compilers give better performace. 13 | 14 | type 'make' 15 | 16 | run './destest' to check things are ok. 17 | run './rpw' to check the tty code for reading passwords works. 18 | run './speed' to see how fast those optimisations make the library run :-) 19 | run './des_opts' to determin the best compile time options. 20 | 21 | The output from des_opts should be put in the makefile options and des_enc.c 22 | should be rebuilt. For 64 bit computers, do not use the DES_PTR option. 23 | For the DEC Alpha, edit des.h and change DES_LONG to 'unsigned int' 24 | and then you can use the 'DES_PTR' option. 25 | 26 | The file options.txt has the options listed for best speed on quite a 27 | few systems. Look and the options (UNROLL, PTR, RISC2 etc) and then 28 | turn on the relevant option in the Makefile. 29 | 30 | There are some special Makefile targets that make life easier. 31 | make cc - standard cc build 32 | make gcc - standard gcc build 33 | make x86-elf - x86 assembler (elf), linux-elf. 34 | make x86-out - x86 assembler (a.out), FreeBSD 35 | make x86-solaris- x86 assembler 36 | make x86-bsdi - x86 assembler (a.out with primative assembler). 37 | 38 | If at all possible use the assembler (for Windows NT/95, use 39 | asm/win32.obj to link with). The x86 assembler is very very fast. 40 | 41 | A make install will by default install 42 | libdes.a in /usr/local/lib/libdes.a 43 | des in /usr/local/bin/des 44 | des_crypt.man in /usr/local/man/man3/des_crypt.3 45 | des.man in /usr/local/man/man1/des.1 46 | des.h in /usr/include/des.h 47 | 48 | des(1) should be compatible with sunOS's but I have been unable to 49 | test it. 50 | 51 | These routines should compile on MSDOS, most 32bit and 64bit version 52 | of Unix (BSD and SYSV) and VMS, without modification. 53 | The only problems should be #include files that are in the wrong places. 54 | 55 | These routines can be compiled under MSDOS. 56 | I have successfully encrypted files using des(1) under MSDOS and then 57 | decrypted the files on a SparcStation. 58 | I have been able to compile and test the routines with 59 | Microsoft C v 5.1 and Turbo C v 2.0. 60 | The code in this library is in no way optimised for the 16bit 61 | operation of MSDOS. 62 | 63 | When building for glibc, ignore all of the above and just unpack into 64 | glibc-1.??/des and then gmake as per normal. 65 | 66 | As a final note on performace. Certain CPUs like sparcs and Alpha often give 67 | a %10 speed difference depending on the link order. It is rather anoying 68 | when one program reports 'x' DES encrypts a second and another reports 69 | 'x*0.9' the speed. 70 | -------------------------------------------------------------------------------- /crypto/des/Imakefile: -------------------------------------------------------------------------------- 1 | # This Imakefile has not been tested for a while but it should still 2 | # work when placed in the correct directory in the kerberos v 4 distribution 3 | 4 | SRCS= cbc_cksm.c cbc_enc.c ecb_enc.c pcbc_enc.c \ 5 | qud_cksm.c rand_key.c read_pwd.c set_key.c str2key.c \ 6 | enc_read.c enc_writ.c fcrypt.c cfb_enc.c \ 7 | ecb3_enc.c ofb_enc.c ofb64enc.c 8 | 9 | OBJS= cbc_cksm.o cbc_enc.o ecb_enc.o pcbc_enc.o \ 10 | qud_cksm.o rand_key.o read_pwd.o set_key.o str2key.o \ 11 | enc_read.o enc_writ.o fcrypt.o cfb_enc.o \ 12 | ecb3_enc.o ofb_enc.o ofb64enc.o 13 | 14 | GENERAL=COPYRIGHT FILES INSTALL Imakefile README VERSION makefile times \ 15 | vms.com KERBEROS 16 | DES= des.c des.man 17 | TESTING=destest.c speed.c rpw.c 18 | LIBDES= des_crypt.man des.h des_locl.h podd.h sk.h spr.h 19 | 20 | PERL= des.pl testdes.pl doIP doPC1 doPC2 PC1 PC2 shifts.pl 21 | 22 | CODE= $(GENERAL) $(DES) $(TESTING) $(SRCS) $(LIBDES) $(PERL) 23 | 24 | SRCDIR=$(SRCTOP)/lib/des 25 | 26 | DBG= -O 27 | INCLUDE= -I$(SRCDIR) 28 | CC= cc 29 | 30 | library_obj_rule() 31 | 32 | install_library_target(des,$(OBJS),$(SRCS),) 33 | 34 | test(destest,libdes.a,) 35 | test(rpw,libdes.a,) 36 | -------------------------------------------------------------------------------- /crypto/des/KERBEROS: -------------------------------------------------------------------------------- 1 | [ This is an old file, I don't know if it is true anymore 2 | but I will leave the file here - eay 21/11/95 ] 3 | 4 | To use this library with Bones (kerberos without DES): 5 | 1) Get my modified Bones - eBones. It can be found on 6 | gondwana.ecr.mu.oz.au (128.250.1.63) /pub/athena/eBones-p9.tar.Z 7 | and 8 | nic.funet.fi (128.214.6.100) /pub/unix/security/Kerberos/eBones-p9.tar.Z 9 | 10 | 2) Unpack this library in src/lib/des, makeing sure it is version 11 | 3.00 or greater (libdes.tar.93-10-07.Z). This versions differences 12 | from the version in comp.sources.misc volume 29 patchlevel2. 13 | The primarily difference is that it should compile under kerberos :-). 14 | It can be found at. 15 | ftp.psy.uq.oz.au (130.102.32.1) /pub/DES/libdes.tar.93-10-07.Z 16 | 17 | Now do a normal kerberos build and things should work. 18 | 19 | One problem I found when I was build on my local sun. 20 | --- 21 | For sunOS 4.1.1 apply the following patch to src/util/ss/make_commands.c 22 | 23 | *** make_commands.c.orig Fri Jul 3 04:18:35 1987 24 | --- make_commands.c Wed May 20 08:47:42 1992 25 | *************** 26 | *** 98,104 **** 27 | if (!rename(o_file, z_file)) { 28 | if (!vfork()) { 29 | chdir("/tmp"); 30 | ! execl("/bin/ld", "ld", "-o", o_file+5, "-s", "-r", "-n", 31 | z_file+5, 0); 32 | perror("/bin/ld"); 33 | _exit(1); 34 | --- 98,104 ---- 35 | if (!rename(o_file, z_file)) { 36 | if (!vfork()) { 37 | chdir("/tmp"); 38 | ! execl("/bin/ld", "ld", "-o", o_file+5, "-s", "-r", 39 | z_file+5, 0); 40 | perror("/bin/ld"); 41 | _exit(1); 42 | -------------------------------------------------------------------------------- /crypto/des/README: -------------------------------------------------------------------------------- 1 | 2 | libdes, Version 4.01 10-Jan-97 3 | 4 | Copyright (c) 1997, Eric Young 5 | All rights reserved. 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms specified in COPYRIGHT. 9 | 10 | -- 11 | The primary ftp site for this library is 12 | ftp://ftp.psy.uq.oz.au/pub/Crypto/DES/libdes-x.xx.tar.gz 13 | libdes is now also shipped with SSLeay. Primary ftp site of 14 | ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL/SSLeay-x.x.x.tar.gz 15 | 16 | The best way to build this library is to build it as part of SSLeay. 17 | 18 | This kit builds a DES encryption library and a DES encryption program. 19 | It supports ecb, cbc, ofb, cfb, triple ecb, triple cbc, triple ofb, 20 | triple cfb, desx, and MIT's pcbc encryption modes and also has a fast 21 | implementation of crypt(3). 22 | It contains support routines to read keys from a terminal, 23 | generate a random key, generate a key from an arbitrary length string, 24 | read/write encrypted data from/to a file descriptor. 25 | 26 | The implementation was written so as to conform with the manual entry 27 | for the des_crypt(3) library routines from MIT's project Athena. 28 | 29 | destest should be run after compilation to test the des routines. 30 | rpw should be run after compilation to test the read password routines. 31 | The des program is a replacement for the sun des command. I believe it 32 | conforms to the sun version. 33 | 34 | The Imakefile is setup for use in the kerberos distribution. 35 | 36 | These routines are best compiled with gcc or any other good 37 | optimising compiler. 38 | Just turn you optimiser up to the highest settings and run destest 39 | after the build to make sure everything works. 40 | 41 | I believe these routines are close to the fastest and most portable DES 42 | routines that use small lookup tables (4.5k) that are publicly available. 43 | The fcrypt routine is faster than ufc's fcrypt (when compiling with 44 | gcc2 -O2) on the sparc 2 (1410 vs 1270) but is not so good on other machines 45 | (on a sun3/260 168 vs 336). It is a function of CPU on chip cache size. 46 | [ 10-Jan-97 and a function of an incorrect speed testing program in 47 | ufc which gave much better test figures that reality ]. 48 | 49 | It is worth noting that on sparc and Alpha CPUs, performance of the DES 50 | library can vary by upto %10 due to the positioning of files after application 51 | linkage. 52 | 53 | Eric Young (eay@cryptsoft.com) 54 | 55 | -------------------------------------------------------------------------------- /crypto/des/asm/desboth.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | 3 | $L="edi"; 4 | $R="esi"; 5 | 6 | sub DES_encrypt3 7 | { 8 | local($name,$enc)=@_; 9 | 10 | &function_begin_B($name,""); 11 | &push("ebx"); 12 | &mov("ebx",&wparam(0)); 13 | 14 | &push("ebp"); 15 | &push("esi"); 16 | 17 | &push("edi"); 18 | 19 | &comment(""); 20 | &comment("Load the data words"); 21 | &mov($L,&DWP(0,"ebx","",0)); 22 | &mov($R,&DWP(4,"ebx","",0)); 23 | &stack_push(3); 24 | 25 | &comment(""); 26 | &comment("IP"); 27 | &IP_new($L,$R,"edx",0); 28 | 29 | # put them back 30 | 31 | if ($enc) 32 | { 33 | &mov(&DWP(4,"ebx","",0),$R); 34 | &mov("eax",&wparam(1)); 35 | &mov(&DWP(0,"ebx","",0),"edx"); 36 | &mov("edi",&wparam(2)); 37 | &mov("esi",&wparam(3)); 38 | } 39 | else 40 | { 41 | &mov(&DWP(4,"ebx","",0),$R); 42 | &mov("esi",&wparam(1)); 43 | &mov(&DWP(0,"ebx","",0),"edx"); 44 | &mov("edi",&wparam(2)); 45 | &mov("eax",&wparam(3)); 46 | } 47 | &mov(&swtmp(2), (DWC(($enc)?"1":"0"))); 48 | &mov(&swtmp(1), "eax"); 49 | &mov(&swtmp(0), "ebx"); 50 | &call("DES_encrypt2"); 51 | &mov(&swtmp(2), (DWC(($enc)?"0":"1"))); 52 | &mov(&swtmp(1), "edi"); 53 | &mov(&swtmp(0), "ebx"); 54 | &call("DES_encrypt2"); 55 | &mov(&swtmp(2), (DWC(($enc)?"1":"0"))); 56 | &mov(&swtmp(1), "esi"); 57 | &mov(&swtmp(0), "ebx"); 58 | &call("DES_encrypt2"); 59 | 60 | &stack_pop(3); 61 | &mov($L,&DWP(0,"ebx","",0)); 62 | &mov($R,&DWP(4,"ebx","",0)); 63 | 64 | &comment(""); 65 | &comment("FP"); 66 | &FP_new($L,$R,"eax",0); 67 | 68 | &mov(&DWP(0,"ebx","",0),"eax"); 69 | &mov(&DWP(4,"ebx","",0),$R); 70 | 71 | &pop("edi"); 72 | &pop("esi"); 73 | &pop("ebp"); 74 | &pop("ebx"); 75 | &ret(); 76 | &function_end_B($name); 77 | } 78 | 79 | 80 | -------------------------------------------------------------------------------- /crypto/des/des3s.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // gettsc.inl 3 | // 4 | // gives access to the Pentium's (secret) cycle counter 5 | // 6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca) 7 | // in 1996-7 and is entered, by him, into the public domain. 8 | 9 | #if defined(__WATCOMC__) 10 | void GetTSC(unsigned long&); 11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; 12 | #elif defined(__GNUC__) 13 | inline 14 | void GetTSC(unsigned long& tsc) 15 | { 16 | asm volatile(".byte 15, 49\n\t" 17 | : "=eax" (tsc) 18 | : 19 | : "%edx", "%eax"); 20 | } 21 | #elif defined(_MSC_VER) 22 | inline 23 | void GetTSC(unsigned long& tsc) 24 | { 25 | unsigned long a; 26 | __asm _emit 0fh 27 | __asm _emit 31h 28 | __asm mov a, eax; 29 | tsc=a; 30 | } 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | void main(int argc,char *argv[]) 38 | { 39 | des_key_schedule key1,key2,key3; 40 | unsigned long s1,s2,e1,e2; 41 | unsigned long data[2]; 42 | int i,j; 43 | 44 | for (j=0; j<6; j++) 45 | { 46 | for (i=0; i<1000; i++) /**/ 47 | { 48 | des_encrypt3(&data[0],key1,key2,key3); 49 | GetTSC(s1); 50 | des_encrypt3(&data[0],key1,key2,key3); 51 | des_encrypt3(&data[0],key1,key2,key3); 52 | des_encrypt3(&data[0],key1,key2,key3); 53 | GetTSC(e1); 54 | GetTSC(s2); 55 | des_encrypt3(&data[0],key1,key2,key3); 56 | des_encrypt3(&data[0],key1,key2,key3); 57 | des_encrypt3(&data[0],key1,key2,key3); 58 | des_encrypt3(&data[0],key1,key2,key3); 59 | GetTSC(e2); 60 | des_encrypt3(&data[0],key1,key2,key3); 61 | } 62 | 63 | printf("des %d %d (%d)\n", 64 | e1-s1,e2-s2,((e2-s2)-(e1-s1))); 65 | } 66 | } 67 | 68 | -------------------------------------------------------------------------------- /crypto/des/dess.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // gettsc.inl 3 | // 4 | // gives access to the Pentium's (secret) cycle counter 5 | // 6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca) 7 | // in 1996-7 and is entered, by him, into the public domain. 8 | 9 | #if defined(__WATCOMC__) 10 | void GetTSC(unsigned long&); 11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; 12 | #elif defined(__GNUC__) 13 | inline 14 | void GetTSC(unsigned long& tsc) 15 | { 16 | asm volatile(".byte 15, 49\n\t" 17 | : "=eax" (tsc) 18 | : 19 | : "%edx", "%eax"); 20 | } 21 | #elif defined(_MSC_VER) 22 | inline 23 | void GetTSC(unsigned long& tsc) 24 | { 25 | unsigned long a; 26 | __asm _emit 0fh 27 | __asm _emit 31h 28 | __asm mov a, eax; 29 | tsc=a; 30 | } 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | void main(int argc,char *argv[]) 38 | { 39 | des_key_schedule key; 40 | unsigned long s1,s2,e1,e2; 41 | unsigned long data[2]; 42 | int i,j; 43 | 44 | for (j=0; j<6; j++) 45 | { 46 | for (i=0; i<1000; i++) /**/ 47 | { 48 | des_encrypt1(&data[0],key,1); 49 | GetTSC(s1); 50 | des_encrypt1(&data[0],key,1); 51 | des_encrypt1(&data[0],key,1); 52 | des_encrypt1(&data[0],key,1); 53 | GetTSC(e1); 54 | GetTSC(s2); 55 | des_encrypt1(&data[0],key,1); 56 | des_encrypt1(&data[0],key,1); 57 | des_encrypt1(&data[0],key,1); 58 | des_encrypt1(&data[0],key,1); 59 | GetTSC(e2); 60 | des_encrypt1(&data[0],key,1); 61 | } 62 | 63 | printf("des %d %d (%d)\n", 64 | e1-s1,e2-s2,((e2-s2)-(e1-s1))); 65 | } 66 | } 67 | 68 | -------------------------------------------------------------------------------- /crypto/des/makefile.bc: -------------------------------------------------------------------------------- 1 | # 2 | # Origional BC Makefile from Teun 3 | # 4 | # 5 | CC = bcc 6 | TLIB = tlib /0 /C 7 | # note: the -3 flag produces code for 386, 486, Pentium etc; omit it for 286s 8 | OPTIMIZE= -3 -O2 9 | #WINDOWS= -W 10 | CFLAGS = -c -ml -d $(OPTIMIZE) $(WINDOWS) -DMSDOS 11 | LFLAGS = -ml $(WINDOWS) 12 | 13 | .c.obj: 14 | $(CC) $(CFLAGS) $*.c 15 | 16 | .obj.exe: 17 | $(CC) $(LFLAGS) -e$*.exe $*.obj libdes.lib 18 | 19 | all: $(LIB) destest.exe rpw.exe des.exe speed.exe 20 | 21 | # "make clean": use a directory containing only libdes .exe and .obj files... 22 | clean: 23 | del *.exe 24 | del *.obj 25 | del libdes.lib 26 | del libdes.rsp 27 | 28 | OBJS= cbc_cksm.obj cbc_enc.obj ecb_enc.obj pcbc_enc.obj \ 29 | qud_cksm.obj rand_key.obj set_key.obj str2key.obj \ 30 | enc_read.obj enc_writ.obj fcrypt.obj cfb_enc.obj \ 31 | ecb3_enc.obj ofb_enc.obj cbc3_enc.obj read_pwd.obj\ 32 | cfb64enc.obj ofb64enc.obj ede_enc.obj cfb64ede.obj\ 33 | ofb64ede.obj supp.obj 34 | 35 | LIB= libdes.lib 36 | 37 | $(LIB): $(OBJS) 38 | del $(LIB) 39 | makersp "+%s &\n" &&| 40 | $(OBJS) 41 | | >libdes.rsp 42 | $(TLIB) libdes.lib @libdes.rsp,nul 43 | del libdes.rsp 44 | 45 | destest.exe: destest.obj libdes.lib 46 | rpw.exe: rpw.obj libdes.lib 47 | speed.exe: speed.obj libdes.lib 48 | des.exe: des.obj libdes.lib 49 | 50 | 51 | -------------------------------------------------------------------------------- /crypto/des/options.txt: -------------------------------------------------------------------------------- 1 | Note that the UNROLL option makes the 'inner' des loop unroll all 16 rounds 2 | instead of the default 4. 3 | RISC1 and RISC2 are 2 alternatives for the inner loop and 4 | PTR means to use pointers arithmatic instead of arrays. 5 | 6 | FreeBSD - Pentium Pro 200mhz - gcc 2.7.2.2 - assembler 577,000 4620k/s 7 | IRIX 6.2 - R10000 195mhz - cc (-O3 -n32) - UNROLL RISC2 PTR 496,000 3968k/s 8 | solaris 2.5.1 usparc 167mhz?? - SC4.0 - UNROLL RISC1 PTR [1] 459,400 3672k/s 9 | FreeBSD - Pentium Pro 200mhz - gcc 2.7.2.2 - UNROLL RISC1 433,000 3468k/s 10 | solaris 2.5.1 usparc 167mhz?? - gcc 2.7.2 - UNROLL 380,000 3041k/s 11 | linux - pentium 100mhz - gcc 2.7.0 - assembler 281,000 2250k/s 12 | NT 4.0 - pentium 100mhz - VC 4.2 - assembler 281,000 2250k/s 13 | AIX 4.1? - PPC604 100mhz - cc - UNROLL 275,000 2200k/s 14 | IRIX 5.3 - R4400 200mhz - gcc 2.6.3 - UNROLL RISC2 PTR 235,300 1882k/s 15 | IRIX 5.3 - R4400 200mhz - cc - UNROLL RISC2 PTR 233,700 1869k/s 16 | NT 4.0 - pentium 100mhz - VC 4.2 - UNROLL RISC1 PTR 191,000 1528k/s 17 | DEC Alpha 165mhz?? - cc - RISC2 PTR [2] 181,000 1448k/s 18 | linux - pentium 100mhz - gcc 2.7.0 - UNROLL RISC1 PTR 158,500 1268k/s 19 | HPUX 10 - 9000/887 - cc - UNROLL [3] 148,000 1190k/s 20 | solaris 2.5.1 - sparc 10 50mhz - gcc 2.7.2 - UNROLL 123,600 989k/s 21 | IRIX 5.3 - R4000 100mhz - cc - UNROLL RISC2 PTR 101,000 808k/s 22 | DGUX - 88100 50mhz(?) - gcc 2.6.3 - UNROLL 81,000 648k/s 23 | solaris 2.4 486 50mhz - gcc 2.6.3 - assembler 65,000 522k/s 24 | HPUX 10 - 9000/887 - k&r cc (default compiler) - UNROLL PTR 76,000 608k/s 25 | solaris 2.4 486 50mhz - gcc 2.6.3 - UNROLL RISC2 43,500 344k/s 26 | AIX - old slow one :-) - cc - 39,000 312k/s 27 | 28 | Notes. 29 | [1] For the ultra sparc, SunC 4.0 30 | cc -xtarget=ultra -xarch=v8plus -Xa -xO5, running 'des_opts' 31 | gives a speed of 344,000 des/s while 'speed' gives 459,000 des/s. 32 | I'll record the higher since it is coming from the library but it 33 | is all rather weird. 34 | [2] Similar to the ultra sparc ([1]), 181,000 for 'des_opts' vs 175,000. 35 | [3] I was unable to get access to this machine when it was not heavily loaded. 36 | As such, my timing program was never able to get more that %30 of the CPU. 37 | This would cause the program to give much lower speed numbers because 38 | it would be 'fighting' to stay in the cache with the other CPU burning 39 | processes. 40 | -------------------------------------------------------------------------------- /crypto/des/t/test: -------------------------------------------------------------------------------- 1 | #!./perl 2 | 3 | BEGIN { push(@INC, qw(../../../lib ../../lib ../lib lib)); } 4 | 5 | use DES; 6 | 7 | $key='00000000'; 8 | $ks=DES::set_key($key); 9 | @a=split(//,$ks); 10 | foreach (@a) { printf "%02x-",ord($_); } 11 | print "\n"; 12 | 13 | 14 | $key=DES::random_key(); 15 | print "($_)\n"; 16 | @a=split(//,$key); 17 | foreach (@a) { printf "%02x-",ord($_); } 18 | print "\n"; 19 | $str="this is and again into the breach"; 20 | ($k1,$k2)=DES::string_to_2keys($str); 21 | @a=split(//,$k1); 22 | foreach (@a) { printf "%02x-",ord($_); } 23 | print "\n"; 24 | @a=split(//,$k2); 25 | foreach (@a) { printf "%02x-",ord($_); } 26 | print "\n"; 27 | 28 | -------------------------------------------------------------------------------- /crypto/des/times/486-50.sol: -------------------------------------------------------------------------------- 1 | Solaris 2.4, 486 50mhz, gcc 2.6.3 2 | options des ecb/s 3 | 16 r2 i 43552.51 100.0% 4 | 16 r1 i 43487.45 99.9% 5 | 16 c p 43003.23 98.7% 6 | 16 r2 p 42339.00 97.2% 7 | 16 c i 41900.91 96.2% 8 | 16 r1 p 41360.64 95.0% 9 | 4 c i 38728.48 88.9% 10 | 4 c p 38225.63 87.8% 11 | 4 r1 i 38085.79 87.4% 12 | 4 r2 i 37825.64 86.9% 13 | 4 r2 p 34611.00 79.5% 14 | 4 r1 p 31802.00 73.0% 15 | -DDES_UNROLL -DDES_RISC2 16 | 17 | -------------------------------------------------------------------------------- /crypto/des/times/586-100.lnx: -------------------------------------------------------------------------------- 1 | Pentium 100 2 | Linux 2 kernel 3 | gcc 2.7.0 -O3 -fomit-frame-pointer 4 | No X server running, just a console, it makes the top speed jump from 151,000 5 | to 158,000 :-). 6 | options des ecb/s 7 | assember 281000.00 177.1% 8 | 16 r1 p 158667.40 100.0% 9 | 16 r1 i 148471.70 93.6% 10 | 16 r2 p 143961.80 90.7% 11 | 16 r2 i 141689.20 89.3% 12 | 4 r1 i 140100.00 88.3% 13 | 4 r2 i 134049.40 84.5% 14 | 16 c i 124145.20 78.2% 15 | 16 c p 121584.20 76.6% 16 | 4 c i 118116.00 74.4% 17 | 4 r2 p 117977.90 74.4% 18 | 4 c p 114971.40 72.5% 19 | 4 r1 p 114578.40 72.2% 20 | -DDES_UNROLL -DDES_RISC1 -DDES_PTR 21 | -------------------------------------------------------------------------------- /crypto/des/times/686-200.fre: -------------------------------------------------------------------------------- 1 | Pentium 100 2 | Free BSD 2.1.5 kernel 3 | gcc 2.7.2.2 -O3 -fomit-frame-pointer 4 | options des ecb/s 5 | assember 578000.00 133.1% 6 | 16 r2 i 434454.80 100.0% 7 | 16 r1 i 433621.43 99.8% 8 | 16 r2 p 431375.69 99.3% 9 | 4 r1 i 423722.30 97.5% 10 | 4 r2 i 422399.40 97.2% 11 | 16 r1 p 421739.40 97.1% 12 | 16 c i 399027.94 91.8% 13 | 16 c p 372251.70 85.7% 14 | 4 c i 365118.35 84.0% 15 | 4 c p 352880.51 81.2% 16 | 4 r2 p 255104.90 58.7% 17 | 4 r1 p 251289.18 57.8% 18 | -DDES_UNROLL -DDES_RISC2 19 | -------------------------------------------------------------------------------- /crypto/des/times/aix.cc: -------------------------------------------------------------------------------- 1 | From: Paco Garcia 2 | 3 | This machine is a Bull Estrella Minitower Model MT604-100 4 | Processor : PPC604 5 | P.Speed : 100Mhz 6 | Data/Instr Cache : 16 K 7 | L2 Cache : 256 K 8 | PCI BUS Speed : 33 Mhz 9 | TransfRate PCI : 132 MB/s 10 | Memory : 96 MB 11 | 12 | options des ecb/s 13 | 4 c p 275118.61 100.0% 14 | 4 c i 273545.07 99.4% 15 | 4 r2 p 270441.02 98.3% 16 | 4 r1 p 253052.15 92.0% 17 | 4 r2 i 240842.97 87.5% 18 | 4 r1 i 240556.66 87.4% 19 | 16 c i 224603.99 81.6% 20 | 16 c p 224483.98 81.6% 21 | 16 r2 p 215691.19 78.4% 22 | 16 r1 p 208332.83 75.7% 23 | 16 r1 i 199206.50 72.4% 24 | 16 r2 i 198963.70 72.3% 25 | -DDES_PTR 26 | 27 | -------------------------------------------------------------------------------- /crypto/des/times/alpha.cc: -------------------------------------------------------------------------------- 1 | cc -O2 2 | DES_LONG is 'unsigned int' 3 | 4 | options des ecb/s 5 | 4 r2 p 181146.14 100.0% 6 | 16 r2 p 172102.94 95.0% 7 | 4 r2 i 165424.11 91.3% 8 | 16 c p 160468.64 88.6% 9 | 4 c p 156653.59 86.5% 10 | 4 c i 155245.18 85.7% 11 | 4 r1 p 154729.68 85.4% 12 | 16 r2 i 154137.69 85.1% 13 | 16 r1 p 152357.96 84.1% 14 | 16 c i 148743.91 82.1% 15 | 4 r1 i 146695.59 81.0% 16 | 16 r1 i 144961.00 80.0% 17 | -DDES_RISC2 -DDES_PTR 18 | 19 | -------------------------------------------------------------------------------- /crypto/des/times/hpux.cc: -------------------------------------------------------------------------------- 1 | HPUX 10 - 9000/887 - cc -D_HPUX_SOURCE -Aa +ESlit +O2 -Wl,-a,archive 2 | 3 | options des ecb/s 4 | 16 c i 149448.90 100.0% 5 | 4 c i 145861.79 97.6% 6 | 16 r2 i 141710.96 94.8% 7 | 16 r1 i 139455.33 93.3% 8 | 4 r2 i 138800.00 92.9% 9 | 4 r1 i 136692.65 91.5% 10 | 16 r2 p 110228.17 73.8% 11 | 16 r1 p 109397.07 73.2% 12 | 16 c p 109209.89 73.1% 13 | 4 c p 108014.71 72.3% 14 | 4 r2 p 107873.88 72.2% 15 | 4 r1 p 107685.83 72.1% 16 | -DDES_UNROLL 17 | 18 | -------------------------------------------------------------------------------- /crypto/des/times/sparc.gcc: -------------------------------------------------------------------------------- 1 | solaris 2.5.1 - sparc 10 50mhz - gcc 2.7.2 2 | 3 | options des ecb/s 4 | 16 c i 124382.70 100.0% 5 | 4 c i 118884.68 95.6% 6 | 16 c p 112261.20 90.3% 7 | 16 r2 i 111777.10 89.9% 8 | 16 r2 p 108896.30 87.5% 9 | 16 r1 p 108791.59 87.5% 10 | 4 c p 107290.10 86.3% 11 | 4 r1 p 104583.80 84.1% 12 | 16 r1 i 104206.20 83.8% 13 | 4 r2 p 103709.80 83.4% 14 | 4 r2 i 98306.43 79.0% 15 | 4 r1 i 91525.80 73.6% 16 | -DDES_UNROLL 17 | 18 | -------------------------------------------------------------------------------- /crypto/des/times/usparc.cc: -------------------------------------------------------------------------------- 1 | solaris 2.5.1 usparc 167mhz?? - SC4.0 cc -fast -Xa -xO5 2 | 3 | For the ultra sparc, SunC 4.0 cc -fast -Xa -xO5, running 'des_opts' 4 | gives a speed of 475,000 des/s while 'speed' gives 417,000 des/s. 5 | I believe the difference is tied up in optimisation that the compiler 6 | is able to perform when the code is 'inlined'. For 'speed', the DES 7 | routines are being linked from a library. I'll record the higher 8 | speed since if performance is everything, you can always inline 9 | 'des_enc.c'. 10 | 11 | [ 16-Jan-06 - I've been playing with the 12 | '-xtarget=ultra -xarch=v8plus -Xa -xO5 -Xa' 13 | and while it makes the des_opts numbers much slower, it makes the 14 | actual 'speed' numbers look better which is a realistic version of 15 | using the libraries. ] 16 | 17 | options des ecb/s 18 | 16 r1 p 475516.90 100.0% 19 | 16 r2 p 439388.10 92.4% 20 | 16 c i 427001.40 89.8% 21 | 16 c p 419516.50 88.2% 22 | 4 r2 p 409491.70 86.1% 23 | 4 r1 p 404266.90 85.0% 24 | 4 c p 398121.00 83.7% 25 | 4 c i 370588.40 77.9% 26 | 4 r1 i 362742.20 76.3% 27 | 16 r2 i 331275.50 69.7% 28 | 16 r1 i 324730.60 68.3% 29 | 4 r2 i 63535.10 13.4% <-- very very weird, must be cache problems. 30 | -DDES_UNROLL -DDES_RISC1 -DDES_PTR 31 | 32 | -------------------------------------------------------------------------------- /crypto/des/typemap: -------------------------------------------------------------------------------- 1 | # 2 | # DES SECTION 3 | # 4 | deschar * T_DESCHARP 5 | des_cblock * T_CBLOCK 6 | des_cblock T_CBLOCK 7 | des_key_schedule T_SCHEDULE 8 | des_key_schedule * T_SCHEDULE 9 | 10 | INPUT 11 | T_CBLOCK 12 | $var=(des_cblock *)SvPV($arg,len); 13 | if (len < DES_KEY_SZ) 14 | { 15 | croak(\"$var needs to be at least %u bytes long\",DES_KEY_SZ); 16 | } 17 | 18 | T_SCHEDULE 19 | $var=(des_key_schedule *)SvPV($arg,len); 20 | if (len < DES_SCHEDULE_SZ) 21 | { 22 | croak(\"$var needs to be at least %u bytes long\", 23 | DES_SCHEDULE_SZ); 24 | } 25 | 26 | OUTPUT 27 | T_CBLOCK 28 | sv_setpvn($arg,(char *)$var,DES_KEY_SZ); 29 | 30 | T_SCHEDULE 31 | sv_setpvn($arg,(char *)$var,DES_SCHEDULE_SZ); 32 | 33 | T_DESCHARP 34 | sv_setpvn($arg,(char *)$var,len); 35 | -------------------------------------------------------------------------------- /crypto/dh/dh1024.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIGHAoGBAJf2QmHKtQXdKCjhPx1ottPb0PMTBH9A6FbaWMsTuKG/K3g6TG1Z1fkq 3 | /Gz/PWk/eLI9TzFgqVAuPvr3q14a1aZeVUMTgo2oO5/y2UHe6VaJ+trqCTat3xlx 4 | /mNbIK9HA2RgPC3gWfVLZQrY+gz3ASHHR5nXWHEyvpuZm7m3h+irAgEC 5 | -----END DH PARAMETERS----- 6 | -------------------------------------------------------------------------------- /crypto/dh/dh192.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MB4CGQDUoLoCULb9LsYm5+/WN992xxbiLQlEuIsCAQM= 3 | -----END DH PARAMETERS----- 4 | -------------------------------------------------------------------------------- /crypto/dh/dh2048.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIIBCAKCAQEA7ZKJNYJFVcs7+6J2WmkEYb8h86tT0s0h2v94GRFS8Q7B4lW9aG9o 3 | AFO5Imov5Jo0H2XMWTKKvbHbSe3fpxJmw/0hBHAY8H/W91hRGXKCeyKpNBgdL8sh 4 | z22SrkO2qCnHJ6PLAMXy5fsKpFmFor2tRfCzrfnggTXu2YOzzK7q62bmqVdmufEo 5 | pT8igNcLpvZxk5uBDvhakObMym9mX3rAEBoe8PwttggMYiiw7NuJKO4MqD1llGkW 6 | aVM8U2ATsCun1IKHrRxynkE1/MJ86VHeYYX8GZt2YA8z+GuzylIOKcMH6JAWzMwA 7 | Gbatw6QwizOhr9iMjZ0B26TE3X8LvW84wwIBAg== 8 | -----END DH PARAMETERS----- 9 | -----BEGIN DH PARAMETERS----- 10 | MIIBCAKCAQEArtA3w73zP6Lu3EOQtwogiXt3AXXpuS6yD4BhzNS1pZFyPHk0/an5 11 | 8ydEkPhQZHKDW+BZJxxPLANaTudWo2YT8TgtvUdN6KSgMiEi6McwqDw+SADuvW+F 12 | SKUYFxG6VFIxyEP6xBdf+vhJxEDbRG2EYsHDRRtJ76gp9cSKTHusf2R+4AAVGqnt 13 | gRAbNqtcOar/7FSj+Pl8G3v0Bty0LcCSpbqgYlnv6z+rErQmmC6PPvSz97TDMCok 14 | yKpCE9hFA1zkqK3TH4FmFvGeIaXJUIBZf4mArWuBTjWFW3nmhESRUn1VK3K3x42N 15 | a5k6c2+EhrMFiLjxuH6JZoqL0/E93FF9SwIBAg== 16 | -----END DH PARAMETERS----- 17 | -------------------------------------------------------------------------------- /crypto/dh/dh4096.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MIICCAKCAgEA/urRnb6vkPYc/KEGXWnbCIOaKitq7ySIq9dTH7s+Ri59zs77zty7 3 | vfVlSe6VFTBWgYjD2XKUFmtqq6CqXMhVX5ElUDoYDpAyTH85xqNFLzFC7nKrff/H 4 | TFKNttp22cZE9V0IPpzedPfnQkE7aUdmF9JnDyv21Z/818O93u1B4r0szdnmEvEF 5 | bKuIxEHX+bp0ZR7RqE1AeifXGJX3d6tsd2PMAObxwwsv55RGkn50vHO4QxtTARr1 6 | rRUV5j3B3oPMgC7Offxx+98Xn45B1/G0Prp11anDsR1PGwtaCYipqsvMwQUSJtyE 7 | EOQWk+yFkeMe4vWv367eEi0Sd/wnC+TSXBE3pYvpYerJ8n1MceI5GQTdarJ77OW9 8 | bGTHmxRsLSCM1jpLdPja5jjb4siAa6EHc4qN9c/iFKS3PQPJEnX7pXKBRs5f7AF3 9 | W3RIGt+G9IVNZfXaS7Z/iCpgzgvKCs0VeqN38QsJGtC1aIkwOeyjPNy2G6jJ4yqH 10 | ovXYt/0mc00vCWeSNS1wren0pR2EiLxX0ypjjgsU1mk/Z3b/+zVf7fZSIB+nDLjb 11 | NPtUlJCVGnAeBK1J1nG3TQicqowOXoM6ISkdaXj5GPJdXHab2+S7cqhKGv5qC7rR 12 | jT6sx7RUr0CNTxzLI7muV2/a4tGmj0PSdXQdsZ7tw7gbXlaWT1+MM2MCAQI= 13 | -----END DH PARAMETERS----- 14 | 15 | -------------------------------------------------------------------------------- /crypto/dh/dh512.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN DH PARAMETERS----- 2 | MEYCQQDaWDwW2YUiidDkr3VvTMqS3UvlM7gE+w/tlO+cikQD7VdGUNNpmdsp13Yn 3 | a6LT1BLiGPTdHghM9tgAPnxHdOgzAgEC 4 | -----END DH PARAMETERS----- 5 | -------------------------------------------------------------------------------- /crypto/dh/example: -------------------------------------------------------------------------------- 1 | From owner-cypherpunks@toad.com Mon Sep 25 10:50:51 1995 2 | Received: from minbne.mincom.oz.au by orb.mincom.oz.au with SMTP id AA10562 3 | (5.65c/IDA-1.4.4 for eay); Wed, 27 Sep 1995 19:41:55 +1000 4 | Received: by minbne.mincom.oz.au id AA19958 5 | (5.65c/IDA-1.4.4 for eay@orb.mincom.oz.au); Wed, 27 Sep 1995 19:34:59 +1000 6 | Received: from relay3.UU.NET by bunyip.cc.uq.oz.au with SMTP (PP); 7 | Wed, 27 Sep 1995 19:13:05 +1000 8 | Received: from toad.com by relay3.UU.NET with SMTP id QQzizb16156; 9 | Wed, 27 Sep 1995 04:48:46 -0400 10 | Received: by toad.com id AA07905; Tue, 26 Sep 95 06:31:45 PDT 11 | Received: from by toad.com id AB07851; Tue, 26 Sep 95 06:31:40 PDT 12 | Received: from servo.qualcomm.com (servo.qualcomm.com [129.46.128.14]) 13 | by cygnus.com (8.6.12/8.6.9) with ESMTP id RAA18442 14 | for ; Mon, 25 Sep 1995 17:52:47 -0700 15 | Received: (karn@localhost) by servo.qualcomm.com (8.6.12/QC-BSD-2.5.1) 16 | id RAA14732; Mon, 25 Sep 1995 17:50:51 -0700 17 | Date: Mon, 25 Sep 1995 17:50:51 -0700 18 | From: Phil Karn 19 | Message-Id: <199509260050.RAA14732@servo.qualcomm.com> 20 | To: cypherpunks@toad.com, ipsec-dev@eit.com 21 | Subject: Primality verification needed 22 | Sender: owner-cypherpunks@toad.com 23 | Precedence: bulk 24 | Status: RO 25 | X-Status: 26 | 27 | Hi. I've generated a 2047-bit "strong" prime number that I would like to 28 | use with Diffie-Hellman key exchange. I assert that not only is this number 29 | 'p' prime, but so is (p-1)/2. 30 | 31 | I've used the mpz_probab_prime() function in the Gnu Math Package (GMP) version 32 | 1.3.2 to test this number. This function uses the Miller-Rabin primality test. 33 | However, to increase my confidence that this number really is a strong prime, 34 | I'd like to ask others to confirm it with other tests. Here's the number in hex: 35 | 36 | 72a925f760b2f954ed287f1b0953f3e6aef92e456172f9fe86fdd8822241b9c9788fbc289982743e 37 | fbcd2ccf062b242d7a567ba8bbb40d79bca7b8e0b6c05f835a5b938d985816bc648985adcff5402a 38 | a76756b36c845a840a1d059ce02707e19cf47af0b5a882f32315c19d1b86a56c5389c5e9bee16b65 39 | fde7b1a8d74a7675de9b707d4c5a4633c0290c95ff30a605aeb7ae864ff48370f13cf01d49adb9f2 40 | 3d19a439f753ee7703cf342d87f431105c843c78ca4df639931f3458fae8a94d1687e99a76ed99d0 41 | ba87189f42fd31ad8262c54a8cf5914ae6c28c540d714a5f6087a171fb74f4814c6f968d72386ef3 42 | 56a05180c3bec7ddd5ef6fe76b1f717b 43 | 44 | The generator, g, for this prime is 2. 45 | 46 | Thanks! 47 | 48 | Phil Karn 49 | 50 | 51 | -------------------------------------------------------------------------------- /crypto/dh/generate: -------------------------------------------------------------------------------- 1 | From: stewarts@ix.netcom.com (Bill Stewart) 2 | Newsgroups: sci.crypt 3 | Subject: Re: Diffie-Hellman key exchange 4 | Date: Wed, 11 Oct 1995 23:08:28 GMT 5 | Organization: Freelance Information Architect 6 | Lines: 32 7 | Message-ID: <45hir2$7l8@ixnews7.ix.netcom.com> 8 | References: <458rhn$76m$1@mhadf.production.compuserve.com> 9 | NNTP-Posting-Host: ix-pl4-16.ix.netcom.com 10 | X-NETCOM-Date: Wed Oct 11 4:09:22 PM PDT 1995 11 | X-Newsreader: Forte Free Agent 1.0.82 12 | 13 | Kent Briggs <72124.3234@CompuServe.COM> wrote: 14 | 15 | >I have a copy of the 1976 IEEE article describing the 16 | >Diffie-Hellman public key exchange algorithm: y=a^x mod q. I'm 17 | >looking for sources that give examples of secure a,q pairs and 18 | >possible some source code that I could examine. 19 | 20 | q should be prime, and ideally should be a "strong prime", 21 | which means it's of the form 2n+1 where n is also prime. 22 | q also needs to be long enough to prevent the attacks LaMacchia and 23 | Odlyzko described (some variant on a factoring attack which generates 24 | a large pile of simultaneous equations and then solves them); 25 | long enough is about the same size as factoring, so 512 bits may not 26 | be secure enough for most applications. (The 192 bits used by 27 | "secure NFS" was certainly not long enough.) 28 | 29 | a should be a generator for q, which means it needs to be 30 | relatively prime to q-1. Usually a small prime like 2, 3 or 5 will 31 | work. 32 | 33 | .... 34 | 35 | Date: Tue, 26 Sep 1995 13:52:36 MST 36 | From: "Richard Schroeppel" 37 | To: karn 38 | Cc: ho@cs.arizona.edu 39 | Subject: random large primes 40 | 41 | Since your prime is really random, proving it is hard. 42 | My personal limit on rigorously proved primes is ~350 digits. 43 | If you really want a proof, we should talk to Francois Morain, 44 | or the Australian group. 45 | 46 | If you want 2 to be a generator (mod P), then you need it 47 | to be a non-square. If (P-1)/2 is also prime, then 48 | non-square == primitive-root for bases << P. 49 | 50 | In the case at hand, this means 2 is a generator iff P = 11 (mod 24). 51 | If you want this, you should restrict your sieve accordingly. 52 | 53 | 3 is a generator iff P = 5 (mod 12). 54 | 55 | 5 is a generator iff P = 3 or 7 (mod 10). 56 | 57 | 2 is perfectly usable as a base even if it's a non-generator, since 58 | it still covers half the space of possible residues. And an 59 | eavesdropper can always determine the low-bit of your exponent for 60 | a generator anyway. 61 | 62 | Rich rcs@cs.arizona.edu 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /crypto/dsa/README: -------------------------------------------------------------------------------- 1 | The stuff in here is based on patches supplied to me by 2 | Steven Schoch to do DSS. 3 | I have since modified a them a little but a debt of gratitude 4 | is due for doing the initial work. 5 | -------------------------------------------------------------------------------- /crypto/dso/README: -------------------------------------------------------------------------------- 1 | NOTES 2 | ----- 3 | 4 | I've checked out HPUX (well, version 11 at least) and shl_t is 5 | a pointer type so it's safe to use in the way it has been in 6 | dso_dl.c. On the other hand, HPUX11 support dlfcn too and 7 | according to their man page, prefer developers to move to that. 8 | I'll leave Richard's changes there as I guess dso_dl is needed 9 | for HPUX10.20. 10 | 11 | There is now a callback scheme in place where filename conversion can 12 | (a) be turned off altogether through the use of the 13 | DSO_FLAG_NO_NAME_TRANSLATION flag, 14 | (b) be handled by default using the default DSO_METHOD's converter 15 | (c) overriden per-DSO by setting the override callback 16 | (d) a mix of (b) and (c) - eg. implement an override callback that; 17 | (i) checks if we're win32 (if(strstr(dso->meth->name, "win32")....) 18 | and if so, convert "blah" into "blah32.dll" (the default is 19 | otherwise to make it "blah.dll"). 20 | (ii) default to the normal behaviour - we're not on win32, eg. 21 | finish with (return dso->meth->dso_name_converter(dso,NULL)). 22 | 23 | -------------------------------------------------------------------------------- /crypto/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | #define HEADER_EBCDIC_H 5 | 6 | #include 7 | 8 | /* Avoid name clashes with other applications */ 9 | #define os_toascii _openssl_os_toascii 10 | #define os_toebcdic _openssl_os_toebcdic 11 | #define ebcdic2ascii _openssl_ebcdic2ascii 12 | #define ascii2ebcdic _openssl_ascii2ebcdic 13 | 14 | extern const unsigned char os_toascii[256]; 15 | extern const unsigned char os_toebcdic[256]; 16 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 17 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /crypto/evp/m_wp.c: -------------------------------------------------------------------------------- 1 | /* crypto/evp/m_wp.c */ 2 | 3 | #include 4 | #include "cryptlib.h" 5 | 6 | #ifndef OPENSSL_NO_WHIRLPOOL 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "evp_locl.h" 13 | 14 | static int init(EVP_MD_CTX *ctx) 15 | { return WHIRLPOOL_Init(ctx->md_data); } 16 | 17 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) 18 | { return WHIRLPOOL_Update(ctx->md_data,data,count); } 19 | 20 | static int final(EVP_MD_CTX *ctx,unsigned char *md) 21 | { return WHIRLPOOL_Final(md,ctx->md_data); } 22 | 23 | static const EVP_MD whirlpool_md= 24 | { 25 | NID_whirlpool, 26 | 0, 27 | WHIRLPOOL_DIGEST_LENGTH, 28 | 0, 29 | init, 30 | update, 31 | final, 32 | NULL, 33 | NULL, 34 | EVP_PKEY_NULL_method, 35 | WHIRLPOOL_BBLOCK/8, 36 | sizeof(EVP_MD *)+sizeof(WHIRLPOOL_CTX), 37 | }; 38 | 39 | const EVP_MD *EVP_whirlpool(void) 40 | { 41 | return(&whirlpool_md); 42 | } 43 | #endif 44 | -------------------------------------------------------------------------------- /crypto/fips_ers.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef OPENSSL_FIPS 4 | # include "fips_err.h" 5 | #else 6 | static void *dummy=&dummy; 7 | #endif 8 | -------------------------------------------------------------------------------- /crypto/jpake/Makefile: -------------------------------------------------------------------------------- 1 | DIR=jpake 2 | TOP=../.. 3 | 4 | CFLAGS= $(INCLUDES) $(CFLAG) 5 | 6 | LIB=$(TOP)/libcrypto.a 7 | LIBOBJ=jpake.o jpake_err.o 8 | LIBSRC=jpake.c jpake_err.c 9 | 10 | EXHEADER=jpake.h 11 | TEST=jpaketest.c 12 | 13 | top: 14 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) 15 | 16 | all: lib 17 | 18 | lib: $(LIBOBJ) 19 | $(AR) $(LIB) $(LIBOBJ) 20 | $(RANLIB) $(LIB) || echo Never mind. 21 | @touch lib 22 | 23 | links: 24 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) 25 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) 26 | 27 | install: 28 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... 29 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ 30 | do \ 31 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ 32 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ 33 | done; 34 | 35 | depend: 36 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... 37 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) 38 | 39 | dclean: 40 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 41 | mv -f Makefile.new $(MAKEFILE) 42 | 43 | clean: 44 | rm -f *.s *.o *.obj des lib tags core .pure .nfs* *.old *.bak fluff 45 | 46 | jpaketest: top jpaketest.c $(LIB) 47 | $(CC) $(CFLAGS) -Wall -Werror -g -o jpaketest jpaketest.c $(LIB) 48 | # DO NOT DELETE THIS LINE -- make depend depends on it. 49 | 50 | jpake.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 51 | jpake.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 52 | jpake.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 53 | jpake.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 54 | jpake.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 55 | jpake.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 56 | jpake.o: ../../include/openssl/symhacks.h jpake.c jpake.h 57 | jpake_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 58 | jpake_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 59 | jpake_err.o: ../../include/openssl/err.h ../../include/openssl/jpake.h 60 | jpake_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 61 | jpake_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 62 | jpake_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 63 | jpake_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 64 | jpake_err.o: jpake_err.c 65 | -------------------------------------------------------------------------------- /crypto/krb5/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # OpenSSL/krb5/Makefile 3 | # 4 | 5 | DIR= krb5 6 | TOP= ../.. 7 | CC= cc 8 | INCLUDES= -I.. -I$(TOP) -I../../include 9 | CFLAG=-g 10 | MAKEFILE= Makefile 11 | AR= ar r 12 | 13 | CFLAGS= $(INCLUDES) $(CFLAG) 14 | 15 | GENERAL=Makefile README 16 | TEST= 17 | APPS= 18 | 19 | LIB=$(TOP)/libcrypto.a 20 | LIBSRC= krb5_asn.c 21 | 22 | LIBOBJ= krb5_asn.o 23 | 24 | SRC= $(LIBSRC) 25 | 26 | EXHEADER= krb5_asn.h 27 | HEADER= $(EXHEADER) 28 | 29 | ALL= $(GENERAL) $(SRC) $(HEADER) 30 | 31 | top: 32 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) 33 | 34 | all: lib 35 | 36 | lib: $(LIBOBJ) 37 | $(AR) $(LIB) $(LIBOBJ) 38 | $(RANLIB) $(LIB) || echo Never mind. 39 | @touch lib 40 | 41 | files: 42 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO 43 | 44 | links: 45 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) 46 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) 47 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) 48 | 49 | install: 50 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... 51 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ 52 | do \ 53 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ 54 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ 55 | done; 56 | 57 | tags: 58 | ctags $(SRC) 59 | 60 | tests: 61 | 62 | lint: 63 | lint -DLINT $(INCLUDES) $(SRC)>fluff 64 | 65 | depend: 66 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... 67 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC) 68 | 69 | dclean: 70 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 71 | mv -f Makefile.new $(MAKEFILE) 72 | 73 | clean: 74 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff 75 | 76 | # DO NOT DELETE THIS LINE -- make depend depends on it. 77 | 78 | krb5_asn.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h 79 | krb5_asn.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h 80 | krb5_asn.o: ../../include/openssl/e_os2.h ../../include/openssl/krb5_asn.h 81 | krb5_asn.o: ../../include/openssl/opensslconf.h 82 | krb5_asn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 83 | krb5_asn.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 84 | krb5_asn.o: ../../include/openssl/symhacks.h krb5_asn.c 85 | -------------------------------------------------------------------------------- /crypto/lhash/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # OpenSSL/crypto/lhash/Makefile 3 | # 4 | 5 | DIR= lhash 6 | TOP= ../.. 7 | CC= cc 8 | INCLUDES= 9 | CFLAG=-g 10 | MAKEFILE= Makefile 11 | AR= ar r 12 | 13 | CFLAGS= $(INCLUDES) $(CFLAG) 14 | 15 | GENERAL=Makefile 16 | TEST= 17 | APPS= 18 | 19 | LIB=$(TOP)/libcrypto.a 20 | LIBSRC=lhash.c lh_stats.c 21 | LIBOBJ=lhash.o lh_stats.o 22 | 23 | SRC= $(LIBSRC) 24 | 25 | EXHEADER= lhash.h 26 | HEADER= $(EXHEADER) 27 | 28 | ALL= $(GENERAL) $(SRC) $(HEADER) 29 | 30 | top: 31 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) 32 | 33 | all: lib 34 | 35 | lib: $(LIBOBJ) 36 | $(AR) $(LIB) $(LIBOBJ) 37 | $(RANLIB) $(LIB) || echo Never mind. 38 | @touch lib 39 | 40 | files: 41 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO 42 | 43 | links: 44 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) 45 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) 46 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) 47 | 48 | install: 49 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... 50 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ 51 | do \ 52 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ 53 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ 54 | done; 55 | 56 | tags: 57 | ctags $(SRC) 58 | 59 | tests: 60 | 61 | lint: 62 | lint -DLINT $(INCLUDES) $(SRC)>fluff 63 | 64 | depend: 65 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... 66 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) 67 | 68 | dclean: 69 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 70 | mv -f Makefile.new $(MAKEFILE) 71 | 72 | clean: 73 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff 74 | 75 | # DO NOT DELETE THIS LINE -- make depend depends on it. 76 | 77 | lh_stats.o: ../../e_os.h ../../include/openssl/bio.h 78 | lh_stats.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 79 | lh_stats.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 80 | lh_stats.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 81 | lh_stats.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 82 | lh_stats.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 83 | lh_stats.o: ../../include/openssl/symhacks.h ../cryptlib.h lh_stats.c 84 | lhash.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h 85 | lhash.o: ../../include/openssl/e_os2.h ../../include/openssl/lhash.h 86 | lhash.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 87 | lhash.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 88 | lhash.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h lhash.c 89 | -------------------------------------------------------------------------------- /crypto/lhash/num.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | 3 | #node 10 -> 4 4 | 5 | while (<>) 6 | { 7 | next unless /^node/; 8 | chop; 9 | @a=split; 10 | $num{$a[3]}++; 11 | } 12 | 13 | @a=sort {$a <=> $b } keys %num; 14 | foreach (0 .. $a[$#a]) 15 | { 16 | printf "%4d:%4d\n",$_,$num{$_}; 17 | } 18 | -------------------------------------------------------------------------------- /crypto/md4/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # OpenSSL/crypto/md4/Makefile 3 | # 4 | 5 | DIR= md4 6 | TOP= ../.. 7 | CC= cc 8 | CPP= $(CC) -E 9 | INCLUDES= 10 | CFLAG=-g 11 | MAKEFILE= Makefile 12 | AR= ar r 13 | 14 | CFLAGS= $(INCLUDES) $(CFLAG) 15 | 16 | GENERAL=Makefile 17 | TEST=md4test.c 18 | APPS=md4.c 19 | 20 | LIB=$(TOP)/libcrypto.a 21 | LIBSRC=md4_dgst.c md4_one.c 22 | LIBOBJ=md4_dgst.o md4_one.o 23 | 24 | SRC= $(LIBSRC) 25 | 26 | EXHEADER= md4.h 27 | HEADER= md4_locl.h $(EXHEADER) 28 | 29 | ALL= $(GENERAL) $(SRC) $(HEADER) 30 | 31 | top: 32 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) 33 | 34 | all: lib 35 | 36 | lib: $(LIBOBJ) 37 | $(AR) $(LIB) $(LIBOBJ) 38 | $(RANLIB) $(LIB) || echo Never mind. 39 | @touch lib 40 | 41 | files: 42 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO 43 | 44 | links: 45 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) 46 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) 47 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) 48 | 49 | install: 50 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... 51 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ 52 | do \ 53 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ 54 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ 55 | done; 56 | 57 | tags: 58 | ctags $(SRC) 59 | 60 | tests: 61 | 62 | lint: 63 | lint -DLINT $(INCLUDES) $(SRC)>fluff 64 | 65 | depend: 66 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... 67 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) 68 | 69 | dclean: 70 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 71 | mv -f Makefile.new $(MAKEFILE) 72 | rm -f ../../include/openssl/$(EXHEADER) ../../test/$(TEST) ../../apps/$(APPS) 73 | 74 | clean: 75 | rm -f asm/mx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff 76 | 77 | # DO NOT DELETE THIS LINE -- make depend depends on it. 78 | 79 | md4_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 80 | md4_dgst.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h 81 | md4_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 82 | md4_dgst.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 83 | md4_dgst.o: ../../include/openssl/symhacks.h ../md32_common.h md4_dgst.c 84 | md4_dgst.o: md4_locl.h 85 | md4_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 86 | md4_one.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h 87 | md4_one.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 88 | md4_one.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 89 | md4_one.o: ../../include/openssl/symhacks.h md4_one.c 90 | -------------------------------------------------------------------------------- /crypto/md4/md4s.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // gettsc.inl 3 | // 4 | // gives access to the Pentium's (secret) cycle counter 5 | // 6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca) 7 | // in 1996-7 and is entered, by him, into the public domain. 8 | 9 | #if defined(__WATCOMC__) 10 | void GetTSC(unsigned long&); 11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; 12 | #elif defined(__GNUC__) 13 | inline 14 | void GetTSC(unsigned long& tsc) 15 | { 16 | asm volatile(".byte 15, 49\n\t" 17 | : "=eax" (tsc) 18 | : 19 | : "%edx", "%eax"); 20 | } 21 | #elif defined(_MSC_VER) 22 | inline 23 | void GetTSC(unsigned long& tsc) 24 | { 25 | unsigned long a; 26 | __asm _emit 0fh 27 | __asm _emit 31h 28 | __asm mov a, eax; 29 | tsc=a; 30 | } 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | extern "C" { 38 | void md4_block_x86(MD4_CTX *ctx, unsigned char *buffer,int num); 39 | } 40 | 41 | void main(int argc,char *argv[]) 42 | { 43 | unsigned char buffer[64*256]; 44 | MD4_CTX ctx; 45 | unsigned long s1,s2,e1,e2; 46 | unsigned char k[16]; 47 | unsigned long data[2]; 48 | unsigned char iv[8]; 49 | int i,num=0,numm; 50 | int j=0; 51 | 52 | if (argc >= 2) 53 | num=atoi(argv[1]); 54 | 55 | if (num == 0) num=16; 56 | if (num > 250) num=16; 57 | numm=num+2; 58 | num*=64; 59 | numm*=64; 60 | 61 | for (j=0; j<6; j++) 62 | { 63 | for (i=0; i<10; i++) /**/ 64 | { 65 | md4_block_x86(&ctx,buffer,numm); 66 | GetTSC(s1); 67 | md4_block_x86(&ctx,buffer,numm); 68 | GetTSC(e1); 69 | GetTSC(s2); 70 | md4_block_x86(&ctx,buffer,num); 71 | GetTSC(e2); 72 | md4_block_x86(&ctx,buffer,num); 73 | } 74 | printf("md4 (%d bytes) %d %d (%.2f)\n",num, 75 | e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2); 76 | } 77 | } 78 | 79 | -------------------------------------------------------------------------------- /crypto/md5/md5s.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // gettsc.inl 3 | // 4 | // gives access to the Pentium's (secret) cycle counter 5 | // 6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca) 7 | // in 1996-7 and is entered, by him, into the public domain. 8 | 9 | #if defined(__WATCOMC__) 10 | void GetTSC(unsigned long&); 11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; 12 | #elif defined(__GNUC__) 13 | inline 14 | void GetTSC(unsigned long& tsc) 15 | { 16 | asm volatile(".byte 15, 49\n\t" 17 | : "=eax" (tsc) 18 | : 19 | : "%edx", "%eax"); 20 | } 21 | #elif defined(_MSC_VER) 22 | inline 23 | void GetTSC(unsigned long& tsc) 24 | { 25 | unsigned long a; 26 | __asm _emit 0fh 27 | __asm _emit 31h 28 | __asm mov a, eax; 29 | tsc=a; 30 | } 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | extern "C" { 38 | void md5_block_x86(MD5_CTX *ctx, unsigned char *buffer,int num); 39 | } 40 | 41 | void main(int argc,char *argv[]) 42 | { 43 | unsigned char buffer[64*256]; 44 | MD5_CTX ctx; 45 | unsigned long s1,s2,e1,e2; 46 | unsigned char k[16]; 47 | unsigned long data[2]; 48 | unsigned char iv[8]; 49 | int i,num=0,numm; 50 | int j=0; 51 | 52 | if (argc >= 2) 53 | num=atoi(argv[1]); 54 | 55 | if (num == 0) num=16; 56 | if (num > 250) num=16; 57 | numm=num+2; 58 | num*=64; 59 | numm*=64; 60 | 61 | for (j=0; j<6; j++) 62 | { 63 | for (i=0; i<10; i++) /**/ 64 | { 65 | md5_block_x86(&ctx,buffer,numm); 66 | GetTSC(s1); 67 | md5_block_x86(&ctx,buffer,numm); 68 | GetTSC(e1); 69 | GetTSC(s2); 70 | md5_block_x86(&ctx,buffer,num); 71 | GetTSC(e2); 72 | md5_block_x86(&ctx,buffer,num); 73 | } 74 | printf("md5 (%d bytes) %d %d (%.2f)\n",num, 75 | e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2); 76 | } 77 | } 78 | 79 | -------------------------------------------------------------------------------- /crypto/modes/asm/ghash-armv4.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/modes/asm/ghash-armv4.pl -------------------------------------------------------------------------------- /crypto/modes/asm/ghash-x86.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/modes/asm/ghash-x86.pl -------------------------------------------------------------------------------- /crypto/o_dir.h: -------------------------------------------------------------------------------- 1 | /* crypto/o_dir.h -*- mode:C; c-file-style: "eay" -*- */ 2 | /* Copied from Richard Levitte's (richard@levitte.org) LP library. All 3 | * symbol names have been changed, with permission from the author. 4 | */ 5 | 6 | /* $LP: LPlib/source/LPdir.h,v 1.1 2004/06/14 08:56:04 _cvs_levitte Exp $ */ 7 | /* 8 | * Copyright (c) 2004, Richard Levitte 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 1. Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | * SUCH DAMAGE. 31 | */ 32 | 33 | 34 | #ifndef O_DIR_H 35 | #define O_DIR_H 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef struct OPENSSL_dir_context_st OPENSSL_DIR_CTX; 42 | 43 | /* returns NULL on error or end-of-directory. 44 | If it is end-of-directory, errno will be zero */ 45 | const char *OPENSSL_DIR_read(OPENSSL_DIR_CTX **ctx, const char *directory); 46 | /* returns 1 on success, 0 on error */ 47 | int OPENSSL_DIR_end(OPENSSL_DIR_CTX **ctx); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* LPDIR_H */ 54 | -------------------------------------------------------------------------------- /crypto/o_dir_test.c: -------------------------------------------------------------------------------- 1 | /* crypto/o_dir.h -*- mode:C; c-file-style: "eay" -*- */ 2 | /* Copied from Richard Levitte's (richard@levitte.org) LP library. All 3 | * symbol names have been changed, with permission from the author. 4 | */ 5 | 6 | /* $LP: LPlib/test/test_dir.c,v 1.1 2004/06/16 22:59:47 _cvs_levitte Exp $ */ 7 | /* 8 | * Copyright (c) 2004, Richard Levitte 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 1. Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | * SUCH DAMAGE. 31 | */ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include "e_os2.h" 38 | #include "o_dir.h" 39 | 40 | #if defined OPENSSL_SYS_UNIX || defined OPENSSL_SYS_WIN32 || defined OPENSSL_SYS_WINCE 41 | #define CURRDIR "." 42 | #elif defined OPENSSL_SYS_VMS 43 | #define CURRDIR "SYS$DISK:[]" 44 | #else 45 | #error "No supported platform defined!" 46 | #endif 47 | 48 | int main() 49 | { 50 | OPENSSL_DIR_CTX *ctx = NULL; 51 | const char *result; 52 | 53 | while((result = OPENSSL_DIR_read(&ctx, CURRDIR)) != NULL) 54 | { 55 | printf("%s\n", result); 56 | } 57 | 58 | if (errno) 59 | { 60 | perror("test_dir"); 61 | exit(1); 62 | } 63 | 64 | if (!OPENSSL_DIR_end(&ctx)) 65 | { 66 | perror("test_dir"); 67 | exit(2); 68 | } 69 | exit(0); 70 | } 71 | -------------------------------------------------------------------------------- /crypto/objects/obj_xref.h: -------------------------------------------------------------------------------- 1 | /* AUTOGENERATED BY objxref.pl, DO NOT EDIT */ 2 | 3 | typedef struct 4 | { 5 | int sign_id; 6 | int hash_id; 7 | int pkey_id; 8 | } nid_triple; 9 | 10 | static const nid_triple sigoid_srt[] = 11 | { 12 | {NID_md2WithRSAEncryption, NID_md2, NID_rsaEncryption}, 13 | {NID_md5WithRSAEncryption, NID_md5, NID_rsaEncryption}, 14 | {NID_shaWithRSAEncryption, NID_sha, NID_rsaEncryption}, 15 | {NID_sha1WithRSAEncryption, NID_sha1, NID_rsaEncryption}, 16 | {NID_dsaWithSHA, NID_sha, NID_dsa}, 17 | {NID_dsaWithSHA1_2, NID_sha1, NID_dsa_2}, 18 | {NID_mdc2WithRSA, NID_mdc2, NID_rsaEncryption}, 19 | {NID_md5WithRSA, NID_md5, NID_rsa}, 20 | {NID_dsaWithSHA1, NID_sha1, NID_dsa}, 21 | {NID_sha1WithRSA, NID_sha1, NID_rsa}, 22 | {NID_ripemd160WithRSA, NID_ripemd160, NID_rsaEncryption}, 23 | {NID_md4WithRSAEncryption, NID_md4, NID_rsaEncryption}, 24 | {NID_ecdsa_with_SHA1, NID_sha1, NID_X9_62_id_ecPublicKey}, 25 | {NID_sha256WithRSAEncryption, NID_sha256, NID_rsaEncryption}, 26 | {NID_sha384WithRSAEncryption, NID_sha384, NID_rsaEncryption}, 27 | {NID_sha512WithRSAEncryption, NID_sha512, NID_rsaEncryption}, 28 | {NID_sha224WithRSAEncryption, NID_sha224, NID_rsaEncryption}, 29 | {NID_ecdsa_with_Recommended, NID_undef, NID_X9_62_id_ecPublicKey}, 30 | {NID_ecdsa_with_Specified, NID_undef, NID_X9_62_id_ecPublicKey}, 31 | {NID_ecdsa_with_SHA224, NID_sha224, NID_X9_62_id_ecPublicKey}, 32 | {NID_ecdsa_with_SHA256, NID_sha256, NID_X9_62_id_ecPublicKey}, 33 | {NID_ecdsa_with_SHA384, NID_sha384, NID_X9_62_id_ecPublicKey}, 34 | {NID_ecdsa_with_SHA512, NID_sha512, NID_X9_62_id_ecPublicKey}, 35 | {NID_dsa_with_SHA224, NID_sha224, NID_dsa}, 36 | {NID_dsa_with_SHA256, NID_sha256, NID_dsa}, 37 | {NID_id_GostR3411_94_with_GostR3410_2001, NID_id_GostR3411_94, NID_id_GostR3410_2001}, 38 | {NID_id_GostR3411_94_with_GostR3410_94, NID_id_GostR3411_94, NID_id_GostR3410_94}, 39 | {NID_id_GostR3411_94_with_GostR3410_94_cc, NID_id_GostR3411_94, NID_id_GostR3410_94_cc}, 40 | {NID_id_GostR3411_94_with_GostR3410_2001_cc, NID_id_GostR3411_94, NID_id_GostR3410_2001_cc}, 41 | {NID_rsassaPss, NID_undef, NID_rsaEncryption}, 42 | }; 43 | 44 | static const nid_triple * const sigoid_srt_xref[] = 45 | { 46 | &sigoid_srt[29], 47 | &sigoid_srt[17], 48 | &sigoid_srt[18], 49 | &sigoid_srt[0], 50 | &sigoid_srt[1], 51 | &sigoid_srt[7], 52 | &sigoid_srt[2], 53 | &sigoid_srt[4], 54 | &sigoid_srt[3], 55 | &sigoid_srt[9], 56 | &sigoid_srt[5], 57 | &sigoid_srt[8], 58 | &sigoid_srt[12], 59 | &sigoid_srt[6], 60 | &sigoid_srt[10], 61 | &sigoid_srt[11], 62 | &sigoid_srt[13], 63 | &sigoid_srt[24], 64 | &sigoid_srt[20], 65 | &sigoid_srt[14], 66 | &sigoid_srt[21], 67 | &sigoid_srt[15], 68 | &sigoid_srt[22], 69 | &sigoid_srt[16], 70 | &sigoid_srt[23], 71 | &sigoid_srt[19], 72 | &sigoid_srt[25], 73 | &sigoid_srt[26], 74 | &sigoid_srt[27], 75 | &sigoid_srt[28], 76 | }; 77 | 78 | -------------------------------------------------------------------------------- /crypto/objects/obj_xref.txt: -------------------------------------------------------------------------------- 1 | # OID cross reference table. 2 | # Links signatures OIDs to their corresponding public key algorithms 3 | # and digests. 4 | 5 | md2WithRSAEncryption md2 rsaEncryption 6 | md5WithRSAEncryption md5 rsaEncryption 7 | shaWithRSAEncryption sha rsaEncryption 8 | sha1WithRSAEncryption sha1 rsaEncryption 9 | md4WithRSAEncryption md4 rsaEncryption 10 | sha256WithRSAEncryption sha256 rsaEncryption 11 | sha384WithRSAEncryption sha384 rsaEncryption 12 | sha512WithRSAEncryption sha512 rsaEncryption 13 | sha224WithRSAEncryption sha224 rsaEncryption 14 | mdc2WithRSA mdc2 rsaEncryption 15 | ripemd160WithRSA ripemd160 rsaEncryption 16 | # For PSS the digest algorithm can vary and depends on the included 17 | # AlgorithmIdentifier. The digest "undef" indicates the public key 18 | # method should handle this explicitly. 19 | rsassaPss undef rsaEncryption 20 | 21 | # Alternative deprecated OIDs. By using the older "rsa" OID this 22 | # type will be recognized by not normally used. 23 | 24 | md5WithRSA md5 rsa 25 | sha1WithRSA sha1 rsa 26 | 27 | dsaWithSHA sha dsa 28 | dsaWithSHA1 sha1 dsa 29 | 30 | dsaWithSHA1_2 sha1 dsa_2 31 | 32 | ecdsa_with_SHA1 sha1 X9_62_id_ecPublicKey 33 | ecdsa_with_SHA224 sha224 X9_62_id_ecPublicKey 34 | ecdsa_with_SHA256 sha256 X9_62_id_ecPublicKey 35 | ecdsa_with_SHA384 sha384 X9_62_id_ecPublicKey 36 | ecdsa_with_SHA512 sha512 X9_62_id_ecPublicKey 37 | ecdsa_with_Recommended undef X9_62_id_ecPublicKey 38 | ecdsa_with_Specified undef X9_62_id_ecPublicKey 39 | 40 | dsa_with_SHA224 sha224 dsa 41 | dsa_with_SHA256 sha256 dsa 42 | 43 | id_GostR3411_94_with_GostR3410_2001 id_GostR3411_94 id_GostR3410_2001 44 | id_GostR3411_94_with_GostR3410_94 id_GostR3411_94 id_GostR3410_94 45 | id_GostR3411_94_with_GostR3410_94_cc id_GostR3411_94 id_GostR3410_94_cc 46 | id_GostR3411_94_with_GostR3410_2001_cc id_GostR3411_94 id_GostR3410_2001_cc 47 | -------------------------------------------------------------------------------- /crypto/objects/objects.README: -------------------------------------------------------------------------------- 1 | objects.txt syntax 2 | ------------------ 3 | 4 | To cover all the naming hacks that were previously in objects.h needed some 5 | kind of hacks in objects.txt. 6 | 7 | The basic syntax for adding an object is as follows: 8 | 9 | 1 2 3 4 : shortName : Long Name 10 | 11 | If the long name doesn't contain spaces, or no short name 12 | exists, the long name is used as basis for the base name 13 | in C. Otherwise, the short name is used. 14 | 15 | The base name (let's call it 'base') will then be used to 16 | create the C macros SN_base, LN_base, NID_base and OBJ_base. 17 | 18 | Note that if the base name contains spaces, dashes or periods, 19 | those will be converte to underscore. 20 | 21 | Then there are some extra commands: 22 | 23 | !Alias foo 1 2 3 4 24 | 25 | This juts makes a name foo for an OID. The C macro 26 | OBJ_foo will be created as a result. 27 | 28 | !Cname foo 29 | 30 | This makes sure that the name foo will be used as base name 31 | in C. 32 | 33 | !module foo 34 | 1 2 3 4 : shortName : Long Name 35 | !global 36 | 37 | The !module command was meant to define a kind of modularity. 38 | What it does is to make sure the module name is prepended 39 | to the base name. !global turns this off. This construction 40 | is not recursive. 41 | 42 | Lines starting with # are treated as comments, as well as any line starting 43 | with ! and not matching the commands above. 44 | 45 | -------------------------------------------------------------------------------- /crypto/objects/objxref.pl: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/perl 2 | 3 | use strict; 4 | 5 | my %xref_tbl; 6 | my %oid_tbl; 7 | 8 | my ($mac_file, $xref_file) = @ARGV; 9 | 10 | open(IN, $mac_file) || die "Can't open $mac_file"; 11 | 12 | # Read in OID nid values for a lookup table. 13 | 14 | while () 15 | { 16 | chomp; 17 | my ($name, $num) = /^(\S+)\s+(\S+)$/; 18 | $oid_tbl{$name} = $num; 19 | } 20 | close IN; 21 | 22 | open(IN, $xref_file) || die "Can't open $xref_file"; 23 | 24 | my $ln = 1; 25 | 26 | while () 27 | { 28 | chomp; 29 | s/#.*$//; 30 | next if (/^\S*$/); 31 | my ($xr, $p1, $p2) = /^(\S+)\s+(\S+)\s+(\S+)/; 32 | check_oid($xr); 33 | check_oid($p1); 34 | check_oid($p2); 35 | $xref_tbl{$xr} = [$p1, $p2, $ln]; 36 | } 37 | 38 | my @xrkeys = keys %xref_tbl; 39 | 40 | my @srt1 = sort { $oid_tbl{$a} <=> $oid_tbl{$b}} @xrkeys; 41 | 42 | for(my $i = 0; $i <= $#srt1; $i++) 43 | { 44 | $xref_tbl{$srt1[$i]}[2] = $i; 45 | } 46 | 47 | my @srt2 = sort 48 | { 49 | my$ap1 = $oid_tbl{$xref_tbl{$a}[0]}; 50 | my$bp1 = $oid_tbl{$xref_tbl{$b}[0]}; 51 | return $ap1 - $bp1 if ($ap1 != $bp1); 52 | my$ap2 = $oid_tbl{$xref_tbl{$a}[1]}; 53 | my$bp2 = $oid_tbl{$xref_tbl{$b}[1]}; 54 | 55 | return $ap2 - $bp2; 56 | } @xrkeys; 57 | 58 | my $pname = $0; 59 | 60 | $pname =~ s|^.[^/]/||; 61 | 62 | print <> $(TOP)/MINFO 42 | 43 | links: 44 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) 45 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) 46 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) 47 | 48 | install: 49 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... 50 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ 51 | do \ 52 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ 53 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ 54 | done; 55 | 56 | tags: 57 | ctags $(SRC) 58 | 59 | tests: 60 | 61 | lint: 62 | lint -DLINT $(INCLUDES) $(SRC)>fluff 63 | 64 | depend: 65 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... 66 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) 67 | 68 | dclean: 69 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 70 | mv -f Makefile.new $(MAKEFILE) 71 | 72 | clean: 73 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff 74 | 75 | # DO NOT DELETE THIS LINE -- make depend depends on it. 76 | 77 | pqueue.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h 78 | pqueue.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 79 | pqueue.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 80 | pqueue.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 81 | pqueue.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 82 | pqueue.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 83 | pqueue.o: ../../include/openssl/symhacks.h ../cryptlib.h pqueue.c pqueue.h 84 | -------------------------------------------------------------------------------- /crypto/rc2/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # OpenSSL/crypto/rc2/Makefile 3 | # 4 | 5 | DIR= rc2 6 | TOP= ../.. 7 | CC= cc 8 | INCLUDES= 9 | CFLAG=-g 10 | MAKEFILE= Makefile 11 | AR= ar r 12 | 13 | CFLAGS= $(INCLUDES) $(CFLAG) 14 | 15 | GENERAL=Makefile 16 | TEST=rc2test.c 17 | APPS= 18 | 19 | LIB=$(TOP)/libcrypto.a 20 | LIBSRC=rc2_ecb.c rc2_skey.c rc2_cbc.c rc2cfb64.c rc2ofb64.c 21 | LIBOBJ=rc2_ecb.o rc2_skey.o rc2_cbc.o rc2cfb64.o rc2ofb64.o 22 | 23 | SRC= $(LIBSRC) 24 | 25 | EXHEADER= rc2.h 26 | HEADER= rc2_locl.h $(EXHEADER) 27 | 28 | ALL= $(GENERAL) $(SRC) $(HEADER) 29 | 30 | top: 31 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) 32 | 33 | all: lib 34 | 35 | lib: $(LIBOBJ) 36 | $(AR) $(LIB) $(LIBOBJ) 37 | $(RANLIB) $(LIB) || echo Never mind. 38 | @touch lib 39 | 40 | files: 41 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO 42 | 43 | links: 44 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) 45 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) 46 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) 47 | 48 | install: 49 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... 50 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ 51 | do \ 52 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ 53 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ 54 | done; 55 | 56 | tags: 57 | ctags $(SRC) 58 | 59 | tests: 60 | 61 | lint: 62 | lint -DLINT $(INCLUDES) $(SRC)>fluff 63 | 64 | depend: 65 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... 66 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) 67 | 68 | dclean: 69 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 70 | mv -f Makefile.new $(MAKEFILE) 71 | 72 | clean: 73 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff 74 | 75 | # DO NOT DELETE THIS LINE -- make depend depends on it. 76 | 77 | rc2_cbc.o: ../../include/openssl/opensslconf.h ../../include/openssl/rc2.h 78 | rc2_cbc.o: rc2_cbc.c rc2_locl.h 79 | rc2_ecb.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 80 | rc2_ecb.o: ../../include/openssl/rc2.h rc2_ecb.c rc2_locl.h 81 | rc2_skey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 82 | rc2_skey.o: ../../include/openssl/opensslconf.h 83 | rc2_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 84 | rc2_skey.o: ../../include/openssl/rc2.h ../../include/openssl/safestack.h 85 | rc2_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 86 | rc2_skey.o: rc2_locl.h rc2_skey.c 87 | rc2cfb64.o: ../../include/openssl/opensslconf.h ../../include/openssl/rc2.h 88 | rc2cfb64.o: rc2_locl.h rc2cfb64.c 89 | rc2ofb64.o: ../../include/openssl/opensslconf.h ../../include/openssl/rc2.h 90 | rc2ofb64.o: rc2_locl.h rc2ofb64.c 91 | -------------------------------------------------------------------------------- /crypto/rc2/version: -------------------------------------------------------------------------------- 1 | 1.1 23/08/96 - eay 2 | Changed RC2_set_key() so it now takes another argument. Many 3 | thanks to Peter Gutmann for the 4 | clarification and origional specification of RC2. BSAFE uses 5 | this last parameter, 'bits'. It the key is 128 bits, BSAFE 6 | also sets this parameter to 128. The old behaviour can be 7 | duplicated by setting this parameter to 1024. 8 | 9 | 1.0 08/04/96 - eay 10 | First version of SSLeay with rc2. This has been written from the spec 11 | posted sci.crypt. It is in this directory under rrc2.doc 12 | I have no test values for any mode other than ecb, my wrappers for the 13 | other modes should be ok since they are basically the same as 14 | the ones taken from idea and des :-). I have implemented them as 15 | little-endian operators. 16 | While rc2 is included because it is used with SSL, I don't know how 17 | far I trust it. It is about the same speed as IDEA and DES. 18 | So if you are paranoid, used Tripple DES, else IDEA. If RC2 19 | does get used more, perhaps more people will look for weaknesses in 20 | it. 21 | 22 | 23 | -------------------------------------------------------------------------------- /crypto/rc4/asm/rc4-x86_64.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/rc4/asm/rc4-x86_64.pl -------------------------------------------------------------------------------- /crypto/rc4/rc4_locl.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_RC4_LOCL_H 2 | #define HEADER_RC4_LOCL_H 3 | #include 4 | #include 5 | #endif 6 | -------------------------------------------------------------------------------- /crypto/rc4/rc4_utl.c: -------------------------------------------------------------------------------- 1 | /* crypto/rc4/rc4_utl.c -*- mode:C; c-file-style: "eay" -*- */ 2 | /* ==================================================================== 3 | * Copyright (c) 2011 The OpenSSL Project. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in 14 | * the documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * 3. All advertising materials mentioning features or use of this 18 | * software must display the following acknowledgment: 19 | * "This product includes software developed by the OpenSSL Project 20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 21 | * 22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 23 | * endorse or promote products derived from this software without 24 | * prior written permission. For written permission, please contact 25 | * openssl-core@openssl.org. 26 | * 27 | * 5. Products derived from this software may not be called "OpenSSL" 28 | * nor may "OpenSSL" appear in their names without prior written 29 | * permission of the OpenSSL Project. 30 | * 31 | * 6. Redistributions of any form whatsoever must retain the following 32 | * acknowledgment: 33 | * "This product includes software developed by the OpenSSL Project 34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 35 | * 36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 47 | * OF THE POSSIBILITY OF SUCH DAMAGE. 48 | * ==================================================================== 49 | * 50 | */ 51 | 52 | #include 53 | #include 54 | #include 55 | 56 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data) 57 | { 58 | #ifdef OPENSSL_FIPS 59 | fips_cipher_abort(RC4); 60 | #endif 61 | private_RC4_set_key(key, len, data); 62 | } 63 | -------------------------------------------------------------------------------- /crypto/rc4/rc4s.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // gettsc.inl 3 | // 4 | // gives access to the Pentium's (secret) cycle counter 5 | // 6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca) 7 | // in 1996-7 and is entered, by him, into the public domain. 8 | 9 | #if defined(__WATCOMC__) 10 | void GetTSC(unsigned long&); 11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; 12 | #elif defined(__GNUC__) 13 | inline 14 | void GetTSC(unsigned long& tsc) 15 | { 16 | asm volatile(".byte 15, 49\n\t" 17 | : "=eax" (tsc) 18 | : 19 | : "%edx", "%eax"); 20 | } 21 | #elif defined(_MSC_VER) 22 | inline 23 | void GetTSC(unsigned long& tsc) 24 | { 25 | unsigned long a; 26 | __asm _emit 0fh 27 | __asm _emit 31h 28 | __asm mov a, eax; 29 | tsc=a; 30 | } 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | void main(int argc,char *argv[]) 38 | { 39 | unsigned char buffer[1024]; 40 | RC4_KEY ctx; 41 | unsigned long s1,s2,e1,e2; 42 | unsigned char k[16]; 43 | unsigned long data[2]; 44 | unsigned char iv[8]; 45 | int i,num=64,numm; 46 | int j=0; 47 | 48 | if (argc >= 2) 49 | num=atoi(argv[1]); 50 | 51 | if (num == 0) num=256; 52 | if (num > 1024-16) num=1024-16; 53 | numm=num+8; 54 | 55 | for (j=0; j<6; j++) 56 | { 57 | for (i=0; i<10; i++) /**/ 58 | { 59 | RC4(&ctx,numm,buffer,buffer); 60 | GetTSC(s1); 61 | RC4(&ctx,numm,buffer,buffer); 62 | GetTSC(e1); 63 | GetTSC(s2); 64 | RC4(&ctx,num,buffer,buffer); 65 | GetTSC(e2); 66 | RC4(&ctx,num,buffer,buffer); 67 | } 68 | 69 | printf("RC4 (%d bytes) %d %d (%d) - 8 bytes\n",num, 70 | e1-s1,e2-s2,(e1-s1)-(e2-s2)); 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /crypto/ripemd/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # OpenSSL/crypto/ripemd/Makefile 3 | # 4 | 5 | DIR= ripemd 6 | TOP= ../.. 7 | CC= cc 8 | CPP= $(CC) -E 9 | INCLUDES= 10 | CFLAG=-g 11 | MAKEFILE= Makefile 12 | AR= ar r 13 | 14 | RIP_ASM_OBJ= 15 | 16 | CFLAGS= $(INCLUDES) $(CFLAG) 17 | ASFLAGS= $(INCLUDES) $(ASFLAG) 18 | AFLAGS= $(ASFLAGS) 19 | 20 | GENERAL=Makefile 21 | TEST=rmdtest.c 22 | APPS= 23 | 24 | LIB=$(TOP)/libcrypto.a 25 | LIBSRC=rmd_dgst.c rmd_one.c 26 | LIBOBJ=rmd_dgst.o rmd_one.o $(RMD160_ASM_OBJ) 27 | 28 | SRC= $(LIBSRC) 29 | 30 | EXHEADER= ripemd.h 31 | HEADER= rmd_locl.h rmdconst.h $(EXHEADER) 32 | 33 | ALL= $(GENERAL) $(SRC) $(HEADER) 34 | 35 | top: 36 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) 37 | 38 | all: lib 39 | 40 | lib: $(LIBOBJ) 41 | $(AR) $(LIB) $(LIBOBJ) 42 | $(RANLIB) $(LIB) || echo Never mind. 43 | @touch lib 44 | 45 | rmd-586.s: asm/rmd-586.pl ../perlasm/x86asm.pl 46 | $(PERL) asm/rmd-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@ 47 | 48 | files: 49 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO 50 | 51 | links: 52 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) 53 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) 54 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) 55 | 56 | install: 57 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... 58 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ 59 | do \ 60 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ 61 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ 62 | done; 63 | 64 | tags: 65 | ctags $(SRC) 66 | 67 | tests: 68 | 69 | lint: 70 | lint -DLINT $(INCLUDES) $(SRC)>fluff 71 | 72 | depend: 73 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... 74 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) 75 | 76 | dclean: 77 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 78 | mv -f Makefile.new $(MAKEFILE) 79 | 80 | clean: 81 | rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff 82 | 83 | # DO NOT DELETE THIS LINE -- make depend depends on it. 84 | 85 | rmd_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 86 | rmd_dgst.o: ../../include/openssl/opensslconf.h 87 | rmd_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 88 | rmd_dgst.o: ../../include/openssl/ripemd.h ../../include/openssl/safestack.h 89 | rmd_dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 90 | rmd_dgst.o: ../md32_common.h rmd_dgst.c rmd_locl.h rmdconst.h 91 | rmd_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 92 | rmd_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 93 | rmd_one.o: ../../include/openssl/ossl_typ.h ../../include/openssl/ripemd.h 94 | rmd_one.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 95 | rmd_one.o: ../../include/openssl/symhacks.h rmd_one.c 96 | -------------------------------------------------------------------------------- /crypto/ripemd/README: -------------------------------------------------------------------------------- 1 | RIPEMD-160 2 | http://www.esat.kuleuven.ac.be/~bosselae/ripemd160.html 3 | 4 | This is my implementation of RIPEMD-160. The pentium assember is a little 5 | off the pace since I only get 1050 cycles, while the best is 1013. 6 | I have a few ideas for how to get another 20 or so cycles, but at 7 | this point I will not bother right now. I believe the trick will be 8 | to remove my 'copy X array onto stack' until inside the RIP1() finctions the 9 | first time round. To do this I need another register and will only have one 10 | temporary one. A bit tricky.... I can also cleanup the saving of the 5 words 11 | after the first half of the calculation. I should read the origional 12 | value, add then write. Currently I just save the new and read the origioal. 13 | I then read both at the end. Bad. 14 | 15 | eric (20-Jan-1998) 16 | -------------------------------------------------------------------------------- /crypto/ripemd/asm/rips.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // gettsc.inl 3 | // 4 | // gives access to the Pentium's (secret) cycle counter 5 | // 6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca) 7 | // in 1996-7 and is entered, by him, into the public domain. 8 | 9 | #if defined(__WATCOMC__) 10 | void GetTSC(unsigned long&); 11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; 12 | #elif defined(__GNUC__) 13 | inline 14 | void GetTSC(unsigned long& tsc) 15 | { 16 | asm volatile(".byte 15, 49\n\t" 17 | : "=eax" (tsc) 18 | : 19 | : "%edx", "%eax"); 20 | } 21 | #elif defined(_MSC_VER) 22 | inline 23 | void GetTSC(unsigned long& tsc) 24 | { 25 | unsigned long a; 26 | __asm _emit 0fh 27 | __asm _emit 31h 28 | __asm mov a, eax; 29 | tsc=a; 30 | } 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #define ripemd160_block_x86 ripemd160_block_asm_host_order 38 | 39 | extern "C" { 40 | void ripemd160_block_x86(RIPEMD160_CTX *ctx, unsigned char *buffer,int num); 41 | } 42 | 43 | void main(int argc,char *argv[]) 44 | { 45 | unsigned char buffer[64*256]; 46 | RIPEMD160_CTX ctx; 47 | unsigned long s1,s2,e1,e2; 48 | unsigned char k[16]; 49 | unsigned long data[2]; 50 | unsigned char iv[8]; 51 | int i,num=0,numm; 52 | int j=0; 53 | 54 | if (argc >= 2) 55 | num=atoi(argv[1]); 56 | 57 | if (num == 0) num=16; 58 | if (num > 250) num=16; 59 | numm=num+2; 60 | #if 0 61 | num*=64; 62 | numm*=64; 63 | #endif 64 | 65 | for (j=0; j<6; j++) 66 | { 67 | for (i=0; i<10; i++) /**/ 68 | { 69 | ripemd160_block_x86(&ctx,buffer,numm); 70 | GetTSC(s1); 71 | ripemd160_block_x86(&ctx,buffer,numm); 72 | GetTSC(e1); 73 | GetTSC(s2); 74 | ripemd160_block_x86(&ctx,buffer,num); 75 | GetTSC(e2); 76 | ripemd160_block_x86(&ctx,buffer,num); 77 | } 78 | printf("ripemd160 (%d bytes) %d %d (%.2f)\n",num*64, 79 | e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2); 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /crypto/rsa/rsa_locl.h: -------------------------------------------------------------------------------- 1 | extern int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, 2 | unsigned char *rm, size_t *prm_len, 3 | const unsigned char *sigbuf, size_t siglen, 4 | RSA *rsa); 5 | -------------------------------------------------------------------------------- /crypto/s390xcap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | extern unsigned long OPENSSL_s390xcap_P[]; 8 | 9 | static sigjmp_buf ill_jmp; 10 | static void ill_handler (int sig) { siglongjmp(ill_jmp,sig); } 11 | 12 | unsigned long OPENSSL_s390x_facilities(void); 13 | 14 | void OPENSSL_cpuid_setup(void) 15 | { 16 | sigset_t oset; 17 | struct sigaction ill_act,oact; 18 | 19 | if (OPENSSL_s390xcap_P[0]) return; 20 | 21 | OPENSSL_s390xcap_P[0] = 1UL<<(8*sizeof(unsigned long)-1); 22 | 23 | memset(&ill_act,0,sizeof(ill_act)); 24 | ill_act.sa_handler = ill_handler; 25 | sigfillset(&ill_act.sa_mask); 26 | sigdelset(&ill_act.sa_mask,SIGILL); 27 | sigdelset(&ill_act.sa_mask,SIGTRAP); 28 | sigprocmask(SIG_SETMASK,&ill_act.sa_mask,&oset); 29 | sigaction (SIGILL,&ill_act,&oact); 30 | 31 | /* protection against missing store-facility-list-extended */ 32 | if (sigsetjmp(ill_jmp,1) == 0) 33 | OPENSSL_s390x_facilities(); 34 | 35 | sigaction (SIGILL,&oact,NULL); 36 | sigprocmask(SIG_SETMASK,&oset,NULL); 37 | } 38 | -------------------------------------------------------------------------------- /crypto/s390xcpuid.S: -------------------------------------------------------------------------------- 1 | .text 2 | 3 | .globl OPENSSL_s390x_facilities 4 | .type OPENSSL_s390x_facilities,@function 5 | .align 16 6 | OPENSSL_s390x_facilities: 7 | lghi %r0,0 8 | larl %r2,OPENSSL_s390xcap_P 9 | stg %r0,8(%r2) 10 | .long 0xb2b02000 # stfle 0(%r2) 11 | brc 8,.Ldone 12 | lghi %r0,1 13 | .long 0xb2b02000 # stfle 0(%r2) 14 | .Ldone: 15 | lg %r2,0(%r2) 16 | br %r14 17 | .size OPENSSL_s390x_facilities,.-OPENSSL_s390x_facilities 18 | 19 | .globl OPENSSL_rdtsc 20 | .type OPENSSL_rdtsc,@function 21 | .align 16 22 | OPENSSL_rdtsc: 23 | stck 16(%r15) 24 | lg %r2,16(%r15) 25 | br %r14 26 | .size OPENSSL_rdtsc,.-OPENSSL_rdtsc 27 | 28 | .globl OPENSSL_atomic_add 29 | .type OPENSSL_atomic_add,@function 30 | .align 16 31 | OPENSSL_atomic_add: 32 | l %r1,0(%r2) 33 | .Lspin: lr %r0,%r1 34 | ar %r0,%r3 35 | cs %r1,%r0,0(%r2) 36 | brc 4,.Lspin 37 | lgfr %r2,%r0 # OpenSSL expects the new value 38 | br %r14 39 | .size OPENSSL_atomic_add,.-OPENSSL_atomic_add 40 | 41 | .globl OPENSSL_wipe_cpu 42 | .type OPENSSL_wipe_cpu,@function 43 | .align 16 44 | OPENSSL_wipe_cpu: 45 | xgr %r0,%r0 46 | xgr %r1,%r1 47 | lgr %r2,%r15 48 | xgr %r3,%r3 49 | xgr %r4,%r4 50 | lzdr %f0 51 | lzdr %f1 52 | lzdr %f2 53 | lzdr %f3 54 | lzdr %f4 55 | lzdr %f5 56 | lzdr %f6 57 | lzdr %f7 58 | br %r14 59 | .size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu 60 | 61 | .globl OPENSSL_cleanse 62 | .type OPENSSL_cleanse,@function 63 | .align 16 64 | OPENSSL_cleanse: 65 | #if !defined(__s390x__) && !defined(__s390x) 66 | llgfr %r3,%r3 67 | #endif 68 | lghi %r4,15 69 | lghi %r0,0 70 | clgr %r3,%r4 71 | jh .Lot 72 | clgr %r3,%r0 73 | bcr 8,%r14 74 | .Little: 75 | stc %r0,0(%r2) 76 | la %r2,1(%r2) 77 | brctg %r3,.Little 78 | br %r14 79 | .align 4 80 | .Lot: tmll %r2,7 81 | jz .Laligned 82 | stc %r0,0(%r2) 83 | la %r2,1(%r2) 84 | brctg %r3,.Lot 85 | .Laligned: 86 | srlg %r4,%r3,3 87 | .Loop: stg %r0,0(%r2) 88 | la %r2,8(%r2) 89 | brctg %r4,.Loop 90 | lghi %r4,7 91 | ngr %r3,%r4 92 | jnz .Little 93 | br %r14 94 | .size OPENSSL_cleanse,.-OPENSSL_cleanse 95 | 96 | .section .init 97 | brasl %r14,OPENSSL_cpuid_setup 98 | 99 | .comm OPENSSL_s390xcap_P,16,8 100 | -------------------------------------------------------------------------------- /crypto/sha/asm/README: -------------------------------------------------------------------------------- 1 | C2.pl works 2 | -------------------------------------------------------------------------------- /crypto/sha/asm/sha1-586.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/sha/asm/sha1-586.pl -------------------------------------------------------------------------------- /crypto/sha/asm/sha256-586.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/sha/asm/sha256-586.pl -------------------------------------------------------------------------------- /crypto/sha/asm/sha512-586.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/sha/asm/sha512-586.pl -------------------------------------------------------------------------------- /crypto/sparccpuid.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/sparccpuid.S -------------------------------------------------------------------------------- /crypto/stack/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # OpenSSL/crypto/stack/Makefile 3 | # 4 | 5 | DIR= stack 6 | TOP= ../.. 7 | CC= cc 8 | INCLUDES= 9 | CFLAG=-g 10 | MAKEFILE= Makefile 11 | AR= ar r 12 | 13 | CFLAGS= $(INCLUDES) $(CFLAG) 14 | 15 | GENERAL=Makefile 16 | TEST= 17 | APPS= 18 | 19 | LIB=$(TOP)/libcrypto.a 20 | LIBSRC=stack.c 21 | LIBOBJ=stack.o 22 | 23 | SRC= $(LIBSRC) 24 | 25 | EXHEADER= stack.h safestack.h 26 | HEADER= $(EXHEADER) 27 | 28 | ALL= $(GENERAL) $(SRC) $(HEADER) 29 | 30 | top: 31 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) 32 | 33 | all: lib 34 | 35 | lib: $(LIBOBJ) 36 | $(AR) $(LIB) $(LIBOBJ) 37 | $(RANLIB) $(LIB) || echo Never mind. 38 | @touch lib 39 | 40 | files: 41 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO 42 | 43 | links: 44 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) 45 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) 46 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) 47 | 48 | install: 49 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... 50 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ 51 | do \ 52 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ 53 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ 54 | done; 55 | 56 | tags: 57 | ctags $(SRC) 58 | 59 | tests: 60 | 61 | lint: 62 | lint -DLINT $(INCLUDES) $(SRC)>fluff 63 | 64 | depend: 65 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... 66 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) 67 | 68 | dclean: 69 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 70 | mv -f Makefile.new $(MAKEFILE) 71 | 72 | clean: 73 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff 74 | 75 | # DO NOT DELETE THIS LINE -- make depend depends on it. 76 | 77 | stack.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 78 | stack.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 79 | stack.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 80 | stack.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 81 | stack.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 82 | stack.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 83 | stack.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 84 | stack.o: ../../include/openssl/symhacks.h ../cryptlib.h stack.c 85 | -------------------------------------------------------------------------------- /crypto/threads/README: -------------------------------------------------------------------------------- 1 | Mutithreading testing area. 2 | 3 | Since this stuff is very very platorm specific, this is not part of the 4 | normal build. Have a read of doc/threads.doc. 5 | 6 | mttest will do some testing and will currently build under Windows NT/95, 7 | Solaris and Linux. The IRIX stuff is not finished. 8 | 9 | I have tested this program on a 12 CPU ultra sparc box (solaris 2.5.1) 10 | and things seem to work ok. 11 | 12 | The Linux pthreads package can be retrieved from 13 | http://www.mit.edu:8001/people/proven/pthreads.html 14 | 15 | -------------------------------------------------------------------------------- /crypto/threads/netware.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem batch file to build multi-thread test ( mttest.nlm ) 3 | 4 | rem command line arguments: 5 | rem debug => build using debug settings 6 | 7 | rem 8 | rem After building, copy mttest.nlm to the server and run it, you'll probably 9 | rem want to redirect stdout and stderr. An example command line would be 10 | rem "mttest.nlm -thread 20 -loops 10 -CAfile \openssl\apps\server.pem >mttest.out 2>mttest.err" 11 | rem 12 | 13 | del mttest.nlm 14 | 15 | set BLD_DEBUG= 16 | set CFLAGS= 17 | set LFLAGS= 18 | set LIBS= 19 | 20 | if "%1" == "DEBUG" set BLD_DEBUG=YES 21 | if "%1" == "debug" set BLD_DEBUG=YES 22 | 23 | if "%MWCIncludes%" == "" goto inc_error 24 | if "%PRELUDE%" == "" goto prelude_error 25 | if "%IMPORTS%" == "" goto imports_error 26 | 27 | set CFLAGS=-c -I..\..\outinc_nw -nosyspath -DOPENSSL_SYS_NETWARE -opt off -g -sym internal -maxerrors 20 28 | 29 | if "%BLD_DEBUG%" == "YES" set LIBS=..\..\out_nw.dbg\ssl.lib ..\..\out_nw.dbg\crypto.lib 30 | if "%BLD_DEBUG%" == "" set LIBS=..\..\out_nw\ssl.lib ..\..\out_nw\crypto.lib 31 | 32 | set LFLAGS=-msgstyle gcc -zerobss -stacksize 32768 -nostdlib -sym internal 33 | 34 | rem generate command file for metrowerks 35 | echo. 36 | echo Generating Metrowerks command file: mttest.def 37 | echo # dynamically generated command file for metrowerks build > mttest.def 38 | echo IMPORT @%IMPORTS%\clib.imp >> mttest.def 39 | echo IMPORT @%IMPORTS%\threads.imp >> mttest.def 40 | echo IMPORT @%IMPORTS%\ws2nlm.imp >> mttest.def 41 | echo IMPORT GetProcessSwitchCount >> mttest.def 42 | echo MODULE clib >> mttest.def 43 | 44 | rem compile 45 | echo. 46 | echo Compiling mttest.c 47 | mwccnlm.exe mttest.c %CFLAGS% 48 | if errorlevel 1 goto end 49 | 50 | rem link 51 | echo. 52 | echo Linking mttest.nlm 53 | mwldnlm.exe %LFLAGS% -screenname mttest -commandfile mttest.def mttest.o "%PRELUDE%" %LIBS% -o mttest.nlm 54 | if errorlevel 1 goto end 55 | 56 | goto end 57 | 58 | :inc_error 59 | echo. 60 | echo Environment variable MWCIncludes is not set - see install.nw 61 | goto end 62 | 63 | :prelude_error 64 | echo. 65 | echo Environment variable PRELUDE is not set - see install.nw 66 | goto end 67 | 68 | :imports_error 69 | echo. 70 | echo Environment variable IMPORTS is not set - see install.nw 71 | goto end 72 | 73 | 74 | :end 75 | set BLD_DEBUG= 76 | set CFLAGS= 77 | set LFLAGS= 78 | set LIBS= 79 | 80 | -------------------------------------------------------------------------------- /crypto/threads/profile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | /bin/rm -f mttest 3 | cc -p -DSOLARIS -I../../include -g mttest.c -o mttest -L/usr/lib/libc -ldl -L../.. -lthread -lssl -lcrypto -lnsl -lsocket 4 | 5 | -------------------------------------------------------------------------------- /crypto/threads/ptest.bat: -------------------------------------------------------------------------------- 1 | del mttest.exe 2 | 3 | purify cl /O2 -DWIN32 /MD -I..\..\out mttest.c /Femttest ..\..\out\ssl32.lib ..\..\out\crypt32.lib 4 | 5 | -------------------------------------------------------------------------------- /crypto/threads/pthread.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # build using pthreads 4 | # 5 | # http://www.mit.edu:8001/people/proven/pthreads.html 6 | # 7 | /bin/rm -f mttest 8 | pgcc -DPTHREADS -I../../include -g mttest.c -o mttest -L../.. -lssl -lcrypto 9 | 10 | -------------------------------------------------------------------------------- /crypto/threads/pthread2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # build using pthreads where it's already built into the system 4 | # 5 | /bin/rm -f mttest 6 | gcc -DPTHREADS -I../../include -g mttest.c -o mttest -L../.. -lssl -lcrypto -lpthread 7 | 8 | -------------------------------------------------------------------------------- /crypto/threads/pthreads-vms.com: -------------------------------------------------------------------------------- 1 | $! To compile mttest on VMS. 2 | $! 3 | $! WARNING: only tested with DEC C so far. 4 | $ 5 | $ if (f$getsyi("cpu").lt.128) 6 | $ then 7 | $ arch := VAX 8 | $ else 9 | $ arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") 10 | $ if (arch .eqs. "") then arch = "UNK" 11 | $ endif 12 | $ define/user openssl [--.include.openssl] 13 | $ cc/def=PTHREADS mttest.c 14 | $ link mttest,[--.'arch'.exe.ssl]libssl/lib,[--.'arch'.exe.crypto]libcrypto/lib 15 | -------------------------------------------------------------------------------- /crypto/threads/purify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | /bin/rm -f mttest 3 | purify cc -DSOLARIS -I../../include -g mttest.c -o mttest -L../.. -lthread -lssl -lcrypto -lnsl -lsocket 4 | 5 | -------------------------------------------------------------------------------- /crypto/threads/solaris.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | /bin/rm -f mttest 3 | cc -DSOLARIS -I../../include -g mttest.c -o mttest -L../.. -lthread -lssl -lcrypto -lnsl -lsocket 4 | 5 | -------------------------------------------------------------------------------- /crypto/threads/win32.bat: -------------------------------------------------------------------------------- 1 | del mttest.exe 2 | 3 | cl /O2 -DWIN32 /MD -I..\..\out mttest.c /Femttest ..\..\out\ssleay32.lib ..\..\out\libeay32.lib 4 | 5 | -------------------------------------------------------------------------------- /crypto/txt_db/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # OpenSSL/crypto/txt_db/Makefile 3 | # 4 | 5 | DIR= txt_db 6 | TOP= ../.. 7 | CC= cc 8 | INCLUDES= 9 | CFLAG=-g 10 | MAKEFILE= Makefile 11 | AR= ar r 12 | 13 | CFLAGS= $(INCLUDES) $(CFLAG) 14 | 15 | GENERAL=Makefile 16 | TEST= 17 | APPS= 18 | 19 | LIB=$(TOP)/libcrypto.a 20 | LIBSRC=txt_db.c 21 | LIBOBJ=txt_db.o 22 | 23 | SRC= $(LIBSRC) 24 | 25 | EXHEADER= txt_db.h 26 | HEADER= $(EXHEADER) 27 | 28 | ALL= $(GENERAL) $(SRC) $(HEADER) 29 | 30 | top: 31 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) 32 | 33 | all: lib 34 | 35 | lib: $(LIBOBJ) 36 | $(AR) $(LIB) $(LIBOBJ) 37 | $(RANLIB) $(LIB) || echo Never mind. 38 | @touch lib 39 | 40 | files: 41 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO 42 | 43 | links: 44 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) 45 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) 46 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) 47 | 48 | install: 49 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... 50 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ 51 | do \ 52 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ 53 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ 54 | done; 55 | 56 | tags: 57 | ctags $(SRC) 58 | 59 | tests: 60 | 61 | lint: 62 | lint -DLINT $(INCLUDES) $(SRC)>fluff 63 | 64 | depend: 65 | @[ -n "$(MAKEDEPEND)" ] # should be set by top Makefile... 66 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) 67 | 68 | dclean: 69 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 70 | mv -f Makefile.new $(MAKEFILE) 71 | 72 | clean: 73 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff 74 | 75 | # DO NOT DELETE THIS LINE -- make depend depends on it. 76 | 77 | txt_db.o: ../../e_os.h ../../include/openssl/bio.h 78 | txt_db.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 79 | txt_db.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 80 | txt_db.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 81 | txt_db.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 82 | txt_db.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 83 | txt_db.o: ../../include/openssl/symhacks.h ../../include/openssl/txt_db.h 84 | txt_db.o: ../cryptlib.h txt_db.c 85 | -------------------------------------------------------------------------------- /crypto/vms_rms.h: -------------------------------------------------------------------------------- 1 | 2 | #ifdef NAML$C_MAXRSS 3 | 4 | # define CC_RMS_NAMX cc$rms_naml 5 | # define FAB_NAMX fab$l_naml 6 | # define FAB_OR_NAML( fab, naml) naml 7 | # define FAB_OR_NAML_DNA naml$l_long_defname 8 | # define FAB_OR_NAML_DNS naml$l_long_defname_size 9 | # define FAB_OR_NAML_FNA naml$l_long_filename 10 | # define FAB_OR_NAML_FNS naml$l_long_filename_size 11 | # define NAMX_ESA naml$l_long_expand 12 | # define NAMX_ESL naml$l_long_expand_size 13 | # define NAMX_ESS naml$l_long_expand_alloc 14 | # define NAMX_NOP naml$b_nop 15 | # define SET_NAMX_NO_SHORT_UPCASE( nam) nam.naml$v_no_short_upcase = 1 16 | 17 | # if __INITIAL_POINTER_SIZE == 64 18 | # define NAMX_DNA_FNA_SET(fab) fab.fab$l_dna = (__char_ptr32) -1; \ 19 | fab.fab$l_fna = (__char_ptr32) -1; 20 | # else /* __INITIAL_POINTER_SIZE == 64 */ 21 | # define NAMX_DNA_FNA_SET(fab) fab.fab$l_dna = (char *) -1; \ 22 | fab.fab$l_fna = (char *) -1; 23 | # endif /* __INITIAL_POINTER_SIZE == 64 [else] */ 24 | 25 | # define NAMX_MAXRSS NAML$C_MAXRSS 26 | # define NAMX_STRUCT NAML 27 | 28 | #else /* def NAML$C_MAXRSS */ 29 | 30 | # define CC_RMS_NAMX cc$rms_nam 31 | # define FAB_NAMX fab$l_nam 32 | # define FAB_OR_NAML( fab, naml) fab 33 | # define FAB_OR_NAML_DNA fab$l_dna 34 | # define FAB_OR_NAML_DNS fab$b_dns 35 | # define FAB_OR_NAML_FNA fab$l_fna 36 | # define FAB_OR_NAML_FNS fab$b_fns 37 | # define NAMX_ESA nam$l_esa 38 | # define NAMX_ESL nam$b_esl 39 | # define NAMX_ESS nam$b_ess 40 | # define NAMX_NOP nam$b_nop 41 | # define NAMX_DNA_FNA_SET(fab) 42 | # define NAMX_MAXRSS NAM$C_MAXRSS 43 | # define NAMX_STRUCT NAM 44 | # ifdef NAM$M_NO_SHORT_UPCASE 45 | # define SET_NAMX_NO_SHORT_UPCASE( nam) naml.naml$v_no_short_upcase = 1 46 | # else /* def NAM$M_NO_SHORT_UPCASE */ 47 | # define SET_NAMX_NO_SHORT_UPCASE( nam) 48 | # endif /* def NAM$M_NO_SHORT_UPCASE [else] */ 49 | 50 | #endif /* def NAML$C_MAXRSS [else] */ 51 | 52 | -------------------------------------------------------------------------------- /crypto/whrlpool/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # crypto/whrlpool/Makefile 3 | # 4 | 5 | DIR= whrlpool 6 | TOP= ../.. 7 | CC= cc 8 | CPP= $(CC) -E 9 | INCLUDES= 10 | CFLAG=-g 11 | MAKEFILE= Makefile 12 | AR= ar r 13 | 14 | WP_ASM_OBJ=wp_block.o 15 | 16 | CFLAGS= $(INCLUDES) $(CFLAG) 17 | ASFLAGS= $(INCLUDES) $(ASFLAG) 18 | AFLAGS= $(ASFLAGS) 19 | 20 | GENERAL=Makefile 21 | TEST=wp_test.c 22 | APPS= 23 | 24 | LIB=$(TOP)/libcrypto.a 25 | LIBSRC=wp_dgst.c wp_block.c 26 | LIBOBJ=wp_dgst.o $(WP_ASM_OBJ) 27 | 28 | SRC= $(LIBSRC) 29 | 30 | EXHEADER= whrlpool.h 31 | HEADER= wp_locl.h $(EXHEADER) 32 | 33 | ALL= $(GENERAL) $(SRC) $(HEADER) 34 | 35 | top: 36 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) 37 | 38 | all: lib 39 | 40 | lib: $(LIBOBJ) 41 | $(AR) $(LIB) $(LIBOBJ) 42 | $(RANLIB) $(LIB) || echo Never mind. 43 | @touch lib 44 | 45 | wp-mmx.s: asm/wp-mmx.pl ../perlasm/x86asm.pl 46 | $(PERL) asm/wp-mmx.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ 47 | 48 | wp-x86_64.s: asm/wp-x86_64.pl 49 | $(PERL) asm/wp-x86_64.pl $(PERLASM_SCHEME) > $@ 50 | 51 | $(LIBOBJ): $(LIBSRC) 52 | 53 | files: 54 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO 55 | 56 | links: 57 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) 58 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) 59 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) 60 | 61 | install: 62 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... 63 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ 64 | do \ 65 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ 66 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ 67 | done; 68 | 69 | tags: 70 | ctags $(SRC) 71 | 72 | tests: 73 | 74 | lint: 75 | lint -DLINT $(INCLUDES) $(SRC)>fluff 76 | 77 | depend: 78 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... 79 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) 80 | 81 | dclean: 82 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new 83 | mv -f Makefile.new $(MAKEFILE) 84 | 85 | clean: 86 | rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff 87 | 88 | # DO NOT DELETE THIS LINE -- make depend depends on it. 89 | 90 | wp_block.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h 91 | wp_block.o: ../../include/openssl/whrlpool.h wp_block.c wp_locl.h 92 | wp_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 93 | wp_dgst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 94 | wp_dgst.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 95 | wp_dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 96 | wp_dgst.o: ../../include/openssl/whrlpool.h wp_dgst.c wp_locl.h 97 | -------------------------------------------------------------------------------- /crypto/whrlpool/asm/wp-mmx.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/whrlpool/asm/wp-mmx.pl -------------------------------------------------------------------------------- /crypto/whrlpool/whrlpool.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_WHRLPOOL_H 2 | #define HEADER_WHRLPOOL_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define WHIRLPOOL_DIGEST_LENGTH (512/8) 12 | #define WHIRLPOOL_BBLOCK 512 13 | #define WHIRLPOOL_COUNTER (256/8) 14 | 15 | typedef struct { 16 | union { 17 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 18 | /* double q is here to ensure 64-bit alignment */ 19 | double q[WHIRLPOOL_DIGEST_LENGTH/sizeof(double)]; 20 | } H; 21 | unsigned char data[WHIRLPOOL_BBLOCK/8]; 22 | unsigned int bitoff; 23 | size_t bitlen[WHIRLPOOL_COUNTER/sizeof(size_t)]; 24 | } WHIRLPOOL_CTX; 25 | 26 | #ifndef OPENSSL_NO_WHIRLPOOL 27 | #ifdef OPENSSL_FIPS 28 | int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 29 | #endif 30 | int WHIRLPOOL_Init (WHIRLPOOL_CTX *c); 31 | int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes); 32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,const void *inp,size_t bits); 33 | int WHIRLPOOL_Final (unsigned char *md,WHIRLPOOL_CTX *c); 34 | unsigned char *WHIRLPOOL(const void *inp,size_t bytes,unsigned char *md); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /crypto/whrlpool/wp_locl.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void whirlpool_block(WHIRLPOOL_CTX *,const void *,size_t); 4 | -------------------------------------------------------------------------------- /crypto/x509v3/v3_pci.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/x509v3/v3_pci.c -------------------------------------------------------------------------------- /crypto/x509v3/v3_pcia.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aluvalasuman/OpenSSL1.0.1cForAndroid/bde1fe2c52f6b9b2b2a4c7cb6240a0246915b538/crypto/x509v3/v3_pcia.c -------------------------------------------------------------------------------- /include/openssl/comp.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER_COMP_H 3 | #define HEADER_COMP_H 4 | 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | typedef struct comp_ctx_st COMP_CTX; 12 | 13 | typedef struct comp_method_st 14 | { 15 | int type; /* NID for compression library */ 16 | const char *name; /* A text string to identify the library */ 17 | int (*init)(COMP_CTX *ctx); 18 | void (*finish)(COMP_CTX *ctx); 19 | int (*compress)(COMP_CTX *ctx, 20 | unsigned char *out, unsigned int olen, 21 | unsigned char *in, unsigned int ilen); 22 | int (*expand)(COMP_CTX *ctx, 23 | unsigned char *out, unsigned int olen, 24 | unsigned char *in, unsigned int ilen); 25 | /* The following two do NOTHING, but are kept for backward compatibility */ 26 | long (*ctrl)(void); 27 | long (*callback_ctrl)(void); 28 | } COMP_METHOD; 29 | 30 | struct comp_ctx_st 31 | { 32 | COMP_METHOD *meth; 33 | unsigned long compress_in; 34 | unsigned long compress_out; 35 | unsigned long expand_in; 36 | unsigned long expand_out; 37 | 38 | CRYPTO_EX_DATA ex_data; 39 | }; 40 | 41 | 42 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 43 | void COMP_CTX_free(COMP_CTX *ctx); 44 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 45 | unsigned char *in, int ilen); 46 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 47 | unsigned char *in, int ilen); 48 | COMP_METHOD *COMP_rle(void ); 49 | COMP_METHOD *COMP_zlib(void ); 50 | void COMP_zlib_cleanup(void); 51 | 52 | #ifdef HEADER_BIO_H 53 | #ifdef ZLIB 54 | BIO_METHOD *BIO_f_zlib(void); 55 | #endif 56 | #endif 57 | 58 | /* BEGIN ERROR CODES */ 59 | /* The following lines are auto generated by the script mkerr.pl. Any changes 60 | * made after this point may be overwritten when the script is next run. 61 | */ 62 | void ERR_load_COMP_strings(void); 63 | 64 | /* Error codes for the COMP functions. */ 65 | 66 | /* Function codes. */ 67 | #define COMP_F_BIO_ZLIB_FLUSH 99 68 | #define COMP_F_BIO_ZLIB_NEW 100 69 | #define COMP_F_BIO_ZLIB_READ 101 70 | #define COMP_F_BIO_ZLIB_WRITE 102 71 | 72 | /* Reason codes. */ 73 | #define COMP_R_ZLIB_DEFLATE_ERROR 99 74 | #define COMP_R_ZLIB_INFLATE_ERROR 100 75 | #define COMP_R_ZLIB_NOT_SUPPORTED 101 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | #endif 81 | -------------------------------------------------------------------------------- /include/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | #define HEADER_EBCDIC_H 5 | 6 | #include 7 | 8 | /* Avoid name clashes with other applications */ 9 | #define os_toascii _openssl_os_toascii 10 | #define os_toebcdic _openssl_os_toebcdic 11 | #define ebcdic2ascii _openssl_ebcdic2ascii 12 | #define ascii2ebcdic _openssl_ascii2ebcdic 13 | 14 | extern const unsigned char os_toascii[256]; 15 | extern const unsigned char os_toebcdic[256]; 16 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 17 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_WHRLPOOL_H 2 | #define HEADER_WHRLPOOL_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define WHIRLPOOL_DIGEST_LENGTH (512/8) 12 | #define WHIRLPOOL_BBLOCK 512 13 | #define WHIRLPOOL_COUNTER (256/8) 14 | 15 | typedef struct { 16 | union { 17 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 18 | /* double q is here to ensure 64-bit alignment */ 19 | double q[WHIRLPOOL_DIGEST_LENGTH/sizeof(double)]; 20 | } H; 21 | unsigned char data[WHIRLPOOL_BBLOCK/8]; 22 | unsigned int bitoff; 23 | size_t bitlen[WHIRLPOOL_COUNTER/sizeof(size_t)]; 24 | } WHIRLPOOL_CTX; 25 | 26 | #ifndef OPENSSL_NO_WHIRLPOOL 27 | #ifdef OPENSSL_FIPS 28 | int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 29 | #endif 30 | int WHIRLPOOL_Init (WHIRLPOOL_CTX *c); 31 | int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes); 32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,const void *inp,size_t bits); 33 | int WHIRLPOOL_Final (unsigned char *md,WHIRLPOOL_CTX *c); 34 | unsigned char *WHIRLPOOL(const void *inp,size_t bytes,unsigned char *md); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_PROJECT_PATH := $(shell pwd) 2 | APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk 3 | -------------------------------------------------------------------------------- /ssl/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | local_c_includes := \ 4 | $(NDK_PROJECT_PATH) \ 5 | $(NDK_PROJECT_PATH)/include \ 6 | $(NDK_PROJECT_PATH)/crypto \ 7 | $(NDK_PROJECT_PATH)/../include 8 | 9 | local_src_files:= \ 10 | s2_meth.c \ 11 | s2_srvr.c \ 12 | s2_clnt.c \ 13 | s2_lib.c \ 14 | s2_enc.c \ 15 | s2_pkt.c \ 16 | s3_meth.c \ 17 | s3_srvr.c \ 18 | s3_clnt.c \ 19 | s3_lib.c \ 20 | s3_enc.c \ 21 | s3_pkt.c \ 22 | s3_both.c \ 23 | s23_meth.c \ 24 | s23_srvr.c \ 25 | s23_clnt.c \ 26 | s23_lib.c \ 27 | s23_pkt.c \ 28 | t1_meth.c \ 29 | t1_srvr.c \ 30 | t1_clnt.c \ 31 | t1_lib.c \ 32 | t1_enc.c \ 33 | t1_reneg.c \ 34 | d1_meth.c \ 35 | d1_srvr.c \ 36 | d1_clnt.c \ 37 | d1_lib.c \ 38 | d1_pkt.c \ 39 | d1_both.c \ 40 | d1_enc.c \ 41 | d1_srtp.c \ 42 | ssl_lib.c \ 43 | ssl_err2.c \ 44 | ssl_cert.c \ 45 | ssl_sess.c \ 46 | ssl_ciph.c \ 47 | ssl_stat.c \ 48 | ssl_rsa.c \ 49 | ssl_asn1.c \ 50 | ssl_txt.c \ 51 | ssl_algs.c \ 52 | bio_ssl.c \ 53 | ssl_err.c \ 54 | kssl.c \ 55 | tls_srp.c 56 | 57 | include $(CLEAR_VARS) 58 | include $(LOCAL_PATH)/../android-config.mk 59 | LOCAL_SRC_FILES += $(local_src_files) 60 | LOCAL_C_INCLUDES += $(local_c_includes) 61 | LOCAL_SHARED_LIBRARIES += libcrypto 62 | LOCAL_MODULE_TAGS := optional 63 | LOCAL_MODULE:= libssl 64 | include $(BUILD_SHARED_LIBRARY) 65 | 66 | ifeq ($(WITH_HOST_DALVIK),true) 67 | include $(CLEAR_VARS) 68 | include $(LOCAL_PATH)/../android-config.mk 69 | LOCAL_SRC_FILES += $(local_src_files) 70 | LOCAL_C_INCLUDES += $(local_c_includes) 71 | LOCAL_SHARED_LIBRARIES += libcrypto 72 | LOCAL_MODULE_TAGS := optional 73 | LOCAL_MODULE:= libssl 74 | include $(BUILD_SHARED_LIBRARY) 75 | endif 76 | 77 | # ssltest 78 | include $(CLEAR_VARS) 79 | include $(LOCAL_PATH)/../android-config.mk 80 | LOCAL_SRC_FILES:= ssltest.c 81 | LOCAL_C_INCLUDES += $(local_c_includes) 82 | LOCAL_SHARED_LIBRARIES := libssl libcrypto 83 | LOCAL_MODULE:= ssltest 84 | LOCAL_MODULE_TAGS := optional 85 | include $(BUILD_EXECUTABLE) 86 | --------------------------------------------------------------------------------