diff --git a/INSTALL b/INSTALL index 5458714e1..7d1c323be 100644 --- a/INSTALL +++ b/INSTALL @@ -2,18 +2,24 @@ Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006 Free Software Foundation, Inc. +2006, 2007, 2008, 2009 Free Software Foundation, Inc. -This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. Basic Installation ================== -Briefly, the shell commands `./configure; make; make install' should + Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for -instructions specific to this package. +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -42,7 +48,7 @@ may remove or edit it. you want to change it or regenerate `configure' using a newer version of `autoconf'. -The simplest way to compile this package is: + The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. @@ -53,12 +59,22 @@ The simplest way to compile this package is: 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with - the package. + the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and - documentation. + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. - 5. You can remove the program binaries and object files from the + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is @@ -67,12 +83,22 @@ The simplest way to compile this package is: all sorts of other programs in order to regenerate files that came with the distribution. + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + Compilers and Options ===================== -Some systems require unusual options for compilation or linking that the -`configure' script does not know about. Run `./configure --help' for -details on some of the pertinent environment variables. + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here @@ -85,25 +111,41 @@ is an example: Compiling For Multiple Architectures ==================================== -You can compile the package for more than one kind of computer at the + You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + Installation Names ================== -By default, `make install' installs the package's commands under + By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you @@ -114,16 +156,47 @@ Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. -Optional Features -================= - -Some packages pay attention to `--enable-FEATURE' options to + Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The @@ -135,14 +208,53 @@ find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + Specifying the System Type ========================== -There may be some features `configure' cannot figure out automatically, -but needs to determine by the type of machine the package will run on. -Usually, assuming the package is built to be run on the _same_ -architectures, `configure' can figure that out, but if it prints a -message saying it cannot guess the machine type, give it the + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: @@ -150,7 +262,8 @@ type, such as `sun4', or a canonical name which has the form: where SYSTEM can have one of these forms: - OS KERNEL-OS + OS + KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't @@ -168,9 +281,9 @@ eventually be run) with `--host=TYPE'. Sharing Defaults ================ -If you want to set default values for `configure' scripts to share, you -can create a site shell script called `config.site' that gives default -values for variables like `CC', `cache_file', and `prefix'. + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. @@ -179,7 +292,7 @@ A warning: not all `configure' scripts look for a site script. Defining Variables ================== -Variables not defined in a site shell script can be set in the + Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set @@ -198,11 +311,19 @@ an Autoconf bug. Until the bug is fixed you can use this workaround: `configure' Invocation ====================== -`configure' recognizes the following options to control how it operates. + `configure' recognizes the following options to control how it +operates. `--help' `-h' - Print a summary of the options to `configure', and exit. + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. `--version' `-V' @@ -229,6 +350,16 @@ an Autoconf bug. Until the bug is fixed you can use this workaround: Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. diff --git a/ctaocrypt/benchmark/benchmark.c b/ctaocrypt/benchmark/benchmark.c index ba40913e9..d98c4fce2 100644 --- a/ctaocrypt/benchmark/benchmark.c +++ b/ctaocrypt/benchmark/benchmark.c @@ -18,8 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + /* CTaoCrypt benchmark */ + #include #include diff --git a/ctaocrypt/include/ctc_aes.h b/ctaocrypt/include/ctc_aes.h index 659714fbf..cc92c76ee 100644 --- a/ctaocrypt/include/ctc_aes.h +++ b/ctaocrypt/include/ctc_aes.h @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef NO_AES #ifndef CTAO_CRYPT_AES_H diff --git a/ctaocrypt/include/ctc_asn.h b/ctaocrypt/include/ctc_asn.h index 01957f87e..ee759d808 100644 --- a/ctaocrypt/include/ctc_asn.h +++ b/ctaocrypt/include/ctc_asn.h @@ -62,7 +62,6 @@ enum ASN_Tags { ASN_LONG_LENGTH = 0x80 }; - enum ASN_Flags{ ASN_CONSTRUCTED = 0x20, ASN_CONTEXT_SPECIFIC = 0x80 @@ -203,7 +202,7 @@ struct DecodedCert { byte serial[EXTERNAL_SERIAL_SIZE]; /* raw serial number */ int serialSz; /* raw serial bytes stored */ #ifdef CYASSL_CERT_GEN - /* easy access to sujbect info for other sign */ + /* easy access to subject info for other sign */ char* subjectSN; int subjectSNLen; char* subjectC; diff --git a/ctaocrypt/include/ctc_config.h b/ctaocrypt/include/ctc_config.h index 0c3b3c69c..722877e60 100644 --- a/ctaocrypt/include/ctc_config.h +++ b/ctaocrypt/include/ctc_config.h @@ -1,6 +1,9 @@ /* ctaocrypt/include/ctc_config.h. Generated from ctc_config.h.in by configure. */ /* ctaocrypt/include/ctc_config.h.in. Generated from configure.ac by autoheader. */ +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 @@ -66,6 +69,9 @@ /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "cyassl" +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + /* Define to the version of this package. */ #define PACKAGE_VERSION "2.0.0rc2" @@ -85,6 +91,14 @@ /* Version number of package */ #define VERSION "2.0.0rc2" -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #undef WORDS_BIGENDIAN */ +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif diff --git a/ctaocrypt/include/ctc_config.h.in b/ctaocrypt/include/ctc_config.h.in index e7c71438d..78ae95e5c 100644 --- a/ctaocrypt/include/ctc_config.h.in +++ b/ctaocrypt/include/ctc_config.h.in @@ -1,5 +1,8 @@ /* ctaocrypt/include/ctc_config.h.in. Generated from configure.ac by autoheader. */ +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H @@ -65,6 +68,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -84,6 +90,14 @@ /* Version number of package */ #undef VERSION -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif diff --git a/ctaocrypt/include/ctc_des3.h b/ctaocrypt/include/ctc_des3.h index 85bb0102f..22159ba43 100644 --- a/ctaocrypt/include/ctc_des3.h +++ b/ctaocrypt/include/ctc_des3.h @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef NO_DES3 #ifndef CTAO_CRYPT_DES3_H diff --git a/ctaocrypt/include/ctc_dh.h b/ctaocrypt/include/ctc_dh.h index 780517a1b..1d08c37fc 100644 --- a/ctaocrypt/include/ctc_dh.h +++ b/ctaocrypt/include/ctc_dh.h @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef NO_DH #ifndef CTAO_CRYPT_DH_H @@ -33,7 +34,6 @@ #endif - /* Diffie-Hellman Key */ typedef struct DhKey { mp_int p, g; /* group parameters */ diff --git a/ctaocrypt/include/ctc_dsa.h b/ctaocrypt/include/ctc_dsa.h index 2d6564379..e45a618b4 100644 --- a/ctaocrypt/include/ctc_dsa.h +++ b/ctaocrypt/include/ctc_dsa.h @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef NO_DSA #ifndef CTAO_CRYPT_DSA_H diff --git a/ctaocrypt/include/ctc_ecc.h b/ctaocrypt/include/ctc_ecc.h index 2069dc900..e57486fc3 100644 --- a/ctaocrypt/include/ctc_ecc.h +++ b/ctaocrypt/include/ctc_ecc.h @@ -63,6 +63,7 @@ typedef struct { mp_int z; /* The z coordinate */ } ecc_point; + /* An ECC Key */ typedef struct { int type; /* Public or Private */ diff --git a/ctaocrypt/include/ctc_error.h b/ctaocrypt/include/ctc_error.h index 177adde8d..72d03d216 100644 --- a/ctaocrypt/include/ctc_error.h +++ b/ctaocrypt/include/ctc_error.h @@ -79,11 +79,11 @@ enum { ASN_BEFORE_DATE_E = -150, /* ASN date error, current date before */ ASN_AFTER_DATE_E = -151, /* ASN date error, current date after */ ASN_SIG_OID_E = -152, /* ASN signature error, mismatched oid */ - ASN_TIME_E = -153, /* ASN time error, unkown time type */ + ASN_TIME_E = -153, /* ASN time error, unknown time type */ ASN_INPUT_E = -154, /* ASN input error, not enough data */ ASN_SIG_CONFIRM_E = -155, /* ASN sig error, confirm failure */ ASN_SIG_HASH_E = -156, /* ASN sig error, unsupported hash type */ - ASN_SIG_KEY_E = -157, /* ASN sig error, unsupported key type */ + ASN_SIG_KEY_E = -157, /* ASN sig error, unsupported key type */ ASN_DH_KEY_E = -158, /* ASN key init error, invalid input */ ASN_NTRU_KEY_E = -159, /* ASN ntru key decode error, invalid input */ @@ -92,7 +92,7 @@ enum { ECC_CURVE_OID_E = -172, /* Unsupported ECC OID curve type */ BAD_FUNC_ARG = -173, /* Bad function argument provided */ NOT_COMPILED_IN = -174, /* Feature not compiled in */ - UNICODE_SIZE_E = -175, /* Unicdoe password too big */ + UNICODE_SIZE_E = -175, /* Unicode password too big */ NO_PASSWORD = -176, /* no password provided by user */ MIN_CODE_E = -200 /* errors -101 - -199 */ diff --git a/ctaocrypt/include/ctc_hc128.h b/ctaocrypt/include/ctc_hc128.h index d292ef3e4..3738bb80c 100644 --- a/ctaocrypt/include/ctc_hc128.h +++ b/ctaocrypt/include/ctc_hc128.h @@ -32,7 +32,6 @@ #endif - /* HC-128 stream cipher */ typedef struct HC128 { word32 T[1024]; /* P[i] = T[i]; Q[i] = T[1024 + i ]; */ diff --git a/ctaocrypt/include/ctc_hmac.h b/ctaocrypt/include/ctc_hmac.h index 571a8ccc9..97a3ff0ac 100644 --- a/ctaocrypt/include/ctc_hmac.h +++ b/ctaocrypt/include/ctc_hmac.h @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef NO_HMAC #ifndef CTAO_CRYPT_HMAC_H @@ -36,7 +37,6 @@ #endif - enum { IPAD = 0x36, OPAD = 0x5C, diff --git a/ctaocrypt/include/ctc_integer.h b/ctaocrypt/include/ctc_integer.h index 842f2e605..4bfbe3067 100644 --- a/ctaocrypt/include/ctc_integer.h +++ b/ctaocrypt/include/ctc_integer.h @@ -19,8 +19,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ - - /* * Based on public domain LibTomMath 0.38 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com diff --git a/ctaocrypt/include/ctc_misc.h b/ctaocrypt/include/ctc_misc.h index 15062cdc0..196dadf85 100644 --- a/ctaocrypt/include/ctc_misc.h +++ b/ctaocrypt/include/ctc_misc.h @@ -27,7 +27,6 @@ #include "ctc_types.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/ctaocrypt/include/ctc_ripemd.h b/ctaocrypt/include/ctc_ripemd.h index c7b22e8ed..313a8af34 100644 --- a/ctaocrypt/include/ctc_ripemd.h +++ b/ctaocrypt/include/ctc_ripemd.h @@ -32,7 +32,6 @@ #endif - /* in bytes */ enum { RIPEMD = 3, /* hash type unique */ diff --git a/ctaocrypt/include/ctc_settings.h b/ctaocrypt/include/ctc_settings.h index 9ea9e4b1e..3497cc185 100644 --- a/ctaocrypt/include/ctc_settings.h +++ b/ctaocrypt/include/ctc_settings.h @@ -22,6 +22,7 @@ /* Place OS specific preprocessor flags, defines, includes here, will be included into every file because ctc_types.h includes it */ + #ifndef CTAO_CRYPT_SETTINGS_H #define CTAO_CRYPT_SETTINGS_H diff --git a/ctaocrypt/include/ctc_sha.h b/ctaocrypt/include/ctc_sha.h index 12ab98d8c..4e5160247 100644 --- a/ctaocrypt/include/ctc_sha.h +++ b/ctaocrypt/include/ctc_sha.h @@ -30,7 +30,6 @@ #endif - /* in bytes */ enum { SHA = 1, /* hash type unique */ diff --git a/ctaocrypt/include/ctc_sha256.h b/ctaocrypt/include/ctc_sha256.h index 7b080bf40..38fa059c7 100644 --- a/ctaocrypt/include/ctc_sha256.h +++ b/ctaocrypt/include/ctc_sha256.h @@ -35,7 +35,6 @@ #endif - /* in bytes */ enum { SHA256 = 2, /* hash type unique */ diff --git a/ctaocrypt/include/ctc_sha512.h b/ctaocrypt/include/ctc_sha512.h index 05225889c..f20899d67 100644 --- a/ctaocrypt/include/ctc_sha512.h +++ b/ctaocrypt/include/ctc_sha512.h @@ -32,7 +32,6 @@ #endif - /* in bytes */ enum { SHA512 = 4, /* hash type unique */ diff --git a/ctaocrypt/include/ctc_tfm.h b/ctaocrypt/include/ctc_tfm.h index e0852bd46..66054b825 100644 --- a/ctaocrypt/include/ctc_tfm.h +++ b/ctaocrypt/include/ctc_tfm.h @@ -20,7 +20,6 @@ */ - /* * Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com diff --git a/ctaocrypt/include/ctc_types.h b/ctaocrypt/include/ctc_types.h index 68ce42b27..67a23dadb 100644 --- a/ctaocrypt/include/ctc_types.h +++ b/ctaocrypt/include/ctc_types.h @@ -125,7 +125,7 @@ enum { /* idea to add global alloc override by Moisés Guimarães */ /* default to libc stuff */ -/* XREALLOC is used once in mormal math lib, not in fast math lib */ +/* XREALLOC is used once in normal math lib, not in fast math lib */ /* XFREE on some embeded systems doesn't like free(0) so test */ #ifdef XMALLOC_USER /* prototypes for user heap override functions */ diff --git a/ctaocrypt/include/ctc_visibility.h b/ctaocrypt/include/ctc_visibility.h index e03e0f0cc..86f402493 100644 --- a/ctaocrypt/include/ctc_visibility.h +++ b/ctaocrypt/include/ctc_visibility.h @@ -21,9 +21,11 @@ /* Visibility control macros */ + #ifndef CTAO_CRYPT_VISIBILITY_H #define CTAO_CRYPT_VISIBILITY_H + /* CYASSL_API is used for the public API symbols. It either imports or exports (or does nothing for static builds) diff --git a/ctaocrypt/include/cyassl_logging.h b/ctaocrypt/include/cyassl_logging.h index d5b18a44c..aba438799 100644 --- a/ctaocrypt/include/cyassl_logging.h +++ b/ctaocrypt/include/cyassl_logging.h @@ -21,6 +21,7 @@ /* submitted by eof */ + #ifndef CYASSL_LOGGING_H #define CYASSL_LOGGING_H diff --git a/ctaocrypt/include/cyassl_memory.h b/ctaocrypt/include/cyassl_memory.h index 8cdd6e589..6a1760068 100644 --- a/ctaocrypt/include/cyassl_memory.h +++ b/ctaocrypt/include/cyassl_memory.h @@ -21,6 +21,7 @@ /* submitted by eof */ + #ifndef CYASSL_MEMORY_H #define CYASSL_MEMORY_H @@ -31,7 +32,6 @@ #endif - typedef void *(*CyaSSL_Malloc_cb)(size_t size); typedef void (*CyaSSL_Free_cb)(void *ptr); typedef void *(*CyaSSL_Realloc_cb)(void *ptr, size_t size); @@ -48,7 +48,6 @@ CYASSL_API void CyaSSL_Free(void *ptr); CYASSL_API void* CyaSSL_Realloc(void *ptr, size_t size); - #ifdef __cplusplus } #endif diff --git a/ctaocrypt/include/mpi_class.h b/ctaocrypt/include/mpi_class.h index d40391257..b767f792a 100644 --- a/ctaocrypt/include/mpi_class.h +++ b/ctaocrypt/include/mpi_class.h @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #if !(defined(LTM1) && defined(LTM2) && defined(LTM3)) #if defined(LTM2) #define LTM3 diff --git a/ctaocrypt/include/mpi_superclass.h b/ctaocrypt/include/mpi_superclass.h index baf76f596..b979b5dab 100644 --- a/ctaocrypt/include/mpi_superclass.h +++ b/ctaocrypt/include/mpi_superclass.h @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + /* super class file for PK algos */ /* default ... include all MPI */ diff --git a/ctaocrypt/src/aes.c b/ctaocrypt/src/aes.c index cf07f134d..4c15706ad 100644 --- a/ctaocrypt/src/aes.c +++ b/ctaocrypt/src/aes.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef NO_AES #include "ctc_aes.h" @@ -1295,7 +1296,7 @@ void AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz) printf("sz = %d\n", sz); #endif - /* if input and output same will overwirte input iv */ + /* if input and output same will overwrite input iv */ XMEMCPY(aes->tmp, in + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE); AES_CBC_decrypt(in, out, (byte*)aes->reg, sz, (byte*)aes->key, aes->rounds); diff --git a/ctaocrypt/src/arc4.c b/ctaocrypt/src/arc4.c index 486c97b5c..cc31de275 100644 --- a/ctaocrypt/src/arc4.c +++ b/ctaocrypt/src/arc4.c @@ -23,7 +23,6 @@ #include "ctc_arc4.h" - void Arc4SetKey(Arc4* arc4, const byte* key, word32 length) { word32 i; diff --git a/ctaocrypt/src/asn.c b/ctaocrypt/src/asn.c index 4d1b88f44..32a0fc494 100644 --- a/ctaocrypt/src/asn.c +++ b/ctaocrypt/src/asn.c @@ -169,7 +169,6 @@ struct tm* gmtime(const time_t* timer) #endif /* _WIN32_WCE */ - #ifdef THREADX #define YEAR0 1900 @@ -2634,7 +2633,7 @@ static int SetValidity(byte* output, int daysValid) /* ASN Encoded Name field */ typedef struct EncodedName { int nameLen; /* actual string value length */ - int totalLen; /* total encodeding length */ + int totalLen; /* total encoded length */ int type; /* type of name */ int used; /* are we actually using this one */ byte encoded[CTC_NAME_SIZE * 2]; /* encoding */ @@ -3125,7 +3124,7 @@ int SetIssuer(Cert* cert, const char* issuerCertFile) #ifdef HAVE_ECC -/* Der Eoncde r & s ints into out, outLen is (in/out) size */ +/* Der Encode r & s ints into out, outLen is (in/out) size */ int StoreECC_DSA_Sig(byte* out, word32* outLen, mp_int* r, mp_int* s) { word32 idx = 0; diff --git a/ctaocrypt/src/ctc_asm.c b/ctaocrypt/src/ctc_asm.c index aef2cbf94..c45ee3142 100644 --- a/ctaocrypt/src/ctc_asm.c +++ b/ctaocrypt/src/ctc_asm.c @@ -19,13 +19,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + /* * Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com */ - /******************************************************************/ /* fp_montgomery_reduce.c asm or generic */ #if defined(TFM_X86) && !defined(TFM_SSE2) diff --git a/ctaocrypt/src/cyassl_memory.c b/ctaocrypt/src/cyassl_memory.c index 10ca4ab13..8684bfa67 100644 --- a/ctaocrypt/src/cyassl_memory.c +++ b/ctaocrypt/src/cyassl_memory.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + /* submitted by eof */ diff --git a/ctaocrypt/src/dh.c b/ctaocrypt/src/dh.c index 9df3f0c9e..522b7e3c7 100644 --- a/ctaocrypt/src/dh.c +++ b/ctaocrypt/src/dh.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef NO_DH #include "ctc_dh.h" @@ -33,7 +34,6 @@ #endif - #ifndef min static INLINE word32 min(word32 a, word32 b) @@ -44,7 +44,6 @@ #endif /* min */ - void InitDhKey(DhKey* key) { (void)key; diff --git a/ctaocrypt/src/dsa.c b/ctaocrypt/src/dsa.c index 083479260..e13eea8e0 100644 --- a/ctaocrypt/src/dsa.c +++ b/ctaocrypt/src/dsa.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef NO_DSA #include "ctc_dsa.h" @@ -29,7 +30,7 @@ enum { DSA_HALF_SIZE = 20, /* r and s size */ - DSA_SIG_SIZE = 40 /* signaure size */ + DSA_SIG_SIZE = 40 /* signature size */ }; diff --git a/ctaocrypt/src/fp_mont_small.i b/ctaocrypt/src/fp_mont_small.i index 869a6a1c1..3b50d6b21 100644 --- a/ctaocrypt/src/fp_mont_small.i +++ b/ctaocrypt/src/fp_mont_small.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SMALL_MONT_SET /* computes x/R == x (mod N) via Montgomery Reduction */ void fp_montgomery_reduce_small(fp_int *a, fp_int *m, fp_digit mp) diff --git a/ctaocrypt/src/fp_mul_comba_12.i b/ctaocrypt/src/fp_mul_comba_12.i index 3957bf059..a7c5871bd 100644 --- a/ctaocrypt/src/fp_mul_comba_12.i +++ b/ctaocrypt/src/fp_mul_comba_12.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL12 void fp_mul_comba12(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_17.i b/ctaocrypt/src/fp_mul_comba_17.i index d667a27d5..3ad0716a6 100644 --- a/ctaocrypt/src/fp_mul_comba_17.i +++ b/ctaocrypt/src/fp_mul_comba_17.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL17 void fp_mul_comba17(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_24.i b/ctaocrypt/src/fp_mul_comba_24.i index 6d0912db5..42f44b6ec 100644 --- a/ctaocrypt/src/fp_mul_comba_24.i +++ b/ctaocrypt/src/fp_mul_comba_24.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL24 void fp_mul_comba24(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_28.i b/ctaocrypt/src/fp_mul_comba_28.i index 874e4d087..060bb8a7e 100644 --- a/ctaocrypt/src/fp_mul_comba_28.i +++ b/ctaocrypt/src/fp_mul_comba_28.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL28 void fp_mul_comba28(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_3.i b/ctaocrypt/src/fp_mul_comba_3.i index f9f4623dd..03499c954 100644 --- a/ctaocrypt/src/fp_mul_comba_3.i +++ b/ctaocrypt/src/fp_mul_comba_3.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL3 void fp_mul_comba3(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_32.i b/ctaocrypt/src/fp_mul_comba_32.i index 30cba9957..3ca1fdbb3 100644 --- a/ctaocrypt/src/fp_mul_comba_32.i +++ b/ctaocrypt/src/fp_mul_comba_32.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL32 void fp_mul_comba32(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_4.i b/ctaocrypt/src/fp_mul_comba_4.i index 8ed22b14f..d715937d0 100644 --- a/ctaocrypt/src/fp_mul_comba_4.i +++ b/ctaocrypt/src/fp_mul_comba_4.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL4 void fp_mul_comba4(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_48.i b/ctaocrypt/src/fp_mul_comba_48.i index 8f7d27097..4c185698f 100644 --- a/ctaocrypt/src/fp_mul_comba_48.i +++ b/ctaocrypt/src/fp_mul_comba_48.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL48 void fp_mul_comba48(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_6.i b/ctaocrypt/src/fp_mul_comba_6.i index 89a3cc02c..e691e9813 100644 --- a/ctaocrypt/src/fp_mul_comba_6.i +++ b/ctaocrypt/src/fp_mul_comba_6.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL6 void fp_mul_comba6(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_64.i b/ctaocrypt/src/fp_mul_comba_64.i index f7347b89c..ba0517b13 100644 --- a/ctaocrypt/src/fp_mul_comba_64.i +++ b/ctaocrypt/src/fp_mul_comba_64.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL64 void fp_mul_comba64(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_7.i b/ctaocrypt/src/fp_mul_comba_7.i index e563c11b9..46fb97010 100644 --- a/ctaocrypt/src/fp_mul_comba_7.i +++ b/ctaocrypt/src/fp_mul_comba_7.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL7 void fp_mul_comba7(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_8.i b/ctaocrypt/src/fp_mul_comba_8.i index 495aa7f9a..987d13edf 100644 --- a/ctaocrypt/src/fp_mul_comba_8.i +++ b/ctaocrypt/src/fp_mul_comba_8.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL8 void fp_mul_comba8(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_9.i b/ctaocrypt/src/fp_mul_comba_9.i index e8d820ec9..5b1b3c79b 100644 --- a/ctaocrypt/src/fp_mul_comba_9.i +++ b/ctaocrypt/src/fp_mul_comba_9.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_MUL9 void fp_mul_comba9(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_mul_comba_small_set.i b/ctaocrypt/src/fp_mul_comba_small_set.i index 11e1ee0b7..1fef0825f 100644 --- a/ctaocrypt/src/fp_mul_comba_small_set.i +++ b/ctaocrypt/src/fp_mul_comba_small_set.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #if defined(TFM_SMALL_SET) void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C) { diff --git a/ctaocrypt/src/fp_sqr_comba_12.i b/ctaocrypt/src/fp_sqr_comba_12.i index 02807be85..382ebe271 100644 --- a/ctaocrypt/src/fp_sqr_comba_12.i +++ b/ctaocrypt/src/fp_sqr_comba_12.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR12 void fp_sqr_comba12(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_17.i b/ctaocrypt/src/fp_sqr_comba_17.i index dfafa4735..153ce878b 100644 --- a/ctaocrypt/src/fp_sqr_comba_17.i +++ b/ctaocrypt/src/fp_sqr_comba_17.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR17 void fp_sqr_comba17(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_20.i b/ctaocrypt/src/fp_sqr_comba_20.i index 33285b7c1..34d6593c3 100644 --- a/ctaocrypt/src/fp_sqr_comba_20.i +++ b/ctaocrypt/src/fp_sqr_comba_20.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR20 void fp_sqr_comba20(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_24.i b/ctaocrypt/src/fp_sqr_comba_24.i index 2bdfbfaee..35092def4 100644 --- a/ctaocrypt/src/fp_sqr_comba_24.i +++ b/ctaocrypt/src/fp_sqr_comba_24.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR24 void fp_sqr_comba24(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_28.i b/ctaocrypt/src/fp_sqr_comba_28.i index 4f9b5da01..7164f3946 100644 --- a/ctaocrypt/src/fp_sqr_comba_28.i +++ b/ctaocrypt/src/fp_sqr_comba_28.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR28 void fp_sqr_comba28(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_3.i b/ctaocrypt/src/fp_sqr_comba_3.i index c55d6198f..6ff9d156b 100644 --- a/ctaocrypt/src/fp_sqr_comba_3.i +++ b/ctaocrypt/src/fp_sqr_comba_3.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR3 void fp_sqr_comba3(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_32.i b/ctaocrypt/src/fp_sqr_comba_32.i index 47a0b164b..ada0007d8 100644 --- a/ctaocrypt/src/fp_sqr_comba_32.i +++ b/ctaocrypt/src/fp_sqr_comba_32.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR32 void fp_sqr_comba32(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_4.i b/ctaocrypt/src/fp_sqr_comba_4.i index 5e388d5c8..cd19f761b 100644 --- a/ctaocrypt/src/fp_sqr_comba_4.i +++ b/ctaocrypt/src/fp_sqr_comba_4.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR4 void fp_sqr_comba4(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_48.i b/ctaocrypt/src/fp_sqr_comba_48.i index b0af6bd92..27dddfe50 100644 --- a/ctaocrypt/src/fp_sqr_comba_48.i +++ b/ctaocrypt/src/fp_sqr_comba_48.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR48 void fp_sqr_comba48(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_6.i b/ctaocrypt/src/fp_sqr_comba_6.i index e533ea888..695e6d3d0 100644 --- a/ctaocrypt/src/fp_sqr_comba_6.i +++ b/ctaocrypt/src/fp_sqr_comba_6.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR6 void fp_sqr_comba6(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_64.i b/ctaocrypt/src/fp_sqr_comba_64.i index 3bc6e6243..a2fedc8e4 100644 --- a/ctaocrypt/src/fp_sqr_comba_64.i +++ b/ctaocrypt/src/fp_sqr_comba_64.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR64 void fp_sqr_comba64(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_7.i b/ctaocrypt/src/fp_sqr_comba_7.i index 102a5ff90..1d620fce6 100644 --- a/ctaocrypt/src/fp_sqr_comba_7.i +++ b/ctaocrypt/src/fp_sqr_comba_7.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR7 void fp_sqr_comba7(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_8.i b/ctaocrypt/src/fp_sqr_comba_8.i index bd2dc515e..7d7e58f3f 100644 --- a/ctaocrypt/src/fp_sqr_comba_8.i +++ b/ctaocrypt/src/fp_sqr_comba_8.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR8 void fp_sqr_comba8(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_9.i b/ctaocrypt/src/fp_sqr_comba_9.i index 6643809ce..f0b04b645 100644 --- a/ctaocrypt/src/fp_sqr_comba_9.i +++ b/ctaocrypt/src/fp_sqr_comba_9.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef TFM_SQR9 void fp_sqr_comba9(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/fp_sqr_comba_small_set.i b/ctaocrypt/src/fp_sqr_comba_small_set.i index 85055d1f9..043baecc6 100644 --- a/ctaocrypt/src/fp_sqr_comba_small_set.i +++ b/ctaocrypt/src/fp_sqr_comba_small_set.i @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #if defined(TFM_SMALL_SET) void fp_sqr_comba_small(fp_int *A, fp_int *B) { diff --git a/ctaocrypt/src/hmac.c b/ctaocrypt/src/hmac.c index 6c1a2d052..da1581523 100644 --- a/ctaocrypt/src/hmac.c +++ b/ctaocrypt/src/hmac.c @@ -26,7 +26,6 @@ #include "ctc_error.h" - static int InitHmac(Hmac* hmac, int type) { hmac->innerHashKeyed = 0; diff --git a/ctaocrypt/src/integer.c b/ctaocrypt/src/integer.c index 9d121e922..10275475d 100644 --- a/ctaocrypt/src/integer.c +++ b/ctaocrypt/src/integer.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + /* * Based on public domain LibTomMath 0.38 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com diff --git a/ctaocrypt/src/logging.c b/ctaocrypt/src/logging.c index b29d4cbfa..cdf6631ee 100644 --- a/ctaocrypt/src/logging.c +++ b/ctaocrypt/src/logging.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + /* submitted by eof */ #include "ctc_settings.h" diff --git a/ctaocrypt/src/md4.c b/ctaocrypt/src/md4.c index 0b25a40ca..69bc95715 100644 --- a/ctaocrypt/src/md4.c +++ b/ctaocrypt/src/md4.c @@ -30,7 +30,6 @@ #endif - #ifndef min static INLINE word32 min(word32 a, word32 b) diff --git a/ctaocrypt/src/md5.c b/ctaocrypt/src/md5.c index 88b397c5d..73d298072 100644 --- a/ctaocrypt/src/md5.c +++ b/ctaocrypt/src/md5.c @@ -28,7 +28,6 @@ #endif - #ifndef min static INLINE word32 min(word32 a, word32 b) diff --git a/ctaocrypt/src/pwdbased.c b/ctaocrypt/src/pwdbased.c index 153c33ba6..af4f985b4 100644 --- a/ctaocrypt/src/pwdbased.c +++ b/ctaocrypt/src/pwdbased.c @@ -36,7 +36,6 @@ #endif - #ifndef min static INLINE word32 min(word32 a, word32 b) diff --git a/ctaocrypt/src/rsa.c b/ctaocrypt/src/rsa.c index 2a3c7f126..cfc95a81d 100644 --- a/ctaocrypt/src/rsa.c +++ b/ctaocrypt/src/rsa.c @@ -20,7 +20,6 @@ */ - #include "ctc_rsa.h" #include "ctc_random.h" #include "ctc_error.h" @@ -237,7 +236,6 @@ done: } - int RsaPublicEncrypt(const byte* in, word32 inLen, byte* out, word32 outLen, RsaKey* key, RNG* rng) { @@ -272,6 +270,7 @@ int RsaPrivateDecryptInline(byte* in, word32 inLen, byte** out, RsaKey* key) return plainLen; } + int RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out, word32 outLen, RsaKey* key) { @@ -317,6 +316,7 @@ int RsaSSL_VerifyInline(byte* in, word32 inLen, byte** out, RsaKey* key) return plainLen; } + int RsaSSL_Verify(const byte* in, word32 inLen, byte* out, word32 outLen, RsaKey* key) { diff --git a/ctaocrypt/src/sha256.c b/ctaocrypt/src/sha256.c index dfe6a28e1..65ab591ff 100644 --- a/ctaocrypt/src/sha256.c +++ b/ctaocrypt/src/sha256.c @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -/* code submitted by raphael.huck@efixo.com */ +/* code submitted by raphael.huck@efixo.com */ #ifndef NO_SHA256 diff --git a/ctaocrypt/src/tfm.c b/ctaocrypt/src/tfm.c index 09fb27721..ffc3a55df 100644 --- a/ctaocrypt/src/tfm.c +++ b/ctaocrypt/src/tfm.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + /* * Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca, * http://math.libtomcrypt.com diff --git a/ctaocrypt/test/test.c b/ctaocrypt/test/test.c index 941dd8e22..eea1dbff1 100644 --- a/ctaocrypt/test/test.c +++ b/ctaocrypt/test/test.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #include #include #include diff --git a/examples/client/client.c b/examples/client/client.c index 8f1514ce1..accf0fc0f 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #include "ssl.h" #include "cyassl_test.h" diff --git a/examples/echoclient/echoclient.c b/examples/echoclient/echoclient.c index 6b4bd3858..c2a0070ec 100644 --- a/examples/echoclient/echoclient.c +++ b/examples/echoclient/echoclient.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #include "ssl.h" #include "cyassl_test.h" diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index e53830b75..b2c6942b6 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #include "ssl.h" #include "cyassl_test.h" diff --git a/examples/server/server.c b/examples/server/server.c index 09be49948..a4e26079f 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #include "ssl.h" #include "cyassl_test.h" diff --git a/include/cyassl_error.h b/include/cyassl_error.h index b522faf4f..dea82cd99 100644 --- a/include/cyassl_error.h +++ b/include/cyassl_error.h @@ -20,7 +20,6 @@ */ - #ifndef CYASSL_ERROR_H #define CYASSL_ERROR_H @@ -44,13 +43,13 @@ enum CyaSSL_ErrorCodes { complete task */ UNKNOWN_RECORD_TYPE = -211, /* unknown type in record hdr */ DECRYPT_ERROR = -212, /* error during decryption */ - FATAL_ERROR = -213, /* revcd alert fatal error */ + FATAL_ERROR = -213, /* recvd alert fatal error */ ENCRYPT_ERROR = -214, /* error during encryption */ FREAD_ERROR = -215, /* fread problem */ NO_PEER_KEY = -216, /* need peer's key */ NO_PRIVATE_KEY = -217, /* need the private key */ RSA_PRIVATE_ERROR = -218, /* error during rsa priv op */ - NO_DH_PARAMS = -219, /* server missging DH params */ + NO_DH_PARAMS = -219, /* server missing DH params */ BUILD_MSG_ERROR = -220, /* build message failure */ BAD_HELLO = -221, /* client hello malformed */ @@ -75,7 +74,7 @@ enum CyaSSL_ErrorCodes { SIGACT_ERROR = -239, /* sigaction failed ??? */ SETITIMER_ERROR = -240, /* setitimer failed ??? */ LENGTH_ERROR = -241, /* record layer length error */ - PEER_KEY_ERROR = -242, /* cant decode peer key */ + PEER_KEY_ERROR = -242, /* can't decode peer key */ ZERO_RETURN = -243, /* peer sent close notify */ SIDE_ERROR = -244, /* wrong client/server type */ NO_PEER_CERT = -245, /* peer didn't send key */ @@ -95,7 +94,7 @@ enum CyaSSL_ErrorCodes { /* begin negotiation parameter errors */ UNSUPPORTED_SUITE = -260, /* unsupported cipher suite */ MATCH_SUITE_ERROR = -261 /* can't match cipher suite */ - /* end negotiation parameter errors only 10 for now */ + /* end negotiation parameter errors only 10 for now */ /* add strings to SetErrorString !!!!! */ }; diff --git a/include/cyassl_int.h b/include/cyassl_int.h index 8593df055..611f2ba4d 100644 --- a/include/cyassl_int.h +++ b/include/cyassl_int.h @@ -20,7 +20,6 @@ */ - #ifndef CYASSL_INT_H #define CYASSL_INT_H @@ -854,7 +853,7 @@ enum ConnectState { }; -/* server accpet state for nonblocking restart */ +/* server accept state for nonblocking restart */ enum AcceptState { ACCEPT_BEGIN = 0, ACCEPT_CLIENT_HELLO_DONE, diff --git a/include/openssl/cyassl_callbacks.h b/include/openssl/cyassl_callbacks.h index 87998aa2d..bbc1f7beb 100644 --- a/include/openssl/cyassl_callbacks.h +++ b/include/openssl/cyassl_callbacks.h @@ -20,7 +20,6 @@ */ - #ifndef CYASSL_CALLBACKS_H #define CYASSL_CALLBACKS_H diff --git a/include/openssl/des.h b/include/openssl/des.h index 0a48db3b9..95e342391 100644 --- a/include/openssl/des.h +++ b/include/openssl/des.h @@ -25,7 +25,6 @@ */ - #ifndef CYASSL_DES_H_ #define CYASSL_DES_H_ diff --git a/include/openssl/evp.h b/include/openssl/evp.h index fc427589f..489b03164 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -25,7 +25,6 @@ */ - #ifndef CYASSL_EVP_H_ #define CYASSL_EVP_H_ diff --git a/include/openssl/hmac.h b/include/openssl/hmac.h index 8cd40b1d2..8c4f943fb 100644 --- a/include/openssl/hmac.h +++ b/include/openssl/hmac.h @@ -25,7 +25,6 @@ */ - #ifndef CYASSL_HMAC_H_ #define CYASSL_HMAC_H_ diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 517d3cf4b..45d6e4958 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -25,7 +25,6 @@ */ - #ifndef CYASSL_OPENSSL_H_ #define CYASSL_OPENSSL_H_ @@ -53,7 +52,6 @@ #endif - typedef struct SSL SSL; typedef struct SSL_SESSION SSL_SESSION; typedef struct SSL_METHOD SSL_METHOD; @@ -68,8 +66,6 @@ typedef struct X509_CHAIN X509_CHAIN; #define SSL_TYPES_DEFINED - - typedef struct EVP_PKEY EVP_PKEY; typedef struct RSA RSA; typedef struct BIO BIO; diff --git a/include/sniffer.h b/include/sniffer.h index 61f5ca2dd..1b5820e9a 100644 --- a/include/sniffer.h +++ b/include/sniffer.h @@ -20,7 +20,6 @@ */ - #ifndef CYASSL_SNIFFER_H #define CYASSL_SNIFFER_H @@ -42,7 +41,6 @@ #endif - CYASSL_API SSL_SNIFFER_API int ssl_SetPrivateKey(const char* address, int port, const char* keyFile, int keyType, diff --git a/include/sniffer_error.h b/include/sniffer_error.h index 7157ee12d..fcdc8191e 100644 --- a/include/sniffer_error.h +++ b/include/sniffer_error.h @@ -20,7 +20,6 @@ */ - #ifndef CYASSL_SNIFFER_ERROR_H #define CYASSL_SNIFFER_ERROR_H diff --git a/src/cyassl_int.c b/src/cyassl_int.c index f5f8378c2..91c8d37c1 100644 --- a/src/cyassl_int.c +++ b/src/cyassl_int.c @@ -20,7 +20,6 @@ */ - #include "cyassl_int.h" #include "cyassl_error.h" #include "ctc_asn.h" @@ -84,8 +83,6 @@ static void Hmac(SSL* ssl, byte* digest, const byte* buffer, word32 sz, static void BuildCertHashes(SSL* ssl, Hashes* hashes); - - #ifndef min static INLINE word32 min(word32 a, word32 b) @@ -1250,7 +1247,7 @@ static INLINE int GrowInputBuffer(SSL* ssl, int size, int usedLength) } -/* check avalaible size into outbut buffer */ +/* check avalaible size into output buffer */ static INLINE int CheckAvalaibleSize(SSL *ssl, int size) { if ((word32)size > ssl->buffers.outputBuffer.bufferSize) @@ -1719,7 +1716,7 @@ static int DoHandShakeMsg(SSL* ssl, byte* input, word32* inOutIdx, HashInput(ssl, input + *inOutIdx, size); #ifdef CYASSL_CALLBACKS - /* add name later, add on record and handshake header part back on */ + /* add name later, add on record and handshake header part back on */ if (ssl->toInfoOn) { int add = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; AddPacketInfo(0, &ssl->timeoutInfo, input + *inOutIdx - add, diff --git a/src/keys.c b/src/keys.c index 31afe8ba4..7252a54eb 100644 --- a/src/keys.c +++ b/src/keys.c @@ -20,7 +20,6 @@ */ - #include "cyassl_int.h" #include "cyassl_error.h" #ifdef SHOW_SECRETS @@ -28,8 +27,6 @@ #endif - - int SetCipherSpecs(SSL* ssl) { #ifdef HAVE_ECC @@ -807,6 +804,3 @@ int MakeMasterSecret(SSL* ssl) return ret; } - - - diff --git a/src/sniffer.c b/src/sniffer.c index 319cfba24..50f22020c 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef CYASSL_SNIFFER #include "ssl.h" @@ -102,7 +103,7 @@ static int TraceOn = 0; /* Trace is off by default */ static FILE* TraceFile = 0; -/* windows uses .rc talbe for this */ +/* windows uses .rc table for this */ #ifndef _WIN32 static const char* const msgTable[] = diff --git a/sslSniffer/sslSnifferTest/snifftest.c b/sslSniffer/sslSnifferTest/snifftest.c index b4225777b..ad32c2fb5 100755 --- a/sslSniffer/sslSnifferTest/snifftest.c +++ b/sslSniffer/sslSnifferTest/snifftest.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifdef _WIN32 #define CYASSL_SNIFFER #endif diff --git a/swig/cyassl_adds.c b/swig/cyassl_adds.c index f3ac18be9..65a7aba6f 100644 --- a/swig/cyassl_adds.c +++ b/swig/cyassl_adds.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #ifndef _WIN32 #define HAVE_CONFIG_H #endif diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c index b9cc2f644..508c2dd2c 100644 --- a/testsuite/testsuite.c +++ b/testsuite/testsuite.c @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ + #include "ssl.h" #include "cyassl_test.h" #include "ctc_md5.h"