From fcc1f6571c7d61b839e3d092b29940bf739c4f4c Mon Sep 17 00:00:00 2001 From: jbj Date: Wed, 19 Sep 2001 21:30:01 +0000 Subject: [PATCH] Wire in doxygen doco. CVS patchset: 5064 CVS date: 2001/09/19 21:30:01 --- beecrypt/.cvsignore | 3 + beecrypt/Doxyfile.in | 902 ++++++++++++++++++++++++++++++++++++++++++++++++++ beecrypt/Makefile.am | 7 + beecrypt/Makefile.in | 13 +- beecrypt/beecrypt.h | 658 ++++++++++++++++++++---------------- beecrypt/configure | 4 +- beecrypt/configure.in | 784 +++++++++++++++++++++++++++++++++++++------ beecrypt/mp32prime.c | 2 +- 8 files changed, 1977 insertions(+), 396 deletions(-) create mode 100644 beecrypt/Doxyfile.in diff --git a/beecrypt/.cvsignore b/beecrypt/.cvsignore index 10ba484..3da5856 100644 --- a/beecrypt/.cvsignore +++ b/beecrypt/.cvsignore @@ -2,8 +2,10 @@ .depend .depend-done .libs +Doxyfile Makefile Makefile.in +apidocs config.cache config.guess config.gnu.h @@ -11,6 +13,7 @@ config.log config.status config.sub configure +doxygen libtool ltconfig ltmain.sh diff --git a/beecrypt/Doxyfile.in b/beecrypt/Doxyfile.in new file mode 100644 index 0000000..352729a --- /dev/null +++ b/beecrypt/Doxyfile.in @@ -0,0 +1,902 @@ +# Doxyfile 1.2.10 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = @PACKAGE@ + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @VERSION@ + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = apidocs + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Chinese, Croatian, Czech, Danish, Dutch, Finnish, French, +# German, Hungarian, Italian, Japanese, Korean, Norwegian, Polish, +# Portuguese, Romanian, Russian, Slovak, Slovene, Spanish and Swedish. + +OUTPUT_LANGUAGE = English + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these class will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. It is allowed to use relative paths in the argument list. + +STRIP_FROM_PATH = @top_srcdir@/ + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = YES + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a class diagram (in Html and LaTeX) for classes with base or +# super classes. Setting the tag to NO turns the diagrams off. + +CLASS_DIAGRAMS = YES + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower case letters. If set to YES upper case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# users are adviced to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explict @brief command for a brief description. + +JAVADOC_AUTOBRIEF = YES + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# reimplements. + +INHERIT_DOCS = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consist of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. +# For instance some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. + +WARN_FORMAT = + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = \ + @top_srcdir@/acconfig.h \ + @top_srcdir@/base64.c \ + @top_srcdir@/base64.h \ + @top_srcdir@/beecrypt.c \ + @top_srcdir@/beecrypt.h \ + @top_srcdir@/blockmode.c \ + @top_srcdir@/blockmode.h \ + @top_srcdir@/blockpad.c \ + @top_srcdir@/blockpad.h \ + @top_srcdir@/blowfish.c \ + @top_srcdir@/blowfish.h \ + @top_srcdir@/blowfishopt.h \ + @top_srcdir@/config.gas.h \ + @top_srcdir@/config.h \ + @top_srcdir@/config.win.h \ + @top_srcdir@/dhaes.c \ + @top_srcdir@/dhaes.h \ + @top_srcdir@/dldp.c \ + @top_srcdir@/dldp.h \ + @top_srcdir@/dlkp.c \ + @top_srcdir@/dlkp.h \ + @top_srcdir@/dlpk.c \ + @top_srcdir@/dlpk.h \ + @top_srcdir@/dlsvdp-dh.c \ + @top_srcdir@/dlsvdp-dh.h \ + @top_srcdir@/elgamal.c \ + @top_srcdir@/elgamal.h \ + @top_srcdir@/endianness.c \ + @top_srcdir@/endianness.h \ + @top_srcdir@/entropy.c \ + @top_srcdir@/entropy.h \ + @top_srcdir@/fips180.c \ + @top_srcdir@/fips180.h \ + @top_srcdir@/fips180opt.h \ + @top_srcdir@/fips186.c \ + @top_srcdir@/fips186.h \ + @top_srcdir@/hmac.c \ + @top_srcdir@/hmac.h \ + @top_srcdir@/hmacmd5.c \ + @top_srcdir@/hmacmd5.h \ + @top_srcdir@/hmacsha1.c \ + @top_srcdir@/hmacsha1.h \ + @top_srcdir@/hmacsha256.c \ + @top_srcdir@/hmacsha256.h \ + @top_srcdir@/javaglue.c \ + @top_srcdir@/javaglue.h \ + @top_srcdir@/md5.c \ + @top_srcdir@/md5.h \ + @top_srcdir@/memchunk.c \ + @top_srcdir@/memchunk.h \ + @top_srcdir@/mp32barrett.c \ + @top_srcdir@/mp32barrett.h \ + @top_srcdir@/mp32.c \ + @top_srcdir@/mp32.h \ + @top_srcdir@/mp32number.c \ + @top_srcdir@/mp32number.h \ + @top_srcdir@/mp32opt.h \ + @top_srcdir@/mp32prime.c \ + @top_srcdir@/mp32prime.h \ + @top_srcdir@/mtprng.c \ + @top_srcdir@/mtprng.h \ + @top_srcdir@/rsa.c \ + @top_srcdir@/rsa.h \ + @top_srcdir@/rsakp.c \ + @top_srcdir@/rsakp.h \ + @top_srcdir@/rsapk.c \ + @top_srcdir@/rsapk.h \ + @top_srcdir@/sha256.c \ + @top_srcdir@/sha256.h \ + @top_srcdir@/timestamp.c \ + @top_srcdir@/timestamp.h + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +FILE_PATTERNS = *.c *.h + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. + +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = @top_srcdir@/doc + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. + +INPUT_FILTER = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse. + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the Html help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript and frames is required (for instance Netscape 4.0+ +# or Internet explorer 4.0+). + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimised for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assigments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = YES + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_XML = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_PREDEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES tag can be used to specify one or more tagfiles. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found on the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_HEIGHT = 1024 + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermedate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO + +# The CGI_NAME tag should be the name of the CGI script that +# starts the search engine (doxysearch) with the correct parameters. +# A script with this name will be generated by doxygen. + +CGI_NAME = + +# The CGI_URL tag should be the absolute URL to the directory where the +# cgi binaries are located. See the documentation of your http daemon for +# details. + +CGI_URL = + +# The DOC_URL tag should be the absolute URL to the directory where the +# documentation is located. If left blank the absolute path to the +# documentation, with file:// prepended to it, will be used. + +DOC_URL = + +# The DOC_ABSPATH tag should be the absolute path to the directory where the +# documentation is located. If left blank the directory on the local machine +# will be used. + +DOC_ABSPATH = + +# The BIN_ABSPATH tag must point to the directory where the doxysearch binary +# is installed. + +BIN_ABSPATH = /usr/bin + +# The EXT_DOC_PATHS tag can be used to specify one or more paths to +# documentation generated for other projects. This allows doxysearch to search +# the documentation for these projects as well. + +EXT_DOC_PATHS = diff --git a/beecrypt/Makefile.am b/beecrypt/Makefile.am index 89a62a0..caa113b 100644 --- a/beecrypt/Makefile.am +++ b/beecrypt/Makefile.am @@ -60,3 +60,10 @@ lclintfiles = base64.c blockmode.c blockpad.c blowfish.c dhaes.c dldp.c dlkp.c d .PHONY: lclint lclint: lclint $(DEFS) $(INCLUDES) ${lclintfiles} + +DOXYGEN = /usr/bin/doxygen +.PHONY: doxygen +doxygen apidocs: Doxyfile + rm -rf $@ + mkdir -p $@ + - [ -x ${DOXYGEN} ] && ${DOXYGEN} diff --git a/beecrypt/Makefile.in b/beecrypt/Makefile.in index 501b4e1..8aec19b 100644 --- a/beecrypt/Makefile.in +++ b/beecrypt/Makefile.in @@ -141,10 +141,12 @@ EXTRA_DIST = BENCHMARKS BUGS CONTRIBUTORS README.DLL README.WIN32 beecrypt.def b # beecrypt.c entropy.c javaglue.c mtprng.c lclintfiles = base64.c blockmode.c blockpad.c blowfish.c dhaes.c dldp.c dlkp.c dlpk.c dlsvdp-dh.c elgamal.c endianness.c fips180.c fips186.c hmac.c hmacmd5.c hmacsha1.c hmacsha256.c md5.c memchunk.c mp32.c mp32barrett.c mp32number.c mp32prime.c rsa.c rsakp.c rsapk.c sha256.c timestamp.c + +DOXYGEN = /usr/bin/doxygen ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.gnu.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = Doxyfile LTLIBRARIES = $(lib_LTLIBRARIES) @@ -166,7 +168,7 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ HEADERS = $(pkginclude_HEADERS) DIST_COMMON = README ./stamp-h.in AUTHORS COPYING COPYING.LIB ChangeLog \ -INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 \ +Doxyfile.in INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 \ config.gnu.h.in config.guess config.sub configure configure.in \ install-sh ltconfig ltmain.sh missing mkinstalldirs @@ -223,6 +225,8 @@ distclean-hdr: -rm -f config.gnu.h maintainer-clean-hdr: +Doxyfile: $(top_builddir)/config.status Doxyfile.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-libLTLIBRARIES: @@ -556,6 +560,11 @@ maintainer-clean-generic clean mostlyclean distclean maintainer-clean .PHONY: lclint lclint: lclint $(DEFS) $(INCLUDES) ${lclintfiles} +.PHONY: doxygen +doxygen apidocs: Doxyfile + rm -rf $@ + mkdir -p $@ + - [ -x ${DOXYGEN} ] && ${DOXYGEN} # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/beecrypt/beecrypt.h b/beecrypt/beecrypt.h index 64e8c83..83c74f0 100644 --- a/beecrypt/beecrypt.h +++ b/beecrypt/beecrypt.h @@ -33,24 +33,21 @@ #include "memchunk.h" #include "mp32number.h" -/* - * Entropy Sources +/** + * Return an array of 32-bit unsigned integers of given size with + * entropy data. + * + * @retval data entropy data + * @param size no. of ints of data + * @return 0 on success, -1 on failure */ +typedef int (*entropyNext) (uint32* data, int size); -typedef int (*entropyNext)(uint32*, int); - -/* +/** * The struct 'entropySource' holds information and pointers to code specific * to each entropy source. Each specific entropy source MUST be written to be * multithread-safe. * - * The struct contains the following function(s): - * - * int (*next)(uint32* data, int size); - * - * This function will fill an array of 32-bit unsigned integers of given size - * with entropy. - * Return value is 0 on success, or -1 on failure. */ typedef struct @@ -59,44 +56,55 @@ typedef struct /*@unused@*/ const entropyNext next; } entropySource; -/* - * You can use the following functions to find entropy sources implemented by - * the library: - * - * entropySourceCount returns the number of sources available. - * - * entropySourceGet returns the entropy source with a given index (starting - * at zero, up to entropySourceCount() - 1), or NULL if the index was out of - * bounds. - * - * entropySourceFind returns the entropy source with the given name, or NULL - * if no entropy source exists with that name. - */ - #ifdef __cplusplus extern "C" { #endif +/** + * Return the number of entropy sources available. + * @return number of entropy sources available + */ BEEDLLAPI -int entropySourceCount(void) +int entropySourceCount(void) /*@*/; -BEEDLLAPI -const entropySource* entropySourceGet(int) + +/** + * Retrieve a entropy source by index. + * @param index entropy source index + * @return entropy source pointer (or NULL) + */ +BEEDLLAPI /*@null@*/ +const entropySource* entropySourceGet(int index) /*@*/; -BEEDLLAPI -const entropySource* entropySourceFind(const char*) + +/** + * Retrieve a entropy source by name. + * @param name entropy source name + * @return entropy source pointer (or NULL) + */ +BEEDLLAPI /*@null@*/ +const entropySource* entropySourceFind(const char* name) /*@*/; -BEEDLLAPI -const entropySource* entropySourceDefault(void) + +/** + * Retrieve the default entropy source. + * If the BEECRYPT_ENTROPY environment variable is set, use that + * entropy source. Otherwise, use the 1st entry + * @return entropy source pointer (or NULL) + */ +BEEDLLAPI /*@null@*/ +const entropySource* entropySourceDefault(void) /*@*/; -/* - * The following function can try multiple entropy sources for gathering - * the requested amount. It will only try multiple sources if variable - * BEECRYPT_ENTROPY is not set. +/** + * Gather entropy from multiple sources (if BEECRYPT_ENTROPY is not set). + * + * @retval data entropy data + * @param size no. of ints of data + * @return 0 on success, -1 on failure */ BEEDLLAPI -int entropyGatherNext(uint32*, int) +int entropyGatherNext(uint32* data, int size) /*@*/; #ifdef __cplusplus @@ -109,16 +117,49 @@ int entropyGatherNext(uint32*, int) typedef void randomGeneratorParam; -typedef int (*randomGeneratorSetup )(randomGeneratorParam*) - /*@*/; -typedef int (*randomGeneratorSeed )(randomGeneratorParam*, const uint32*, int) - /*@*/; -typedef int (*randomGeneratorNext )(randomGeneratorParam*, uint32*, int) - /*@*/; -typedef int (*randomGeneratorCleanup)(randomGeneratorParam*) - /*@*/; +/** + * Initialize the parameters for use, and seed the generator + * with entropy from the default entropy source. + * + * @param param generator parameters + * @return 0 on success, -1 on failure + */ +typedef int (*randomGeneratorSetup) (randomGeneratorParam* param) + /*@modifies param @*/; -/* +/** + * Re-seed the random generator with user-provided entropy. + * + * @param param generator parameters + * @param data user entropy + * @param size no. of ints of entropy + * @return 0 on success, -1 on failure + */ +typedef int (*randomGeneratorSeed) (randomGeneratorParam* param, const uint32* data, int size) + /*@modifies param @*/; + +/** + * Return an array of 32-bit unsigned integers of given size with + * pseudo-random data. + * + * @param param generator parameters + * @retval data pseudo-random data + * @param size no. of ints of data + * @return 0 on success, -1 on failure + */ +typedef int (*randomGeneratorNext) (randomGeneratorParam* param, uint32* data, int size) + /*@modifies param, data @*/; + +/** + * Cleanup after using a generator. + * + * @param param generator parameters + * @return 0 on success, -1 on failure + */ +typedef int (*randomGeneratorCleanup) (randomGeneratorParam* param) + /*@modifies param @*/; + +/** * The struct 'randomGenerator' holds information and pointers to code specific * to each random generator. Each specific random generator MUST be written to * be multithread safe. @@ -132,77 +173,63 @@ typedef int (*randomGeneratorCleanup)(randomGeneratorParam*) * of memory which must be at least as large as indicated by the paramsize * field. * - * The struct contains the following function(s): - * - * int (*setup)(randomGeneratorParam* param); - * - * This function will initialize the parameters for use, and seed the generator - * with entropy from the default entropy source. - * Return value is 0 on success, or -1 on failure. - * - * int (*seed)(randomGeneratorParam* param, const uint32* data, int size); - * - * This function reseeds the random generator with user-provided entropy. - * Return value is 0 on success, or -1 on failure. - * - * int (*next)(randomGeneratorParam* param, uint32* data, int size); - * - * This function will fill an array of 32-bit unsigned integers of given size - * with pseudo-random data. - * Return value is 0 on success, or -1 on failure. - * - * int (*cleanup)(randomGeneratorParam* param); - * - * This function will cleanup after the use of a generator - * Return value is 0 on success, or -1 on failure. */ typedef struct { - const char* name; - const unsigned int paramsize; - const randomGeneratorSetup setup; - const randomGeneratorSeed seed; - const randomGeneratorNext next; + const char* name; + const unsigned int paramsize; + const randomGeneratorSetup setup; + const randomGeneratorSeed seed; + const randomGeneratorNext next; const randomGeneratorCleanup cleanup; } randomGenerator; -/* - * You can use the following functions to find random generators implemented by - * the library: - * - * randomGeneratorCount returns the number of generators available. - * - * randomGeneratorGet returns the random generator with a given index (starting - * at zero, up to randomGeneratorCount() - 1), or NULL if the index was out of - * bounds. - * - * randomGeneratorFind returns the random generator with the given name, or - * NULL if no random generator exists with that name. - */ - #ifdef __cplusplus extern "C" { #endif +/** + * Return the number of generators available. + * @return number of generators available + */ BEEDLLAPI -int randomGeneratorCount(void) +int randomGeneratorCount(void) /*@*/; -BEEDLLAPI -const randomGenerator* randomGeneratorGet(int) + +/** + * Retrieve a generator by index. + * @param index generator index + * @return generator pointer (or NULL) + */ +BEEDLLAPI /*@null@*/ +const randomGenerator* randomGeneratorGet(int index) /*@*/; + +/** + * Retrieve a generator by name. + * @param name generator name + * @return generator pointer (or NULL) + */ BEEDLLAPI -const randomGenerator* randomGeneratorFind(const char*) +const randomGenerator* randomGeneratorFind(const char* name) /*@*/; + +/** + * Retrieve the default generator. + * If the BEECRYPT_RANDOM environment variable is set, use that + * generator. Otherwise, use "fips186prng". + * @return generator pointer + */ BEEDLLAPI -const randomGenerator* randomGeneratorDefault(void) +const randomGenerator* randomGeneratorDefault(void) /*@*/; #ifdef __cplusplus } #endif -/* +/** * The struct 'randomGeneratorContext' is used to contain both the functional * part (the randomGenerator), and its parameters. */ @@ -213,7 +240,7 @@ typedef struct randomGeneratorParam* param; } randomGeneratorContext; -/* +/** * The following functions can be used to initialize and free a * randomGeneratorContext. Initializing will allocate a buffer of the size * required by the randomGenerator, freeing will deallocate that buffer. @@ -240,88 +267,106 @@ int randomGeneratorContextFree(randomGeneratorContext*) typedef void hashFunctionParam; -typedef int (*hashFunctionReset )(hashFunctionParam*) - /*@*/; -typedef int (*hashFunctionUpdate)(hashFunctionParam*, const byte*, int) - /*@*/; -typedef int (*hashFunctionDigest)(hashFunctionParam*, uint32*) - /*@*/; - -/* - * The struct 'hashFunction' holds information and pointers to code specific - * to each hash function. Specific hash functions MAY be written to be - * multithread-safe. - * - * The struct contains the following function(s): +/** + * Re-initialize the parameters of the hash function. * - * int (*reset)(hashFunctionParam* param); + * @param param hash parameters + * @return 0 on success, -1 on failure + */ +typedef int (*hashFunctionReset) (hashFunctionParam* param) + /*@modifies param @*/; + +/** + * Update the hash function with an array of bytes. * - * This function will re-initialize the parameters of this hash function. - * Return value is 0 on success, or -1 on failure. + * @param param hash parameters + * @param data array of bytes + * @param size no. of bytes + * @return 0 on success, -1 on failure + */ +typedef int (*hashFunctionUpdate) (hashFunctionParam* param, const byte* data, int size) + /*@modifies param @*/; + +/** + * Compute the digest of all the data passed to the hash function, and return + * the result in data. * - * int (*update)(hashFunctionParam* param, const byte* data, int size); + * @note data must be at least have a bytesize of 'digestsize' as described + * in the hashFunction struct. * - * This function updates the hash function with an array of bytes. - * Return value is 0 on success, or -1 on failure. + * @note For safety reasons, after calling digest, each specific implementation + * MUST reset itself so that previous values in the parameters are erased. * - * int (*digest)(hashFunctionParam* param, uint32* data); + * @param param hash parameters + * @retval data digest + * @return 0 on success, -1 on failure + */ +typedef int (*hashFunctionDigest) (hashFunctionParam* param, uint32* data) + /*@modifies param, data @*/; + +/** + * The struct 'hashFunction' holds information and pointers to code specific + * to each hash function. Specific hash functions MAY be written to be + * multithread-safe. * - * This function computes the digest of all the data passed to the hash - * function, and stores the result in data. - * Return value is 0 on success, or -1 on failure. - * NOTE: data MUST have a size (in bytes) of at least 'digestsize' as described - * in the hashFunction struct. - * NOTE: for safety reasons, after calling digest, each specific implementation - * MUST reset itself so that previous values in the parameters are erased. */ typedef struct { - const char* name; - const unsigned int paramsize; /* in bytes */ - const unsigned int blocksize; /* in bytes */ - const unsigned int digestsize; /* in bytes */ + const char* name; + const unsigned int paramsize; /*!< in bytes */ + const unsigned int blocksize; /*!< in bytes */ + const unsigned int digestsize; /*!< in bytes */ const hashFunctionReset reset; const hashFunctionUpdate update; const hashFunctionDigest digest; } hashFunction; -/* - * You can use the following functions to find hash functions implemented by - * the library: - * - * hashFunctionCount returns the number of hash functions available. - * - * hashFunctionGet returns the hash function with a given index (starting - * at zero, up to hashFunctionCount() - 1), or NULL if the index was out of - * bounds. - * - * hashFunctionFind returns the hash function with the given name, or - * NULL if no hash function exists with that name. - */ - #ifdef __cplusplus extern "C" { #endif +/** + * Return the number of hash functions available. + * @return number of hash functions available + */ BEEDLLAPI -int hashFunctionCount(void) +int hashFunctionCount(void) /*@*/; -BEEDLLAPI -const hashFunction* hashFunctionGet(int) + +/** + * Retrieve a hash function by index. + * @param index hash function index + * @return hash function pointer (or NULL) + */ +BEEDLLAPI /*@null@*/ +const hashFunction* hashFunctionGet(int index) /*@*/; -BEEDLLAPI -const hashFunction* hashFunctionFind(const char*) + +/** + * Retrieve a hash function by name. + * @param name hash function name + * @return hash function pointer (or NULL) + */ +BEEDLLAPI /*@null@*/ +const hashFunction* hashFunctionFind(const char* name) /*@*/; + +/** + * Retrieve the default hash function. + * If the BEECRYPT_HASH environment variable is set, use that + * hash function. Otherwise, use "sha1". + * @return hash function pointer + */ BEEDLLAPI -const hashFunction* hashFunctionDefault(void) +const hashFunction* hashFunctionDefault(void) /*@*/; #ifdef __cplusplus } #endif -/* +/** * The struct 'hashFunctionContext' is used to contain both the functional * part (the hashFunction), and its parameters. */ @@ -332,7 +377,7 @@ typedef struct /*@unused@*/ hashFunctionParam* param; } hashFunctionContext; -/* +/** * The following functions can be used to initialize and free a * hashFunctionContext. Initializing will allocate a buffer of the size * required by the hashFunction, freeing will deallocate that buffer. @@ -371,112 +416,132 @@ int hashFunctionContextDigestMatch(hashFunctionContext* ctxt, const mp32number*) } #endif -/* +/** * Keyed Hash Functions, a.k.a. Message Authentication Codes */ typedef void keyedHashFunctionParam; -typedef int (*keyedHashFunctionSetup )(keyedHashFunctionParam*, const uint32*, int) - /*@*/; -typedef int (*keyedHashFunctionReset )(keyedHashFunctionParam*) - /*@*/; -typedef int (*keyedHashFunctionUpdate )(keyedHashFunctionParam*, const byte*, int) - /*@*/; -typedef int (*keyedHashFunctionDigest )(keyedHashFunctionParam*, uint32*) - /*@*/; - -/* - * The struct 'keyedHashFunction' holds information and pointers to code - * specific to each keyed hash function. Specific keyed hash functions MAY be - * written to be multithread-safe. - * - * The struct field 'keybitsmin' contains the minimum number of bits a key - * must contains, 'keybitsmax' the maximum number of bits a key may contain, - * 'keybitsinc', the increment in bits that may be used between min and max. - * - * The struct contains the following function(s): +/** + * Setup the keyed hash function parameters with the given secret key. + * This can also be used to reset the parameters. * - * int (*setup)(keyedHashFunctionParam *param, const uint32* key, int keybits); - * - * This function will setup the keyed hash function parameters with the given - * secret key; it will also 'reset' the parameters. - * Return value is 0 on success, or -1 on failure. - * NOTE: after use, it is recommended to wipe the parameters by calling setup + * @note After use, it is recommended to wipe the parameters by calling setup * again with another (dummy) key. * - * int (*reset)(keyedHashFunctionParam* param); - * - * This function will re-initialize the parameters of this keyed hash function. - * Return value is 0 on success, or -1 on failure. + * @param param keyed hash parameters + * @param key secret key + * @param keybits no. bits in secret key + * @return 0 on success, -1 on failure + */ +typedef int (*keyedHashFunctionSetup) (keyedHashFunctionParam* param, const uint32* key, int keybits) + /*@modifies param @*/; + +/** + * Re-initialize the parameters of a keyed hash function. * - * int (*update)(keyedHashFunctionParam* param, const byte* data, int size); + * @param param keyed hash parameters + * @return 0 on success, -1 on failure + */ +typedef int (*keyedHashFunctionReset) (keyedHashFunctionParam* param) + /*@modifies param @*/; + +/** + * Update the keyed hash function with an array of bytes. * - * This function updates the keyed hash function with an array of bytes. - * Return value is 0 on success, or -1 on failure. + * @param param keyed hash parameters + * @param data array of bytes + * @param size no. of bytes + * @return 0 on success, -1 on failure * - * int (*digest)(keyedHashFunctionParam* param, uint32* data); + */ +typedef int (*keyedHashFunctionUpdate) (keyedHashFunctionParam* param, const byte* data, int size) + /*@modifies param @*/; + +/** + * Compute the digest (or authentication code) of all the data passed to + * the keyed hash function, and return the result in data. * - * This function computes the digest (or authentication code) of all the data - * passed to the keyed hash function, and stores the result in data. - * Return value is 0 on success, or -1 on failure. - * NOTE: data must be at least have a bytesize of 'digestsize' as described + * @note data must be at least have a bytesize of 'digestsize' as described * in the keyedHashFunction struct. - * NOTE: for safety reasons, after calling digest, each specific implementation + * + * @note For safety reasons, after calling digest, each specific implementation * MUST reset itself so that previous values in the parameters are erased. + * + * @param param keyed hash parameters + * @retval data digest (or authentication code) + * @return 0 on success, -1 on failure + */ +typedef int (*keyedHashFunctionDigest) (keyedHashFunctionParam* param, /*@out@*/ uint32* data) + /*@modifies param, data @*/; + +/** + * The struct 'keyedHashFunction' holds information and pointers to code + * specific to each keyed hash function. Specific keyed hash functions MAY be + * written to be multithread-safe. + * */ typedef struct { - const char* name; - const unsigned int paramsize; /* in bytes */ - const unsigned int blocksize; /* in bytes */ - const unsigned int digestsize; /* in bytes */ - const unsigned int keybitsmin; /* in bits */ - const unsigned int keybitsmax; /* in bits */ - const unsigned int keybitsinc; /* in bits */ + const char* name; + const unsigned int paramsize; /*!< in bytes */ + const unsigned int blocksize; /*!< in bytes */ + const unsigned int digestsize; /*!< in bytes */ + const unsigned int keybitsmin; /*!< min keysize in bits */ + const unsigned int keybitsmax; /*!< max keysize in bits */ + const unsigned int keybitsinc; /*!< keysize increment in bits */ const keyedHashFunctionSetup setup; const keyedHashFunctionReset reset; const keyedHashFunctionUpdate update; const keyedHashFunctionDigest digest; } keyedHashFunction; -/* - * You can use the following functions to find keyed hash functions implemented - * by the library: - * - * keyedHashFunctionCount returns the number of keyed hash functions available. - * - * keyedHashFunctionGet returns the keyed hash function with a given index - * (starting at zero, up to keyedHashFunctionCount() - 1), or NULL if the index - * was out of bounds. - * - * keyedHashFunctionFind returns the keyed hash function with the given name, - * or NULL if no keyed hash function exists with that name. - */ - #ifdef __cplusplus extern "C" { #endif +/** + * Return the number of keyed hash functions available. + * @return number of keyed hash functions available + */ BEEDLLAPI -int keyedHashFunctionCount(void) +int keyedHashFunctionCount(void) /*@*/; -BEEDLLAPI -const keyedHashFunction* keyedHashFunctionGet(int) + +/** + * Retrieve a keyed hash function by index. + * @param index keyed hash function index + * @return keyed hash function pointer (or NULL) + */ +BEEDLLAPI /*@null@*/ +const keyedHashFunction* keyedHashFunctionGet(int index) /*@*/; -BEEDLLAPI -const keyedHashFunction* keyedHashFunctionFind(const char*) + +/** + * Retrieve a keyed hash function by name. + * @param name keyed hash function name + * @return keyed hash function pointer (or NULL) + */ +BEEDLLAPI /*@null@*/ +const keyedHashFunction* keyedHashFunctionFind(const char* name) /*@*/; + +/** + * Retrieve the default keyed hash function. + * If the BEECRYPT_KEYEDHASH environment variable is set, use that keyed + * hash function. Otherwise, use "hmacsha1". + * @return keyed hash function pointer + */ BEEDLLAPI -const keyedHashFunction* keyedHashFunctionDefault(void) +const keyedHashFunction* keyedHashFunctionDefault(void) /*@*/; #ifdef __cplusplus } #endif -/* +/** * The struct 'keyedHashFunctionContext' is used to contain both the functional * part (the keyedHashFunction), and its parameters. */ @@ -487,7 +552,7 @@ typedef struct /*@unused@*/ keyedHashFunctionParam* param; } keyedHashFunctionContext; -/* +/** * The following functions can be used to initialize and free a * keyedHashFunctionContext. Initializing will allocate a buffer of the size * required by the keyedHashFunction, freeing will deallocate that buffer. @@ -529,16 +594,18 @@ int keyedHashFunctionContextDigestMatch(keyedHashFunctionContext*, const mp32num } #endif -/* - * Block ciphers +/** + * Block cipher operations. */ - typedef enum { ENCRYPT, DECRYPT } cipherOperation; +/** + * Block cipher modes. + */ typedef enum { /*@-enummemuse@*/ @@ -560,100 +627,119 @@ typedef struct const blockModeDecrypt decrypt; } blockMode; -typedef int (*blockCipherSetup )(blockCipherParam*, const uint32*, int, cipherOperation) +/** + * Setup the blockcipher parameters with the given secret key for either + * encryption or decryption. + * + * @note After use, it is recommended to wipe the parameters by calling setup + * again with another (dummy) key. + * + * @param param blockcipher parameters + * @param key secret key + * @param keybits no. bits in secret key + * @param cipherOperation + * @return 0 on success, -1 on failure + */ +typedef int (*blockCipherSetup )(blockCipherParam* param, const uint32* key, int keybits, cipherOperation cipherOperation) /*@*/; -typedef int (*blockCipherSetIV )(blockCipherParam*, const uint32*) + +/** + * @param param blockcipher parameters + * @return 0 on success, -1 on failure + */ +typedef int (*blockCipherSetIV )(blockCipherParam* param, const uint32* data) /*@*/; -typedef int (*blockCipherEncrypt)(blockCipherParam*, uint32*, const uint32*) + +/** + * Encrypt one block of data (with bit size chosen by the blockcipher). + * @note This is raw encryption, without padding, etc. + * + * @param param blockcipher parameters + * @retval dst ciphertext block + * @param src plaintext block + * @return 0 on success, -1 on failure + */ +typedef int (*blockCipherEncrypt)(blockCipherParam* param, uint32* dst, const uint32* src) /*@*/; -typedef int (*blockCipherDecrypt)(blockCipherParam*, uint32*, const uint32*) + +/** + * Decrypt one block of data (with bit size chosen by the blockcipher). + * @note This is raw decryption, without padding, etc. + * + * @param param blockcipher parameters + * @retval dst plaintext block + * @param src ciphertext block + * @return 0 on success, -1 on failure + */ +typedef int (*blockCipherDecrypt)(blockCipherParam* param, uint32* dst, const uint32* src) /*@*/; -/* +/** * The struct 'blockCipher' holds information and pointers to code specific * to each blockcipher. Specific block ciphers MAY be written to be * multithread-safe. - * - * The struct field 'keybitsmin' contains the minimum number of bits a key - * must contains, 'keybitsmax' the maximum number of bits a key may contain, - * 'keybitsinc', the increment in bits that may be used between min and max. - * - * The struct contains the following function(s): - * - * int (*setup)(blockCipherParam *param, const uint32* key, int keybits, cipherOperation); - * - * This function will setup the blockcipher parameters with the given secret - * key for either encryption or decryption; - * Return value is 0 on success, or -1 on failure. - * NOTE: after use, it is recommended to wipe the parameters by calling setup - * again with another (dummy) key. - * - * int (*encrypt)(blockCipherParam* param, uint32* block); - * - * This function will encrypt one block of data (with bit size equal to - * 'blockbits') - * Return value is 0 on success, or -1 on failure. - * NOTE: this is raw encryption, without padding, etc. - * - * int (*decrypt)(blockCipherParam* param, uint32* block); - * - * This function will decrypt one block of data (with bit size equal to - * 'blockbits') - * Return value is 0 on success, or -1 on failure. - * NOTE: this is raw decryption, without padding, etc. */ typedef struct { - const char* name; - const unsigned int paramsize; /* in bytes */ - const unsigned int blocksize; /* in bytes */ - const unsigned int keybitsmin; /* in bits */ - const unsigned int keybitsmax; /* in bits */ - const unsigned int keybitsinc; /* in bits */ - const blockCipherSetup setup; - const blockCipherSetIV setiv; - const blockCipherEncrypt encrypt; - const blockCipherDecrypt decrypt; -/*@dependent@*/ const blockMode* mode; + const char* name; + const unsigned int paramsize; /*!< in bytes */ + const unsigned int blocksize; /*!< in bytes */ + const unsigned int keybitsmin; /*!< min keysize in bits */ + const unsigned int keybitsmax; /*!< max keysize in bits */ + const unsigned int keybitsinc; /*!< keysize increment in bits */ + const blockCipherSetup setup; + const blockCipherSetIV setiv; + const blockCipherEncrypt encrypt; + const blockCipherDecrypt decrypt; +/*@dependent@*/ const blockMode* mode; } blockCipher; -/* - * You can use the following functions to find blockciphers implemented by - * the library: - * - * blockCipherCount returns the number of blockciphers available. - * - * blockCipherGet returns the blockcipher with a given index (starting - * at zero, up to blockCipherCount() - 1), or NULL if the index was out of - * bounds. - * - * blockCipherFind returns the blockcipher with the given name, or - * NULL if no hash function exists with that name. - */ - #ifdef __cplusplus extern "C" { #endif +/** + * Return the number of blockciphers available. + * @return number of blockciphers available + */ BEEDLLAPI -int blockCipherCount(void) +int blockCipherCount(void) /*@*/; -BEEDLLAPI -const blockCipher* blockCipherGet(int) + +/** + * Retrieve a blockcipher by index. + * @param index blockcipher index + * @return blockcipher pointer (or NULL) + */ +BEEDLLAPI /*@null@*/ +const blockCipher* blockCipherGet(int index) /*@*/; -BEEDLLAPI -const blockCipher* blockCipherFind(const char*) + +/** + * Retrieve a blockcipher by name. + * @param name blockcipher name + * @return blockcipher pointer (or NULL) + */ +BEEDLLAPI /*@null@*/ +const blockCipher* blockCipherFind(const char* name) /*@*/; + +/** + * Retrieve the default blockcipher. + * If the BEECRYPT_CIPHER environment variable is set, use that blockcipher. + * Otherwise, use "blowfish". + * @return blockcipher pointer + */ BEEDLLAPI -const blockCipher* blockCipherDefault(void) +const blockCipher* blockCipherDefault(void) /*@*/; #ifdef __cplusplus } #endif -/* +/** * The struct 'blockCipherContext' is used to contain both the functional * part (the blockCipher), and its parameters. */ @@ -664,7 +750,7 @@ typedef struct blockCipherParam* param; } blockCipherContext; -/* +/** * The following functions can be used to initialize and free a * blockCipherContext. Initializing will allocate a buffer of the size * required by the blockCipher, freeing will deallocate that buffer. diff --git a/beecrypt/configure b/beecrypt/configure index c6537db..ead258d 100755 --- a/beecrypt/configure +++ b/beecrypt/configure @@ -7995,7 +7995,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "Makefile docs/Makefile gas/Makefile masm/Makefile mwerks/Makefile tests/Makefile config.gnu.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "Doxyfile Makefile docs/Makefile gas/Makefile masm/Makefile mwerks/Makefile tests/Makefile config.gnu.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/beecrypt/configure.in b/beecrypt/configure.in index a8598f8..5460a3c 100644 --- a/beecrypt/configure.in +++ b/beecrypt/configure.in @@ -1,64 +1,206 @@ -dnl Process this file with autoconf to produce a configure script. +dnl Process this file with autoconf to produce a configure script + +dnl Initialization AC_INIT() AC_CANONICAL_SYSTEM +dnl Automake +AM_INIT_AUTOMAKE(beecrypt, 2.1.0) +AM_CONFIG_HEADER(config.gnu.h) +AM_DISABLE_STATIC +AC_LIBTOOL_WIN32_DLL + dnl Check system type case $target_os in - solaris*) - AC_DEFINE(SOLARIS) + cygwin*) + AC_DEFINE(CYGWIN) + AC_DEFINE(WIN32) + ;; + darwin*) + AC_DEFINE(DARWIN) + ;; + freebsd*) + AC_DEFINE(FREEBSD) ;; linux*) AC_DEFINE(LINUX) ;; + netbsd*) + AC_DEFINE(NETBSD) + ;; + openbsd*) + AC_DEFINE(OPENBSD) + ;; + osf*) + AC_DEFINE(OSF) + ;; + *qnx) + AC_DEFINE(QNX) + ;; + solaris*) + AC_DEFINE(SOLARIS) + ;; + sysv*uv*) + AC_DEFINE(SCO_UNIX) + ;; *) - AC_MSG_ERROR([ -Operating system type $host currently not supported/tested -]) - ;; + AC_MSG_WARN([Operating system type $target_os currently not supported and/or tested]) + ;; +esac +case $target_os in + cygwin* | darwin*) + AC_DEFINE(LEADING_UNDERSCORE) + ;; + *) + AC_DEFINE(NO_UNDERSCORES) + ;; esac -dnl Generate the config header -AC_CONFIG_HEADER(gnu/config.gnu.h) +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CPP +AC_PROG_LN_S +AM_PROG_LIBTOOL +AC_SUBST(LIBTOOL_DEPS) + +AC_C_INLINE + +if test "$ac_cv_prog_gcc" != yes; then + AC_CACHE_CHECK([whether we are using Sun Workshop C], ac_cv_prog_SUNPRO_CC, [ + AC_EGREP_CPP(yes, [ + #ifdef __SUNPRO_C + yes; + #endif + ], ac_cv_prog_SUNPRO_CC=yes, ac_cv_prog_SUNPRO_CC=no) + ]) + if test "$ac_cv_prog_SUNPRO_CC" != yes; then + AC_CACHE_CHECK([whether we are using Compaq's C compiler], ac_cv_prog_DECC, [ + AC_EGREP_CPP(yes, [ + #ifdef __DECC + yes; + #endif + ], ac_cv_prog_DECC=yes, ac_cv_prog_DECC=no) + ]) + fi +fi -AC_ARG_ENABLE(debug, [ --enable-debug creates debugging code [default=no]], +AC_ARG_ENABLE(debug, [ --enable-debug creates debugging code [default=no]], [ if test "$enableval" = no; then - ac_use_debug_code=no + ac_enable_debug=no else - ac_use_debug_code=yes + ac_enable_debug=yes fi - ], [ ac_use_debug_code=no]) - -dnl Product and version -PRODUCT=beecrypt -VERSION=1.0.0 -AC_DEFINE_UNQUOTED(PRODUCT, "$PRODUCT") -AC_DEFINE_UNQUOTED(VERSION, "$VERSION") -AC_SUBST(PRODUCT) -AC_SUBST(VERSION) + ], [ ac_enable_debug=no]) -dnl Checks for programs. -AC_PROG_CC -AC_PROG_INSTALL +dnl Check if we need to disable optimizations +AC_ARG_ENABLE(optimized, [ --enable-optimized enables the assembler optimizations [default depends on --enable-debug value]], + [ if test "$enableval" = no; then + ac_enable_optimized=no + else + ac_enable_optimized=yes + fi + ], + [ if test "$ac_enable_debug" = no; then + ac_enable_optimized=yes + else + ac_enable_optimized=no + fi + ]) -AC_C_INLINE +dnl Check if we have the necessary java components installed +AC_ARG_WITH(javaglue, [ --with-javaglue creates the java glue code [default=yes]], + [ if test "$withval" = no; then + ac_with_javaglue=no + else + ac_with_javaglue=yes + fi + ], [ ac_with_javaglue=yes ]) -if test "$ac_cv_prog_gcc" != yes; then - AC_MSG_CHECKING(whether we are using Sun Workshop C) - cat > conftest.c << EOF -#ifdef __SUNPRO_C - yes; -#endif +if test "$ac_with_javaglue" = yes ; then + AC_CHECK_PROG(ac_cv_have_java, java, yes, no) + if test "$ac_cv_have_java" = yes; then + AC_CHECK_PROG(ac_cv_have_javac, javac, yes, no) + if test "$ac_cv_have_javac" = yes; then + AC_CACHE_CHECK([for java native interface headers], ac_cv_java_include, [ + cat > conftest.java << EOF +public class conftest +{ + public static void main(String[[]] argv) + { + System.out.println(System.getProperty("java.home")); + } +} EOF - ac_try="$CC -E conftest.c" - if { (eval echo configure:__online__: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | egrep yes > /dev/null 2>&1; then - ac_cv_prog_SUNPRO_CC=yes - # test version of sunpro cc here + java_home=`javac conftest.java; java -classpath . conftest` + case $target_os in + cygwin*) + java_home=`cygpath -u -p "$java_home"` + ;; + esac + if test -d "$ac_cv_java_include" ; then + ac_cv_java_headers=yes + else + ac_cv_java_include="$java_home"/../include + if test -d "$ac_cv_java_include" ; then + ac_cv_java_headers=yes + else + AC_MSG_WARN([java headers not found, disabling javaglue]) + ac_cv_java_headers=no + ac_with_javaglue=no + fi + fi + rm -fr conftest* + ]) + else + AC_MSG_WARN([javac not found, disabling javaglue]) + ac_cv_java_headers=no + ac_with_javaglue=no + fi else - ac_cv_prog_SUNPRO_CC=no + AC_MSG_WARN([java not found, disabling javaglue]) + ac_cv_java_headers=no + ac_with_javaglue=no fi - AC_MSG_RESULT($ac_cv_prog_SUNPRO_CC) fi +if test "$ac_with_javaglue" = yes ; then + AC_DEFINE(JAVAGLUE,1) +else + AC_DEFINE(JAVAGLUE,0) +fi + +dnl Check if we want to enable threads +AC_ARG_ENABLE(threads, [ --enable-threads enables multithread safety [default=yes]], + [ if test "$enableval" = no; then + ac_enable_threads=no + else + ac_enable_threads=yes + fi + ], [ ac_enable_threads=yes ]) + +dnl Check if we want to enable aio +AC_ARG_ENABLE(aio, [ --enable-aio enables asynchronous i/o for entropy gathering [default=yes]], + [ if test "$enableval" = no; then + ac_enable_aio=no + else + ac_enable_aio=yes + fi + ], [ ac_enable_aio=yes ]) + +dnl Check if we want to use mtmalloc +AC_ARG_WITH(mtmalloc, [ --with-mtmalloc links against the mtmalloc library [default=no]], + [ if test "$withval" = no; then + ac_with_mtmalloc=no + else + ac_with_mtmalloc=yes + fi + ], [ ac_with_mtmalloc=no ]) + +dnl Product and version +AC_SUBST(CC) +AC_SUBST(CPP) +AC_SUBST(LD) + dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T @@ -67,16 +209,13 @@ dnl Checks for library functions. AC_FUNC_MEMCMP dnl Checks for header files. -AC_HEADER_STDC - AC_CHECK_HEADERS(errno.h string.h ctype.h stdlib.h) -AC_CHECK_HEADERS(unistd.h fcntl.h limits.h) -AC_CHECK_HEADERS(time.h) -AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h) -AC_CHECK_HEADERS(thread.h pthread.h synch.h semaphore.h) -AC_CHECK_HEADERS(termio.h) +AC_CHECK_HEADERS(unistd.h fcntl.h) +AC_CHECK_HEADERS(sys/types.h sys/stat.h) +AC_CHECK_HEADERS(termio.h termios.h) AC_CHECK_HEADERS(sys/audioio.h sys/ioctl.h sys/soundcard.h) +AC_CHECK_HEADERS(time.h sys/time.h) if test "$ac_cv_header_sys_time_h" = yes; then AC_CHECK_FUNC(gettimeofday, [ AC_DEFINE(HAVE_GETTIMEOFDAY, 1) @@ -86,89 +225,524 @@ if test "$ac_cv_header_sys_time_h" = yes; then ]) fi -if test "$ac_cv_header_thread_h" = yes; then - AC_HAVE_LIBRARY(thread) -elif test "$ac_cv_header_pthread_h" = yes; then - AC_HAVE_LIBRARY(pthread) +case $target_os in + cygwin*) + ;; + *) + if test "$ac_enable_threads" = yes; then + AC_DEFINE(ENABLE_THREADS, 1) + AC_CHECK_HEADERS(thread.h pthread.h synch.h semaphore.h) + if test "$ac_cv_header_thread_h" = yes; then + AC_HAVE_LIBRARY(thread) + elif test "$ac_cv_header_pthread_h" = yes; then + AC_HAVE_LIBRARY(pthread) + else + AC_MSG_WARN([Can't find any thread libraries]) + AC_DEFINE(ENABLE_THREADS, 0) + fi + fi + + if test "$ac_enable_aio" = yes; then + AC_CHECK_HEADERS(aio.h) + if test "$ac_cv_header_aio_h" = yes; then + AC_SEARCH_LIBS(aio_read, [c rt aio posix4], [ ], [ + AC_MSG_ERROR([no library containing aio routines found]) + ]) + AC_CACHE_CHECK([whether aio works], ac_cv_have_working_aio, [ + cat > conftest.aio << EOF +The quick brown fox jumps over the lazy dog. +EOF + AC_TRY_RUN([ +#if HAVE_ERRNO_H +# include +#endif +#if HAVE_FCNTL_H +# include +#endif +#if HAVE_STRING_H +# include +#endif +#if HAVE_UNISTD_H +# include +#endif +#include +#include + +main() +{ + struct aiocb a; + const struct aiocb* a_list = &a; + struct timespec a_timeout; + + char buffer[32]; + + int i, rc, fd = open("conftest.aio", O_RDONLY); + + if (fd < 0) + exit(1); + + memset(&a, 0, sizeof(struct aiocb)); + + a.aio_fildes = fd; + a.aio_offset = 0; + a.aio_reqprio = 0; + a.aio_buf = buffer; + a.aio_nbytes = sizeof(buffer); + a.aio_sigevent.sigev_notify = SIGEV_NONE; + + a_timeout.tv_sec = 1; + a_timeout.tv_nsec = 0; + + if (aio_read(&a) < 0) + exit(1); + + if (aio_suspend(&a_list, 1, &a_timeout) < 0) + { + #if HAVE_ERRNO_H + /* some linux systems don't await timeout and return instantly */ + if (errno == EAGAIN) + { + nanosleep(&a_timeout, (struct timespec*) 0); + if (aio_suspend(&a_list, 1, &a_timeout) < 0) + exit(1); + } + else + exit(1); + #else + exit(1); + #endif + } + + if (aio_error(&a) < 0) + exit(1); + + if (aio_return(&a) < 0) + exit(1); + + exit(0); +} + ], ac_cv_have_working_aio=yes, ac_cv_have_working_aio=no) + ]) + if test "$ac_cv_have_working_aio" = yes; then + AC_DEFINE(ENABLE_AIO, 1) + fi + rm -fr conftest* + fi + fi + + if test "$ac_with_mtmalloc" = yes; then + AC_CHECK_HEADERS(mtmalloc.h) + AC_HAVE_LIBRARY(mtmalloc) + fi + ;; +esac + +dnl Checks for compiler flags +CFLAGS="" +CPPFLAGS="" +LDFLAGS="" + +if test "$ac_enable_optimized" = yes; then + case $target_cpu in + alpha*) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_ALPHA" + ;; + arm*) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_ARM" + ;; + ia64) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_IA64" + ;; + i386) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_I386" + ;; + i486) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_I486" + ;; + i586) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_I586" + ;; + i686) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_I686" + ;; + ia64) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_IA64" + ;; + powerpc) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_POWERPC" + ;; + sparcv8) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_SPARCV8" + ;; + sparcv8plus*) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_SPARCV8PLUS" + CFLAGS="$CFLAGS -Wa,-xarch=v8plus" + ;; + sparcv9) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_SPARCV9" + CFLAGS="$CFLAGS -Wa,-xarch=v9" + ;; + sparcv9a) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_SPARCV9" + CFLAGS="$CFLAGS -Wa,-xarch=v9a" + ;; + sparcv9b) + CPPFLAGS="$CPPFLAGS -DOPTIMIZE_SPARCV9" + CFLAGS="$CFLAGS -Wa,-xarch=v9b" + ;; + x86) + # QNX Neutrino doesn't list the exact cpu type + ;; + esac +fi + +if test "$ac_enable_debug" = yes; then + CFLAGS="$CFLAGS -g" + if test "$ac_cv_prog_gcc" = yes; then + CFLAGS="$CFLAGS -Wall" + elif test "$ac_cv_prog_SUNPRO_CC" = yes; then + if test "$ac_enable_threads" = yes; then + CFLAGS="$CFLAGS -mt" + fi + fi +else + if test "$ac_cv_prog_gcc" = yes; then + CFLAGS="$CFLAGS -O3" + if test "$ac_enable_optimized" = yes; then + case $target_cpu in +# This switch makes the mp32 routines slower by about 10%, so it's disabled +# alphaev6) +# CFLAGS="$CFLAGS -mcpu=ev6" +# ;; + arm*) + CFLAGS="$CFLAGS -fomit-frame-pointer" + ;; + i386) + CFLAGS="$CFLAGS -m386 -march=i386 -fomit-frame-pointer" + ;; + i486) + CFLAGS="$CFLAGS -m486 -march=i486 -fomit-frame-pointer" + ;; + i586) + CFLAGS="$CFLAGS -mpentium -march=pentium -fomit-frame-pointer" + ;; + i686) + CFLAGS="$CFLAGS -mpentiumpro -march=pentiumpro -fomit-frame-pointer" + ;; + sparcv8) + CFLAGS="$CFLAGS -mv8" + ;; +# This actually performs WORSE on gcc up to 2.95.3! +# sparcv8plus*) +# CFLAGS="$CFLAGS -mv8plus" +# ;; + sparcv9*) + AC_MSG_WARN([gcc currently cannot build 64-bit objects]) + CFLAGS="$CFLAGS -mcpu=v9 -m64 -mptr64" + ;; + esac + fi + elif test "$ac_cv_prog_SUNPRO_CC" = yes; then + CFLAGS="$CFLAGS -fast" + if test "$ac_enable_threads" = yes; then + CFLAGS="$CFLAGS -mt" + fi + if test "$ac_enable_optimized" = yes; then + case $target_cpu in + sparcv8) + CFLAGS="$CFLAGS -xtarget=generic -xarch=v8" + ;; + sparcv8plus) + CFLAGS="$CFLAGS -xtarget=generic -xarch=v8plus" + ;; + sparcv8plusa) + CFLAGS="$CFLAGS -xtarget=generic -xarch=v8plusa" + ;; + sparcv8plusb) + CFLAGS="$CFLAGS -xtarget=generic -xarch=v8plusb" + ;; + sparcv9) + CFLAGS="-xarch=v9" + CFLAGS="$CFLAGS -xtarget=generic64 -xarch=v9" + LDFLAGS="$LDFLAGS -64" + ;; + sparcv9a) + CFLAGS="-xarch=v9" + CFLAGS="$CFLAGS -xtarget=generic64 -xarch=v9a" + LDFLAGS="$LDFLAGS -64" + ;; + sparcv9b) + CFLAGS="-xarch=v9" + CFLAGS="$CFLAGS -xtarget=generic64 -xarch=v9b" + LDFLAGS="$LDFLAGS -64" + ;; + esac + fi + elif test "$ac_cv_prog_DECC" = yes; then + CFLAGS="$CFLAGS -fast" + if test "$ac_enable_threads" = yes; then + CFLAGS="$CFLAGS -pthread" + fi + else + CFLAGS="$CFLAGS -O2" + fi +fi + +case $target_os in + freebsd*) + if test "$ac_enable_threads" = yes; then + CFLAGS="$CFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" + fi + ;; +esac + +if test "$ac_with_javaglue" = yes ; then + CFLAGS="$CFLAGS -I$ac_cv_java_include" + case $target_os in + cygwin*) + CFLAGS="$CFLAGS -I$ac_cv_java_include"/win32 + ;; + linux*) + CFLAGS="$CFLAGS -I$ac_cv_java_include"/linux + ;; + osf*) + CFLAGS="$CFLAGS -I$ac_cv_java_include"/osf + ;; + solaris*) + CFLAGS="$CFLAGS -I$ac_cv_java_include"/solaris + ;; + *) + AC_MSG_WARN([please add appropriate -I$ac_cv_java_include/ flag]) + ;; + esac fi +dnl Checks for endianness +AC_C_BIGENDIAN + dnl Checks for word sizes AC_CHECK_SIZEOF(char) AC_CHECK_SIZEOF(unsigned char) +if test "$ac_cv_sizeof_char" -eq 1; then + AC_DEFINE(INT8_TYPE, [char]) +else + AC_MSG_ERROR([compiler has no 1 byte char]) +fi +if test "$ac_cv_sizeof_unsigned_char" -eq 1; then + AC_DEFINE(UINT8_TYPE, [unsigned char]) +else + AC_MSG_ERROR([compiler has no 1 byte unsigned char]) +fi + AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(unsigned short) +if test "$ac_cv_sizeof_short" -eq 2; then + AC_DEFINE(INT16_TYPE, [short]) +else + AC_MSG_ERROR([compiler has no 2 byte short]) +fi +if test "$ac_cv_sizeof_unsigned_short" -eq 2; then + AC_DEFINE(UINT16_TYPE, [unsigned short]) +else + AC_MSG_ERROR([compiler has no 2 byte unsigned short]) +fi + AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(unsigned int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(unsigned long) -AC_CHECK_SIZEOF(long long) -AC_CHECK_SIZEOF(unsigned long long) -AC_CHECK_SIZEOF(float) -AC_CHECK_SIZEOF(double) - -dnl Checks for endianness -AC_C_BIGENDIAN +if test "$ac_cv_sizeof_int" -eq 4; then + AC_DEFINE(INT32_TYPE, [int]) +elif test "$ac_cv_sizeof_long" -eq 4; then + AC_DEFINE(INT32_TYPE, [long]) +else + AC_MSG_ERROR([compiler has no 4 byte integer]) +fi +if test "$ac_cv_sizeof_unsigned_int" -eq 4; then + AC_DEFINE(UINT32_TYPE, [unsigned int]) +elif test "$ac_cv_sizeof_unsigned_long" -eq 4; then + AC_DEFINE(UINT32_TYPE, [unsigned long]) +else + AC_MSG_ERROR([compiler has no 4 byte unsigned integer]) +fi -dnl Checks for compiler flags -if test "$ac_use_debug_code" = yes; then - if test "$ac_cv_prog_gcc" = yes; then - CFLAGS="-g -shared" - elif test "$ac_cv_prog_SUNPRO_CC" = yes; then - CFLAGS="-g -mt -KPIC" +if test "$ac_cv_sizeof_long" -eq 8; then + AC_DEFINE(INT64_TYPE, [long]) +else + AC_CHECK_SIZEOF(long long) + if test "$ac_cv_sizeof_long_long" -eq 8; then + AC_DEFINE(HAVE_LONG_LONG) + AC_DEFINE(INT64_TYPE, [long long]) else - CFLAGS="-g -shared" + AC_MSG_ERROR([compiler has no 8 byte integer]) fi +fi +if test "$ac_cv_sizeof_unsigned_long" -eq 8; then + AC_DEFINE(UINT64_TYPE, [unsigned long]) else - if test "$ac_cv_prog_gcc" = yes; then - CFLAGS="-O3 -shared" - case $target_cpu in - i386) - ;; - i486) - CFLAGS="$CFLAGS -m486 -Di486" ;; - i586) - CFLAGS="$CFLAGS -mpentium -Di586" ;; - i686) - CFLAGS="$CFLAGS -mpentiumpro -Di686" ;; - *) - echo "Don't know how to optimize for" $target_cpu ;; - esac - elif test "$ac_cv_prog_SUNPRO_CC" = yes; then - CFLAGS="-fast -mt -KPIC" - case $target_cpu in - sparcv8plus) - CFLAGS="$CFLAGS -Dsparcv8plus -xchip=ultra -xarch=v8plus" ;; - sparcv9) - CFLAGS="$CFLAGS -Dsparcv9 -xchip=ultra -xarch=v9" ;; - *) - echo "Using general optimization for" $target_cpu ;; - esac + AC_CHECK_SIZEOF(unsigned long long) + if test "$ac_cv_sizeof_unsigned_long_long" -eq 8; then + AC_DEFINE(HAVE_UNSIGNED_LONG_LONG) + AC_DEFINE(UINT64_TYPE, [unsigned long long]) else - CFLAGS="-O2 -shared" + AC_MSG_ERROR([compiler has no 8 byte unsigned integer]) fi fi +AC_CHECK_SIZEOF(float) +if test "$ac_cv_sizeof_float" -eq 4; then + AC_DEFINE(FLOAT4_TYPE, [float]) +else + AC_MSG_ERROR([compiler has no 4 byte float]) +fi + +AC_CHECK_SIZEOF(double) +if test "$ac_cv_sizeof_double" -eq 8; then + AC_DEFINE(DOUBLE8_TYPE, [double]) +else + AC_MSG_ERROR([compiler has no 8 byte double]) +fi + dnl Checks for devices -AC_MSG_CHECKING(for entropy device) -case $host in - *-*-solaris*) - AC_DEFINE(HAVE_DEV_AUDIO,1) - AC_DEFINE(HAVE_DEV_TTY,1) - ac_cv_entropy_device="/dev/audio,/dev/tty" - ;; - *-*-linux*) - AC_DEFINE(HAVE_DEV_DSP,1) - AC_DEFINE(HAVE_DEV_RANDOM,1) - AC_DEFINE(HAVE_DEV_TTY,1) - ac_cv_entropy_device="/dev/dsp,/dev/random,/dev/tty" +AC_CHECKING(for specific entropy devices) +case $target_os in + cygwin*) + AC_MSG_CHECKING([for wavein]) + AC_MSG_RESULT(yes) + AC_MSG_CHECKING([for wincrypt]) + AC_MSG_RESULT(yes) + AC_MSG_CHECKING([for console]) + AC_MSG_RESULT(yes) + ;; + linux*) + AC_CACHE_CHECK([for /dev/dsp], ac_cv_have_dev_dsp, [ + if test -r /dev/dsp; then + ac_cv_have_dev_dsp=yes + else + ac_cv_have_dev_dsp=no + fi + ]) + if test "$ac_cv_have_dev_dsp" = yes; then + AC_DEFINE(HAVE_DEV_DSP, 1) + fi + ;; + solaris*) + AC_CACHE_CHECK([for /dev/audio], ac_cv_have_dev_audio, [ + if test -r /dev/audio; then + ac_cv_have_dev_audio=yes + else + ac_cv_have_dev_audio=no + fi + ]) + if test "$ac_cv_have_dev_audio" = yes; then + AC_DEFINE(HAVE_DEV_AUDIO, 1) + fi ;; *) - AC_MSG_ERROR([ -There is no entropy device to initialize the random generator on host $host -]) - ;; + AC_MSG_WARN(no specific entropy devices present) + ;; +esac + +case $target_os in + cygwin*) + ;; + *) + AC_CHECKING(for generic entropy devices) + AC_CACHE_CHECK([for /dev/random], ac_cv_have_dev_random, [ + if test -r /dev/random; then + ac_cv_have_dev_random=yes + else + ac_cv_have_dev_random=no + fi + ]) + if test "$ac_cv_have_dev_random" = yes; then + AC_DEFINE(HAVE_DEV_RANDOM, 1) + fi + AC_CACHE_CHECK([for /dev/urandom], ac_cv_have_dev_urandom, [ + if test -r /dev/urandom; then + ac_cv_have_dev_urandom=yes + else + ac_cv_have_dev_urandom=no + fi + ]) + if test "$ac_cv_have_dev_urandom" = yes; then + AC_DEFINE(HAVE_DEV_URANDOM, 1) + fi + AC_CACHE_CHECK([for /dev/tty], ac_cv_have_dev_tty, [ + if test -r /dev/tty; then + ac_cv_have_dev_tty=yes + else + ac_cv_have_dev_tty=no + fi + ]) + if test "$ac_cv_have_dev_tty" = yes; then + AC_DEFINE(HAVE_DEV_TTY, 1) + fi + ;; esac -AC_MSG_RESULT($ac_cv_entropy_device) + +dnl Generate the assembler optimizations +rm -f $srcdir/blowfishopt.c $srcdir/blowfishopt.S +rm -f $srcdir/fips180opt.c $srcdir/fips180opt.S +rm -f $srcdir/mp32opt.c $srcdir/mp32opt.S +if test "$ac_enable_optimized" = yes; then + case $target_cpu in + arm*) + cat > $srcdir/mp32opt.S << EOF +#include "gas/mp32opt.arm.S" +EOF + ;; + i[[34]]86) + cat > $srcdir/mp32opt.S << EOF +#include "gas/mp32opt.i386.S" +EOF + ;; + i[[56]]86) + cat > $srcdir/blowfishopt.S << EOF +#include "gas/blowfishopt.i586.S" +EOF + cat > $srcdir/fips180opt.S << EOF +#include "gas/fips180opt.i586.S" +EOF + cat > $srcdir/mp32opt.S << EOF +#include "gas/mp32opt.i386.S" +EOF + ;; + ia64) + cat > $srcdir/mp32opt.S << EOF +#include "gas/mp32opt.ia64.S" +EOF + ;; + powerpc) + cat > $srcdir/mp32opt.S << EOF +#include "gas/mp32opt.powerpc.S" +EOF + ;; + sparcv8) + cat > $srcdir/mp32opt.S << EOF +#include "gas/mp32opt.sparcv8.S" +EOF + ;; + sparcv8plus* | sparcv9*) + cat > $srcdir/mp32opt.S << EOF +#include "gas/mp32opt.sparcv9.S" +EOF + ;; + esac +fi +if test ! -r $srcdir/blowfishopt.S; then + cat > $srcdir/blowfishopt.c << EOF +EOF +fi +if test ! -r $srcdir/fips180opt.S; then + cat > $srcdir/fips180opt.c << EOF +EOF +fi +if test ! -r $srcdir/mp32opt.S; then + cat > $srcdir/mp32opt.c << EOF +EOF +fi dnl Output -AC_OUTPUT(Makefile) +AC_OUTPUT(Doxyfile Makefile docs/Makefile gas/Makefile masm/Makefile mwerks/Makefile tests/Makefile) diff --git a/beecrypt/mp32prime.c b/beecrypt/mp32prime.c index d40c7c6..3f266e1 100644 --- a/beecrypt/mp32prime.c +++ b/beecrypt/mp32prime.c @@ -1106,7 +1106,7 @@ void mp32prndconone_w(mp32barrett* p, randomGeneratorContext* rc, uint32 size, i mp32setx(s.size, wksp, q->size, q->modl); mp32gcd_w(s.size, s.modl, wksp, wksp+s.size, wksp+2*s.size); - if (!mp32isone(s.size, wksp)) + if (!mp32isone(s.size, wksp+s.size)) continue; } } -- 2.7.4