mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 19:54:40 +02:00
Corrected spelling mistakes, formatting
This commit is contained in:
197
INSTALL
197
INSTALL
@@ -2,18 +2,24 @@ Installation Instructions
|
|||||||
*************************
|
*************************
|
||||||
|
|
||||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
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
|
Copying and distribution of this file, with or without modification,
|
||||||
unlimited permission to copy, distribute and modify it.
|
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
|
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
|
configure, build, and install this package. The following
|
||||||
more-detailed instructions are generic; see the `README' file for
|
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
|
The `configure' shell script attempts to guess correct values for
|
||||||
various system-dependent variables used during compilation. It uses
|
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
|
you want to change it or regenerate `configure' using a newer version
|
||||||
of `autoconf'.
|
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
|
1. `cd' to the directory containing the package's source code and type
|
||||||
`./configure' to configure the package for your system.
|
`./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.
|
2. Type `make' to compile the package.
|
||||||
|
|
||||||
3. Optionally, type `make check' to run any self-tests that come with
|
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
|
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
|
source code directory by typing `make clean'. To also remove the
|
||||||
files that `configure' created (so you can compile the package for
|
files that `configure' created (so you can compile the package for
|
||||||
a different kind of computer), type `make distclean'. There is
|
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
|
all sorts of other programs in order to regenerate files that came
|
||||||
with the distribution.
|
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
|
Compilers and Options
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
Some systems require unusual options for compilation or linking that the
|
Some systems require unusual options for compilation or linking that
|
||||||
`configure' script does not know about. Run `./configure --help' for
|
the `configure' script does not know about. Run `./configure --help'
|
||||||
details on some of the pertinent environment variables.
|
for details on some of the pertinent environment variables.
|
||||||
|
|
||||||
You can give `configure' initial values for configuration parameters
|
You can give `configure' initial values for configuration parameters
|
||||||
by setting variables in the command line or in the environment. Here
|
by setting variables in the command line or in the environment. Here
|
||||||
@@ -85,25 +111,41 @@ is an example:
|
|||||||
Compiling For Multiple Architectures
|
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
|
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
|
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
|
directory where you want the object files and executables to go and run
|
||||||
the `configure' script. `configure' automatically checks for the
|
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
|
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
|
architecture at a time in the source code directory. After you have
|
||||||
installed the package for one architecture, use `make distclean' before
|
installed the package for one architecture, use `make distclean' before
|
||||||
reconfiguring for another architecture.
|
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
|
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
|
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||||
can specify an installation prefix other than `/usr/local' by giving
|
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
|
You can specify separate installation prefixes for
|
||||||
architecture-specific files and architecture-independent files. If you
|
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
|
In addition, if you use an unusual directory layout you can give
|
||||||
options like `--bindir=DIR' to specify different values for particular
|
options like `--bindir=DIR' to specify different values for particular
|
||||||
kinds of files. Run `configure --help' for a list of the directories
|
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
|
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
|
with an extra prefix or suffix on their names by giving `configure' the
|
||||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
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.
|
`configure', where FEATURE indicates an optional part of the package.
|
||||||
They may also pay attention to `--with-PACKAGE' options, where 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
|
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
|
you can use the `configure' options `--x-includes=DIR' and
|
||||||
`--x-libraries=DIR' to specify their locations.
|
`--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 `<wchar.h>' 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
|
Specifying the System Type
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
There may be some features `configure' cannot figure out automatically,
|
There may be some features `configure' cannot figure out
|
||||||
but needs to determine by the type of machine the package will run on.
|
automatically, but needs to determine by the type of machine the package
|
||||||
Usually, assuming the package is built to be run on the _same_
|
will run on. Usually, assuming the package is built to be run on the
|
||||||
architectures, `configure' can figure that out, but if it prints a
|
_same_ architectures, `configure' can figure that out, but if it prints
|
||||||
message saying it cannot guess the machine type, give it the
|
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
|
`--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:
|
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:
|
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
|
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
|
`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
|
Sharing Defaults
|
||||||
================
|
================
|
||||||
|
|
||||||
If you want to set default values for `configure' scripts to share, you
|
If you want to set default values for `configure' scripts to share,
|
||||||
can create a site shell script called `config.site' that gives default
|
you can create a site shell script called `config.site' that gives
|
||||||
values for variables like `CC', `cache_file', and `prefix'.
|
default values for variables like `CC', `cache_file', and `prefix'.
|
||||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||||
`CONFIG_SITE' environment variable to the location of the site script.
|
`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
|
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
|
environment passed to `configure'. However, some packages may run
|
||||||
configure again during the build, and the customized values of these
|
configure again during the build, and the customized values of these
|
||||||
variables may be lost. In order to avoid this problem, you should set
|
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' Invocation
|
||||||
======================
|
======================
|
||||||
|
|
||||||
`configure' recognizes the following options to control how it operates.
|
`configure' recognizes the following options to control how it
|
||||||
|
operates.
|
||||||
|
|
||||||
`--help'
|
`--help'
|
||||||
`-h'
|
`-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'
|
`--version'
|
||||||
`-V'
|
`-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
|
Look for the package's source code in directory DIR. Usually
|
||||||
`configure' can determine that directory automatically.
|
`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' also accepts some other, not widely useful, options. Run
|
||||||
`configure --help' for more details.
|
`configure --help' for more details.
|
||||||
|
|
||||||
|
@@ -18,8 +18,10 @@
|
|||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* CTaoCrypt benchmark */
|
/* CTaoCrypt benchmark */
|
||||||
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_AES
|
#ifndef NO_AES
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_AES_H
|
#ifndef CTAO_CRYPT_AES_H
|
||||||
|
@@ -62,7 +62,6 @@ enum ASN_Tags {
|
|||||||
ASN_LONG_LENGTH = 0x80
|
ASN_LONG_LENGTH = 0x80
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
enum ASN_Flags{
|
enum ASN_Flags{
|
||||||
ASN_CONSTRUCTED = 0x20,
|
ASN_CONSTRUCTED = 0x20,
|
||||||
ASN_CONTEXT_SPECIFIC = 0x80
|
ASN_CONTEXT_SPECIFIC = 0x80
|
||||||
@@ -203,7 +202,7 @@ struct DecodedCert {
|
|||||||
byte serial[EXTERNAL_SERIAL_SIZE]; /* raw serial number */
|
byte serial[EXTERNAL_SERIAL_SIZE]; /* raw serial number */
|
||||||
int serialSz; /* raw serial bytes stored */
|
int serialSz; /* raw serial bytes stored */
|
||||||
#ifdef CYASSL_CERT_GEN
|
#ifdef CYASSL_CERT_GEN
|
||||||
/* easy access to sujbect info for other sign */
|
/* easy access to subject info for other sign */
|
||||||
char* subjectSN;
|
char* subjectSN;
|
||||||
int subjectSNLen;
|
int subjectSNLen;
|
||||||
char* subjectC;
|
char* subjectC;
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
/* ctaocrypt/include/ctc_config.h. Generated from ctc_config.h.in by configure. */
|
/* 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. */
|
/* 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 <dlfcn.h> header file. */
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
#define HAVE_DLFCN_H 1
|
#define HAVE_DLFCN_H 1
|
||||||
|
|
||||||
@@ -66,6 +69,9 @@
|
|||||||
/* Define to the one symbol short name of this package. */
|
/* Define to the one symbol short name of this package. */
|
||||||
#define PACKAGE_TARNAME "cyassl"
|
#define PACKAGE_TARNAME "cyassl"
|
||||||
|
|
||||||
|
/* Define to the home page for this package. */
|
||||||
|
#define PACKAGE_URL ""
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
/* Define to the version of this package. */
|
||||||
#define PACKAGE_VERSION "2.0.0rc2"
|
#define PACKAGE_VERSION "2.0.0rc2"
|
||||||
|
|
||||||
@@ -85,6 +91,14 @@
|
|||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
#define VERSION "2.0.0rc2"
|
#define VERSION "2.0.0rc2"
|
||||||
|
|
||||||
/* Define to 1 if your processor stores words with the most significant byte
|
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||||
/* #undef WORDS_BIGENDIAN */
|
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||||
|
# if defined __BIG_ENDIAN__
|
||||||
|
# define WORDS_BIGENDIAN 1
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# ifndef WORDS_BIGENDIAN
|
||||||
|
/* # undef WORDS_BIGENDIAN */
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
/* ctaocrypt/include/ctc_config.h.in. Generated from configure.ac by autoheader. */
|
/* 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 <dlfcn.h> header file. */
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
#undef HAVE_DLFCN_H
|
#undef HAVE_DLFCN_H
|
||||||
|
|
||||||
@@ -65,6 +68,9 @@
|
|||||||
/* Define to the one symbol short name of this package. */
|
/* Define to the one symbol short name of this package. */
|
||||||
#undef PACKAGE_TARNAME
|
#undef PACKAGE_TARNAME
|
||||||
|
|
||||||
|
/* Define to the home page for this package. */
|
||||||
|
#undef PACKAGE_URL
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
/* Define to the version of this package. */
|
||||||
#undef PACKAGE_VERSION
|
#undef PACKAGE_VERSION
|
||||||
|
|
||||||
@@ -84,6 +90,14 @@
|
|||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
#undef VERSION
|
#undef VERSION
|
||||||
|
|
||||||
/* Define to 1 if your processor stores words with the most significant byte
|
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||||
#undef WORDS_BIGENDIAN
|
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||||
|
# if defined __BIG_ENDIAN__
|
||||||
|
# define WORDS_BIGENDIAN 1
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# ifndef WORDS_BIGENDIAN
|
||||||
|
# undef WORDS_BIGENDIAN
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_DES3
|
#ifndef NO_DES3
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_DES3_H
|
#ifndef CTAO_CRYPT_DES3_H
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_DH
|
#ifndef NO_DH
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_DH_H
|
#ifndef CTAO_CRYPT_DH_H
|
||||||
@@ -33,7 +34,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Diffie-Hellman Key */
|
/* Diffie-Hellman Key */
|
||||||
typedef struct DhKey {
|
typedef struct DhKey {
|
||||||
mp_int p, g; /* group parameters */
|
mp_int p, g; /* group parameters */
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_DSA
|
#ifndef NO_DSA
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_DSA_H
|
#ifndef CTAO_CRYPT_DSA_H
|
||||||
|
@@ -63,6 +63,7 @@ typedef struct {
|
|||||||
mp_int z; /* The z coordinate */
|
mp_int z; /* The z coordinate */
|
||||||
} ecc_point;
|
} ecc_point;
|
||||||
|
|
||||||
|
|
||||||
/* An ECC Key */
|
/* An ECC Key */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int type; /* Public or Private */
|
int type; /* Public or Private */
|
||||||
|
@@ -79,11 +79,11 @@ enum {
|
|||||||
ASN_BEFORE_DATE_E = -150, /* ASN date error, current date before */
|
ASN_BEFORE_DATE_E = -150, /* ASN date error, current date before */
|
||||||
ASN_AFTER_DATE_E = -151, /* ASN date error, current date after */
|
ASN_AFTER_DATE_E = -151, /* ASN date error, current date after */
|
||||||
ASN_SIG_OID_E = -152, /* ASN signature error, mismatched oid */
|
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_INPUT_E = -154, /* ASN input error, not enough data */
|
||||||
ASN_SIG_CONFIRM_E = -155, /* ASN sig error, confirm failure */
|
ASN_SIG_CONFIRM_E = -155, /* ASN sig error, confirm failure */
|
||||||
ASN_SIG_HASH_E = -156, /* ASN sig error, unsupported hash type */
|
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_DH_KEY_E = -158, /* ASN key init error, invalid input */
|
||||||
ASN_NTRU_KEY_E = -159, /* ASN ntru key decode 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 */
|
ECC_CURVE_OID_E = -172, /* Unsupported ECC OID curve type */
|
||||||
BAD_FUNC_ARG = -173, /* Bad function argument provided */
|
BAD_FUNC_ARG = -173, /* Bad function argument provided */
|
||||||
NOT_COMPILED_IN = -174, /* Feature not compiled in */
|
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 */
|
NO_PASSWORD = -176, /* no password provided by user */
|
||||||
|
|
||||||
MIN_CODE_E = -200 /* errors -101 - -199 */
|
MIN_CODE_E = -200 /* errors -101 - -199 */
|
||||||
|
@@ -32,7 +32,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* HC-128 stream cipher */
|
/* HC-128 stream cipher */
|
||||||
typedef struct HC128 {
|
typedef struct HC128 {
|
||||||
word32 T[1024]; /* P[i] = T[i]; Q[i] = T[1024 + i ]; */
|
word32 T[1024]; /* P[i] = T[i]; Q[i] = T[1024 + i ]; */
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_HMAC
|
#ifndef NO_HMAC
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_HMAC_H
|
#ifndef CTAO_CRYPT_HMAC_H
|
||||||
@@ -36,7 +37,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
IPAD = 0x36,
|
IPAD = 0x36,
|
||||||
OPAD = 0x5C,
|
OPAD = 0x5C,
|
||||||
|
@@ -19,8 +19,6 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* 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,
|
* Based on public domain LibTomMath 0.38 by Tom St Denis, tomstdenis@iahu.ca,
|
||||||
* http://math.libtomcrypt.com
|
* http://math.libtomcrypt.com
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
#include "ctc_types.h"
|
#include "ctc_types.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@@ -32,7 +32,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* in bytes */
|
/* in bytes */
|
||||||
enum {
|
enum {
|
||||||
RIPEMD = 3, /* hash type unique */
|
RIPEMD = 3, /* hash type unique */
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
/* Place OS specific preprocessor flags, defines, includes here, will be
|
/* Place OS specific preprocessor flags, defines, includes here, will be
|
||||||
included into every file because ctc_types.h includes it */
|
included into every file because ctc_types.h includes it */
|
||||||
|
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_SETTINGS_H
|
#ifndef CTAO_CRYPT_SETTINGS_H
|
||||||
#define CTAO_CRYPT_SETTINGS_H
|
#define CTAO_CRYPT_SETTINGS_H
|
||||||
|
|
||||||
|
@@ -30,7 +30,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* in bytes */
|
/* in bytes */
|
||||||
enum {
|
enum {
|
||||||
SHA = 1, /* hash type unique */
|
SHA = 1, /* hash type unique */
|
||||||
|
@@ -35,7 +35,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* in bytes */
|
/* in bytes */
|
||||||
enum {
|
enum {
|
||||||
SHA256 = 2, /* hash type unique */
|
SHA256 = 2, /* hash type unique */
|
||||||
|
@@ -32,7 +32,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* in bytes */
|
/* in bytes */
|
||||||
enum {
|
enum {
|
||||||
SHA512 = 4, /* hash type unique */
|
SHA512 = 4, /* hash type unique */
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca,
|
* Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca,
|
||||||
* http://math.libtomcrypt.com
|
* http://math.libtomcrypt.com
|
||||||
|
@@ -125,7 +125,7 @@ enum {
|
|||||||
|
|
||||||
/* idea to add global alloc override by Moisés Guimarães */
|
/* idea to add global alloc override by Moisés Guimarães */
|
||||||
/* default to libc stuff */
|
/* 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 */
|
/* XFREE on some embeded systems doesn't like free(0) so test */
|
||||||
#ifdef XMALLOC_USER
|
#ifdef XMALLOC_USER
|
||||||
/* prototypes for user heap override functions */
|
/* prototypes for user heap override functions */
|
||||||
|
@@ -21,9 +21,11 @@
|
|||||||
|
|
||||||
/* Visibility control macros */
|
/* Visibility control macros */
|
||||||
|
|
||||||
|
|
||||||
#ifndef CTAO_CRYPT_VISIBILITY_H
|
#ifndef CTAO_CRYPT_VISIBILITY_H
|
||||||
#define CTAO_CRYPT_VISIBILITY_H
|
#define CTAO_CRYPT_VISIBILITY_H
|
||||||
|
|
||||||
|
|
||||||
/* CYASSL_API is used for the public API symbols.
|
/* CYASSL_API is used for the public API symbols.
|
||||||
It either imports or exports (or does nothing for static builds)
|
It either imports or exports (or does nothing for static builds)
|
||||||
|
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
/* submitted by eof */
|
/* submitted by eof */
|
||||||
|
|
||||||
|
|
||||||
#ifndef CYASSL_LOGGING_H
|
#ifndef CYASSL_LOGGING_H
|
||||||
#define CYASSL_LOGGING_H
|
#define CYASSL_LOGGING_H
|
||||||
|
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
/* submitted by eof */
|
/* submitted by eof */
|
||||||
|
|
||||||
|
|
||||||
#ifndef CYASSL_MEMORY_H
|
#ifndef CYASSL_MEMORY_H
|
||||||
#define CYASSL_MEMORY_H
|
#define CYASSL_MEMORY_H
|
||||||
|
|
||||||
@@ -31,7 +32,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef void *(*CyaSSL_Malloc_cb)(size_t size);
|
typedef void *(*CyaSSL_Malloc_cb)(size_t size);
|
||||||
typedef void (*CyaSSL_Free_cb)(void *ptr);
|
typedef void (*CyaSSL_Free_cb)(void *ptr);
|
||||||
typedef void *(*CyaSSL_Realloc_cb)(void *ptr, size_t size);
|
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);
|
CYASSL_API void* CyaSSL_Realloc(void *ptr, size_t size);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#if !(defined(LTM1) && defined(LTM2) && defined(LTM3))
|
#if !(defined(LTM1) && defined(LTM2) && defined(LTM3))
|
||||||
#if defined(LTM2)
|
#if defined(LTM2)
|
||||||
#define LTM3
|
#define LTM3
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* super class file for PK algos */
|
/* super class file for PK algos */
|
||||||
|
|
||||||
/* default ... include all MPI */
|
/* default ... include all MPI */
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_AES
|
#ifndef NO_AES
|
||||||
|
|
||||||
#include "ctc_aes.h"
|
#include "ctc_aes.h"
|
||||||
@@ -1295,7 +1296,7 @@ void AesCbcDecrypt(Aes* aes, byte* out, const byte* in, word32 sz)
|
|||||||
printf("sz = %d\n", sz);
|
printf("sz = %d\n", sz);
|
||||||
#endif
|
#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);
|
XMEMCPY(aes->tmp, in + sz - AES_BLOCK_SIZE, AES_BLOCK_SIZE);
|
||||||
AES_CBC_decrypt(in, out, (byte*)aes->reg, sz, (byte*)aes->key,
|
AES_CBC_decrypt(in, out, (byte*)aes->reg, sz, (byte*)aes->key,
|
||||||
aes->rounds);
|
aes->rounds);
|
||||||
|
@@ -23,7 +23,6 @@
|
|||||||
#include "ctc_arc4.h"
|
#include "ctc_arc4.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Arc4SetKey(Arc4* arc4, const byte* key, word32 length)
|
void Arc4SetKey(Arc4* arc4, const byte* key, word32 length)
|
||||||
{
|
{
|
||||||
word32 i;
|
word32 i;
|
||||||
|
@@ -169,7 +169,6 @@ struct tm* gmtime(const time_t* timer)
|
|||||||
#endif /* _WIN32_WCE */
|
#endif /* _WIN32_WCE */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef THREADX
|
#ifdef THREADX
|
||||||
|
|
||||||
#define YEAR0 1900
|
#define YEAR0 1900
|
||||||
@@ -2634,7 +2633,7 @@ static int SetValidity(byte* output, int daysValid)
|
|||||||
/* ASN Encoded Name field */
|
/* ASN Encoded Name field */
|
||||||
typedef struct EncodedName {
|
typedef struct EncodedName {
|
||||||
int nameLen; /* actual string value length */
|
int nameLen; /* actual string value length */
|
||||||
int totalLen; /* total encodeding length */
|
int totalLen; /* total encoded length */
|
||||||
int type; /* type of name */
|
int type; /* type of name */
|
||||||
int used; /* are we actually using this one */
|
int used; /* are we actually using this one */
|
||||||
byte encoded[CTC_NAME_SIZE * 2]; /* encoding */
|
byte encoded[CTC_NAME_SIZE * 2]; /* encoding */
|
||||||
@@ -3125,7 +3124,7 @@ int SetIssuer(Cert* cert, const char* issuerCertFile)
|
|||||||
|
|
||||||
#ifdef HAVE_ECC
|
#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)
|
int StoreECC_DSA_Sig(byte* out, word32* outLen, mp_int* r, mp_int* s)
|
||||||
{
|
{
|
||||||
word32 idx = 0;
|
word32 idx = 0;
|
||||||
|
@@ -19,13 +19,13 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* 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,
|
* Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca,
|
||||||
* http://math.libtomcrypt.com
|
* http://math.libtomcrypt.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* fp_montgomery_reduce.c asm or generic */
|
/* fp_montgomery_reduce.c asm or generic */
|
||||||
#if defined(TFM_X86) && !defined(TFM_SSE2)
|
#if defined(TFM_X86) && !defined(TFM_SSE2)
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* submitted by eof */
|
/* submitted by eof */
|
||||||
|
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_DH
|
#ifndef NO_DH
|
||||||
|
|
||||||
#include "ctc_dh.h"
|
#include "ctc_dh.h"
|
||||||
@@ -33,7 +34,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
|
|
||||||
static INLINE word32 min(word32 a, word32 b)
|
static INLINE word32 min(word32 a, word32 b)
|
||||||
@@ -44,7 +44,6 @@
|
|||||||
#endif /* min */
|
#endif /* min */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void InitDhKey(DhKey* key)
|
void InitDhKey(DhKey* key)
|
||||||
{
|
{
|
||||||
(void)key;
|
(void)key;
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_DSA
|
#ifndef NO_DSA
|
||||||
|
|
||||||
#include "ctc_dsa.h"
|
#include "ctc_dsa.h"
|
||||||
@@ -29,7 +30,7 @@
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
DSA_HALF_SIZE = 20, /* r and s size */
|
DSA_HALF_SIZE = 20, /* r and s size */
|
||||||
DSA_SIG_SIZE = 40 /* signaure size */
|
DSA_SIG_SIZE = 40 /* signature size */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SMALL_MONT_SET
|
#ifdef TFM_SMALL_MONT_SET
|
||||||
/* computes x/R == x (mod N) via Montgomery Reduction */
|
/* computes x/R == x (mod N) via Montgomery Reduction */
|
||||||
void fp_montgomery_reduce_small(fp_int *a, fp_int *m, fp_digit mp)
|
void fp_montgomery_reduce_small(fp_int *a, fp_int *m, fp_digit mp)
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL12
|
#ifdef TFM_MUL12
|
||||||
void fp_mul_comba12(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba12(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL17
|
#ifdef TFM_MUL17
|
||||||
void fp_mul_comba17(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba17(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL24
|
#ifdef TFM_MUL24
|
||||||
void fp_mul_comba24(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba24(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL28
|
#ifdef TFM_MUL28
|
||||||
void fp_mul_comba28(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba28(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL3
|
#ifdef TFM_MUL3
|
||||||
void fp_mul_comba3(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba3(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL32
|
#ifdef TFM_MUL32
|
||||||
void fp_mul_comba32(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba32(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL4
|
#ifdef TFM_MUL4
|
||||||
void fp_mul_comba4(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba4(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL48
|
#ifdef TFM_MUL48
|
||||||
void fp_mul_comba48(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba48(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL6
|
#ifdef TFM_MUL6
|
||||||
void fp_mul_comba6(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba6(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL64
|
#ifdef TFM_MUL64
|
||||||
void fp_mul_comba64(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba64(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL7
|
#ifdef TFM_MUL7
|
||||||
void fp_mul_comba7(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba7(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL8
|
#ifdef TFM_MUL8
|
||||||
void fp_mul_comba8(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba8(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_MUL9
|
#ifdef TFM_MUL9
|
||||||
void fp_mul_comba9(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba9(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#if defined(TFM_SMALL_SET)
|
#if defined(TFM_SMALL_SET)
|
||||||
void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
|
void fp_mul_comba_small(fp_int *A, fp_int *B, fp_int *C)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR12
|
#ifdef TFM_SQR12
|
||||||
void fp_sqr_comba12(fp_int *A, fp_int *B)
|
void fp_sqr_comba12(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR17
|
#ifdef TFM_SQR17
|
||||||
void fp_sqr_comba17(fp_int *A, fp_int *B)
|
void fp_sqr_comba17(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR20
|
#ifdef TFM_SQR20
|
||||||
void fp_sqr_comba20(fp_int *A, fp_int *B)
|
void fp_sqr_comba20(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR24
|
#ifdef TFM_SQR24
|
||||||
void fp_sqr_comba24(fp_int *A, fp_int *B)
|
void fp_sqr_comba24(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR28
|
#ifdef TFM_SQR28
|
||||||
void fp_sqr_comba28(fp_int *A, fp_int *B)
|
void fp_sqr_comba28(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR3
|
#ifdef TFM_SQR3
|
||||||
void fp_sqr_comba3(fp_int *A, fp_int *B)
|
void fp_sqr_comba3(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR32
|
#ifdef TFM_SQR32
|
||||||
void fp_sqr_comba32(fp_int *A, fp_int *B)
|
void fp_sqr_comba32(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR4
|
#ifdef TFM_SQR4
|
||||||
void fp_sqr_comba4(fp_int *A, fp_int *B)
|
void fp_sqr_comba4(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR48
|
#ifdef TFM_SQR48
|
||||||
void fp_sqr_comba48(fp_int *A, fp_int *B)
|
void fp_sqr_comba48(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR6
|
#ifdef TFM_SQR6
|
||||||
void fp_sqr_comba6(fp_int *A, fp_int *B)
|
void fp_sqr_comba6(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR64
|
#ifdef TFM_SQR64
|
||||||
void fp_sqr_comba64(fp_int *A, fp_int *B)
|
void fp_sqr_comba64(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR7
|
#ifdef TFM_SQR7
|
||||||
void fp_sqr_comba7(fp_int *A, fp_int *B)
|
void fp_sqr_comba7(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR8
|
#ifdef TFM_SQR8
|
||||||
void fp_sqr_comba8(fp_int *A, fp_int *B)
|
void fp_sqr_comba8(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef TFM_SQR9
|
#ifdef TFM_SQR9
|
||||||
void fp_sqr_comba9(fp_int *A, fp_int *B)
|
void fp_sqr_comba9(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#if defined(TFM_SMALL_SET)
|
#if defined(TFM_SMALL_SET)
|
||||||
void fp_sqr_comba_small(fp_int *A, fp_int *B)
|
void fp_sqr_comba_small(fp_int *A, fp_int *B)
|
||||||
{
|
{
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#include "ctc_error.h"
|
#include "ctc_error.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int InitHmac(Hmac* hmac, int type)
|
static int InitHmac(Hmac* hmac, int type)
|
||||||
{
|
{
|
||||||
hmac->innerHashKeyed = 0;
|
hmac->innerHashKeyed = 0;
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* 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,
|
* Based on public domain LibTomMath 0.38 by Tom St Denis, tomstdenis@iahu.ca,
|
||||||
* http://math.libtomcrypt.com
|
* http://math.libtomcrypt.com
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* submitted by eof */
|
/* submitted by eof */
|
||||||
|
|
||||||
#include "ctc_settings.h"
|
#include "ctc_settings.h"
|
||||||
|
@@ -30,7 +30,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
|
|
||||||
static INLINE word32 min(word32 a, word32 b)
|
static INLINE word32 min(word32 a, word32 b)
|
||||||
|
@@ -28,7 +28,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
|
|
||||||
static INLINE word32 min(word32 a, word32 b)
|
static INLINE word32 min(word32 a, word32 b)
|
||||||
|
@@ -36,7 +36,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
|
|
||||||
static INLINE word32 min(word32 a, word32 b)
|
static INLINE word32 min(word32 a, word32 b)
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "ctc_rsa.h"
|
#include "ctc_rsa.h"
|
||||||
#include "ctc_random.h"
|
#include "ctc_random.h"
|
||||||
#include "ctc_error.h"
|
#include "ctc_error.h"
|
||||||
@@ -237,7 +236,6 @@ done:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int RsaPublicEncrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
|
int RsaPublicEncrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
|
||||||
RsaKey* key, RNG* rng)
|
RsaKey* key, RNG* rng)
|
||||||
{
|
{
|
||||||
@@ -272,6 +270,7 @@ int RsaPrivateDecryptInline(byte* in, word32 inLen, byte** out, RsaKey* key)
|
|||||||
return plainLen;
|
return plainLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
|
int RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
|
||||||
RsaKey* key)
|
RsaKey* key)
|
||||||
{
|
{
|
||||||
@@ -317,6 +316,7 @@ int RsaSSL_VerifyInline(byte* in, word32 inLen, byte** out, RsaKey* key)
|
|||||||
return plainLen;
|
return plainLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int RsaSSL_Verify(const byte* in, word32 inLen, byte* out, word32 outLen,
|
int RsaSSL_Verify(const byte* in, word32 inLen, byte* out, word32 outLen,
|
||||||
RsaKey* key)
|
RsaKey* key)
|
||||||
{
|
{
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* 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
|
#ifndef NO_SHA256
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* 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,
|
* Based on public domain TomsFastMath 0.10 by Tom St Denis, tomstdenis@iahu.ca,
|
||||||
* http://math.libtomcrypt.com
|
* http://math.libtomcrypt.com
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ssl.h"
|
#include "ssl.h"
|
||||||
#include "cyassl_test.h"
|
#include "cyassl_test.h"
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ssl.h"
|
#include "ssl.h"
|
||||||
#include "cyassl_test.h"
|
#include "cyassl_test.h"
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ssl.h"
|
#include "ssl.h"
|
||||||
#include "cyassl_test.h"
|
#include "cyassl_test.h"
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ssl.h"
|
#include "ssl.h"
|
||||||
#include "cyassl_test.h"
|
#include "cyassl_test.h"
|
||||||
|
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CYASSL_ERROR_H
|
#ifndef CYASSL_ERROR_H
|
||||||
#define CYASSL_ERROR_H
|
#define CYASSL_ERROR_H
|
||||||
|
|
||||||
@@ -44,13 +43,13 @@ enum CyaSSL_ErrorCodes {
|
|||||||
complete task */
|
complete task */
|
||||||
UNKNOWN_RECORD_TYPE = -211, /* unknown type in record hdr */
|
UNKNOWN_RECORD_TYPE = -211, /* unknown type in record hdr */
|
||||||
DECRYPT_ERROR = -212, /* error during decryption */
|
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 */
|
ENCRYPT_ERROR = -214, /* error during encryption */
|
||||||
FREAD_ERROR = -215, /* fread problem */
|
FREAD_ERROR = -215, /* fread problem */
|
||||||
NO_PEER_KEY = -216, /* need peer's key */
|
NO_PEER_KEY = -216, /* need peer's key */
|
||||||
NO_PRIVATE_KEY = -217, /* need the private key */
|
NO_PRIVATE_KEY = -217, /* need the private key */
|
||||||
RSA_PRIVATE_ERROR = -218, /* error during rsa priv op */
|
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 */
|
BUILD_MSG_ERROR = -220, /* build message failure */
|
||||||
|
|
||||||
BAD_HELLO = -221, /* client hello malformed */
|
BAD_HELLO = -221, /* client hello malformed */
|
||||||
@@ -75,7 +74,7 @@ enum CyaSSL_ErrorCodes {
|
|||||||
SIGACT_ERROR = -239, /* sigaction failed ??? */
|
SIGACT_ERROR = -239, /* sigaction failed ??? */
|
||||||
SETITIMER_ERROR = -240, /* setitimer failed ??? */
|
SETITIMER_ERROR = -240, /* setitimer failed ??? */
|
||||||
LENGTH_ERROR = -241, /* record layer length error */
|
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 */
|
ZERO_RETURN = -243, /* peer sent close notify */
|
||||||
SIDE_ERROR = -244, /* wrong client/server type */
|
SIDE_ERROR = -244, /* wrong client/server type */
|
||||||
NO_PEER_CERT = -245, /* peer didn't send key */
|
NO_PEER_CERT = -245, /* peer didn't send key */
|
||||||
@@ -95,7 +94,7 @@ enum CyaSSL_ErrorCodes {
|
|||||||
/* begin negotiation parameter errors */
|
/* begin negotiation parameter errors */
|
||||||
UNSUPPORTED_SUITE = -260, /* unsupported cipher suite */
|
UNSUPPORTED_SUITE = -260, /* unsupported cipher suite */
|
||||||
MATCH_SUITE_ERROR = -261 /* can't match 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 !!!!! */
|
/* add strings to SetErrorString !!!!! */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CYASSL_INT_H
|
#ifndef CYASSL_INT_H
|
||||||
#define 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 {
|
enum AcceptState {
|
||||||
ACCEPT_BEGIN = 0,
|
ACCEPT_BEGIN = 0,
|
||||||
ACCEPT_CLIENT_HELLO_DONE,
|
ACCEPT_CLIENT_HELLO_DONE,
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CYASSL_CALLBACKS_H
|
#ifndef CYASSL_CALLBACKS_H
|
||||||
#define CYASSL_CALLBACKS_H
|
#define CYASSL_CALLBACKS_H
|
||||||
|
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CYASSL_DES_H_
|
#ifndef CYASSL_DES_H_
|
||||||
#define CYASSL_DES_H_
|
#define CYASSL_DES_H_
|
||||||
|
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CYASSL_EVP_H_
|
#ifndef CYASSL_EVP_H_
|
||||||
#define CYASSL_EVP_H_
|
#define CYASSL_EVP_H_
|
||||||
|
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CYASSL_HMAC_H_
|
#ifndef CYASSL_HMAC_H_
|
||||||
#define CYASSL_HMAC_H_
|
#define CYASSL_HMAC_H_
|
||||||
|
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CYASSL_OPENSSL_H_
|
#ifndef CYASSL_OPENSSL_H_
|
||||||
#define CYASSL_OPENSSL_H_
|
#define CYASSL_OPENSSL_H_
|
||||||
|
|
||||||
@@ -53,7 +52,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct SSL SSL;
|
typedef struct SSL SSL;
|
||||||
typedef struct SSL_SESSION SSL_SESSION;
|
typedef struct SSL_SESSION SSL_SESSION;
|
||||||
typedef struct SSL_METHOD SSL_METHOD;
|
typedef struct SSL_METHOD SSL_METHOD;
|
||||||
@@ -68,8 +66,6 @@ typedef struct X509_CHAIN X509_CHAIN;
|
|||||||
#define SSL_TYPES_DEFINED
|
#define SSL_TYPES_DEFINED
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct EVP_PKEY EVP_PKEY;
|
typedef struct EVP_PKEY EVP_PKEY;
|
||||||
typedef struct RSA RSA;
|
typedef struct RSA RSA;
|
||||||
typedef struct BIO BIO;
|
typedef struct BIO BIO;
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CYASSL_SNIFFER_H
|
#ifndef CYASSL_SNIFFER_H
|
||||||
#define CYASSL_SNIFFER_H
|
#define CYASSL_SNIFFER_H
|
||||||
|
|
||||||
@@ -42,7 +41,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CYASSL_API
|
CYASSL_API
|
||||||
SSL_SNIFFER_API int ssl_SetPrivateKey(const char* address, int port,
|
SSL_SNIFFER_API int ssl_SetPrivateKey(const char* address, int port,
|
||||||
const char* keyFile, int keyType,
|
const char* keyFile, int keyType,
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CYASSL_SNIFFER_ERROR_H
|
#ifndef CYASSL_SNIFFER_ERROR_H
|
||||||
#define CYASSL_SNIFFER_ERROR_H
|
#define CYASSL_SNIFFER_ERROR_H
|
||||||
|
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "cyassl_int.h"
|
#include "cyassl_int.h"
|
||||||
#include "cyassl_error.h"
|
#include "cyassl_error.h"
|
||||||
#include "ctc_asn.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);
|
static void BuildCertHashes(SSL* ssl, Hashes* hashes);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef min
|
#ifndef min
|
||||||
|
|
||||||
static INLINE word32 min(word32 a, word32 b)
|
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)
|
static INLINE int CheckAvalaibleSize(SSL *ssl, int size)
|
||||||
{
|
{
|
||||||
if ((word32)size > ssl->buffers.outputBuffer.bufferSize)
|
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);
|
HashInput(ssl, input + *inOutIdx, size);
|
||||||
#ifdef CYASSL_CALLBACKS
|
#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) {
|
if (ssl->toInfoOn) {
|
||||||
int add = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
|
int add = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
|
||||||
AddPacketInfo(0, &ssl->timeoutInfo, input + *inOutIdx - add,
|
AddPacketInfo(0, &ssl->timeoutInfo, input + *inOutIdx - add,
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "cyassl_int.h"
|
#include "cyassl_int.h"
|
||||||
#include "cyassl_error.h"
|
#include "cyassl_error.h"
|
||||||
#ifdef SHOW_SECRETS
|
#ifdef SHOW_SECRETS
|
||||||
@@ -28,8 +27,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int SetCipherSpecs(SSL* ssl)
|
int SetCipherSpecs(SSL* ssl)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_ECC
|
#ifdef HAVE_ECC
|
||||||
@@ -807,6 +804,3 @@ int MakeMasterSecret(SSL* ssl)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef CYASSL_SNIFFER
|
#ifdef CYASSL_SNIFFER
|
||||||
|
|
||||||
#include "ssl.h"
|
#include "ssl.h"
|
||||||
@@ -102,7 +103,7 @@ static int TraceOn = 0; /* Trace is off by default */
|
|||||||
static FILE* TraceFile = 0;
|
static FILE* TraceFile = 0;
|
||||||
|
|
||||||
|
|
||||||
/* windows uses .rc talbe for this */
|
/* windows uses .rc table for this */
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
|
||||||
static const char* const msgTable[] =
|
static const char* const msgTable[] =
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define CYASSL_SNIFFER
|
#define CYASSL_SNIFFER
|
||||||
#endif
|
#endif
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#define HAVE_CONFIG_H
|
#define HAVE_CONFIG_H
|
||||||
#endif
|
#endif
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ssl.h"
|
#include "ssl.h"
|
||||||
#include "cyassl_test.h"
|
#include "cyassl_test.h"
|
||||||
#include "ctc_md5.h"
|
#include "ctc_md5.h"
|
||||||
|
Reference in New Issue
Block a user