Commit e11033e5 authored by David McGrew's avatar David McGrew

rationalizing header files

parent 89fb7ea3
......@@ -196,7 +196,7 @@ clean:
superclean: clean
rm -rf include/config.h config.log config.cache config.status \
rm -rf crypto/include/config.h config.log config.cache config.status \
Makefile .gdb_history test/.gdb_history .DS_Store
rm -rf autom4te.cache
......
/* crypto/include/config.h. Generated by configure. */
/*
* config_in.h
*
* template for header config file for Secure RTP and libcryptomodule
*
* David A. McGrew
* Cisco Systems, Inc.
*/
#ifndef CONFIG_H
#define CONFIG_H
/* if we're on a big endian machine, we need to define this */
#define WORDS_BIGENDIAN 0
/* if we're on an intel x86, define this to use inlined asm */
#define HAVE_X86 1
/* check for <stdint.h> or <machine/types.h> */
#define HAVE_STDINT_H 1
#define HAVE_MACHINE_TYPES_H 0
#define HAVE_SYS_INT_TYPES_H 0
/* check if an unsigned 64-bit integer is supported natively */
#define HAVE_U_LONG_LONG 1
/* check for microsoft integer definitions (e.g., cygwin) */
#define HAVE_MS_TYPES 1
/* if we don't have uio.h, we'll need to define struct iovec */
#define HAVE_SYS_UIO_H 1
/* <unistd.h> is used by some test/ apps */
#define HAVE_UNISTD_H 1
/* test apps should use inet_aton(), if it's available */
#define HAVE_INET_ATON 1
/* check if we have syslog functions */
#define HAVE_SYSLOG_H 1
/* check to see if the user has requested the use of syslog */
#define USE_SYSLOG 0
#define ERR_REPORTING_STDOUT 1
#define ERR_REPORTING_SYSLOG (HAVE_SYSLOG_H & USE_SYSLOG)
/* define ERR_REPORTING_FILE to have messages sent to file */
#define ERR_REPORTING_FILE
/*
* set ENABLE_DEBUGGING to 1 to compile in dynamic debugging system,
* set it to 0 to not compile in dynamic debugging (for a slight
* performance improvement)
*/
#define ENABLE_DEBUGGING 1
/* if we're going to use GDOI, define SRTP_GDOI to 1 */
#define SRTP_GDOI 0
/*
* CPU_type is defined as 1 if the host processor is of that type.
* Note that more than one type can be defined at once; this is so
* that special instructions and other optimizations can be handled
* independently.
*
* CPU_RISC RISC machines (assume slow byte access)
* CPU_CISC CISC machines (e.g. Intel)
* CPU_ALTIVEC Motorola's SIMD instruction set
*
*/
#define CPU_RISC 0
#define CPU_CISC 1
#define CPU_ALTIVEC 0
/*
* if /dev/urandom is available, then DEV_URANDOM == 1
*
* /dev/urandom is a (true) random number generator which is
* implemented in many modern operating systems
*/
#define DEV_URANDOM 1
/* check for stdlib.h - we use it for alloc() and free() */
#define HAVE_STDLIB_H 1
/* whether to use ismacryp code */
#define GENERIC_AESICM 1
#endif /* CONFIG_H */
......@@ -177,9 +177,9 @@ typedef struct {
/* use err_report() to report debug message */
#define debug_print(mod, format, arg) \
if (mod.on) err_report(err_level_debug, ("%s: " format), mod.name, arg)
if (mod.on) err_report(err_level_debug, ("%s: \n" format), mod.name, arg)
#define debug_print2(mod, format, arg1,arg2) \
if (mod.on) err_report(err_level_debug, ("%s: " format), mod.name, arg1,arg2)
if (mod.on) err_report(err_level_debug, ("%s: \n" format), mod.name, arg1,arg2)
#else
......
/*
* rdbx.h
*
* replay database with extended packet indices, using a rollover counter
*
* David A. McGrew
* Cisco Systems, Inc.
*
*/
#ifndef RDBX_H
#define RDBX_H
#include "datatypes.h"
#include "err.h"
/* #define ROC_TEST */
#ifndef ROC_TEST
typedef uint16_t sequence_number_t; /* 16 bit sequence number */
typedef uint32_t rollover_counter_t; /* 32 bit rollover counter */
#else /* use small seq_num and roc datatypes for testing purposes */
typedef unsigned char sequence_number_t; /* 8 bit sequence number */
typedef uint16_t rollover_counter_t; /* 16 bit rollover counter */
#endif
#define seq_num_median (1 << (8*sizeof(sequence_number_t) - 1))
#define seq_num_max (1 << (8*sizeof(sequence_number_t)))
/*
* An xtd_seq_num_t is a 64-bit unsigned integer used as an 'extended'
* sequence number.
*/
typedef uint64_t xtd_seq_num_t;
/*
* An rdbx_t is a replay database with extended range; it uses an
* xtd_seq_num_t and a bitmask of recently received indices.
*/
typedef struct {
xtd_seq_num_t index;
v128_t bitmask;
} rdbx_t;
/*
* rdbx_init(rdbx_ptr)
*
* initializes the rdbx pointed to by its argument, setting the
* rollover counter and sequence number to zero
*/
err_status_t
rdbx_init(rdbx_t *rdbx);
/*
* rdbx_estimate_index(rdbx, guess, s)
*
* given an rdbx and a sequence number s (from a newly arrived packet),
* sets the contents of *guess to contain the best guess of the packet
* index to which s corresponds, and returns the difference between
* *guess and the locally stored synch info
*/
inline int
rdbx_estimate_index(const rdbx_t *rdbx,
xtd_seq_num_t *guess,
sequence_number_t s);
/*
* rdbx_check(rdbx, delta);
*
* rdbx_check(&r, delta) checks to see if the xtd_seq_num_t
* which is at rdbx->window_start + delta is in the rdb
*
*/
inline err_status_t
rdbx_check(const rdbx_t *rdbx, int difference);
/*
* replay_add_index(rdbx, delta)
*
* adds the xtd_seq_num_t at rdbx->window_start + delta to replay_db
* (and does *not* check if that xtd_seq_num_t appears in db)
*
* this function should be called *only* after replay_check has
* indicated that the index does not appear in the rdbx, and a mutex
* should protect the rdbx between these calls if necessary.
*/
inline err_status_t
rdbx_add_index(rdbx_t *rdbx, int delta);
/*
* xtd_seq_num_t functions - these are *internal* functions of rdbx, and
* shouldn't be used to manipulate rdbx internal values. use the rdbx
* api instead!
*/
/* index_init(&pi) initializes a packet index pi (sets it to zero) */
void
index_init(xtd_seq_num_t *pi);
/* index_advance(&pi, s) advances a xtd_seq_num_t forward by s */
void
index_advance(xtd_seq_num_t *pi, sequence_number_t s);
/*
* index_guess(local, guess, s)
*
* given a xtd_seq_num_t local (which represents the highest
* known-to-be-good index) and a sequence number s (from a newly
* arrived packet), sets the contents of *guess to contain the best
* guess of the packet index to which s corresponds, and returns the
* difference between *guess and *local
*/
int
index_guess(const xtd_seq_num_t *local,
xtd_seq_num_t *guess,
sequence_number_t s);
#endif /* RDBX_H */
/*
* stats.h
*
* interface to statistical test functions
*
* David A. McGrew
* Cisco Systems, Inc.
*/
/*
*
* Copyright(c) 2001-2005, Cisco Systems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef STAT_H
#define STAT_H
#include "datatypes.h" /* for octet_t */
#include "err.h" /* for err_status_t */
#include "rand_source.h" /* for rand_source_func_t definition */
err_status_t
stat_test_monobit(octet_t *data);
err_status_t
stat_test_poker(octet_t *data);
err_status_t
stat_test_runs(octet_t *data);
err_status_t
stat_test_rand_source(rand_source_func_t rs);
#endif /* STAT_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment