fix documentation, fix PanamaMAC, fix algorithm names
parent
ad8043d50c
commit
393ae4859a
1
3way.h
1
3way.h
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct ThreeWay_Info : public FixedBlockSize<12>, public FixedKeyLength<12>, public VariableRounds<11>
|
struct ThreeWay_Info : public FixedBlockSize<12>, public FixedKeyLength<12>, public VariableRounds<11>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "3-Way";}
|
static const char *StaticAlgorithmName() {return "3-Way";}
|
||||||
|
|
|
||||||
556
Doxyfile
556
Doxyfile
|
|
@ -1,4 +1,4 @@
|
||||||
# Doxyfile 1.2.15-20020512
|
# Doxyfile 1.3.7
|
||||||
|
|
||||||
# This file describes the settings to be used by the documentation system
|
# This file describes the settings to be used by the documentation system
|
||||||
# doxygen (www.doxygen.org) for a project
|
# doxygen (www.doxygen.org) for a project
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
# Values that contain spaces should be placed between quotes (" ")
|
# Values that contain spaces should be placed between quotes (" ")
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# General configuration options
|
# Project related configuration options
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||||
|
|
@ -32,17 +32,180 @@ PROJECT_NUMBER =
|
||||||
|
|
||||||
OUTPUT_DIRECTORY = doc
|
OUTPUT_DIRECTORY = doc
|
||||||
|
|
||||||
|
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
|
||||||
|
# 2 levels of 10 sub-directories under the output directory of each output
|
||||||
|
# format and will distribute the generated files over these directories.
|
||||||
|
# Enabling this option can be useful when feeding doxygen a huge amount of source
|
||||||
|
# files, where putting all generated files in the same directory would otherwise
|
||||||
|
# cause performance problems for the file system.
|
||||||
|
|
||||||
|
CREATE_SUBDIRS = NO
|
||||||
|
|
||||||
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
|
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
|
||||||
# documentation generated by doxygen is written. Doxygen will use this
|
# documentation generated by doxygen is written. Doxygen will use this
|
||||||
# information to generate all constant output in the proper language.
|
# information to generate all constant output in the proper language.
|
||||||
# The default language is English, other supported languages are:
|
# The default language is English, other supported languages are:
|
||||||
# Brazilian, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
|
# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
|
||||||
# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean,
|
# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en
|
||||||
# Norwegian, Polish, Portuguese, Romanian, Russian, Slovak, Slovene,
|
# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese,
|
||||||
# Spanish, Swedish and Ukrainian.
|
# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
|
||||||
|
|
||||||
OUTPUT_LANGUAGE = English
|
OUTPUT_LANGUAGE = English
|
||||||
|
|
||||||
|
# This tag can be used to specify the encoding used in the generated output.
|
||||||
|
# The encoding is not always determined by the language that is chosen,
|
||||||
|
# but also whether or not the output is meant for Windows or non-Windows users.
|
||||||
|
# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
|
||||||
|
# forces the Windows encoding (this is the default for the Windows binary),
|
||||||
|
# whereas setting the tag to NO uses a Unix-style encoding (the default for
|
||||||
|
# all platforms other than Windows).
|
||||||
|
|
||||||
|
USE_WINDOWS_ENCODING = YES
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# This tag implements a quasi-intelligent brief description abbreviator
|
||||||
|
# that is used to form the text in various listings. Each string
|
||||||
|
# in this list, if found as the leading text of the brief description, will be
|
||||||
|
# stripped from the text and the result after processing the whole list, is used
|
||||||
|
# as the annotated text. Otherwise, the brief description is used as-is. If left
|
||||||
|
# blank, the following values are used ("$name" is automatically replaced with the
|
||||||
|
# name of the entity): "The $name class" "The $name widget" "The $name file"
|
||||||
|
# "is" "provides" "specifies" "contains" "represents" "a" "an" "the"
|
||||||
|
|
||||||
|
ABBREVIATE_BRIEF =
|
||||||
|
|
||||||
|
# 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 INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
|
||||||
|
# members of a class in the documentation of that class as if those members were
|
||||||
|
# ordinary class members. Constructors, destructors and assignment operators of
|
||||||
|
# the base classes will not be shown.
|
||||||
|
|
||||||
|
INLINE_INHERITED_MEMB = YES
|
||||||
|
|
||||||
|
# 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 = NO
|
||||||
|
|
||||||
|
# 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. The tag can be used to show relative paths in the file list.
|
||||||
|
# If left blank the directory from which doxygen is run is used as the
|
||||||
|
# path to strip.
|
||||||
|
|
||||||
|
STRIP_FROM_PATH =
|
||||||
|
|
||||||
|
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
|
||||||
|
# the path mentioned in the documentation of a class, which tells
|
||||||
|
# the reader which header file to include in order to use a class.
|
||||||
|
# If left blank only the name of the header file containing the class
|
||||||
|
# definition is used. Otherwise one should specify the include paths that
|
||||||
|
# are normally passed to the compiler using the -I flag.
|
||||||
|
|
||||||
|
STRIP_FROM_INC_PATH =
|
||||||
|
|
||||||
|
# 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 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
|
||||||
|
# explicit @brief command for a brief description.
|
||||||
|
|
||||||
|
JAVADOC_AUTOBRIEF = YES
|
||||||
|
|
||||||
|
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
|
||||||
|
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
|
||||||
|
# comments) as a brief description. This used to be the default behaviour.
|
||||||
|
# The new default is to treat a multi-line C++ comment block as a detailed
|
||||||
|
# description. Set this tag to YES if you prefer the old behaviour instead.
|
||||||
|
|
||||||
|
MULTILINE_CPP_IS_BRIEF = NO
|
||||||
|
|
||||||
|
# If the DETAILS_AT_TOP tag is set to YES then Doxygen
|
||||||
|
# will output the detailed description near the top, like JavaDoc.
|
||||||
|
# If set to NO, the detailed description appears after the member
|
||||||
|
# documentation.
|
||||||
|
|
||||||
|
DETAILS_AT_TOP = 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
|
||||||
|
# re-implements.
|
||||||
|
|
||||||
|
INHERIT_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
|
||||||
|
|
||||||
|
# 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 =
|
||||||
|
|
||||||
|
# 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 = NO
|
||||||
|
|
||||||
|
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
|
||||||
|
# only. Doxygen will then generate output that is more tailored for Java.
|
||||||
|
# For instance, namespaces will be presented as packages, qualified scopes
|
||||||
|
# will look different, etc.
|
||||||
|
|
||||||
|
OPTIMIZE_OUTPUT_JAVA = NO
|
||||||
|
|
||||||
|
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
|
||||||
|
# the same type (for instance a group of public functions) to be put as a
|
||||||
|
# subgroup of that type (e.g. under the Public Functions section). Set it to
|
||||||
|
# NO to prevent subgrouping. Alternatively, this can be done per class using
|
||||||
|
# the \nosubgrouping command.
|
||||||
|
|
||||||
|
SUBGROUPING = YES
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# Build related configuration options
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
|
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
|
||||||
# documentation are documented, even if no documentation was available.
|
# documentation are documented, even if no documentation was available.
|
||||||
# Private class members and static file members will be hidden unless
|
# Private class members and static file members will be hidden unless
|
||||||
|
|
@ -66,6 +229,13 @@ EXTRACT_STATIC = NO
|
||||||
|
|
||||||
EXTRACT_LOCAL_CLASSES = YES
|
EXTRACT_LOCAL_CLASSES = YES
|
||||||
|
|
||||||
|
# This flag is only useful for Objective-C code. When set to YES local
|
||||||
|
# methods, which are defined in the implementation section but not in
|
||||||
|
# the interface are included in the documentation.
|
||||||
|
# If set to NO (the default) only methods in the interface are included.
|
||||||
|
|
||||||
|
EXTRACT_LOCAL_METHODS = NO
|
||||||
|
|
||||||
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
|
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
|
||||||
# undocumented members of documented classes, files or namespaces.
|
# undocumented members of documented classes, files or namespaces.
|
||||||
# If set to NO (the default) these members will be included in the
|
# If set to NO (the default) these members will be included in the
|
||||||
|
|
@ -76,50 +246,24 @@ HIDE_UNDOC_MEMBERS = NO
|
||||||
|
|
||||||
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
|
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
|
||||||
# undocumented classes that are normally visible in the class hierarchy.
|
# undocumented classes that are normally visible in the class hierarchy.
|
||||||
# If set to NO (the default) these class will be included in the various
|
# If set to NO (the default) these classes will be included in the various
|
||||||
# overviews. This option has no effect if EXTRACT_ALL is enabled.
|
# overviews. This option has no effect if EXTRACT_ALL is enabled.
|
||||||
|
|
||||||
HIDE_UNDOC_CLASSES = No
|
HIDE_UNDOC_CLASSES = NO
|
||||||
|
|
||||||
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
|
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
|
||||||
# include brief member descriptions after the members that are listed in
|
# friend (class|struct|union) declarations.
|
||||||
# the file and class documentation (similar to JavaDoc).
|
# If set to NO (the default) these declarations will be included in the
|
||||||
# Set to NO to disable this.
|
# documentation.
|
||||||
|
|
||||||
BRIEF_MEMBER_DESC = YES
|
HIDE_FRIEND_COMPOUNDS = NO
|
||||||
|
|
||||||
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
|
# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
|
||||||
# the brief description of a member or function before the detailed description.
|
# documentation blocks found inside the body of a function.
|
||||||
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
|
# If set to NO (the default) these blocks will be appended to the
|
||||||
# brief descriptions will be completely suppressed.
|
# function's detailed documentation block.
|
||||||
|
|
||||||
REPEAT_BRIEF = YES
|
HIDE_IN_BODY_DOCS = NO
|
||||||
|
|
||||||
# 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 INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited
|
|
||||||
# members of a class in the documentation of that class as if those members were
|
|
||||||
# ordinary class members. Constructors, destructors and assignment operators of
|
|
||||||
# the base classes will not be shown.
|
|
||||||
|
|
||||||
INLINE_INHERITED_MEMB = YES
|
|
||||||
|
|
||||||
# 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 = NO
|
|
||||||
|
|
||||||
# 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 =
|
|
||||||
|
|
||||||
# The INTERNAL_DOCS tag determines if documentation
|
# The INTERNAL_DOCS tag determines if documentation
|
||||||
# that is typed after a \internal command is included. If the tag is set
|
# that is typed after a \internal command is included. If the tag is set
|
||||||
|
|
@ -128,65 +272,26 @@ STRIP_FROM_PATH =
|
||||||
|
|
||||||
INTERNAL_DOCS = NO
|
INTERNAL_DOCS = 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 = NO
|
|
||||||
|
|
||||||
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
|
# 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
|
# 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
|
# 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
|
# in case and if your file system supports case sensitive file names. Windows
|
||||||
# users are adviced to set this option to NO.
|
# users are advised to set this option to NO.
|
||||||
|
|
||||||
CASE_SENSE_NAMES = NO
|
CASE_SENSE_NAMES = NO
|
||||||
|
|
||||||
# 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
|
# 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
|
# will show members with their full class and namespace scopes in the
|
||||||
# documentation. If set to YES the scope will be hidden.
|
# documentation. If set to YES the scope will be hidden.
|
||||||
|
|
||||||
HIDE_SCOPE_NAMES = NO
|
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
|
# 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
|
# will put a list of the files that are included by a file in the documentation
|
||||||
# of that file.
|
# of that file.
|
||||||
|
|
||||||
SHOW_INCLUDE_FILES = YES
|
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 DETAILS_AT_TOP tag is set to YES then Doxygen
|
|
||||||
# will output the detailed description near the top, like JavaDoc.
|
|
||||||
# If set to NO, the detailed description appears after the member
|
|
||||||
# documentation.
|
|
||||||
|
|
||||||
DETAILS_AT_TOP = 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]
|
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
|
||||||
# is inserted in the documentation for inline members.
|
# is inserted in the documentation for inline members.
|
||||||
|
|
||||||
|
|
@ -199,17 +304,22 @@ INLINE_INFO = YES
|
||||||
|
|
||||||
SORT_MEMBER_DOCS = NO
|
SORT_MEMBER_DOCS = NO
|
||||||
|
|
||||||
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
|
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
|
||||||
# tag is set to YES, then doxygen will reuse the documentation of the first
|
# brief documentation of file, namespace and class members alphabetically
|
||||||
# member in the group (if any) for the other members of the group. By default
|
# by member name. If set to NO (the default) the members will appear in
|
||||||
# all members of a group must be documented explicitly.
|
# declaration order.
|
||||||
|
|
||||||
DISTRIBUTE_GROUP_DOC = NO
|
SORT_BRIEF_DOCS = NO
|
||||||
|
|
||||||
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
|
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
|
||||||
# Doxygen uses this value to replace tabs by spaces in code fragments.
|
# sorted by fully-qualified names, including namespaces. If set to
|
||||||
|
# NO (the default), the class list will be sorted only by class name,
|
||||||
|
# not including the namespace part.
|
||||||
|
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
|
||||||
|
# Note: This option applies only to the class list, not to the
|
||||||
|
# alphabetical list.
|
||||||
|
|
||||||
TAB_SIZE = 8
|
SORT_BY_SCOPE_NAME = NO
|
||||||
|
|
||||||
# The GENERATE_TODOLIST tag can be used to enable (YES) or
|
# The GENERATE_TODOLIST tag can be used to enable (YES) or
|
||||||
# disable (NO) the todo list. This list is created by putting \todo
|
# disable (NO) the todo list. This list is created by putting \todo
|
||||||
|
|
@ -229,14 +339,11 @@ GENERATE_TESTLIST = YES
|
||||||
|
|
||||||
GENERATE_BUGLIST = YES
|
GENERATE_BUGLIST = YES
|
||||||
|
|
||||||
# This tag can be used to specify a number of aliases that acts
|
# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
|
||||||
# as commands in the documentation. An alias has the form "name=value".
|
# disable (NO) the deprecated list. This list is created by putting
|
||||||
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
|
# \deprecated commands in the documentation.
|
||||||
# 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 =
|
GENERATE_DEPRECATEDLIST= YES
|
||||||
|
|
||||||
# The ENABLED_SECTIONS tag can be used to enable conditional
|
# The ENABLED_SECTIONS tag can be used to enable conditional
|
||||||
# documentation sections, marked by \if sectionname ... \endif.
|
# documentation sections, marked by \if sectionname ... \endif.
|
||||||
|
|
@ -244,28 +351,14 @@ ALIASES =
|
||||||
ENABLED_SECTIONS =
|
ENABLED_SECTIONS =
|
||||||
|
|
||||||
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
|
# 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 initial value of a variable or define consists of for it to appear in
|
||||||
# the documentation. If the initializer consists of more lines than specified
|
# 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.
|
# 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
|
# The appearance of the initializer of individual variables and defines in the
|
||||||
# documentation can be controlled using \showinitializer or \hideinitializer
|
# documentation can be controlled using \showinitializer or \hideinitializer
|
||||||
# command in the documentation regardless of this setting.
|
# command in the documentation regardless of this setting.
|
||||||
|
|
||||||
MAX_INITIALIZER_LINES =
|
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 = NO
|
|
||||||
|
|
||||||
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
|
|
||||||
# only. Doxygen will then generate output that is more tailored for Java.
|
|
||||||
# For instance namespaces will be presented as packages, qualified scopes
|
|
||||||
# will look different, etc.
|
|
||||||
|
|
||||||
OPTIMIZE_OUTPUT_JAVA = NO
|
|
||||||
|
|
||||||
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
|
# 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
|
# at the bottom of the documentation of classes and structs. If set to YES the
|
||||||
|
|
@ -294,6 +387,13 @@ WARNINGS = No
|
||||||
|
|
||||||
WARN_IF_UNDOCUMENTED = No
|
WARN_IF_UNDOCUMENTED = No
|
||||||
|
|
||||||
|
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
|
||||||
|
# potential errors in the documentation, such as not documenting some
|
||||||
|
# parameters in a documented function, or documenting parameters that
|
||||||
|
# don't exist or using markup commands wrongly.
|
||||||
|
|
||||||
|
WARN_IF_DOC_ERROR = YES
|
||||||
|
|
||||||
# The WARN_FORMAT tag determines the format of the warning messages that
|
# The WARN_FORMAT tag determines the format of the warning messages that
|
||||||
# doxygen can produce. The string should contain the $file, $line, and $text
|
# 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
|
# tags, which will be replaced by the file and line number from which the
|
||||||
|
|
@ -323,7 +423,7 @@ INPUT = .
|
||||||
# and *.h) to filter out the source-files in the directories. If left
|
# and *.h) to filter out the source-files in the directories. If left
|
||||||
# blank the following patterns are tested:
|
# blank the following patterns are tested:
|
||||||
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
|
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
|
||||||
# *.h++ *.idl *.odl
|
# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
|
||||||
|
|
||||||
FILE_PATTERNS = *.h \
|
FILE_PATTERNS = *.h \
|
||||||
*.cpp
|
*.cpp
|
||||||
|
|
@ -338,7 +438,7 @@ RECURSIVE = NO
|
||||||
# excluded from the INPUT source files. This way you can easily exclude a
|
# 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.
|
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||||
|
|
||||||
EXCLUDE =
|
EXCLUDE = adhoc.cpp
|
||||||
|
|
||||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
|
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
|
||||||
# that are symbolic links (a Unix filesystem feature) are excluded from the input.
|
# that are symbolic links (a Unix filesystem feature) are excluded from the input.
|
||||||
|
|
@ -355,7 +455,7 @@ EXCLUDE_PATTERNS =
|
||||||
# directories that contain example code fragments that are included (see
|
# directories that contain example code fragments that are included (see
|
||||||
# the \include command).
|
# the \include command).
|
||||||
|
|
||||||
EXAMPLE_PATH =
|
EXAMPLE_PATH = .
|
||||||
|
|
||||||
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
# 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
|
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||||
|
|
@ -388,7 +488,7 @@ INPUT_FILTER =
|
||||||
|
|
||||||
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
|
# 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
|
# INPUT_FILTER) will be used to filter the input files when producing source
|
||||||
# files to browse.
|
# files to browse (i.e. when SOURCE_BROWSER is set to YES).
|
||||||
|
|
||||||
FILTER_SOURCE_FILES = NO
|
FILTER_SOURCE_FILES = NO
|
||||||
|
|
||||||
|
|
@ -397,7 +497,9 @@ FILTER_SOURCE_FILES = NO
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
|
# 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.
|
# be generated. Documented entities will be cross-referenced with these sources.
|
||||||
|
# Note: To get rid of all source code in the generated output, make sure also
|
||||||
|
# VERBATIM_HEADERS is set to NO.
|
||||||
|
|
||||||
SOURCE_BROWSER = YES
|
SOURCE_BROWSER = YES
|
||||||
|
|
||||||
|
|
@ -406,6 +508,12 @@ SOURCE_BROWSER = YES
|
||||||
|
|
||||||
INLINE_SOURCES = NO
|
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 = NO
|
||||||
|
|
||||||
# If the REFERENCED_BY_RELATION tag is set to YES (the default)
|
# If the REFERENCED_BY_RELATION tag is set to YES (the default)
|
||||||
# then for each documented function all documented
|
# then for each documented function all documented
|
||||||
# functions referencing it will be listed.
|
# functions referencing it will be listed.
|
||||||
|
|
@ -418,6 +526,12 @@ REFERENCED_BY_RELATION = YES
|
||||||
|
|
||||||
REFERENCES_RELATION = YES
|
REFERENCES_RELATION = YES
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# configuration options related to the alphabetical class index
|
# configuration options related to the alphabetical class index
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
@ -474,10 +588,12 @@ HTML_HEADER =
|
||||||
|
|
||||||
HTML_FOOTER =
|
HTML_FOOTER =
|
||||||
|
|
||||||
# The HTML_STYLESHEET tag can be used to specify a user defined cascading
|
# 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
|
# 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
|
# fine-tune the look of the HTML output. If the tag is left blank doxygen
|
||||||
# will generate a default style sheet
|
# will generate a default style sheet. Note that doxygen will try to copy
|
||||||
|
# the style sheet file to the HTML output directory, so don't put your own
|
||||||
|
# stylesheet in the HTML output directory as well, or it will be erased!
|
||||||
|
|
||||||
HTML_STYLESHEET =
|
HTML_STYLESHEET =
|
||||||
|
|
||||||
|
|
@ -494,6 +610,20 @@ HTML_ALIGN_MEMBERS = YES
|
||||||
|
|
||||||
GENERATE_HTMLHELP = YES
|
GENERATE_HTMLHELP = YES
|
||||||
|
|
||||||
|
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
|
||||||
|
# be used to specify the file name of the resulting .chm file. You
|
||||||
|
# can add a path in front of the file if the result should not be
|
||||||
|
# written to the html output directory.
|
||||||
|
|
||||||
|
CHM_FILE =
|
||||||
|
|
||||||
|
# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
|
||||||
|
# be used to specify the location (absolute path including file name) of
|
||||||
|
# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
|
||||||
|
# the HTML help compiler on the generated index.hhp.
|
||||||
|
|
||||||
|
HHC_LOCATION =
|
||||||
|
|
||||||
# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
|
# 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
|
# controls if a separate .chi index file is generated (YES) or that
|
||||||
# it should be included in the master .chm file (NO).
|
# it should be included in the master .chm file (NO).
|
||||||
|
|
@ -507,7 +637,7 @@ GENERATE_CHI = NO
|
||||||
BINARY_TOC = NO
|
BINARY_TOC = NO
|
||||||
|
|
||||||
# The TOC_EXPAND flag can be set to YES to add extra items for group members
|
# 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.
|
# to the contents of the HTML help documentation and to the tree view.
|
||||||
|
|
||||||
TOC_EXPAND = NO
|
TOC_EXPAND = NO
|
||||||
|
|
||||||
|
|
@ -525,10 +655,9 @@ ENUM_VALUES_PER_LINE = 4
|
||||||
# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
|
# 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
|
# 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
|
# is generated for HTML Help). For this to work a browser that supports
|
||||||
# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+,
|
# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
|
||||||
# or Internet explorer 4.0+). Note that for large projects the tree generation
|
# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
|
||||||
# can take a very long time. In such cases it is better to disable this feature.
|
# probably better off using the HTML help feature.
|
||||||
# Windows users are probably better off using the HTML help feature.
|
|
||||||
|
|
||||||
GENERATE_TREEVIEW = NO
|
GENERATE_TREEVIEW = NO
|
||||||
|
|
||||||
|
|
@ -553,7 +682,8 @@ GENERATE_LATEX = NO
|
||||||
|
|
||||||
LATEX_OUTPUT =
|
LATEX_OUTPUT =
|
||||||
|
|
||||||
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be invoked. If left blank `latex' will be used as the default command name.
|
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
|
||||||
|
# invoked. If left blank `latex' will be used as the default command name.
|
||||||
|
|
||||||
LATEX_CMD_NAME = latex
|
LATEX_CMD_NAME = latex
|
||||||
|
|
||||||
|
|
@ -607,12 +737,18 @@ USE_PDFLATEX = NO
|
||||||
|
|
||||||
LATEX_BATCHMODE = NO
|
LATEX_BATCHMODE = NO
|
||||||
|
|
||||||
|
# If LATEX_HIDE_INDICES is set to YES then doxygen will not
|
||||||
|
# include the index chapters (such as File Index, Compound Index, etc.)
|
||||||
|
# in the output.
|
||||||
|
|
||||||
|
LATEX_HIDE_INDICES = NO
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# configuration options related to the RTF output
|
# configuration options related to the RTF output
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
# If the GENERATE_RTF tag is set to YES Doxygen will generate 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
|
# The RTF output is optimized for Word 97 and may not look very pretty with
|
||||||
# other RTF readers or editors.
|
# other RTF readers or editors.
|
||||||
|
|
||||||
GENERATE_RTF = NO
|
GENERATE_RTF = NO
|
||||||
|
|
@ -639,7 +775,7 @@ COMPACT_RTF = NO
|
||||||
RTF_HYPERLINKS = NO
|
RTF_HYPERLINKS = NO
|
||||||
|
|
||||||
# Load stylesheet definitions from file. Syntax is similar to doxygen's
|
# Load stylesheet definitions from file. Syntax is similar to doxygen's
|
||||||
# config file, i.e. a series of assigments. You only have to provide
|
# config file, i.e. a series of assignments. You only have to provide
|
||||||
# replacements, missing definitions are set to their default value.
|
# replacements, missing definitions are set to their default value.
|
||||||
|
|
||||||
RTF_STYLESHEET_FILE =
|
RTF_STYLESHEET_FILE =
|
||||||
|
|
@ -683,12 +819,35 @@ MAN_LINKS = NO
|
||||||
|
|
||||||
# If the GENERATE_XML tag is set to YES Doxygen will
|
# If the GENERATE_XML tag is set to YES Doxygen will
|
||||||
# generate an XML file that captures the structure of
|
# generate an XML file that captures the structure of
|
||||||
# the code including all documentation. Note that this
|
# the code including all documentation.
|
||||||
# feature is still experimental and incomplete at the
|
|
||||||
# moment.
|
|
||||||
|
|
||||||
GENERATE_XML = NO
|
GENERATE_XML = NO
|
||||||
|
|
||||||
|
# The XML_OUTPUT tag is used to specify where the XML 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 `xml' will be used as the default path.
|
||||||
|
|
||||||
|
XML_OUTPUT = xml
|
||||||
|
|
||||||
|
# The XML_SCHEMA tag can be used to specify an XML schema,
|
||||||
|
# which can be used by a validating XML parser to check the
|
||||||
|
# syntax of the XML files.
|
||||||
|
|
||||||
|
XML_SCHEMA =
|
||||||
|
|
||||||
|
# The XML_DTD tag can be used to specify an XML DTD,
|
||||||
|
# which can be used by a validating XML parser to check the
|
||||||
|
# syntax of the XML files.
|
||||||
|
|
||||||
|
XML_DTD =
|
||||||
|
|
||||||
|
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
|
||||||
|
# dump the program listings (including syntax highlighting
|
||||||
|
# and cross-referencing information) to the XML output. Note that
|
||||||
|
# enabling this will significantly increase the size of the XML output.
|
||||||
|
|
||||||
|
XML_PROGRAMLISTING = YES
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# configuration options for the AutoGen Definitions output
|
# configuration options for the AutoGen Definitions output
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
@ -701,6 +860,39 @@ GENERATE_XML = NO
|
||||||
|
|
||||||
GENERATE_AUTOGEN_DEF = NO
|
GENERATE_AUTOGEN_DEF = NO
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
# configuration options related to the Perl module output
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# If the GENERATE_PERLMOD tag is set to YES Doxygen will
|
||||||
|
# generate a Perl module file that captures the structure of
|
||||||
|
# the code including all documentation. Note that this
|
||||||
|
# feature is still experimental and incomplete at the
|
||||||
|
# moment.
|
||||||
|
|
||||||
|
GENERATE_PERLMOD = NO
|
||||||
|
|
||||||
|
# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
|
||||||
|
# the necessary Makefile rules, Perl scripts and LaTeX code to be able
|
||||||
|
# to generate PDF and DVI output from the Perl module output.
|
||||||
|
|
||||||
|
PERLMOD_LATEX = NO
|
||||||
|
|
||||||
|
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
|
||||||
|
# nicely formatted so it can be parsed by a human reader. This is useful
|
||||||
|
# if you want to understand what is going on. On the other hand, if this
|
||||||
|
# tag is set to NO the size of the Perl module output will be much smaller
|
||||||
|
# and Perl will parse it just the same.
|
||||||
|
|
||||||
|
PERLMOD_PRETTY = YES
|
||||||
|
|
||||||
|
# The names of the make variables in the generated doxyrules.make file
|
||||||
|
# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
|
||||||
|
# This is useful so different doxyrules.make files included by the same
|
||||||
|
# Makefile don't overwrite each other's variables.
|
||||||
|
|
||||||
|
PERLMOD_MAKEVAR_PREFIX =
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Configuration options related to the preprocessor
|
# Configuration options related to the preprocessor
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
@ -754,7 +946,7 @@ PREDEFINED = _WIN32 \
|
||||||
__FreeBSD__ \
|
__FreeBSD__ \
|
||||||
CRYPTOPP_DOXYGEN_PROCESSING
|
CRYPTOPP_DOXYGEN_PROCESSING
|
||||||
|
|
||||||
# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
|
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
||||||
# this tag can be used to specify a list of macro names that should be expanded.
|
# 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.
|
# 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.
|
# Use the PREDEFINED tag if you want to use a different macro definition.
|
||||||
|
|
@ -763,16 +955,30 @@ EXPAND_AS_DEFINED =
|
||||||
|
|
||||||
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
|
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
|
||||||
# doxygen's preprocessor will remove all function-like macros that are alone
|
# doxygen's preprocessor will remove all function-like macros that are alone
|
||||||
# on a line and do not end with a semicolon. Such function macros are typically
|
# on a line, have an all uppercase name, and do not end with a semicolon. Such
|
||||||
# used for boiler-plate code, and will confuse the parser if not removed.
|
# function macros are typically used for boiler-plate code, and will confuse the
|
||||||
|
# parser if not removed.
|
||||||
|
|
||||||
SKIP_FUNCTION_MACROS = YES
|
SKIP_FUNCTION_MACROS = YES
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Configuration::addtions related to external references
|
# Configuration::additions related to external references
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
# The TAGFILES tag can be used to specify one or more tagfiles.
|
# The TAGFILES option can be used to specify one or more tagfiles.
|
||||||
|
# Optionally an initial location of the external documentation
|
||||||
|
# can be added for each tagfile. The format of a tag file without
|
||||||
|
# this location is as follows:
|
||||||
|
# TAGFILES = file1 file2 ...
|
||||||
|
# Adding location for the tag files is done as follows:
|
||||||
|
# TAGFILES = file1=loc1 "file2 = loc2" ...
|
||||||
|
# where "loc1" and "loc2" can be relative or absolute paths or
|
||||||
|
# URLs. If a location is present for each tag, the installdox tool
|
||||||
|
# does not have to be run to correct the links.
|
||||||
|
# Note that each tag file must have a unique name
|
||||||
|
# (where the name does NOT include the path)
|
||||||
|
# If a tag file is not located in the directory in which doxygen
|
||||||
|
# is run, you must also specify the path to the tagfile here.
|
||||||
|
|
||||||
TAGFILES =
|
TAGFILES =
|
||||||
|
|
||||||
|
|
@ -803,10 +1009,10 @@ PERL_PATH = /usr/bin/perl
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
|
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
|
||||||
# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or
|
# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or
|
||||||
# super classes. Setting the tag to NO turns the diagrams off. Note that this
|
# super classes. Setting the tag to NO turns the diagrams off. Note that this
|
||||||
# option is superceded by the HAVE_DOT option below. This is only a fallback. It is
|
# option is superseded by the HAVE_DOT option below. This is only a fallback. It is
|
||||||
# recommended to install and use dot, since it yield more powerful graphs.
|
# recommended to install and use dot, since it yields more powerful graphs.
|
||||||
|
|
||||||
CLASS_DIAGRAMS = YES
|
CLASS_DIAGRAMS = YES
|
||||||
|
|
||||||
|
|
@ -837,6 +1043,12 @@ CLASS_GRAPH = YES
|
||||||
|
|
||||||
COLLABORATION_GRAPH = YES
|
COLLABORATION_GRAPH = YES
|
||||||
|
|
||||||
|
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
|
||||||
|
# collaboration diagrams in a style similar to the OMG's Unified Modeling
|
||||||
|
# Language.
|
||||||
|
|
||||||
|
UML_LOOK = NO
|
||||||
|
|
||||||
# If set to YES, the inheritance and collaboration graphs will show the
|
# If set to YES, the inheritance and collaboration graphs will show the
|
||||||
# relations between templates and their instances.
|
# relations between templates and their instances.
|
||||||
|
|
||||||
|
|
@ -856,6 +1068,14 @@ INCLUDE_GRAPH = YES
|
||||||
|
|
||||||
INCLUDED_BY_GRAPH = YES
|
INCLUDED_BY_GRAPH = YES
|
||||||
|
|
||||||
|
# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
|
||||||
|
# generate a call dependency graph for every global function or class method.
|
||||||
|
# Note that enabling this option will significantly increase the time of a run.
|
||||||
|
# So in most cases it will be better to enable call graphs for selected
|
||||||
|
# functions only using the \callgraph command.
|
||||||
|
|
||||||
|
CALL_GRAPH = NO
|
||||||
|
|
||||||
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
|
# 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.
|
# will graphical hierarchy of all classes instead of a textual one.
|
||||||
|
|
||||||
|
|
@ -894,6 +1114,17 @@ MAX_DOT_GRAPH_WIDTH = 1024
|
||||||
|
|
||||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||||
|
|
||||||
|
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
|
||||||
|
# graphs generated by dot. A depth value of 3 means that only nodes reachable
|
||||||
|
# from the root by following a path via at most 3 edges will be shown. Nodes that
|
||||||
|
# lay further from the root node will be omitted. Note that setting this option to
|
||||||
|
# 1 or 2 may greatly reduce the computation time needed for large code bases. Also
|
||||||
|
# note that a graph may be further truncated if the graph's image dimensions are
|
||||||
|
# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT).
|
||||||
|
# If 0 is used for the depth value (the default), the graph is not depth-constrained.
|
||||||
|
|
||||||
|
MAX_DOT_GRAPH_DEPTH = 0
|
||||||
|
|
||||||
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
|
# 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
|
# generate a legend page explaining the meaning of the various boxes and
|
||||||
# arrows in the dot generated graphs.
|
# arrows in the dot generated graphs.
|
||||||
|
|
@ -901,51 +1132,16 @@ MAX_DOT_GRAPH_HEIGHT = 1024
|
||||||
GENERATE_LEGEND = YES
|
GENERATE_LEGEND = YES
|
||||||
|
|
||||||
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
|
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
|
||||||
# remove the intermedate dot files that are used to generate
|
# remove the intermediate dot files that are used to generate
|
||||||
# the various graphs.
|
# the various graphs.
|
||||||
|
|
||||||
DOT_CLEANUP = YES
|
DOT_CLEANUP = YES
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Configuration::addtions related to the search engine
|
# Configuration::additions related to the search engine
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
# The SEARCHENGINE tag specifies whether or not a search engine should be
|
# 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.
|
# used. If set to NO the values of all tags below this one will be ignored.
|
||||||
|
|
||||||
SEARCHENGINE = NO
|
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 = search.cgi
|
|
||||||
|
|
||||||
# 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/local/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 =
|
|
||||||
|
|
|
||||||
32
Readme.txt
32
Readme.txt
|
|
@ -1,5 +1,5 @@
|
||||||
Crypto++: a C++ Class Library of Cryptographic Schemes
|
Crypto++: a C++ Class Library of Cryptographic Schemes
|
||||||
Version 5.2 6/29/2004
|
Version 5.2.1 (in development)
|
||||||
|
|
||||||
This library includes:
|
This library includes:
|
||||||
|
|
||||||
|
|
@ -61,6 +61,18 @@ and .NET 2003 on Windows XP, GCC 2.95.4 on FreeBSD 4.6, GCC 2.95.3 on
|
||||||
Linux 2.4 and SunOS 5.8, GCC 3.4 on Cygwin 1.5.10, and Metrowerks
|
Linux 2.4 and SunOS 5.8, GCC 3.4 on Cygwin 1.5.10, and Metrowerks
|
||||||
CodeWarrior 8.3 for Windows and MacOS.
|
CodeWarrior 8.3 for Windows and MacOS.
|
||||||
|
|
||||||
|
*** Important Usage Notes ***
|
||||||
|
|
||||||
|
1. If a constructor for A takes a pointer to an object B (except primitive
|
||||||
|
types such as int and char), then A owns B and will delete B at A's
|
||||||
|
destruction. If a constructor for A takes a reference to an object B,
|
||||||
|
then the caller retains ownership of B and should not destroy it until
|
||||||
|
A no longer needs it.
|
||||||
|
|
||||||
|
2. Crypto++ is thread safe at the class level. This means you can use
|
||||||
|
Crypto++ safely in a multithreaded application, but you must provide
|
||||||
|
synchronization when multiple threads access a common Crypto++ object.
|
||||||
|
|
||||||
*** MSVC-Specific Information ***
|
*** MSVC-Specific Information ***
|
||||||
|
|
||||||
On Windows, Crypto++ can be compiled into 3 forms: a static library
|
On Windows, Crypto++ can be compiled into 3 forms: a static library
|
||||||
|
|
@ -141,18 +153,6 @@ http://www.cryptopp.com. You can also email me directly at
|
||||||
cryptopp@weidai.com, but you will probably get a faster response through
|
cryptopp@weidai.com, but you will probably get a faster response through
|
||||||
the mailing list.
|
the mailing list.
|
||||||
|
|
||||||
*** Important Usage Notes ***
|
|
||||||
|
|
||||||
1. If a constructor for A takes a pointer to an object B (except primitive
|
|
||||||
types such as int and char), then A owns B and will delete B at A's
|
|
||||||
destruction. If a constructor for A takes a reference to an object B,
|
|
||||||
then the caller retains ownership of B and should not destroy it until
|
|
||||||
A no longer needs it.
|
|
||||||
|
|
||||||
2. Crypto++ is thread safe at the class level. This means you can use
|
|
||||||
Crypto++ safely in a multithreaded application, but you must provide
|
|
||||||
synchronization when multiple threads access a common Crypto++ object.
|
|
||||||
|
|
||||||
*** History ***
|
*** History ***
|
||||||
|
|
||||||
1.0 - First public release. Withdrawn at the request of RSA DSI.
|
1.0 - First public release. Withdrawn at the request of RSA DSI.
|
||||||
|
|
@ -337,4 +337,10 @@ synchronization when multiple threads access a common Crypto++ object.
|
||||||
- fixed encoding/decoding of PKCS #8 privateKeyInfo to properly
|
- fixed encoding/decoding of PKCS #8 privateKeyInfo to properly
|
||||||
handle optional attributes
|
handle optional attributes
|
||||||
|
|
||||||
|
5.2.1 - fixed bug in the "dlltest" DLL testing program
|
||||||
|
- fixed compiling with STLport using VC .NET
|
||||||
|
- fixed compiling with -fPIC using GCC
|
||||||
|
- fixed compiling with -msse2 on systems without memalign()
|
||||||
|
- fixed problems with inline documentation
|
||||||
|
|
||||||
Written by Wei Dai
|
Written by Wei Dai
|
||||||
|
|
|
||||||
12
aes.h
12
aes.h
|
|
@ -1,20 +1,12 @@
|
||||||
#ifndef CRYPTOPP_AES_H
|
#ifndef CRYPTOPP_AES_H
|
||||||
#define CRYPTOPP_AES_H
|
#define CRYPTOPP_AES_H
|
||||||
|
|
||||||
/** \file
|
|
||||||
AES winner announced on 10/2/2000
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "rijndael.h"
|
#include "rijndael.h"
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
#ifdef CRYPTOPP_DOXYGEN_PROCESSING // Use inheritance instead of typedef to get a seperate API reference page for AES
|
//! AES winner, announced on 10/2/2000
|
||||||
//! AES
|
DOCUMENTED_TYPEDEF(Rijndael, AES);
|
||||||
class AES : public Rijndael {};
|
|
||||||
#else
|
|
||||||
typedef Rijndael AES;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef RijndaelEncryption AESEncryption;
|
typedef RijndaelEncryption AESEncryption;
|
||||||
typedef RijndaelDecryption AESDecryption;
|
typedef RijndaelDecryption AESDecryption;
|
||||||
|
|
|
||||||
16
arc4.h
16
arc4.h
|
|
@ -5,9 +5,8 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! <a href="http://www.weidai.com/scan-mirror/cs.html#RC4">Alleged RC4</a>
|
//! _
|
||||||
/*! Use #ARC4 typedef rather than this class directly. */
|
class CRYPTOPP_NO_VTABLE ARC4_Base : public VariableKeyLength<16, 1, 256>, public RandomNumberGenerator, public SymmetricCipher, public SymmetricCipherDocumentation
|
||||||
class CRYPTOPP_NO_VTABLE ARC4_Base : public VariableKeyLength<16, 1, 256>, public RandomNumberGenerator, public SymmetricCipher
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
~ARC4_Base();
|
~ARC4_Base();
|
||||||
|
|
@ -34,11 +33,10 @@ protected:
|
||||||
byte m_x, m_y;
|
byte m_x, m_y;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! <a href="http://www.weidai.com/scan-mirror/cs.html#RC4">Alleged RC4</a>
|
||||||
typedef SymmetricCipherFinal<ARC4_Base> ARC4;
|
DOCUMENTED_TYPEDEF(SymmetricCipherFinal<ARC4_Base>, ARC4)
|
||||||
|
|
||||||
//! Modified ARC4: it discards the first 256 bytes of keystream which may be weaker than the rest
|
//! _
|
||||||
/*! Use #MARC4 typedef rather than this class directly. */
|
|
||||||
class CRYPTOPP_NO_VTABLE MARC4_Base : public ARC4_Base
|
class CRYPTOPP_NO_VTABLE MARC4_Base : public ARC4_Base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -51,8 +49,8 @@ protected:
|
||||||
unsigned int GetDefaultDiscardBytes() const {return 256;}
|
unsigned int GetDefaultDiscardBytes() const {return 256;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! Modified ARC4: it discards the first 256 bytes of keystream which may be weaker than the rest
|
||||||
typedef SymmetricCipherFinal<MARC4_Base> MARC4;
|
DOCUMENTED_TYPEDEF(SymmetricCipherFinal<MARC4_Base>, MARC4)
|
||||||
|
|
||||||
NAMESPACE_END
|
NAMESPACE_END
|
||||||
|
|
||||||
|
|
|
||||||
4
asn.h
4
asn.h
|
|
@ -230,7 +230,8 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! key that can be ASN.1 encoded
|
||||||
|
/** derived class should override either BERDecodeKey or BERDecodeKey2 */
|
||||||
class CRYPTOPP_DLL ASN1Key : public ASN1CryptoMaterial
|
class CRYPTOPP_DLL ASN1Key : public ASN1CryptoMaterial
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -239,7 +240,6 @@ public:
|
||||||
{BERDecodeNull(bt); return false;}
|
{BERDecodeNull(bt); return false;}
|
||||||
virtual bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const
|
virtual bool DEREncodeAlgorithmParameters(BufferedTransformation &bt) const
|
||||||
{DEREncodeNull(bt); return false;} // see RFC 2459, section 7.3.1
|
{DEREncodeNull(bt); return false;} // see RFC 2459, section 7.3.1
|
||||||
// one of the following two should be overriden
|
|
||||||
//! decode subjectPublicKey part of subjectPublicKeyInfo, or privateKey part of privateKeyInfo, without the BIT STRING or OCTET STRING header
|
//! decode subjectPublicKey part of subjectPublicKeyInfo, or privateKey part of privateKeyInfo, without the BIT STRING or OCTET STRING header
|
||||||
virtual void BERDecodeKey(BufferedTransformation &bt) {assert(false);}
|
virtual void BERDecodeKey(BufferedTransformation &bt) {assert(false);}
|
||||||
virtual void BERDecodeKey2(BufferedTransformation &bt, bool parametersPresent, unsigned int size)
|
virtual void BERDecodeKey2(BufferedTransformation &bt, bool parametersPresent, unsigned int size)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! base n encoder, where n is a power of 2
|
||||||
class CRYPTOPP_DLL BaseN_Encoder : public Unflushable<Filter>
|
class CRYPTOPP_DLL BaseN_Encoder : public Unflushable<Filter>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -32,6 +33,7 @@ private:
|
||||||
SecByteBlock m_outBuf;
|
SecByteBlock m_outBuf;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! base n decoder, where n is a power of 2
|
||||||
class CRYPTOPP_DLL BaseN_Decoder : public Unflushable<Filter>
|
class CRYPTOPP_DLL BaseN_Decoder : public Unflushable<Filter>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -56,6 +58,7 @@ private:
|
||||||
SecByteBlock m_outBuf;
|
SecByteBlock m_outBuf;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! filter that breaks input stream into groups of fixed size
|
||||||
class CRYPTOPP_DLL Grouper : public Bufferless<Filter>
|
class CRYPTOPP_DLL Grouper : public Bufferless<Filter>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 56>, public FixedRounds<16>
|
struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 56>, public FixedRounds<16>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "Blowfish";}
|
static const char *StaticAlgorithmName() {return "Blowfish";}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
|
struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "Camellia";}
|
static const char *StaticAlgorithmName() {return "Camellia";}
|
||||||
|
|
|
||||||
4
cast.h
4
cast.h
|
|
@ -15,7 +15,7 @@ protected:
|
||||||
static const word32 S[8][256];
|
static const word32 S[8][256];
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! algorithm info
|
||||||
struct CAST128_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 5, 16>
|
struct CAST128_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 5, 16>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "CAST-128";}
|
static const char *StaticAlgorithmName() {return "CAST-128";}
|
||||||
|
|
@ -51,7 +51,7 @@ public:
|
||||||
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
|
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! algorithm info
|
||||||
struct CAST256_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32>
|
struct CAST256_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "CAST-256";}
|
static const char *StaticAlgorithmName() {return "CAST-256";}
|
||||||
|
|
|
||||||
3
cbcmac.h
3
cbcmac.h
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_MAC_Base : public MessageAuthenticationCode
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_MAC_Base : public MessageAuthenticationCode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -26,7 +27,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
//! <a href="http://www.weidai.com/scan-mirror/mac.html#CBC-MAC">CBC-MAC</a>
|
//! <a href="http://www.weidai.com/scan-mirror/mac.html#CBC-MAC">CBC-MAC</a>
|
||||||
/*! Compatible with FIPS 113. T should be an encryption class.
|
/*! Compatible with FIPS 113. T should be a class derived from BlockCipherDocumentation.
|
||||||
Secure only for fixed length messages. For variable length
|
Secure only for fixed length messages. For variable length
|
||||||
messages use DMAC.
|
messages use DMAC.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ CFG=cryptest - Win32 Debug
|
||||||
|
|
||||||
# Begin Project
|
# Begin Project
|
||||||
# PROP AllowPerConfigDependencies 0
|
# PROP AllowPerConfigDependencies 0
|
||||||
|
# PROP Scc_ProjName ""
|
||||||
|
# PROP Scc_LocalPath ""
|
||||||
CPP=cl.exe
|
CPP=cl.exe
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
|
|
||||||
|
|
@ -398,10 +400,6 @@ SOURCE=.\dlltest.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\factory.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\fipsalgt.cpp
|
SOURCE=.\fipsalgt.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ void RandomNumberGenerator::DiscardBytes(unsigned int n)
|
||||||
GenerateByte();
|
GenerateByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! see NullRNG()
|
||||||
class ClassNullRNG : public RandomNumberGenerator
|
class ClassNullRNG : public RandomNumberGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
24
cryptlib.dsp
24
cryptlib.dsp
|
|
@ -25,7 +25,9 @@ CFG=cryptlib - Win32 Debug
|
||||||
|
|
||||||
# Begin Project
|
# Begin Project
|
||||||
# PROP AllowPerConfigDependencies 0
|
# PROP AllowPerConfigDependencies 0
|
||||||
CPP=cl.exe
|
# PROP Scc_ProjName ""
|
||||||
|
# PROP Scc_LocalPath ""
|
||||||
|
CPP=xicl6.exe
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
|
|
||||||
!IF "$(CFG)" == "cryptlib - Win32 DLL-Import Release"
|
!IF "$(CFG)" == "cryptlib - Win32 DLL-Import Release"
|
||||||
|
|
@ -41,13 +43,13 @@ RSC=rc.exe
|
||||||
# PROP Intermediate_Dir "DLL_Import_Release"
|
# PROP Intermediate_Dir "DLL_Import_Release"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c
|
# ADD BASE CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c
|
||||||
# ADD CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /FD /c
|
# ADD CPP /nologo /G5 /Gz /MT /W3 /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /FD /Zm400 /c
|
||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LIB32=link.exe -lib
|
LIB32=xilink6.exe -lib
|
||||||
# ADD BASE LIB32 /nologo
|
# ADD BASE LIB32 /nologo
|
||||||
# ADD LIB32 /nologo
|
# ADD LIB32 /nologo
|
||||||
|
|
||||||
|
|
@ -64,13 +66,13 @@ LIB32=link.exe -lib
|
||||||
# PROP Intermediate_Dir "DLL_Import_Debug"
|
# PROP Intermediate_Dir "DLL_Import_Debug"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c
|
# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /Yu"pch.h" /FD /c
|
||||||
# ADD CPP /nologo /G5 /Gz /MTd /W3 /GX /Zi /Od /D "_DEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /FD /c
|
# ADD CPP /nologo /G5 /Gz /MTd /W3 /GX /Zi /Od /D "_DEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /D "CRYPTOPP_IMPORTS" /Yu"pch.h" /FD /Zm400 /c
|
||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LIB32=link.exe -lib
|
LIB32=xilink6.exe -lib
|
||||||
# ADD BASE LIB32 /nologo
|
# ADD BASE LIB32 /nologo
|
||||||
# ADD LIB32 /nologo
|
# ADD LIB32 /nologo
|
||||||
|
|
||||||
|
|
@ -87,13 +89,13 @@ LIB32=link.exe -lib
|
||||||
# PROP Intermediate_Dir "Release"
|
# PROP Intermediate_Dir "Release"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||||
# ADD CPP /nologo /MT /W3 /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /Yu"pch.h" /FD /c
|
# ADD CPP /nologo /MT /W3 /GX /Zi /O1 /Ob2 /D "NDEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /Yu"pch.h" /FD /Zm400 /c
|
||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LIB32=link.exe -lib
|
LIB32=xilink6.exe -lib
|
||||||
# ADD BASE LIB32 /nologo
|
# ADD BASE LIB32 /nologo
|
||||||
# ADD LIB32 /nologo
|
# ADD LIB32 /nologo
|
||||||
|
|
||||||
|
|
@ -110,13 +112,13 @@ LIB32=link.exe -lib
|
||||||
# PROP Intermediate_Dir "Debug"
|
# PROP Intermediate_Dir "Debug"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||||
# ADD CPP /nologo /MTd /W3 /GX /Zi /Od /D "_DEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /Yu"pch.h" /FD /c
|
# ADD CPP /nologo /MTd /W3 /GX /Zi /Od /D "_DEBUG" /D "_WINDOWS" /D "USE_PRECOMPILED_HEADERS" /D "WIN32" /Yu"pch.h" /FD /Zm400 /c
|
||||||
# ADD BASE RSC /l 0x409
|
# ADD BASE RSC /l 0x409
|
||||||
# ADD RSC /l 0x409
|
# ADD RSC /l 0x409
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LIB32=link.exe -lib
|
LIB32=xilink6.exe -lib
|
||||||
# ADD BASE LIB32 /nologo
|
# ADD BASE LIB32 /nologo
|
||||||
# ADD LIB32 /nologo
|
# ADD LIB32 /nologo
|
||||||
|
|
||||||
|
|
@ -774,6 +776,10 @@ SOURCE=.\esign.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\factory.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\files.h
|
SOURCE=.\files.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
|
||||||
41
cryptlib.h
41
cryptlib.h
|
|
@ -4,20 +4,22 @@
|
||||||
classes that provide a uniform interface to this library.
|
classes that provide a uniform interface to this library.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \mainpage <a href="http://www.cryptopp.com">Crypto++</a><sup><small>TM</small></sup> Library 5.2 Reference Manual
|
/*! \mainpage <a href="http://www.cryptopp.com">Crypto++</a><sup><small>TM</small></sup> Library 5.2.1 Reference Manual
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Abstract Base Classes<dd>
|
<dt>Abstract Base Classes<dd>
|
||||||
cryptlib.h
|
cryptlib.h
|
||||||
<dt>Symmetric Ciphers<dd>
|
<dt>Symmetric Ciphers<dd>
|
||||||
SymmetricCipherDocumentation
|
SymmetricCipherDocumentation
|
||||||
<dt>Hash Functions<dd>
|
<dt>Hash Functions<dd>
|
||||||
HAVAL, MD2, MD4, MD5, PanamaHash, RIPEMD160, SHA, SHA256, SHA384, SHA512, Tiger
|
HAVAL, MD2, MD4, MD5, PanamaHash, RIPEMD160, RIPEMD320, RIPEMD128, RIPEMD256, SHA, SHA256, SHA384, SHA512, Tiger, Whirlpool
|
||||||
<dt>Non-Cryptographic Checksums<dd>
|
<dt>Non-Cryptographic Checksums<dd>
|
||||||
CRC32, Adler32
|
CRC32, Adler32
|
||||||
<dt>Message Authentication Codes<dd>
|
<dt>Message Authentication Codes<dd>
|
||||||
#MD5MAC, XMACC, HMAC, CBC_MAC, DMAC, PanamaMAC
|
#MD5MAC, XMACC, HMAC, CBC_MAC, DMAC, PanamaMAC, TTMAC
|
||||||
<dt>Random Number Generators<dd>
|
<dt>Random Number Generators<dd>
|
||||||
NullRNG(), LC_RNG, RandomPool, BlockingRng, NonblockingRng, AutoSeededRandomPool, AutoSeededX917RNG
|
NullRNG(), LC_RNG, RandomPool, BlockingRng, NonblockingRng, AutoSeededRandomPool, AutoSeededX917RNG
|
||||||
|
<dt>Password-based Cryptography<dd>
|
||||||
|
PasswordBasedKeyDerivationFunction
|
||||||
<dt>Public Key Cryptosystems<dd>
|
<dt>Public Key Cryptosystems<dd>
|
||||||
DLIES, ECIES, LUCES, RSAES, RabinES, LUC_IES
|
DLIES, ECIES, LUCES, RSAES, RabinES, LUC_IES
|
||||||
<dt>Public Key Signature Schemes<dd>
|
<dt>Public Key Signature Schemes<dd>
|
||||||
|
|
@ -39,9 +41,9 @@
|
||||||
<dt>Filter Wrappers<dd>
|
<dt>Filter Wrappers<dd>
|
||||||
StreamTransformationFilter, HashFilter, HashVerificationFilter, SignerFilter, SignatureVerificationFilter
|
StreamTransformationFilter, HashFilter, HashVerificationFilter, SignerFilter, SignatureVerificationFilter
|
||||||
<dt>Binary to Text Encoders and Decoders<dd>
|
<dt>Binary to Text Encoders and Decoders<dd>
|
||||||
HexEncoder, HexDecoder, Base64Encoder, Base64Decoder
|
HexEncoder, HexDecoder, Base64Encoder, Base64Decoder, Base32Encoder, Base32Decoder
|
||||||
<dt>Wrappers for OS features<dd>
|
<dt>Wrappers for OS features<dd>
|
||||||
Timer, Socket, WindowsHandle, ThreadLocalStorage
|
Timer, Socket, WindowsHandle, ThreadLocalStorage, ThreadUserTimer
|
||||||
<dt>FIPS 140 related<dd>
|
<dt>FIPS 140 related<dd>
|
||||||
fips140.h
|
fips140.h
|
||||||
</dl>
|
</dl>
|
||||||
|
|
@ -51,19 +53,19 @@ In the FIPS 140-2 validated DLL version of Crypto++, only the following implemen
|
||||||
<dt>Block Ciphers<dd>
|
<dt>Block Ciphers<dd>
|
||||||
AES, DES_EDE2, DES_EDE3, SKIPJACK
|
AES, DES_EDE2, DES_EDE3, SKIPJACK
|
||||||
<dt>Cipher Modes (replace template parameter BC with one of the block ciphers above)<dd>
|
<dt>Cipher Modes (replace template parameter BC with one of the block ciphers above)<dd>
|
||||||
ECB_Mode <BC>, CTR_Mode <BC>, CBC_Mode <BC>, CFB_Mode <BC>, OFB_Mode <BC>
|
ECB_Mode\<BC\>, CTR_Mode\<BC\>, CBC_Mode\<BC\>, CFB_Mode\<BC\>, OFB_Mode\<BC\>
|
||||||
<dt>Hash Functions<dd>
|
<dt>Hash Functions<dd>
|
||||||
SHA
|
SHA
|
||||||
<dt>Public Key Signature Schemes<dd>
|
<dt>Public Key Signature Schemes<dd>
|
||||||
RSASSA <PKCS1v15, SHA>, DSA, ECDSA <ECP, SHA>, ECDSA <EC2N, SHA>
|
RSASS\<PKCS1v15, SHA\>, DSA, ECDSA\<ECP, SHA\>, ECDSA\<EC2N, SHA\>
|
||||||
<dt>Message Authentication Codes<dd>
|
<dt>Message Authentication Codes<dd>
|
||||||
HMAC <SHA>, CBC_MAC <DES_EDE2>, CBC_MAC <DES_EDE3>
|
HMAC\<SHA\>, CBC_MAC\<DES_EDE2\>, CBC_MAC\<DES_EDE3\>
|
||||||
<dt>Random Number Generators<dd>
|
<dt>Random Number Generators<dd>
|
||||||
AutoSeededX917RNG <DES_EDE3>
|
AutoSeededX917RNG\<DES_EDE3\>
|
||||||
<dt>Key Agreement<dd>
|
<dt>Key Agreement<dd>
|
||||||
#DH
|
#DH
|
||||||
<dt>Public Key Cryptosystems<dd>
|
<dt>Public Key Cryptosystems<dd>
|
||||||
RSAES <OAEP<SHA> >
|
RSAES\<OAEP\<SHA\> \>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<p>This reference manual is a work in progress. Some classes are still lacking detailed descriptions.
|
<p>This reference manual is a work in progress. Some classes are still lacking detailed descriptions.
|
||||||
|
|
@ -311,14 +313,14 @@ DOCUMENTED_NAMESPACE_BEGIN(Name)
|
||||||
// more names defined in argnames.h
|
// more names defined in argnames.h
|
||||||
DOCUMENTED_NAMESPACE_END
|
DOCUMENTED_NAMESPACE_END
|
||||||
|
|
||||||
//! .
|
//! empty set of name-value pairs
|
||||||
class CRYPTOPP_DLL NullNameValuePairs : public NameValuePairs
|
class CRYPTOPP_DLL NullNameValuePairs : public NameValuePairs
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const {return false;}
|
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const {return false;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
extern CRYPTOPP_DLL const NullNameValuePairs g_nullNameValuePairs;
|
extern CRYPTOPP_DLL const NullNameValuePairs g_nullNameValuePairs;
|
||||||
|
|
||||||
// ********************************************************
|
// ********************************************************
|
||||||
|
|
@ -578,7 +580,8 @@ protected:
|
||||||
void ThrowIfInvalidTruncatedSize(unsigned int size) const;
|
void ThrowIfInvalidTruncatedSize(unsigned int size) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
typedef HashTransformation HashFunction;
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SimpleKeyedTransformation : public T, public SimpleKeyingInterface
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SimpleKeyedTransformation : public T, public SimpleKeyingInterface
|
||||||
{
|
{
|
||||||
|
|
@ -587,12 +590,11 @@ public:
|
||||||
{SimpleKeyingInterface::ThrowIfInvalidKeyLength(*this, length);}
|
{SimpleKeyingInterface::ThrowIfInvalidKeyLength(*this, length);}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
|
||||||
typedef HashTransformation HashFunction;
|
|
||||||
#ifdef CRYPTOPP_DOXYGEN_PROCESSING
|
#ifdef CRYPTOPP_DOXYGEN_PROCESSING
|
||||||
//! These objects usually should not be used directly. See BlockTransformation for more details.
|
//! interface for one direction (encryption or decryption) of a block cipher
|
||||||
|
/*! \note These objects usually should not be used directly. See BlockTransformation for more details. */
|
||||||
class BlockCipher : public BlockTransformation, public SimpleKeyingInterface {};
|
class BlockCipher : public BlockTransformation, public SimpleKeyingInterface {};
|
||||||
//! interface for stream ciphers
|
//! interface for one direction (encryption or decryption) of a stream cipher or cipher mode
|
||||||
class SymmetricCipher : public StreamTransformation, public SimpleKeyingInterface {};
|
class SymmetricCipher : public StreamTransformation, public SimpleKeyingInterface {};
|
||||||
//! interface for message authentication codes
|
//! interface for message authentication codes
|
||||||
class MessageAuthenticationCode : public HashTransformation, public SimpleKeyingInterface {};
|
class MessageAuthenticationCode : public HashTransformation, public SimpleKeyingInterface {};
|
||||||
|
|
@ -600,11 +602,11 @@ class MessageAuthenticationCode : public HashTransformation, public SimpleKeying
|
||||||
typedef SimpleKeyedTransformation<BlockTransformation> BlockCipher;
|
typedef SimpleKeyedTransformation<BlockTransformation> BlockCipher;
|
||||||
typedef SimpleKeyedTransformation<StreamTransformation> SymmetricCipher;
|
typedef SimpleKeyedTransformation<StreamTransformation> SymmetricCipher;
|
||||||
typedef SimpleKeyedTransformation<HashTransformation> MessageAuthenticationCode;
|
typedef SimpleKeyedTransformation<HashTransformation> MessageAuthenticationCode;
|
||||||
|
#endif
|
||||||
|
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS SimpleKeyedTransformation<BlockTransformation>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS SimpleKeyedTransformation<BlockTransformation>;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS SimpleKeyedTransformation<StreamTransformation>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS SimpleKeyedTransformation<StreamTransformation>;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS SimpleKeyedTransformation<HashTransformation>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS SimpleKeyedTransformation<HashTransformation>;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
|
#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
|
||||||
typedef SymmetricCipher StreamCipher;
|
typedef SymmetricCipher StreamCipher;
|
||||||
|
|
@ -882,7 +884,6 @@ public:
|
||||||
|
|
||||||
//! \name NON-BLOCKING TRANSFER OF OUTPUT
|
//! \name NON-BLOCKING TRANSFER OF OUTPUT
|
||||||
//@{
|
//@{
|
||||||
//! .
|
|
||||||
virtual unsigned int TransferTo2(BufferedTransformation &target, unsigned long &byteCount, const std::string &channel=NULL_CHANNEL, bool blocking=true) =0;
|
virtual unsigned int TransferTo2(BufferedTransformation &target, unsigned long &byteCount, const std::string &channel=NULL_CHANNEL, bool blocking=true) =0;
|
||||||
virtual unsigned int CopyRangeTo2(BufferedTransformation &target, unsigned long &begin, unsigned long end=ULONG_MAX, const std::string &channel=NULL_CHANNEL, bool blocking=true) const =0;
|
virtual unsigned int CopyRangeTo2(BufferedTransformation &target, unsigned long &begin, unsigned long end=ULONG_MAX, const std::string &channel=NULL_CHANNEL, bool blocking=true) const =0;
|
||||||
unsigned int TransferMessagesTo2(BufferedTransformation &target, unsigned int &messageCount, const std::string &channel=NULL_CHANNEL, bool blocking=true);
|
unsigned int TransferMessagesTo2(BufferedTransformation &target, unsigned int &messageCount, const std::string &channel=NULL_CHANNEL, bool blocking=true);
|
||||||
|
|
@ -1140,7 +1141,7 @@ public:
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Encryptor : virtual public PK_CryptoSystem, public PublicKeyAlgorithm
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Encryptor : virtual public PK_CryptoSystem, public PublicKeyAlgorithm
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! .
|
//! exception thrown when trying to encrypt plaintext of invalid length
|
||||||
class CRYPTOPP_DLL InvalidPlaintextLength : public Exception
|
class CRYPTOPP_DLL InvalidPlaintextLength : public Exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
4
des.h
4
des.h
|
|
@ -21,6 +21,7 @@ protected:
|
||||||
FixedSizeSecBlock<word32, 32> k;
|
FixedSizeSecBlock<word32, 32> k;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
struct DES_Info : public FixedBlockSize<8>, public FixedKeyLength<8>
|
struct DES_Info : public FixedBlockSize<8>, public FixedKeyLength<8>
|
||||||
{
|
{
|
||||||
// disable DES in DLL version by not exporting this function
|
// disable DES in DLL version by not exporting this function
|
||||||
|
|
@ -50,6 +51,7 @@ public:
|
||||||
typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
|
typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
struct DES_EDE2_Info : public FixedBlockSize<8>, public FixedKeyLength<16>
|
struct DES_EDE2_Info : public FixedBlockSize<8>, public FixedKeyLength<16>
|
||||||
{
|
{
|
||||||
CRYPTOPP_DLL static const char * StaticAlgorithmName() {return "DES-EDE2";}
|
CRYPTOPP_DLL static const char * StaticAlgorithmName() {return "DES-EDE2";}
|
||||||
|
|
@ -73,6 +75,7 @@ public:
|
||||||
typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
|
typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
struct DES_EDE3_Info : public FixedBlockSize<8>, public FixedKeyLength<24>
|
struct DES_EDE3_Info : public FixedBlockSize<8>, public FixedKeyLength<24>
|
||||||
{
|
{
|
||||||
CRYPTOPP_DLL static const char * StaticAlgorithmName() {return "DES-EDE3";}
|
CRYPTOPP_DLL static const char * StaticAlgorithmName() {return "DES-EDE3";}
|
||||||
|
|
@ -96,6 +99,7 @@ public:
|
||||||
typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
|
typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
struct DES_XEX3_Info : public FixedBlockSize<8>, public FixedKeyLength<24>
|
struct DES_XEX3_Info : public FixedBlockSize<8>, public FixedKeyLength<24>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "DES-XEX3";}
|
static const char *StaticAlgorithmName() {return "DES-XEX3";}
|
||||||
|
|
|
||||||
8
dh.h
8
dh.h
|
|
@ -17,7 +17,7 @@ class DH_Domain : public DL_SimpleKeyAgreementDomainBase<typename GROUP_PARAMETE
|
||||||
public:
|
public:
|
||||||
typedef GROUP_PARAMETERS GroupParameters;
|
typedef GROUP_PARAMETERS GroupParameters;
|
||||||
typedef typename GroupParameters::Element Element;
|
typedef typename GroupParameters::Element Element;
|
||||||
typedef DL_KeyAgreementAlgorithm_DH<Element, COFACTOR_OPTION> KeyAgreementAlgorithm;
|
typedef DL_KeyAgreementAlgorithm_DH<Element, COFACTOR_OPTION> DH_Algorithm;
|
||||||
typedef DH_Domain<GROUP_PARAMETERS, COFACTOR_OPTION> Domain;
|
typedef DH_Domain<GROUP_PARAMETERS, COFACTOR_OPTION> Domain;
|
||||||
|
|
||||||
DH_Domain() {}
|
DH_Domain() {}
|
||||||
|
|
@ -76,9 +76,13 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string StaticAlgorithmName()
|
||||||
|
{return GroupParameters::StaticAlgorithmNamePrefix() + DH_Algorithm::StaticAlgorithmName();}
|
||||||
|
std::string AlgorithmName() const {return StaticAlgorithmName();}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const DL_KeyAgreementAlgorithm<Element> & GetKeyAgreementAlgorithm() const
|
const DL_KeyAgreementAlgorithm<Element> & GetKeyAgreementAlgorithm() const
|
||||||
{return Singleton<KeyAgreementAlgorithm>().Ref();}
|
{return Singleton<DH_Algorithm>().Ref();}
|
||||||
DL_GroupParameters<Element> & AccessAbstractGroupParameters()
|
DL_GroupParameters<Element> & AccessAbstractGroupParameters()
|
||||||
{return m_groupParameters;}
|
{return m_groupParameters;}
|
||||||
|
|
||||||
|
|
|
||||||
3
dmac.h
3
dmac.h
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DMAC_Base : public SameKeyLengthAs<T>, public MessageAuthenticationCode
|
class CRYPTOPP_NO_VTABLE DMAC_Base : public SameKeyLengthAs<T>, public MessageAuthenticationCode
|
||||||
{
|
{
|
||||||
|
|
@ -32,7 +33,7 @@ private:
|
||||||
|
|
||||||
//! DMAC
|
//! DMAC
|
||||||
/*! Based on "CBC MAC for Real-Time Data Sources" by Erez Petrank
|
/*! Based on "CBC MAC for Real-Time Data Sources" by Erez Petrank
|
||||||
and Charles Rackoff. T should be BlockTransformation class.
|
and Charles Rackoff. T should be a class derived from BlockCipherDocumentation.
|
||||||
*/
|
*/
|
||||||
template <class T>
|
template <class T>
|
||||||
class DMAC : public MessageAuthenticationCodeFinal<DMAC_Base<T> >
|
class DMAC : public MessageAuthenticationCodeFinal<DMAC_Base<T> >
|
||||||
|
|
|
||||||
2
ec2n.h
2
ec2n.h
|
|
@ -89,7 +89,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupPrecomputation<EC2N::Point>;
|
||||||
|
|
||||||
template <class T> class EcPrecomputation;
|
template <class T> class EcPrecomputation;
|
||||||
|
|
||||||
//! .
|
//! EC2N precomputation
|
||||||
template<> class EcPrecomputation<EC2N> : public DL_GroupPrecomputation<EC2N::Point>
|
template<> class EcPrecomputation<EC2N> : public DL_GroupPrecomputation<EC2N::Point>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
13
eccrypto.h
13
eccrypto.h
|
|
@ -93,6 +93,7 @@ public:
|
||||||
Integer GetMaxExponent() const {return GetSubgroupOrder()-1;}
|
Integer GetMaxExponent() const {return GetSubgroupOrder()-1;}
|
||||||
bool IsIdentity(const Element &element) const {return element.identity;}
|
bool IsIdentity(const Element &element) const {return element.identity;}
|
||||||
void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const;
|
void SimultaneousExponentiate(Element *results, const Element &base, const Integer *exponents, unsigned int exponentsCount) const;
|
||||||
|
static std::string StaticAlgorithmNamePrefix() {return "EC";}
|
||||||
|
|
||||||
// ASN1Key
|
// ASN1Key
|
||||||
OID GetAlgorithmID() const;
|
OID GetAlgorithmID() const;
|
||||||
|
|
@ -141,7 +142,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_EC<EC2N>;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl<DL_GroupParameters_EC<ECP> >;
|
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl<DL_GroupParameters_EC<ECP> >;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl<DL_GroupParameters_EC<EC2N> >;
|
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKeyImpl<DL_GroupParameters_EC<EC2N> >;
|
||||||
|
|
||||||
//! .
|
//! EC public key
|
||||||
template <class EC>
|
template <class EC>
|
||||||
class DL_PublicKey_EC : public DL_PublicKeyImpl<DL_GroupParameters_EC<EC> >
|
class DL_PublicKey_EC : public DL_PublicKeyImpl<DL_GroupParameters_EC<EC> >
|
||||||
{
|
{
|
||||||
|
|
@ -163,7 +164,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_EC<EC2N>;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl<DL_GroupParameters_EC<ECP> >;
|
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl<DL_GroupParameters_EC<ECP> >;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl<DL_GroupParameters_EC<EC2N> >;
|
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKeyImpl<DL_GroupParameters_EC<EC2N> >;
|
||||||
|
|
||||||
//! .
|
//! EC private key
|
||||||
template <class EC>
|
template <class EC>
|
||||||
class DL_PrivateKey_EC : public DL_PrivateKeyImpl<DL_GroupParameters_EC<EC> >
|
class DL_PrivateKey_EC : public DL_PrivateKeyImpl<DL_GroupParameters_EC<EC> >
|
||||||
{
|
{
|
||||||
|
|
@ -201,7 +202,7 @@ struct ECMQV
|
||||||
typedef MQV_Domain<DL_GroupParameters_EC<EC>, COFACTOR_OPTION> Domain;
|
typedef MQV_Domain<DL_GroupParameters_EC<EC>, COFACTOR_OPTION> Domain;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! EC keys
|
||||||
template <class EC>
|
template <class EC>
|
||||||
struct DL_Keys_EC
|
struct DL_Keys_EC
|
||||||
{
|
{
|
||||||
|
|
@ -212,7 +213,7 @@ struct DL_Keys_EC
|
||||||
template <class EC, class H = SHA>
|
template <class EC, class H = SHA>
|
||||||
struct ECDSA;
|
struct ECDSA;
|
||||||
|
|
||||||
//! .
|
//! ECDSA keys
|
||||||
template <class EC>
|
template <class EC>
|
||||||
struct DL_Keys_ECDSA
|
struct DL_Keys_ECDSA
|
||||||
{
|
{
|
||||||
|
|
@ -223,7 +224,7 @@ struct DL_Keys_ECDSA
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA<ECP::Point>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA<ECP::Point>;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA<EC2N::Point>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA<EC2N::Point>;
|
||||||
|
|
||||||
//! .
|
//! ECDSA algorithm
|
||||||
template <class EC>
|
template <class EC>
|
||||||
class DL_Algorithm_ECDSA : public DL_Algorithm_GDSA<typename EC::Point>
|
class DL_Algorithm_ECDSA : public DL_Algorithm_GDSA<typename EC::Point>
|
||||||
{
|
{
|
||||||
|
|
@ -231,7 +232,7 @@ public:
|
||||||
static const char * StaticAlgorithmName() {return "ECDSA";}
|
static const char * StaticAlgorithmName() {return "ECDSA";}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! ECNR algorithm
|
||||||
template <class EC>
|
template <class EC>
|
||||||
class DL_Algorithm_ECNR : public DL_Algorithm_NR<typename EC::Point>
|
class DL_Algorithm_ECNR : public DL_Algorithm_NR<typename EC::Point>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
2
ecp.h
2
ecp.h
|
|
@ -93,7 +93,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupPrecomputation<ECP::Point>;
|
||||||
|
|
||||||
template <class T> class EcPrecomputation;
|
template <class T> class EcPrecomputation;
|
||||||
|
|
||||||
//! .
|
//! ECP precomputation
|
||||||
template<> class EcPrecomputation<ECP> : public DL_GroupPrecomputation<ECP::Point>
|
template<> class EcPrecomputation<ECP> : public DL_GroupPrecomputation<ECP::Point>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
6
esign.h
6
esign.h
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class ESIGNFunction : public TrapdoorFunction, public PublicKey, public ASN1CryptoMaterial
|
class ESIGNFunction : public TrapdoorFunction, public PublicKey, public ASN1CryptoMaterial
|
||||||
{
|
{
|
||||||
typedef ESIGNFunction ThisClass;
|
typedef ESIGNFunction ThisClass;
|
||||||
|
|
@ -47,7 +47,7 @@ protected:
|
||||||
Integer m_n, m_e;
|
Integer m_n, m_e;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class InvertibleESIGNFunction : public ESIGNFunction, public RandomizedTrapdoorFunctionInverse, public PrivateKey
|
class InvertibleESIGNFunction : public ESIGNFunction, public RandomizedTrapdoorFunctionInverse, public PrivateKey
|
||||||
{
|
{
|
||||||
typedef InvertibleESIGNFunction ThisClass;
|
typedef InvertibleESIGNFunction ThisClass;
|
||||||
|
|
@ -81,7 +81,7 @@ protected:
|
||||||
Integer m_p, m_q;
|
Integer m_p, m_q;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class EMSA5Pad : public PK_DeterministicSignatureMessageEncodingMethod
|
class EMSA5Pad : public PK_DeterministicSignatureMessageEncodingMethod
|
||||||
{
|
{
|
||||||
|
|
|
||||||
26
factory.h
26
factory.h
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class AbstractClass>
|
template <class AbstractClass>
|
||||||
class ObjectFactory
|
class ObjectFactory
|
||||||
{
|
{
|
||||||
|
|
@ -13,6 +14,7 @@ public:
|
||||||
virtual AbstractClass * CreateObject() const =0;
|
virtual AbstractClass * CreateObject() const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class AbstractClass, class ConcreteClass>
|
template <class AbstractClass, class ConcreteClass>
|
||||||
class DefaultObjectFactory : public ObjectFactory<AbstractClass>
|
class DefaultObjectFactory : public ObjectFactory<AbstractClass>
|
||||||
{
|
{
|
||||||
|
|
@ -24,10 +26,17 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class AbstractClass, int instance=0>
|
template <class AbstractClass, int instance=0>
|
||||||
class ObjectFactoryRegistry
|
class ObjectFactoryRegistry
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
class FactoryNotFound : public Exception
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FactoryNotFound(const char *name) : Exception(OTHER_ERROR, std::string("ObjectFactoryRegistry: could not find factory for algorithm ") + name) {}
|
||||||
|
};
|
||||||
|
|
||||||
~ObjectFactoryRegistry()
|
~ObjectFactoryRegistry()
|
||||||
{
|
{
|
||||||
for (CPP_TYPENAME Map::iterator i = m_map.begin(); i != m_map.end(); ++i)
|
for (CPP_TYPENAME Map::iterator i = m_map.begin(); i != m_map.end(); ++i)
|
||||||
|
|
@ -37,7 +46,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegisterFactory(const char *name, ObjectFactory<AbstractClass> *factory)
|
void RegisterFactory(const std::string &name, ObjectFactory<AbstractClass> *factory)
|
||||||
{
|
{
|
||||||
m_map[name] = factory;
|
m_map[name] = factory;
|
||||||
}
|
}
|
||||||
|
|
@ -51,7 +60,9 @@ public:
|
||||||
AbstractClass *CreateObject(const char *name) const
|
AbstractClass *CreateObject(const char *name) const
|
||||||
{
|
{
|
||||||
const ObjectFactory<AbstractClass> *factory = GetFactory(name);
|
const ObjectFactory<AbstractClass> *factory = GetFactory(name);
|
||||||
return factory ? factory->CreateObject() : NULL;
|
if (!factory)
|
||||||
|
throw FactoryNotFound(name);
|
||||||
|
return factory->CreateObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
// VC60 workaround: use "..." to prevent this function from being inlined
|
// VC60 workaround: use "..." to prevent this function from being inlined
|
||||||
|
|
@ -72,27 +83,28 @@ ObjectFactoryRegistry<AbstractClass, instance> & ObjectFactoryRegistry<AbstractC
|
||||||
|
|
||||||
template <class AbstractClass, class ConcreteClass, int instance = 0>
|
template <class AbstractClass, class ConcreteClass, int instance = 0>
|
||||||
struct RegisterDefaultFactoryFor {
|
struct RegisterDefaultFactoryFor {
|
||||||
RegisterDefaultFactoryFor(const char *name)
|
RegisterDefaultFactoryFor(const char *name=NULL)
|
||||||
{
|
{
|
||||||
ObjectFactoryRegistry<AbstractClass, instance>::Registry().RegisterFactory(name, new DefaultObjectFactory<AbstractClass, ConcreteClass>);
|
ObjectFactoryRegistry<AbstractClass, instance>::Registry().
|
||||||
|
RegisterFactory(name ? name : ConcreteClass::StaticAlgorithmName(), new DefaultObjectFactory<AbstractClass, ConcreteClass>);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
template <class SchemeClass>
|
template <class SchemeClass>
|
||||||
void RegisterAsymmetricCipherDefaultFactories(const char *name, SchemeClass *dummy=NULL)
|
void RegisterAsymmetricCipherDefaultFactories(const char *name=NULL, SchemeClass *dummy=NULL)
|
||||||
{
|
{
|
||||||
RegisterDefaultFactoryFor<PK_Encryptor, CPP_TYPENAME SchemeClass::Encryptor>((const char *)name);
|
RegisterDefaultFactoryFor<PK_Encryptor, CPP_TYPENAME SchemeClass::Encryptor>((const char *)name);
|
||||||
RegisterDefaultFactoryFor<PK_Decryptor, CPP_TYPENAME SchemeClass::Decryptor>((const char *)name);
|
RegisterDefaultFactoryFor<PK_Decryptor, CPP_TYPENAME SchemeClass::Decryptor>((const char *)name);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class SchemeClass>
|
template <class SchemeClass>
|
||||||
void RegisterSignatureSchemeDefaultFactories(const char *name, SchemeClass *dummy=NULL)
|
void RegisterSignatureSchemeDefaultFactories(const char *name=NULL, SchemeClass *dummy=NULL)
|
||||||
{
|
{
|
||||||
RegisterDefaultFactoryFor<PK_Signer, CPP_TYPENAME SchemeClass::Signer>((const char *)name);
|
RegisterDefaultFactoryFor<PK_Signer, CPP_TYPENAME SchemeClass::Signer>((const char *)name);
|
||||||
RegisterDefaultFactoryFor<PK_Verifier, CPP_TYPENAME SchemeClass::Verifier>((const char *)name);
|
RegisterDefaultFactoryFor<PK_Verifier, CPP_TYPENAME SchemeClass::Verifier>((const char *)name);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class SchemeClass>
|
template <class SchemeClass>
|
||||||
void RegisterSymmetricCipherDefaultFactories(const char *name, SchemeClass *dummy=NULL)
|
void RegisterSymmetricCipherDefaultFactories(const char *name=NULL, SchemeClass *dummy=NULL)
|
||||||
{
|
{
|
||||||
RegisterDefaultFactoryFor<SymmetricCipher, CPP_TYPENAME SchemeClass::Encryption, ENCRYPTION>((const char *)name);
|
RegisterDefaultFactoryFor<SymmetricCipher, CPP_TYPENAME SchemeClass::Encryption, ENCRYPTION>((const char *)name);
|
||||||
RegisterDefaultFactoryFor<SymmetricCipher, CPP_TYPENAME SchemeClass::Decryption, DECRYPTION>((const char *)name);
|
RegisterDefaultFactoryFor<SymmetricCipher, CPP_TYPENAME SchemeClass::Decryption, DECRYPTION>((const char *)name);
|
||||||
|
|
|
||||||
6
files.h
6
files.h
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! .
|
//! file-based implementation of Store interface
|
||||||
class CRYPTOPP_DLL FileStore : public Store, private FilterPutSpaceHelper, public NotCopyable
|
class CRYPTOPP_DLL FileStore : public Store, private FilterPutSpaceHelper, public NotCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -45,7 +45,7 @@ private:
|
||||||
bool m_waiting;
|
bool m_waiting;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! file-based implementation of Source interface
|
||||||
class CRYPTOPP_DLL FileSource : public SourceTemplate<FileStore>
|
class CRYPTOPP_DLL FileSource : public SourceTemplate<FileStore>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -63,7 +63,7 @@ public:
|
||||||
std::istream* GetStream() {return m_store.GetStream();}
|
std::istream* GetStream() {return m_store.GetStream();}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! file-based implementation of Sink interface
|
||||||
class CRYPTOPP_DLL FileSink : public Sink, public NotCopyable
|
class CRYPTOPP_DLL FileSink : public Sink, public NotCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
18
filters.h
18
filters.h
|
|
@ -109,14 +109,14 @@ private:
|
||||||
unsigned int m_currentSeriesMessages, m_totalMessages, m_totalMessageSeries;
|
unsigned int m_currentSeriesMessages, m_totalMessages, m_totalMessageSeries;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL TransparentFilter : public MeterFilter
|
class CRYPTOPP_DLL TransparentFilter : public MeterFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TransparentFilter(BufferedTransformation *attachment=NULL) : MeterFilter(attachment, true) {}
|
TransparentFilter(BufferedTransformation *attachment=NULL) : MeterFilter(attachment, true) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL OpaqueFilter : public MeterFilter
|
class CRYPTOPP_DLL OpaqueFilter : public MeterFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -210,7 +210,7 @@ private:
|
||||||
BlockQueue m_queue;
|
BlockQueue m_queue;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL FilterWithInputQueue : public Filter
|
class CRYPTOPP_DLL FilterWithInputQueue : public Filter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -571,7 +571,7 @@ public:
|
||||||
byte * CreatePutSpace(unsigned int &size) {return BufferedTransformation::CreatePutSpace(size);}
|
byte * CreatePutSpace(unsigned int &size) {return BufferedTransformation::CreatePutSpace(size);}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! string-based implementation of Store interface
|
||||||
class StringStore : public Store
|
class StringStore : public Store
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -592,7 +592,7 @@ private:
|
||||||
unsigned int m_length, m_count;
|
unsigned int m_length, m_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! RNG-based implementation of Source interface
|
||||||
class CRYPTOPP_DLL RandomNumberStore : public Store
|
class CRYPTOPP_DLL RandomNumberStore : public Store
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -619,7 +619,7 @@ private:
|
||||||
unsigned long m_count;
|
unsigned long m_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! empty store
|
||||||
class CRYPTOPP_DLL NullStore : public Store
|
class CRYPTOPP_DLL NullStore : public Store
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -638,7 +638,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Source : public InputRejecting<Filter>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Source(BufferedTransformation *attachment = NULL)
|
Source(BufferedTransformation *attachment = NULL)
|
||||||
{Detach(attachment);}
|
{Source::Detach(attachment);}
|
||||||
|
|
||||||
unsigned long Pump(unsigned long pumpMax=ULONG_MAX)
|
unsigned long Pump(unsigned long pumpMax=ULONG_MAX)
|
||||||
{Pump2(pumpMax); return pumpMax;}
|
{Pump2(pumpMax); return pumpMax;}
|
||||||
|
|
@ -686,7 +686,7 @@ protected:
|
||||||
T m_store;
|
T m_store;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! string-based implementation of Source interface
|
||||||
class CRYPTOPP_DLL StringSource : public SourceTemplate<StringStore>
|
class CRYPTOPP_DLL StringSource : public SourceTemplate<StringStore>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -700,7 +700,7 @@ public:
|
||||||
: SourceTemplate<StringStore>(attachment) {SourceInitialize(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter(string)));}
|
: SourceTemplate<StringStore>(attachment) {SourceInitialize(pumpAll, MakeParameters("InputBuffer", ConstByteArrayParameter(string)));}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! RNG-based implementation of Source interface
|
||||||
class CRYPTOPP_DLL RandomNumberSource : public SourceTemplate<RandomNumberStore>
|
class CRYPTOPP_DLL RandomNumberSource : public SourceTemplate<RandomNumberStore>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
30
gfpcrypt.h
30
gfpcrypt.h
|
|
@ -19,7 +19,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters<Integer>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters<Integer>;
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE DL_GroupParameters_IntegerBased : public DL_GroupParameters<Integer>, public ASN1CryptoMaterial
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE DL_GroupParameters_IntegerBased : public DL_GroupParameters<Integer>, public ASN1CryptoMaterial
|
||||||
{
|
{
|
||||||
typedef DL_GroupParameters_IntegerBased ThisClass;
|
typedef DL_GroupParameters_IntegerBased ThisClass;
|
||||||
|
|
@ -57,6 +57,7 @@ public:
|
||||||
Integer ConvertElementToInteger(const Element &element) const
|
Integer ConvertElementToInteger(const Element &element) const
|
||||||
{return element;}
|
{return element;}
|
||||||
Integer GetMaxExponent() const;
|
Integer GetMaxExponent() const;
|
||||||
|
static std::string StaticAlgorithmNamePrefix() {return "";}
|
||||||
|
|
||||||
OID GetAlgorithmID() const;
|
OID GetAlgorithmID() const;
|
||||||
|
|
||||||
|
|
@ -78,7 +79,7 @@ private:
|
||||||
Integer m_q;
|
Integer m_q;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class GROUP_PRECOMP, class BASE_PRECOMP = DL_FixedBasePrecomputationImpl<CPP_TYPENAME GROUP_PRECOMP::Element> >
|
template <class GROUP_PRECOMP, class BASE_PRECOMP = DL_FixedBasePrecomputationImpl<CPP_TYPENAME GROUP_PRECOMP::Element> >
|
||||||
class CRYPTOPP_NO_VTABLE DL_GroupParameters_IntegerBasedImpl : public DL_GroupParametersImpl<GROUP_PRECOMP, BASE_PRECOMP, DL_GroupParameters_IntegerBased>
|
class CRYPTOPP_NO_VTABLE DL_GroupParameters_IntegerBasedImpl : public DL_GroupParametersImpl<GROUP_PRECOMP, BASE_PRECOMP, DL_GroupParameters_IntegerBased>
|
||||||
{
|
{
|
||||||
|
|
@ -114,7 +115,7 @@ public:
|
||||||
|
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_IntegerBasedImpl<ModExpPrecomputation>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupParameters_IntegerBasedImpl<ModExpPrecomputation>;
|
||||||
|
|
||||||
//! .
|
//! GF(p) group parameters
|
||||||
class CRYPTOPP_DLL DL_GroupParameters_GFP : public DL_GroupParameters_IntegerBasedImpl<ModExpPrecomputation>
|
class CRYPTOPP_DLL DL_GroupParameters_GFP : public DL_GroupParameters_IntegerBasedImpl<ModExpPrecomputation>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -136,7 +137,7 @@ protected:
|
||||||
int GetFieldType() const {return 1;}
|
int GetFieldType() const {return 1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! GF(p) group parameters that default to same primes
|
||||||
class CRYPTOPP_DLL DL_GroupParameters_GFP_DefaultSafePrime : public DL_GroupParameters_GFP
|
class CRYPTOPP_DLL DL_GroupParameters_GFP_DefaultSafePrime : public DL_GroupParameters_GFP
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -146,7 +147,7 @@ protected:
|
||||||
unsigned int GetDefaultSubgroupOrderSize(unsigned int modulusSize) const {return modulusSize-1;}
|
unsigned int GetDefaultSubgroupOrderSize(unsigned int modulusSize) const {return modulusSize-1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! GDSA algorithm
|
||||||
template <class T>
|
template <class T>
|
||||||
class DL_Algorithm_GDSA : public DL_ElgamalLikeSignatureAlgorithm<T>
|
class DL_Algorithm_GDSA : public DL_ElgamalLikeSignatureAlgorithm<T>
|
||||||
{
|
{
|
||||||
|
|
@ -178,7 +179,7 @@ public:
|
||||||
|
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA<Integer>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS DL_Algorithm_GDSA<Integer>;
|
||||||
|
|
||||||
//! .
|
//! NR algorithm
|
||||||
template <class T>
|
template <class T>
|
||||||
class DL_Algorithm_NR : public DL_ElgamalLikeSignatureAlgorithm<T>
|
class DL_Algorithm_NR : public DL_ElgamalLikeSignatureAlgorithm<T>
|
||||||
{
|
{
|
||||||
|
|
@ -224,7 +225,7 @@ public:
|
||||||
{this->GetPublicElement().DEREncode(bt);}
|
{this->GetPublicElement().DEREncode(bt);}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! DL private key (in GF(p) groups)
|
||||||
template <class GP>
|
template <class GP>
|
||||||
class DL_PrivateKey_GFP : public DL_PrivateKeyImpl<GP>
|
class DL_PrivateKey_GFP : public DL_PrivateKeyImpl<GP>
|
||||||
{
|
{
|
||||||
|
|
@ -243,7 +244,7 @@ public:
|
||||||
{this->AccessGroupParameters().Initialize(p, q, g); this->SetPrivateExponent(x);}
|
{this->AccessGroupParameters().Initialize(p, q, g); this->SetPrivateExponent(x);}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! DL signing/verification keys (in GF(p) groups)
|
||||||
struct DL_SignatureKeys_GFP
|
struct DL_SignatureKeys_GFP
|
||||||
{
|
{
|
||||||
typedef DL_GroupParameters_GFP GroupParameters;
|
typedef DL_GroupParameters_GFP GroupParameters;
|
||||||
|
|
@ -251,7 +252,7 @@ struct DL_SignatureKeys_GFP
|
||||||
typedef DL_PrivateKey_GFP<GroupParameters> PrivateKey;
|
typedef DL_PrivateKey_GFP<GroupParameters> PrivateKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! DL encryption/decryption keys (in GF(p) groups)
|
||||||
struct DL_CryptoKeys_GFP
|
struct DL_CryptoKeys_GFP
|
||||||
{
|
{
|
||||||
typedef DL_GroupParameters_GFP_DefaultSafePrime GroupParameters;
|
typedef DL_GroupParameters_GFP_DefaultSafePrime GroupParameters;
|
||||||
|
|
@ -359,20 +360,20 @@ struct NR : public DL_SS<
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! DSA group parameters, these are GF(p) group parameters that are allowed by the DSA standard
|
||||||
class CRYPTOPP_DLL DL_GroupParameters_DSA : public DL_GroupParameters_GFP
|
class CRYPTOPP_DLL DL_GroupParameters_DSA : public DL_GroupParameters_GFP
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/*! also checks that the lengths of p and q are allowed by the DSA standard */
|
/*! also checks that the lengths of p and q are allowed by the DSA standard */
|
||||||
bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const;
|
bool ValidateGroup(RandomNumberGenerator &rng, unsigned int level) const;
|
||||||
/*! parameters: (ModulusSize), or (Modulus, SubgroupOrder, SubgroupGenerator) */
|
/*! parameters: (ModulusSize), or (Modulus, SubgroupOrder, SubgroupGenerator) */
|
||||||
/*! ModulusSize must be between 512 and 1024, and divisible by 64 */
|
/*! ModulusSize must be between DSA::MIN_PRIME_LENGTH and DSA::MAX_PRIME_LENGTH, and divisible by DSA::PRIME_LENGTH_MULTIPLE */
|
||||||
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg);
|
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DSA;
|
struct DSA;
|
||||||
|
|
||||||
//! .
|
//! DSA keys
|
||||||
struct DL_Keys_DSA
|
struct DL_Keys_DSA
|
||||||
{
|
{
|
||||||
typedef DL_PublicKey_GFP<DL_GroupParameters_DSA> PublicKey;
|
typedef DL_PublicKey_GFP<DL_GroupParameters_DSA> PublicKey;
|
||||||
|
|
@ -400,6 +401,7 @@ struct CRYPTOPP_DLL DSA : public DL_SS<
|
||||||
static bool IsValidPrimeLength(unsigned int pbits)
|
static bool IsValidPrimeLength(unsigned int pbits)
|
||||||
{return pbits >= MIN_PRIME_LENGTH && pbits <= MAX_PRIME_LENGTH && pbits % PRIME_LENGTH_MULTIPLE == 0;}
|
{return pbits >= MIN_PRIME_LENGTH && pbits <= MAX_PRIME_LENGTH && pbits % PRIME_LENGTH_MULTIPLE == 0;}
|
||||||
|
|
||||||
|
//! FIPS 186-2 Change Notice 1 changed the minimum modulus length to 1024
|
||||||
enum {
|
enum {
|
||||||
#if (DSA_1024_BIT_MODULUS_ONLY)
|
#if (DSA_1024_BIT_MODULUS_ONLY)
|
||||||
MIN_PRIME_LENGTH = 1024,
|
MIN_PRIME_LENGTH = 1024,
|
||||||
|
|
@ -413,7 +415,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS DL_PublicKey_GFP<DL_GroupParameters_DSA>;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_GFP<DL_GroupParameters_DSA>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_GFP<DL_GroupParameters_DSA>;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest<DL_PrivateKey_GFP<DL_GroupParameters_DSA>, DSA>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS DL_PrivateKey_WithSignaturePairwiseConsistencyTest<DL_PrivateKey_GFP<DL_GroupParameters_DSA>, DSA>;
|
||||||
|
|
||||||
//! .
|
//! the XOR encryption method, for use with DL-based cryptosystems
|
||||||
template <class MAC, bool DHAES_MODE>
|
template <class MAC, bool DHAES_MODE>
|
||||||
class DL_EncryptionAlgorithm_Xor : public DL_SymmetricEncryptionAlgorithm
|
class DL_EncryptionAlgorithm_Xor : public DL_SymmetricEncryptionAlgorithm
|
||||||
{
|
{
|
||||||
|
|
@ -489,7 +491,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T, bool DHAES_MODE, class KDF>
|
template <class T, bool DHAES_MODE, class KDF>
|
||||||
class DL_KeyDerivationAlgorithm_P1363 : public DL_KeyDerivationAlgorithm<T>
|
class DL_KeyDerivationAlgorithm_P1363 : public DL_KeyDerivationAlgorithm<T>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
1
gost.h
1
gost.h
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct GOST_Info : public FixedBlockSize<8>, public FixedKeyLength<32>
|
struct GOST_Info : public FixedBlockSize<8>, public FixedKeyLength<32>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "GOST";}
|
static const char *StaticAlgorithmName() {return "GOST";}
|
||||||
|
|
|
||||||
1
hmac.h
1
hmac.h
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE HMAC_Base : public VariableKeyLength<16, 0, UINT_MAX>, public MessageAuthenticationCode
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE HMAC_Base : public VariableKeyLength<16, 0, UINT_MAX>, public MessageAuthenticationCode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
class TimerBase
|
class TimerBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
1
idea.h
1
idea.h
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct IDEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public FixedRounds<8>
|
struct IDEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public FixedRounds<8>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "IDEA";}
|
static const char *StaticAlgorithmName() {return "IDEA";}
|
||||||
|
|
|
||||||
11
iterhash.h
11
iterhash.h
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class T, class BASE>
|
template <class T, class BASE>
|
||||||
class CRYPTOPP_NO_VTABLE IteratedHashBase : public BASE
|
class CRYPTOPP_NO_VTABLE IteratedHashBase : public BASE
|
||||||
{
|
{
|
||||||
|
|
@ -15,8 +16,6 @@ public:
|
||||||
typedef T HashWordType;
|
typedef T HashWordType;
|
||||||
|
|
||||||
IteratedHashBase() : m_countHi(0), m_countLo(0) {}
|
IteratedHashBase() : m_countHi(0), m_countLo(0) {}
|
||||||
void SetBlockSize(unsigned int blockSize) {m_data.resize(blockSize / sizeof(HashWordType));}
|
|
||||||
void SetStateSize(unsigned int stateSize) {m_digest.resize(stateSize / sizeof(HashWordType));}
|
|
||||||
unsigned int BlockSize() const {return m_data.size() * sizeof(T);}
|
unsigned int BlockSize() const {return m_data.size() * sizeof(T);}
|
||||||
unsigned int OptimalBlockSize() const {return BlockSize();}
|
unsigned int OptimalBlockSize() const {return BlockSize();}
|
||||||
unsigned int OptimalDataAlignment() const {return sizeof(T);}
|
unsigned int OptimalDataAlignment() const {return sizeof(T);}
|
||||||
|
|
@ -25,6 +24,9 @@ public:
|
||||||
void Restart();
|
void Restart();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void SetBlockSize(unsigned int blockSize) {m_data.resize(blockSize / sizeof(HashWordType));}
|
||||||
|
void SetStateSize(unsigned int stateSize) {m_digest.resize(stateSize / sizeof(HashWordType));}
|
||||||
|
|
||||||
T GetBitCountHi() const {return (m_countLo >> (8*sizeof(T)-3)) + (m_countHi << 3);}
|
T GetBitCountHi() const {return (m_countLo >> (8*sizeof(T)-3)) + (m_countHi << 3);}
|
||||||
T GetBitCountLo() const {return m_countLo << 3;}
|
T GetBitCountLo() const {return m_countLo << 3;}
|
||||||
|
|
||||||
|
|
@ -48,7 +50,7 @@ CRYPTOPP_STATIC_TEMPLATE_CLASS IteratedHashBase<word64, MessageAuthenticationCod
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS IteratedHashBase<word32, HashTransformation>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS IteratedHashBase<word32, HashTransformation>;
|
||||||
CRYPTOPP_STATIC_TEMPLATE_CLASS IteratedHashBase<word32, MessageAuthenticationCode>;
|
CRYPTOPP_STATIC_TEMPLATE_CLASS IteratedHashBase<word32, MessageAuthenticationCode>;
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T, class B, class BASE>
|
template <class T, class B, class BASE>
|
||||||
class CRYPTOPP_NO_VTABLE IteratedHashBase2 : public IteratedHashBase<T, BASE>
|
class CRYPTOPP_NO_VTABLE IteratedHashBase2 : public IteratedHashBase<T, BASE>
|
||||||
{
|
{
|
||||||
|
|
@ -68,7 +70,7 @@ protected:
|
||||||
virtual void HashEndianCorrectedBlock(const HashWordType *data) =0;
|
virtual void HashEndianCorrectedBlock(const HashWordType *data) =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T_HashWordType, class T_Endianness, unsigned int T_BlockSize, class T_Base = HashTransformation>
|
template <class T_HashWordType, class T_Endianness, unsigned int T_BlockSize, class T_Base = HashTransformation>
|
||||||
class CRYPTOPP_NO_VTABLE IteratedHash : public IteratedHashBase2<T_HashWordType, T_Endianness, T_Base>
|
class CRYPTOPP_NO_VTABLE IteratedHash : public IteratedHashBase2<T_HashWordType, T_Endianness, T_Base>
|
||||||
{
|
{
|
||||||
|
|
@ -80,6 +82,7 @@ protected:
|
||||||
IteratedHash() {this->SetBlockSize(T_BlockSize);}
|
IteratedHash() {this->SetBlockSize(T_BlockSize);}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class T_HashWordType, class T_Endianness, unsigned int T_BlockSize, unsigned int T_StateSize, class T_Transform, unsigned int T_DigestSize = T_StateSize>
|
template <class T_HashWordType, class T_Endianness, unsigned int T_BlockSize, unsigned int T_StateSize, class T_Transform, unsigned int T_DigestSize = T_StateSize>
|
||||||
class CRYPTOPP_NO_VTABLE IteratedHashWithStaticTransform
|
class CRYPTOPP_NO_VTABLE IteratedHashWithStaticTransform
|
||||||
: public ClonableImpl<T_Transform, AlgorithmImpl<IteratedHash<T_HashWordType, T_Endianness, T_BlockSize>, T_Transform> >
|
: public ClonableImpl<T_Transform, AlgorithmImpl<IteratedHash<T_HashWordType, T_Endianness, T_BlockSize>, T_Transform> >
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
template <class T> struct DigestSizeDoubleWorkaround {enum {RESULT = 2*T::DIGESTSIZE};}; // VC60 workaround
|
template <class T> struct DigestSizeDoubleWorkaround {enum {RESULT = 2*T::DIGESTSIZE};}; // VC60 workaround
|
||||||
|
|
||||||
//! .
|
//! algorithm info
|
||||||
template <class T>
|
template <class T>
|
||||||
struct LR_Info : public VariableKeyLength<16, 0, 2*(UINT_MAX/2), 2>, public FixedBlockSize<DigestSizeDoubleWorkaround<T>::RESULT>
|
struct LR_Info : public VariableKeyLength<16, 0, 2*(UINT_MAX/2), 2>, public FixedBlockSize<DigestSizeDoubleWorkaround<T>::RESULT>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
14
luc.h
14
luc.h
|
|
@ -49,7 +49,7 @@ protected:
|
||||||
Integer m_n, m_e;
|
Integer m_n, m_e;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class InvertibleLUCFunction : public LUCFunction, public TrapdoorFunctionInverse, public PrivateKey
|
class InvertibleLUCFunction : public LUCFunction, public TrapdoorFunctionInverse, public PrivateKey
|
||||||
{
|
{
|
||||||
typedef InvertibleLUCFunction ThisClass;
|
typedef InvertibleLUCFunction ThisClass;
|
||||||
|
|
@ -127,7 +127,7 @@ private:
|
||||||
Integer m_p;
|
Integer m_p;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class DL_BasePrecomputation_LUC : public DL_FixedBasePrecomputation<Integer>
|
class DL_BasePrecomputation_LUC : public DL_FixedBasePrecomputation<Integer>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -146,7 +146,7 @@ private:
|
||||||
Integer m_g;
|
Integer m_g;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class DL_GroupParameters_LUC : public DL_GroupParameters_IntegerBasedImpl<DL_GroupPrecomputation_LUC, DL_BasePrecomputation_LUC>
|
class DL_GroupParameters_LUC : public DL_GroupParameters_IntegerBasedImpl<DL_GroupPrecomputation_LUC, DL_BasePrecomputation_LUC>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -168,7 +168,7 @@ private:
|
||||||
int GetFieldType() const {return 2;}
|
int GetFieldType() const {return 2;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class DL_GroupParameters_LUC_DefaultSafePrime : public DL_GroupParameters_LUC
|
class DL_GroupParameters_LUC_DefaultSafePrime : public DL_GroupParameters_LUC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -178,7 +178,7 @@ protected:
|
||||||
unsigned int GetDefaultSubgroupOrderSize(unsigned int modulusSize) const {return modulusSize-1;}
|
unsigned int GetDefaultSubgroupOrderSize(unsigned int modulusSize) const {return modulusSize-1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class DL_Algorithm_LUC_HMP : public DL_ElgamalLikeSignatureAlgorithm<Integer>
|
class DL_Algorithm_LUC_HMP : public DL_ElgamalLikeSignatureAlgorithm<Integer>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -191,7 +191,7 @@ public:
|
||||||
{return params.GetGroupOrder().ByteCount();}
|
{return params.GetGroupOrder().ByteCount();}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
struct DL_SignatureKeys_LUC
|
struct DL_SignatureKeys_LUC
|
||||||
{
|
{
|
||||||
typedef DL_GroupParameters_LUC GroupParameters;
|
typedef DL_GroupParameters_LUC GroupParameters;
|
||||||
|
|
@ -205,7 +205,7 @@ struct LUC_HMP : public DL_SS<DL_SignatureKeys_LUC, DL_Algorithm_LUC_HMP, DL_Sig
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
struct DL_CryptoKeys_LUC
|
struct DL_CryptoKeys_LUC
|
||||||
{
|
{
|
||||||
typedef DL_GroupParameters_LUC_DefaultSafePrime GroupParameters;
|
typedef DL_GroupParameters_LUC_DefaultSafePrime GroupParameters;
|
||||||
|
|
|
||||||
1
mars.h
1
mars.h
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 56, 4>
|
struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 56, 4>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "MARS";}
|
static const char *StaticAlgorithmName() {return "MARS";}
|
||||||
|
|
|
||||||
3
md5mac.h
3
md5mac.h
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! .
|
|
||||||
class CRYPTOPP_NO_VTABLE MD5MAC_Base : public FixedKeyLength<16>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>
|
class CRYPTOPP_NO_VTABLE MD5MAC_Base : public FixedKeyLength<16>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -32,7 +31,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
//! <a href="http://www.weidai.com/scan-mirror/mac.html#MD5-MAC">MD5-MAC</a>
|
//! <a href="http://www.weidai.com/scan-mirror/mac.html#MD5-MAC">MD5-MAC</a>
|
||||||
typedef MessageAuthenticationCodeFinal<MD5MAC_Base> MD5MAC;
|
DOCUMENTED_TYPEDEF(MessageAuthenticationCodeFinal<MD5MAC_Base>, MD5MAC)
|
||||||
|
|
||||||
NAMESPACE_END
|
NAMESPACE_END
|
||||||
|
|
||||||
|
|
|
||||||
1
mdc.h
1
mdc.h
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
struct MDC_Info : public FixedBlockSize<T::DIGESTSIZE>, public FixedKeyLength<T::BLOCKSIZE>
|
struct MDC_Info : public FixedBlockSize<T::DIGESTSIZE>, public FixedKeyLength<T::BLOCKSIZE>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
9
misc.h
9
misc.h
|
|
@ -33,11 +33,13 @@ class CRYPTOPP_DLL Empty
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class BASE1, class BASE2>
|
template <class BASE1, class BASE2>
|
||||||
class CRYPTOPP_NO_VTABLE TwoBases : public BASE1, public BASE2
|
class CRYPTOPP_NO_VTABLE TwoBases : public BASE1, public BASE2
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class BASE1, class BASE2, class BASE3>
|
template <class BASE1, class BASE2, class BASE3>
|
||||||
class CRYPTOPP_NO_VTABLE ThreeBases : public BASE1, public BASE2, public BASE3
|
class CRYPTOPP_NO_VTABLE ThreeBases : public BASE1, public BASE2, public BASE3
|
||||||
{
|
{
|
||||||
|
|
@ -65,9 +67,10 @@ struct NewObject
|
||||||
T* operator()() const {return new T;}
|
T* operator()() const {return new T;}
|
||||||
};
|
};
|
||||||
|
|
||||||
// This function safely initializes a static object in a multithreaded environment without using locks.
|
/*! This function safely initializes a static object in a multithreaded environment without using locks.
|
||||||
// It may leak memory when two threads try to initialize the static object at the same time
|
It may leak memory when two threads try to initialize the static object at the same time
|
||||||
// but this should be acceptable since each static object is only initialized once per session.
|
but this should be acceptable since each static object is only initialized once per session.
|
||||||
|
*/
|
||||||
template <class T, class F = NewObject<T>, int instance=0>
|
template <class T, class F = NewObject<T>, int instance=0>
|
||||||
class Singleton
|
class Singleton
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ CRYPTOPP_DLL_TEMPLATE_CLASS AbstractGroup<Integer>;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS AbstractRing<Integer>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS AbstractRing<Integer>;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS AbstractEuclideanDomain<Integer>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS AbstractEuclideanDomain<Integer>;
|
||||||
|
|
||||||
//! .
|
//! ring of congruence classes modulo n
|
||||||
|
/*! \note this implementation represents each congruence class as the smallest non-negative integer in that class */
|
||||||
class CRYPTOPP_DLL ModularArithmetic : public AbstractRing<Integer>
|
class CRYPTOPP_DLL ModularArithmetic : public AbstractRing<Integer>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -117,6 +118,7 @@ protected:
|
||||||
// const ModularArithmetic::RandomizationParameter ModularArithmetic::DefaultRandomizationParameter = 0 ;
|
// const ModularArithmetic::RandomizationParameter ModularArithmetic::DefaultRandomizationParameter = 0 ;
|
||||||
|
|
||||||
//! do modular arithmetics in Montgomery representation for increased speed
|
//! do modular arithmetics in Montgomery representation for increased speed
|
||||||
|
/*! \note the Montgomery representation represents each congruence class [a] as a*r%n, where r is a convenient power of 2 */
|
||||||
class CRYPTOPP_DLL MontgomeryRepresentation : public ModularArithmetic
|
class CRYPTOPP_DLL MontgomeryRepresentation : public ModularArithmetic
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
15
modes.h
15
modes.h
|
|
@ -82,6 +82,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CFB_ModePolicy : public ModePolicyCommonTe
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IV_Requirement IVRequirement() const {return RANDOM_IV;}
|
IV_Requirement IVRequirement() const {return RANDOM_IV;}
|
||||||
|
static const char *StaticAlgorithmName() {return "CFB";}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
unsigned int GetBytesPerIteration() const {return m_feedbackSize;}
|
unsigned int GetBytesPerIteration() const {return m_feedbackSize;}
|
||||||
|
|
@ -126,6 +127,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE OFB_ModePolicy : public ModePolicyCommonTe
|
||||||
public:
|
public:
|
||||||
bool IsRandomAccess() const {return false;}
|
bool IsRandomAccess() const {return false;}
|
||||||
IV_Requirement IVRequirement() const {return STRUCTURED_IV;}
|
IV_Requirement IVRequirement() const {return STRUCTURED_IV;}
|
||||||
|
static const char *StaticAlgorithmName() {return "OFB";}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int GetBytesPerIteration() const {return BlockSize();}
|
unsigned int GetBytesPerIteration() const {return BlockSize();}
|
||||||
|
|
@ -148,6 +150,7 @@ public:
|
||||||
bool IsRandomAccess() const {return true;}
|
bool IsRandomAccess() const {return true;}
|
||||||
IV_Requirement IVRequirement() const {return STRUCTURED_IV;}
|
IV_Requirement IVRequirement() const {return STRUCTURED_IV;}
|
||||||
void GetNextIV(byte *IV);
|
void GetNextIV(byte *IV);
|
||||||
|
static const char *StaticAlgorithmName() {return "Counter-BE";}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int GetBytesPerIteration() const {return BlockSize();}
|
unsigned int GetBytesPerIteration() const {return BlockSize();}
|
||||||
|
|
@ -194,6 +197,7 @@ public:
|
||||||
unsigned int OptimalBlockSize() const {return BlockSize() * m_cipher->OptimalNumberOfParallelBlocks();}
|
unsigned int OptimalBlockSize() const {return BlockSize() * m_cipher->OptimalNumberOfParallelBlocks();}
|
||||||
void ProcessBlocks(byte *outString, const byte *inString, unsigned int numberOfBlocks)
|
void ProcessBlocks(byte *outString, const byte *inString, unsigned int numberOfBlocks)
|
||||||
{m_cipher->ProcessAndXorMultipleBlocks(inString, NULL, outString, numberOfBlocks);}
|
{m_cipher->ProcessAndXorMultipleBlocks(inString, NULL, outString, numberOfBlocks);}
|
||||||
|
static const char *StaticAlgorithmName() {return "ECB";}
|
||||||
};
|
};
|
||||||
|
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_ModeBase : public BlockOrientedCipherModeBase
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_ModeBase : public BlockOrientedCipherModeBase
|
||||||
|
|
@ -202,6 +206,7 @@ public:
|
||||||
IV_Requirement IVRequirement() const {return UNPREDICTABLE_RANDOM_IV;}
|
IV_Requirement IVRequirement() const {return UNPREDICTABLE_RANDOM_IV;}
|
||||||
bool RequireAlignedInput() const {return false;}
|
bool RequireAlignedInput() const {return false;}
|
||||||
unsigned int MinLastBlockSize() const {return 0;}
|
unsigned int MinLastBlockSize() const {return 0;}
|
||||||
|
static const char *StaticAlgorithmName() {return "CBC";}
|
||||||
};
|
};
|
||||||
|
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Encryption : public CBC_ModeBase
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Encryption : public CBC_ModeBase
|
||||||
|
|
@ -216,6 +221,7 @@ public:
|
||||||
void SetStolenIV(byte *iv) {m_stolenIV = iv;}
|
void SetStolenIV(byte *iv) {m_stolenIV = iv;}
|
||||||
unsigned int MinLastBlockSize() const {return BlockSize()+1;}
|
unsigned int MinLastBlockSize() const {return BlockSize()+1;}
|
||||||
void ProcessLastBlock(byte *outString, const byte *inString, unsigned int length);
|
void ProcessLastBlock(byte *outString, const byte *inString, unsigned int length);
|
||||||
|
static const char *StaticAlgorithmName() {return "CBC/CTS";}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void UncheckedSetKey(const NameValuePairs ¶ms, const byte *key, unsigned int length, const byte *iv)
|
void UncheckedSetKey(const NameValuePairs ¶ms, const byte *key, unsigned int length, const byte *iv)
|
||||||
|
|
@ -248,9 +254,9 @@ public:
|
||||||
void ProcessLastBlock(byte *outString, const byte *inString, unsigned int length);
|
void ProcessLastBlock(byte *outString, const byte *inString, unsigned int length);
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class CIPHER, class BASE>
|
template <class CIPHER, class BASE>
|
||||||
class CipherModeFinalTemplate_CipherHolder : public ObjectHolder<CIPHER>, public BASE
|
class CipherModeFinalTemplate_CipherHolder : protected ObjectHolder<CIPHER>, public AlgorithmImpl<BASE, CipherModeFinalTemplate_CipherHolder<CIPHER, BASE> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CipherModeFinalTemplate_CipherHolder()
|
CipherModeFinalTemplate_CipherHolder()
|
||||||
|
|
@ -273,9 +279,12 @@ public:
|
||||||
this->m_cipher = &this->m_object;
|
this->m_cipher = &this->m_object;
|
||||||
this->SetKey(key, length, MakeParameters(Name::IV(), iv)(Name::FeedbackSize(), feedbackSize));
|
this->SetKey(key, length, MakeParameters(Name::IV(), iv)(Name::FeedbackSize(), feedbackSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string StaticAlgorithmName()
|
||||||
|
{return CIPHER::StaticAlgorithmName() + "/" + BASE::StaticAlgorithmName();}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE>
|
template <class BASE>
|
||||||
class CipherModeFinalTemplate_ExternalCipher : public BASE
|
class CipherModeFinalTemplate_ExternalCipher : public BASE
|
||||||
{
|
{
|
||||||
|
|
|
||||||
2
mqv.h
2
mqv.h
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class GROUP_PARAMETERS, class COFACTOR_OPTION = CPP_TYPENAME GROUP_PARAMETERS::DefaultCofactorOption>
|
template <class GROUP_PARAMETERS, class COFACTOR_OPTION = CPP_TYPENAME GROUP_PARAMETERS::DefaultCofactorOption>
|
||||||
class MQV_Domain : public AuthenticatedKeyAgreementDomain
|
class MQV_Domain : public AuthenticatedKeyAgreementDomain
|
||||||
{
|
{
|
||||||
|
|
|
||||||
3
oaep.h
3
oaep.h
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! <a href="http://www.weidai.com/scan-mirror/ca.html#cem_OAEP-MGF1">EME-OAEP</a>, for use with RSAES
|
//! _
|
||||||
class CRYPTOPP_DLL OAEP_Base : public PK_EncryptionMessageEncodingMethod
|
class CRYPTOPP_DLL OAEP_Base : public PK_EncryptionMessageEncodingMethod
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -21,6 +21,7 @@ protected:
|
||||||
virtual MaskGeneratingFunction * NewMGF() const =0;
|
virtual MaskGeneratingFunction * NewMGF() const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! <a href="http://www.weidai.com/scan-mirror/ca.html#cem_OAEP-MGF1">EME-OAEP</a>, for use with classes derived from TF_ES
|
||||||
template <class H, class MGF=P1363_MGF1>
|
template <class H, class MGF=P1363_MGF1>
|
||||||
class OAEP : public OAEP_Base, public EncryptionStandard
|
class OAEP : public OAEP_Base, public EncryptionStandard
|
||||||
{
|
{
|
||||||
|
|
|
||||||
62
panama.h
62
panama.h
|
|
@ -33,7 +33,7 @@ public:
|
||||||
PanamaHash() {Panama<B>::Reset();}
|
PanamaHash() {Panama<B>::Reset();}
|
||||||
unsigned int DigestSize() const {return DIGESTSIZE;}
|
unsigned int DigestSize() const {return DIGESTSIZE;}
|
||||||
void TruncatedFinal(byte *hash, unsigned int size);
|
void TruncatedFinal(byte *hash, unsigned int size);
|
||||||
static const char * StaticAlgorithmName() {return "Panama";}
|
static const char * StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Init() {Panama<B>::Reset();}
|
void Init() {Panama<B>::Reset();}
|
||||||
|
|
@ -41,47 +41,77 @@ protected:
|
||||||
unsigned int HashMultipleBlocks(const word32 *input, unsigned int length);
|
unsigned int HashMultipleBlocks(const word32 *input, unsigned int length);
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! MAC construction using a hermetic hash function
|
||||||
template <class B = LittleEndian>
|
template <class T_Hash, class T_Info = T_Hash>
|
||||||
class CRYPTOPP_NO_VTABLE PanamaMAC_Base : public PanamaHash<B>, public VariableKeyLength<32, 0, UINT_MAX>, public MessageAuthenticationCode
|
class HermeticHashFunctionMAC : public AlgorithmImpl<SimpleKeyingInterfaceImpl<TwoBases<MessageAuthenticationCode, VariableKeyLength<32, 0, UINT_MAX> > >, T_Info>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void UncheckedSetKey(const byte *userKey, unsigned int keylength)
|
void SetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms = g_nullNameValuePairs)
|
||||||
{
|
{
|
||||||
m_key.Assign(userKey, keylength);
|
m_key.Assign(key, length);
|
||||||
Restart();
|
Restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char * StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";}
|
void Restart()
|
||||||
|
|
||||||
protected:
|
|
||||||
void Init()
|
|
||||||
{
|
{
|
||||||
PanamaHash<B>::Init();
|
m_hash.Restart();
|
||||||
Update(m_key, m_key.size());
|
m_keyed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Update(const byte *input, unsigned int length)
|
||||||
|
{
|
||||||
|
if (!m_keyed)
|
||||||
|
KeyHash();
|
||||||
|
m_hash.Update(input, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TruncatedFinal(byte *digest, unsigned int digestSize)
|
||||||
|
{
|
||||||
|
if (!m_keyed)
|
||||||
|
KeyHash();
|
||||||
|
m_hash.TruncatedFinal(digest, digestSize);
|
||||||
|
m_keyed = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int DigestSize() const
|
||||||
|
{return m_hash.DigestSize();}
|
||||||
|
unsigned int BlockSize() const
|
||||||
|
{return m_hash.BlockSize();}
|
||||||
|
unsigned int OptimalBlockSize() const
|
||||||
|
{return m_hash.OptimalBlockSize();}
|
||||||
|
unsigned int OptimalDataAlignment() const
|
||||||
|
{return m_hash.OptimalDataAlignment();}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void KeyHash()
|
||||||
|
{
|
||||||
|
m_hash.Update(m_key, m_key.size());
|
||||||
|
m_keyed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
T_Hash m_hash;
|
||||||
|
bool m_keyed;
|
||||||
SecByteBlock m_key;
|
SecByteBlock m_key;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Panama MAC
|
/// Panama MAC
|
||||||
template <class B = LittleEndian>
|
template <class B = LittleEndian>
|
||||||
class PanamaMAC : public MessageAuthenticationCodeImpl<PanamaMAC_Base<B> >
|
class PanamaMAC : public HermeticHashFunctionMAC<PanamaHash<B> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PanamaMAC() {}
|
PanamaMAC() {}
|
||||||
PanamaMAC(const byte *key, unsigned int length=PanamaMAC_Base<B>::DEFAULT_KEYLENGTH)
|
PanamaMAC(const byte *key, unsigned int length)
|
||||||
{this->SetKey(key, length);}
|
{this->SetKey(key, length);}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! algorithm info
|
||||||
template <class B>
|
template <class B>
|
||||||
struct PanamaCipherInfo : public VariableKeyLength<32, 32, 64, 32, SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
|
struct PanamaCipherInfo : public VariableKeyLength<32, 32, 64, 32, SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
|
||||||
{
|
{
|
||||||
static const char * StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";}
|
static const char * StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class B>
|
template <class B>
|
||||||
class PanamaCipherPolicy : public AdditiveCipherConcretePolicy<word32, 8>,
|
class PanamaCipherPolicy : public AdditiveCipherConcretePolicy<word32, 8>,
|
||||||
public PanamaCipherInfo<B>,
|
public PanamaCipherInfo<B>,
|
||||||
|
|
|
||||||
31
pkcspad.h
31
pkcspad.h
|
|
@ -28,6 +28,18 @@ public:
|
||||||
static const unsigned int length;
|
static const unsigned int length;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// PKCS_DigestDecoration can be instantiated with the following
|
||||||
|
// classes as specified in PKCS#1 v2.0 and P1363a
|
||||||
|
class SHA;
|
||||||
|
class MD2;
|
||||||
|
class MD5;
|
||||||
|
class RIPEMD160;
|
||||||
|
class Tiger;
|
||||||
|
class SHA256;
|
||||||
|
class SHA384;
|
||||||
|
class SHA512;
|
||||||
|
// end of list
|
||||||
|
|
||||||
//! <a href="http://www.weidai.com/scan-mirror/sig.html#sem_PKCS1-1.5">EMSA-PKCS1-v1_5</a>
|
//! <a href="http://www.weidai.com/scan-mirror/sig.html#sem_PKCS1-1.5">EMSA-PKCS1-v1_5</a>
|
||||||
class CRYPTOPP_DLL PKCS1v15_SignatureMessageEncodingMethod : public PK_DeterministicSignatureMessageEncodingMethod
|
class CRYPTOPP_DLL PKCS1v15_SignatureMessageEncodingMethod : public PK_DeterministicSignatureMessageEncodingMethod
|
||||||
{
|
{
|
||||||
|
|
@ -51,8 +63,12 @@ public:
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
//! PKCS #1 version 1.5, for use with RSAES and RSASSA
|
//! PKCS #1 version 1.5, for use with RSAES and RSASS
|
||||||
/*! The following hash functions are supported for signature: SHA, MD2, MD5, RIPEMD160, SHA256, SHA384, SHA512. */
|
/*! Only the following hash functions are supported by this signature standard:
|
||||||
|
\dontinclude pkcspad.h
|
||||||
|
\skip can be instantiated
|
||||||
|
\until end of list
|
||||||
|
*/
|
||||||
struct PKCS1v15 : public SignatureStandard, public EncryptionStandard
|
struct PKCS1v15 : public SignatureStandard, public EncryptionStandard
|
||||||
{
|
{
|
||||||
typedef PKCS_EncryptionPaddingScheme EncryptionMessageEncodingMethod;
|
typedef PKCS_EncryptionPaddingScheme EncryptionMessageEncodingMethod;
|
||||||
|
|
@ -63,17 +79,6 @@ struct PKCS1v15 : public SignatureStandard, public EncryptionStandard
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration<SHA>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration<SHA>;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// PKCS_DecoratedHashModule can be instantiated with the following
|
|
||||||
// classes as specified in PKCS#1 v2.0 and P1363a
|
|
||||||
class SHA;
|
|
||||||
class MD2;
|
|
||||||
class MD5;
|
|
||||||
class RIPEMD160;
|
|
||||||
class Tiger;
|
|
||||||
class SHA256;
|
|
||||||
class SHA384;
|
|
||||||
class SHA512;
|
|
||||||
|
|
||||||
NAMESPACE_END
|
NAMESPACE_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
3
pssr.h
3
pssr.h
|
|
@ -33,7 +33,7 @@ template <class H> struct EMSA2HashId
|
||||||
static const byte id;
|
static const byte id;
|
||||||
};
|
};
|
||||||
|
|
||||||
// EMSA2HashId can be instantiated with the following two classes.
|
// EMSA2HashId can be instantiated with the following classes.
|
||||||
class SHA;
|
class SHA;
|
||||||
class RIPEMD160;
|
class RIPEMD160;
|
||||||
class RIPEMD128;
|
class RIPEMD128;
|
||||||
|
|
@ -41,6 +41,7 @@ class SHA256;
|
||||||
class SHA384;
|
class SHA384;
|
||||||
class SHA512;
|
class SHA512;
|
||||||
class Whirlpool;
|
class Whirlpool;
|
||||||
|
// end of list
|
||||||
|
|
||||||
template <class BASE>
|
template <class BASE>
|
||||||
class EMSA2HashIdLookup : public BASE
|
class EMSA2HashIdLookup : public BASE
|
||||||
|
|
|
||||||
124
pubkey.h
124
pubkey.h
|
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionBounds
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionBounds
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -56,7 +56,7 @@ public:
|
||||||
virtual Integer MaxImage() const {return --ImageBound();}
|
virtual Integer MaxImage() const {return --ImageBound();}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomizedTrapdoorFunction : public TrapdoorFunctionBounds
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomizedTrapdoorFunction : public TrapdoorFunctionBounds
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -64,7 +64,7 @@ public:
|
||||||
virtual bool IsRandomized() const {return true;}
|
virtual bool IsRandomized() const {return true;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunction : public RandomizedTrapdoorFunction
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunction : public RandomizedTrapdoorFunction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -75,7 +75,7 @@ public:
|
||||||
virtual Integer ApplyFunction(const Integer &x) const =0;
|
virtual Integer ApplyFunction(const Integer &x) const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomizedTrapdoorFunctionInverse
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomizedTrapdoorFunctionInverse
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -85,7 +85,7 @@ public:
|
||||||
virtual bool IsRandomized() const {return true;}
|
virtual bool IsRandomized() const {return true;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionInverse : public RandomizedTrapdoorFunctionInverse
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionInverse : public RandomizedTrapdoorFunctionInverse
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -118,7 +118,7 @@ public:
|
||||||
|
|
||||||
// ********************************************************
|
// ********************************************************
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class TFI, class MEI>
|
template <class TFI, class MEI>
|
||||||
class CRYPTOPP_NO_VTABLE TF_Base
|
class CRYPTOPP_NO_VTABLE TF_Base
|
||||||
{
|
{
|
||||||
|
|
@ -134,6 +134,7 @@ protected:
|
||||||
|
|
||||||
// ********************************************************
|
// ********************************************************
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class BASE>
|
template <class BASE>
|
||||||
class CRYPTOPP_NO_VTABLE PK_FixedLengthCryptoSystemImpl : public BASE
|
class CRYPTOPP_NO_VTABLE PK_FixedLengthCryptoSystemImpl : public BASE
|
||||||
{
|
{
|
||||||
|
|
@ -147,7 +148,7 @@ public:
|
||||||
virtual unsigned int FixedCiphertextLength() const =0;
|
virtual unsigned int FixedCiphertextLength() const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class INTERFACE, class BASE>
|
template <class INTERFACE, class BASE>
|
||||||
class CRYPTOPP_NO_VTABLE TF_CryptoSystemBase : public PK_FixedLengthCryptoSystemImpl<INTERFACE>, protected BASE
|
class CRYPTOPP_NO_VTABLE TF_CryptoSystemBase : public PK_FixedLengthCryptoSystemImpl<INTERFACE>, protected BASE
|
||||||
{
|
{
|
||||||
|
|
@ -161,14 +162,14 @@ protected:
|
||||||
unsigned int PaddedBlockBitLength() const {return this->GetTrapdoorFunctionBounds().PreimageBound().BitCount()-1;}
|
unsigned int PaddedBlockBitLength() const {return this->GetTrapdoorFunctionBounds().PreimageBound().BitCount()-1;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_DecryptorBase : public TF_CryptoSystemBase<PK_Decryptor, TF_Base<TrapdoorFunctionInverse, PK_EncryptionMessageEncodingMethod> >
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_DecryptorBase : public TF_CryptoSystemBase<PK_Decryptor, TF_Base<TrapdoorFunctionInverse, PK_EncryptionMessageEncodingMethod> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DecodingResult Decrypt(RandomNumberGenerator &rng, const byte *ciphertext, unsigned int ciphertextLength, byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const;
|
DecodingResult Decrypt(RandomNumberGenerator &rng, const byte *ciphertext, unsigned int ciphertextLength, byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_EncryptorBase : public TF_CryptoSystemBase<PK_Encryptor, TF_Base<RandomizedTrapdoorFunction, PK_EncryptionMessageEncodingMethod> >
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_EncryptorBase : public TF_CryptoSystemBase<PK_Encryptor, TF_Base<RandomizedTrapdoorFunction, PK_EncryptionMessageEncodingMethod> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -179,7 +180,7 @@ public:
|
||||||
|
|
||||||
typedef std::pair<const byte *, unsigned int> HashIdentifier;
|
typedef std::pair<const byte *, unsigned int> HashIdentifier;
|
||||||
|
|
||||||
//! .
|
//! interface for message encoding method for public key signature schemes
|
||||||
class CRYPTOPP_NO_VTABLE PK_SignatureMessageEncodingMethod
|
class CRYPTOPP_NO_VTABLE PK_SignatureMessageEncodingMethod
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -302,7 +303,7 @@ public:
|
||||||
HashTransformation & AccessHash() {return this->m_object;}
|
HashTransformation & AccessHash() {return this->m_object;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class INTERFACE, class BASE>
|
template <class INTERFACE, class BASE>
|
||||||
class CRYPTOPP_NO_VTABLE TF_SignatureSchemeBase : public INTERFACE, protected BASE
|
class CRYPTOPP_NO_VTABLE TF_SignatureSchemeBase : public INTERFACE, protected BASE
|
||||||
{
|
{
|
||||||
|
|
@ -328,7 +329,7 @@ protected:
|
||||||
virtual unsigned int GetDigestSize() const =0;
|
virtual unsigned int GetDigestSize() const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_SignerBase : public TF_SignatureSchemeBase<PK_Signer, TF_Base<RandomizedTrapdoorFunctionInverse, PK_SignatureMessageEncodingMethod> >
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_SignerBase : public TF_SignatureSchemeBase<PK_Signer, TF_Base<RandomizedTrapdoorFunctionInverse, PK_SignatureMessageEncodingMethod> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -336,7 +337,7 @@ public:
|
||||||
unsigned int SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccumulator &messageAccumulator, byte *signature, bool restart=true) const;
|
unsigned int SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccumulator &messageAccumulator, byte *signature, bool restart=true) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_VerifierBase : public TF_SignatureSchemeBase<PK_Verifier, TF_Base<TrapdoorFunction, PK_SignatureMessageEncodingMethod> >
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TF_VerifierBase : public TF_SignatureSchemeBase<PK_Verifier, TF_Base<TrapdoorFunction, PK_SignatureMessageEncodingMethod> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -347,7 +348,7 @@ public:
|
||||||
|
|
||||||
// ********************************************************
|
// ********************************************************
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T1, class T2, class T3>
|
template <class T1, class T2, class T3>
|
||||||
struct TF_CryptoSchemeOptions
|
struct TF_CryptoSchemeOptions
|
||||||
{
|
{
|
||||||
|
|
@ -358,14 +359,14 @@ struct TF_CryptoSchemeOptions
|
||||||
typedef T3 MessageEncodingMethod;
|
typedef T3 MessageEncodingMethod;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T1, class T2, class T3, class T4>
|
template <class T1, class T2, class T3, class T4>
|
||||||
struct TF_SignatureSchemeOptions : public TF_CryptoSchemeOptions<T1, T2, T3>
|
struct TF_SignatureSchemeOptions : public TF_CryptoSchemeOptions<T1, T2, T3>
|
||||||
{
|
{
|
||||||
typedef T4 HashFunction;
|
typedef T4 HashFunction;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class KEYS>
|
template <class KEYS>
|
||||||
class CRYPTOPP_NO_VTABLE PublicKeyCopier
|
class CRYPTOPP_NO_VTABLE PublicKeyCopier
|
||||||
{
|
{
|
||||||
|
|
@ -374,7 +375,7 @@ public:
|
||||||
virtual void CopyKeyInto(typename KEYS::PublicKey &key) const =0;
|
virtual void CopyKeyInto(typename KEYS::PublicKey &key) const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class KEYS>
|
template <class KEYS>
|
||||||
class CRYPTOPP_NO_VTABLE PrivateKeyCopier
|
class CRYPTOPP_NO_VTABLE PrivateKeyCopier
|
||||||
{
|
{
|
||||||
|
|
@ -384,7 +385,7 @@ public:
|
||||||
virtual void CopyKeyInto(typename KEYS::PrivateKey &key) const =0;
|
virtual void CopyKeyInto(typename KEYS::PrivateKey &key) const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE, class SCHEME_OPTIONS, class KEY>
|
template <class BASE, class SCHEME_OPTIONS, class KEY>
|
||||||
class CRYPTOPP_NO_VTABLE TF_ObjectImplBase : public AlgorithmImpl<BASE, typename SCHEME_OPTIONS::AlgorithmInfo>
|
class CRYPTOPP_NO_VTABLE TF_ObjectImplBase : public AlgorithmImpl<BASE, typename SCHEME_OPTIONS::AlgorithmInfo>
|
||||||
{
|
{
|
||||||
|
|
@ -433,7 +434,7 @@ protected:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE, class SCHEME_OPTIONS, class KEY>
|
template <class BASE, class SCHEME_OPTIONS, class KEY>
|
||||||
class TF_ObjectImplExtRef : public TF_ObjectImplBase<BASE, SCHEME_OPTIONS, KEY>
|
class TF_ObjectImplExtRef : public TF_ObjectImplBase<BASE, SCHEME_OPTIONS, KEY>
|
||||||
{
|
{
|
||||||
|
|
@ -448,7 +449,7 @@ private:
|
||||||
const KEY * m_pKey;
|
const KEY * m_pKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE, class SCHEME_OPTIONS, class KEY_COPIER>
|
template <class BASE, class SCHEME_OPTIONS, class KEY_COPIER>
|
||||||
class CRYPTOPP_NO_VTABLE TF_ObjectImpl : public TF_ObjectImplBase<TwoBases<BASE, KEY_COPIER>, SCHEME_OPTIONS, typename KEY_COPIER::KeyClass>
|
class CRYPTOPP_NO_VTABLE TF_ObjectImpl : public TF_ObjectImplBase<TwoBases<BASE, KEY_COPIER>, SCHEME_OPTIONS, typename KEY_COPIER::KeyClass>
|
||||||
{
|
{
|
||||||
|
|
@ -465,25 +466,25 @@ private:
|
||||||
KeyClass m_trapdoorFunction;
|
KeyClass m_trapdoorFunction;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class SCHEME_OPTIONS>
|
template <class SCHEME_OPTIONS>
|
||||||
class TF_DecryptorImpl : public TF_ObjectImpl<TF_DecryptorBase, SCHEME_OPTIONS, PrivateKeyCopier<typename SCHEME_OPTIONS::Keys> >
|
class TF_DecryptorImpl : public TF_ObjectImpl<TF_DecryptorBase, SCHEME_OPTIONS, PrivateKeyCopier<typename SCHEME_OPTIONS::Keys> >
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class SCHEME_OPTIONS>
|
template <class SCHEME_OPTIONS>
|
||||||
class TF_EncryptorImpl : public TF_ObjectImpl<TF_EncryptorBase, SCHEME_OPTIONS, PublicKeyCopier<typename SCHEME_OPTIONS::Keys> >
|
class TF_EncryptorImpl : public TF_ObjectImpl<TF_EncryptorBase, SCHEME_OPTIONS, PublicKeyCopier<typename SCHEME_OPTIONS::Keys> >
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class SCHEME_OPTIONS>
|
template <class SCHEME_OPTIONS>
|
||||||
class TF_SignerImpl : public TF_ObjectImpl<TF_SignerBase, SCHEME_OPTIONS, PrivateKeyCopier<typename SCHEME_OPTIONS::Keys> >
|
class TF_SignerImpl : public TF_ObjectImpl<TF_SignerBase, SCHEME_OPTIONS, PrivateKeyCopier<typename SCHEME_OPTIONS::Keys> >
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class SCHEME_OPTIONS>
|
template <class SCHEME_OPTIONS>
|
||||||
class TF_VerifierImpl : public TF_ObjectImpl<TF_VerifierBase, SCHEME_OPTIONS, PublicKeyCopier<typename SCHEME_OPTIONS::Keys> >
|
class TF_VerifierImpl : public TF_ObjectImpl<TF_VerifierBase, SCHEME_OPTIONS, PublicKeyCopier<typename SCHEME_OPTIONS::Keys> >
|
||||||
{
|
{
|
||||||
|
|
@ -491,6 +492,7 @@ class TF_VerifierImpl : public TF_ObjectImpl<TF_VerifierBase, SCHEME_OPTIONS, Pu
|
||||||
|
|
||||||
// ********************************************************
|
// ********************************************************
|
||||||
|
|
||||||
|
//! _
|
||||||
class CRYPTOPP_NO_VTABLE MaskGeneratingFunction
|
class CRYPTOPP_NO_VTABLE MaskGeneratingFunction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -500,7 +502,7 @@ public:
|
||||||
|
|
||||||
CRYPTOPP_DLL void P1363_MGF1KDF2_Common(HashTransformation &hash, byte *output, unsigned int outputLength, const byte *input, unsigned int inputLength, const byte *derivationParams, unsigned int derivationParamsLength, bool mask, unsigned int counterStart);
|
CRYPTOPP_DLL void P1363_MGF1KDF2_Common(HashTransformation &hash, byte *output, unsigned int outputLength, const byte *input, unsigned int inputLength, const byte *derivationParams, unsigned int derivationParamsLength, bool mask, unsigned int counterStart);
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class P1363_MGF1 : public MaskGeneratingFunction
|
class P1363_MGF1 : public MaskGeneratingFunction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -513,7 +515,7 @@ public:
|
||||||
|
|
||||||
// ********************************************************
|
// ********************************************************
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class H>
|
template <class H>
|
||||||
class P1363_KDF2
|
class P1363_KDF2
|
||||||
{
|
{
|
||||||
|
|
@ -527,14 +529,14 @@ public:
|
||||||
|
|
||||||
// ********************************************************
|
// ********************************************************
|
||||||
|
|
||||||
// to be thrown by DecodeElement and AgreeWithStaticPrivateKey
|
//! to be thrown by DecodeElement and AgreeWithStaticPrivateKey
|
||||||
class DL_BadElement : public InvalidDataFormat
|
class DL_BadElement : public InvalidDataFormat
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DL_BadElement() : InvalidDataFormat("CryptoPP: invalid group element") {}
|
DL_BadElement() : InvalidDataFormat("CryptoPP: invalid group element") {}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! interface for DL group parameters
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_GroupParameters : public CryptoParameters
|
class CRYPTOPP_NO_VTABLE DL_GroupParameters : public CryptoParameters
|
||||||
{
|
{
|
||||||
|
|
@ -626,7 +628,7 @@ private:
|
||||||
mutable unsigned int m_validationLevel;
|
mutable unsigned int m_validationLevel;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class GROUP_PRECOMP, class BASE_PRECOMP = DL_FixedBasePrecomputationImpl<CPP_TYPENAME GROUP_PRECOMP::Element>, class BASE = DL_GroupParameters<CPP_TYPENAME GROUP_PRECOMP::Element> >
|
template <class GROUP_PRECOMP, class BASE_PRECOMP = DL_FixedBasePrecomputationImpl<CPP_TYPENAME GROUP_PRECOMP::Element>, class BASE = DL_GroupParameters<CPP_TYPENAME GROUP_PRECOMP::Element> >
|
||||||
class DL_GroupParametersImpl : public BASE
|
class DL_GroupParametersImpl : public BASE
|
||||||
{
|
{
|
||||||
|
|
@ -644,7 +646,7 @@ protected:
|
||||||
BASE_PRECOMP m_gpc;
|
BASE_PRECOMP m_gpc;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_Key
|
class CRYPTOPP_NO_VTABLE DL_Key
|
||||||
{
|
{
|
||||||
|
|
@ -653,7 +655,7 @@ public:
|
||||||
virtual DL_GroupParameters<T> & AccessAbstractGroupParameters() =0;
|
virtual DL_GroupParameters<T> & AccessAbstractGroupParameters() =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! interface for DL public keys
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_PublicKey : public DL_Key<T>
|
class CRYPTOPP_NO_VTABLE DL_PublicKey : public DL_Key<T>
|
||||||
{
|
{
|
||||||
|
|
@ -688,7 +690,7 @@ public:
|
||||||
virtual DL_FixedBasePrecomputation<T> & AccessPublicPrecomputation() =0;
|
virtual DL_FixedBasePrecomputation<T> & AccessPublicPrecomputation() =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! interface for DL private keys
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_PrivateKey : public DL_Key<T>
|
class CRYPTOPP_NO_VTABLE DL_PrivateKey : public DL_Key<T>
|
||||||
{
|
{
|
||||||
|
|
@ -736,7 +738,7 @@ void DL_PublicKey<T>::AssignFrom(const NameValuePairs &source)
|
||||||
|
|
||||||
class OID;
|
class OID;
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class PK, class GP, class O = OID>
|
template <class PK, class GP, class O = OID>
|
||||||
class DL_KeyImpl : public PK
|
class DL_KeyImpl : public PK
|
||||||
{
|
{
|
||||||
|
|
@ -763,7 +765,7 @@ private:
|
||||||
class X509PublicKey;
|
class X509PublicKey;
|
||||||
class PKCS8PrivateKey;
|
class PKCS8PrivateKey;
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class GP>
|
template <class GP>
|
||||||
class DL_PrivateKeyImpl : public DL_PrivateKey<CPP_TYPENAME GP::Element>, public DL_KeyImpl<PKCS8PrivateKey, GP>
|
class DL_PrivateKeyImpl : public DL_PrivateKey<CPP_TYPENAME GP::Element>, public DL_KeyImpl<PKCS8PrivateKey, GP>
|
||||||
{
|
{
|
||||||
|
|
@ -834,7 +836,7 @@ private:
|
||||||
Integer m_x;
|
Integer m_x;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE, class SIGNATURE_SCHEME>
|
template <class BASE, class SIGNATURE_SCHEME>
|
||||||
class DL_PrivateKey_WithSignaturePairwiseConsistencyTest : public BASE
|
class DL_PrivateKey_WithSignaturePairwiseConsistencyTest : public BASE
|
||||||
{
|
{
|
||||||
|
|
@ -852,7 +854,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class GP>
|
template <class GP>
|
||||||
class DL_PublicKeyImpl : public DL_PublicKey<typename GP::Element>, public DL_KeyImpl<X509PublicKey, GP>
|
class DL_PublicKeyImpl : public DL_PublicKey<typename GP::Element>, public DL_KeyImpl<X509PublicKey, GP>
|
||||||
{
|
{
|
||||||
|
|
@ -913,7 +915,7 @@ private:
|
||||||
typename GP::BasePrecomputation m_ypc;
|
typename GP::BasePrecomputation m_ypc;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! interface for Elgamal-like signature algorithms
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_ElgamalLikeSignatureAlgorithm
|
class CRYPTOPP_NO_VTABLE DL_ElgamalLikeSignatureAlgorithm
|
||||||
{
|
{
|
||||||
|
|
@ -928,7 +930,7 @@ public:
|
||||||
{return params.GetSubgroupOrder().ByteCount();}
|
{return params.GetSubgroupOrder().ByteCount();}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! interface for DL key agreement algorithms
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_KeyAgreementAlgorithm
|
class CRYPTOPP_NO_VTABLE DL_KeyAgreementAlgorithm
|
||||||
{
|
{
|
||||||
|
|
@ -939,7 +941,7 @@ public:
|
||||||
virtual Element AgreeWithStaticPrivateKey(const DL_GroupParameters<Element> ¶ms, const Element &publicElement, bool validateOtherPublicKey, const Integer &privateExponent) const =0;
|
virtual Element AgreeWithStaticPrivateKey(const DL_GroupParameters<Element> ¶ms, const Element &publicElement, bool validateOtherPublicKey, const Integer &privateExponent) const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! interface for key derivation algorithms used in DL cryptosystems
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_KeyDerivationAlgorithm
|
class CRYPTOPP_NO_VTABLE DL_KeyDerivationAlgorithm
|
||||||
{
|
{
|
||||||
|
|
@ -948,7 +950,7 @@ public:
|
||||||
virtual void Derive(const DL_GroupParameters<T> &groupParams, byte *derivedKey, unsigned int derivedLength, const T &agreedElement, const T &ephemeralPublicKey, const NameValuePairs &derivationParams) const =0;
|
virtual void Derive(const DL_GroupParameters<T> &groupParams, byte *derivedKey, unsigned int derivedLength, const T &agreedElement, const T &ephemeralPublicKey, const NameValuePairs &derivationParams) const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! interface for symmetric encryption algorithms used in DL cryptosystems
|
||||||
class CRYPTOPP_NO_VTABLE DL_SymmetricEncryptionAlgorithm
|
class CRYPTOPP_NO_VTABLE DL_SymmetricEncryptionAlgorithm
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -960,7 +962,7 @@ public:
|
||||||
virtual DecodingResult SymmetricDecrypt(const byte *key, const byte *ciphertext, unsigned int ciphertextLength, byte *plaintext, const NameValuePairs ¶meters) const =0;
|
virtual DecodingResult SymmetricDecrypt(const byte *key, const byte *ciphertext, unsigned int ciphertextLength, byte *plaintext, const NameValuePairs ¶meters) const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class KI>
|
template <class KI>
|
||||||
class CRYPTOPP_NO_VTABLE DL_Base
|
class CRYPTOPP_NO_VTABLE DL_Base
|
||||||
{
|
{
|
||||||
|
|
@ -975,7 +977,7 @@ protected:
|
||||||
virtual const KeyInterface & GetKeyInterface() const =0;
|
virtual const KeyInterface & GetKeyInterface() const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class INTERFACE, class KEY_INTERFACE>
|
template <class INTERFACE, class KEY_INTERFACE>
|
||||||
class CRYPTOPP_NO_VTABLE DL_SignatureSchemeBase : public INTERFACE, public DL_Base<KEY_INTERFACE>
|
class CRYPTOPP_NO_VTABLE DL_SignatureSchemeBase : public INTERFACE, public DL_Base<KEY_INTERFACE>
|
||||||
{
|
{
|
||||||
|
|
@ -1007,7 +1009,7 @@ protected:
|
||||||
virtual unsigned int GetDigestSize() const =0;
|
virtual unsigned int GetDigestSize() const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_SignerBase : public DL_SignatureSchemeBase<PK_Signer, DL_PrivateKey<T> >
|
class CRYPTOPP_NO_VTABLE DL_SignerBase : public DL_SignatureSchemeBase<PK_Signer, DL_PrivateKey<T> >
|
||||||
{
|
{
|
||||||
|
|
@ -1080,7 +1082,7 @@ protected:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_VerifierBase : public DL_SignatureSchemeBase<PK_Verifier, DL_PublicKey<T> >
|
class CRYPTOPP_NO_VTABLE DL_VerifierBase : public DL_SignatureSchemeBase<PK_Verifier, DL_PublicKey<T> >
|
||||||
{
|
{
|
||||||
|
|
@ -1148,7 +1150,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class PK, class KI>
|
template <class PK, class KI>
|
||||||
class CRYPTOPP_NO_VTABLE DL_CryptoSystemBase : public PK, public DL_Base<KI>
|
class CRYPTOPP_NO_VTABLE DL_CryptoSystemBase : public PK, public DL_Base<KI>
|
||||||
{
|
{
|
||||||
|
|
@ -1176,7 +1178,7 @@ protected:
|
||||||
virtual const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const =0;
|
virtual const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_DecryptorBase : public DL_CryptoSystemBase<PK_Decryptor, DL_PrivateKey<T> >
|
class CRYPTOPP_NO_VTABLE DL_DecryptorBase : public DL_CryptoSystemBase<PK_Decryptor, DL_PrivateKey<T> >
|
||||||
{
|
{
|
||||||
|
|
@ -1212,7 +1214,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_EncryptorBase : public DL_CryptoSystemBase<PK_Encryptor, DL_PublicKey<T> >
|
class CRYPTOPP_NO_VTABLE DL_EncryptorBase : public DL_CryptoSystemBase<PK_Encryptor, DL_PublicKey<T> >
|
||||||
{
|
{
|
||||||
|
|
@ -1242,7 +1244,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T1, class T2>
|
template <class T1, class T2>
|
||||||
struct DL_SchemeOptionsBase
|
struct DL_SchemeOptionsBase
|
||||||
{
|
{
|
||||||
|
|
@ -1251,7 +1253,7 @@ struct DL_SchemeOptionsBase
|
||||||
typedef typename GroupParameters::Element Element;
|
typedef typename GroupParameters::Element Element;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T1, class T2>
|
template <class T1, class T2>
|
||||||
struct DL_KeyedSchemeOptions : public DL_SchemeOptionsBase<T1, typename T2::PublicKey::GroupParameters>
|
struct DL_KeyedSchemeOptions : public DL_SchemeOptionsBase<T1, typename T2::PublicKey::GroupParameters>
|
||||||
{
|
{
|
||||||
|
|
@ -1260,7 +1262,7 @@ struct DL_KeyedSchemeOptions : public DL_SchemeOptionsBase<T1, typename T2::Publ
|
||||||
typedef typename Keys::PublicKey PublicKey;
|
typedef typename Keys::PublicKey PublicKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T1, class T2, class T3, class T4, class T5>
|
template <class T1, class T2, class T3, class T4, class T5>
|
||||||
struct DL_SignatureSchemeOptions : public DL_KeyedSchemeOptions<T1, T2>
|
struct DL_SignatureSchemeOptions : public DL_KeyedSchemeOptions<T1, T2>
|
||||||
{
|
{
|
||||||
|
|
@ -1269,7 +1271,7 @@ struct DL_SignatureSchemeOptions : public DL_KeyedSchemeOptions<T1, T2>
|
||||||
typedef T5 HashFunction;
|
typedef T5 HashFunction;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T1, class T2, class T3, class T4, class T5>
|
template <class T1, class T2, class T3, class T4, class T5>
|
||||||
struct DL_CryptoSchemeOptions : public DL_KeyedSchemeOptions<T1, T2>
|
struct DL_CryptoSchemeOptions : public DL_KeyedSchemeOptions<T1, T2>
|
||||||
{
|
{
|
||||||
|
|
@ -1278,7 +1280,7 @@ struct DL_CryptoSchemeOptions : public DL_KeyedSchemeOptions<T1, T2>
|
||||||
typedef T5 SymmetricEncryptionAlgorithm;
|
typedef T5 SymmetricEncryptionAlgorithm;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE, class SCHEME_OPTIONS, class KEY>
|
template <class BASE, class SCHEME_OPTIONS, class KEY>
|
||||||
class CRYPTOPP_NO_VTABLE DL_ObjectImplBase : public AlgorithmImpl<BASE, typename SCHEME_OPTIONS::AlgorithmInfo>
|
class CRYPTOPP_NO_VTABLE DL_ObjectImplBase : public AlgorithmImpl<BASE, typename SCHEME_OPTIONS::AlgorithmInfo>
|
||||||
{
|
{
|
||||||
|
|
@ -1313,7 +1315,7 @@ private:
|
||||||
KEY m_key;
|
KEY m_key;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE, class SCHEME_OPTIONS, class KEY>
|
template <class BASE, class SCHEME_OPTIONS, class KEY>
|
||||||
class CRYPTOPP_NO_VTABLE DL_ObjectImpl : public DL_ObjectImplBase<BASE, SCHEME_OPTIONS, KEY>
|
class CRYPTOPP_NO_VTABLE DL_ObjectImpl : public DL_ObjectImplBase<BASE, SCHEME_OPTIONS, KEY>
|
||||||
{
|
{
|
||||||
|
|
@ -1335,7 +1337,7 @@ protected:
|
||||||
{return Singleton<CPP_TYPENAME SCHEME_OPTIONS::MessageEncodingMethod>().Ref();}
|
{return Singleton<CPP_TYPENAME SCHEME_OPTIONS::MessageEncodingMethod>().Ref();}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE, class SCHEME_OPTIONS>
|
template <class BASE, class SCHEME_OPTIONS>
|
||||||
class CRYPTOPP_NO_VTABLE DL_PublicObjectImpl : public DL_ObjectImpl<BASE, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PublicKey>, public PublicKeyCopier<SCHEME_OPTIONS>
|
class CRYPTOPP_NO_VTABLE DL_PublicObjectImpl : public DL_ObjectImpl<BASE, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PublicKey>, public PublicKeyCopier<SCHEME_OPTIONS>
|
||||||
{
|
{
|
||||||
|
|
@ -1344,7 +1346,7 @@ public:
|
||||||
{key = this->GetKey();}
|
{key = this->GetKey();}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE, class SCHEME_OPTIONS>
|
template <class BASE, class SCHEME_OPTIONS>
|
||||||
class CRYPTOPP_NO_VTABLE DL_PrivateObjectImpl : public DL_ObjectImpl<BASE, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PrivateKey>, public PrivateKeyCopier<SCHEME_OPTIONS>
|
class CRYPTOPP_NO_VTABLE DL_PrivateObjectImpl : public DL_ObjectImpl<BASE, SCHEME_OPTIONS, typename SCHEME_OPTIONS::PrivateKey>, public PrivateKeyCopier<SCHEME_OPTIONS>
|
||||||
{
|
{
|
||||||
|
|
@ -1355,7 +1357,7 @@ public:
|
||||||
{key = this->GetKey();}
|
{key = this->GetKey();}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class SCHEME_OPTIONS>
|
template <class SCHEME_OPTIONS>
|
||||||
class DL_SignerImpl : public DL_PrivateObjectImpl<DL_SignerBase<typename SCHEME_OPTIONS::Element>, SCHEME_OPTIONS>
|
class DL_SignerImpl : public DL_PrivateObjectImpl<DL_SignerBase<typename SCHEME_OPTIONS::Element>, SCHEME_OPTIONS>
|
||||||
{
|
{
|
||||||
|
|
@ -1368,7 +1370,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class SCHEME_OPTIONS>
|
template <class SCHEME_OPTIONS>
|
||||||
class DL_VerifierImpl : public DL_PublicObjectImpl<DL_VerifierBase<typename SCHEME_OPTIONS::Element>, SCHEME_OPTIONS>
|
class DL_VerifierImpl : public DL_PublicObjectImpl<DL_VerifierBase<typename SCHEME_OPTIONS::Element>, SCHEME_OPTIONS>
|
||||||
{
|
{
|
||||||
|
|
@ -1379,13 +1381,13 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class SCHEME_OPTIONS>
|
template <class SCHEME_OPTIONS>
|
||||||
class DL_EncryptorImpl : public DL_PublicObjectImpl<DL_EncryptorBase<typename SCHEME_OPTIONS::Element>, SCHEME_OPTIONS>
|
class DL_EncryptorImpl : public DL_PublicObjectImpl<DL_EncryptorBase<typename SCHEME_OPTIONS::Element>, SCHEME_OPTIONS>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class SCHEME_OPTIONS>
|
template <class SCHEME_OPTIONS>
|
||||||
class DL_DecryptorImpl : public DL_PrivateObjectImpl<DL_DecryptorBase<typename SCHEME_OPTIONS::Element>, SCHEME_OPTIONS>
|
class DL_DecryptorImpl : public DL_PrivateObjectImpl<DL_DecryptorBase<typename SCHEME_OPTIONS::Element>, SCHEME_OPTIONS>
|
||||||
{
|
{
|
||||||
|
|
@ -1393,7 +1395,7 @@ class DL_DecryptorImpl : public DL_PrivateObjectImpl<DL_DecryptorBase<typename S
|
||||||
|
|
||||||
// ********************************************************
|
// ********************************************************
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE DL_SimpleKeyAgreementDomainBase : public SimpleKeyAgreementDomain
|
class CRYPTOPP_NO_VTABLE DL_SimpleKeyAgreementDomainBase : public SimpleKeyAgreementDomain
|
||||||
{
|
{
|
||||||
|
|
@ -1459,7 +1461,7 @@ public:
|
||||||
typedef ELEMENT Element;
|
typedef ELEMENT Element;
|
||||||
|
|
||||||
static const char *StaticAlgorithmName()
|
static const char *StaticAlgorithmName()
|
||||||
{return COFACTOR_OPTION::ToEnum() == NO_COFACTOR_MULTIPLICTION ? "DH" : "DHC";}
|
{return COFACTOR_OPTION::ToEnum() == INCOMPATIBLE_COFACTOR_MULTIPLICTION ? "DHC" : "DH";}
|
||||||
|
|
||||||
Element AgreeWithEphemeralPrivateKey(const DL_GroupParameters<Element> ¶ms, const DL_FixedBasePrecomputation<Element> &publicPrecomputation, const Integer &privateExponent) const
|
Element AgreeWithEphemeralPrivateKey(const DL_GroupParameters<Element> ¶ms, const DL_FixedBasePrecomputation<Element> &publicPrecomputation, const Integer &privateExponent) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
10
rabin.h
10
rabin.h
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! Rabin
|
//! _
|
||||||
class RabinFunction : public TrapdoorFunction, public PublicKey
|
class RabinFunction : public TrapdoorFunction, public PublicKey
|
||||||
{
|
{
|
||||||
typedef RabinFunction ThisClass;
|
typedef RabinFunction ThisClass;
|
||||||
|
|
@ -42,7 +42,7 @@ protected:
|
||||||
Integer m_n, m_r, m_s;
|
Integer m_n, m_r, m_s;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Invertible Rabin
|
//! _
|
||||||
class InvertibleRabinFunction : public RabinFunction, public TrapdoorFunctionInverse, public PrivateKey
|
class InvertibleRabinFunction : public RabinFunction, public TrapdoorFunctionInverse, public PrivateKey
|
||||||
{
|
{
|
||||||
typedef InvertibleRabinFunction ThisClass;
|
typedef InvertibleRabinFunction ThisClass;
|
||||||
|
|
@ -77,7 +77,7 @@ protected:
|
||||||
Integer m_p, m_q, m_u;
|
Integer m_p, m_q, m_u;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! Rabin
|
||||||
struct Rabin
|
struct Rabin
|
||||||
{
|
{
|
||||||
static std::string StaticAlgorithmName() {return "Rabin-Crypto++Variant";}
|
static std::string StaticAlgorithmName() {return "Rabin-Crypto++Variant";}
|
||||||
|
|
@ -85,13 +85,13 @@ struct Rabin
|
||||||
typedef InvertibleRabinFunction PrivateKey;
|
typedef InvertibleRabinFunction PrivateKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! Rabin encryption
|
||||||
template <class STANDARD>
|
template <class STANDARD>
|
||||||
struct RabinES : public TF_ES<STANDARD, Rabin>
|
struct RabinES : public TF_ES<STANDARD, Rabin>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! Rabin signature
|
||||||
template <class STANDARD, class H>
|
template <class STANDARD, class H>
|
||||||
struct RabinSS : public TF_SS<STANDARD, H, Rabin>
|
struct RabinSS : public TF_SS<STANDARD, H, Rabin>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
1
rc2.h
1
rc2.h
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct RC2_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 128>
|
struct RC2_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 128>
|
||||||
{
|
{
|
||||||
enum {DEFAULT_EFFECTIVE_KEYLENGTH = 1024, MAX_EFFECTIVE_KEYLENGTH = 1024};
|
enum {DEFAULT_EFFECTIVE_KEYLENGTH = 1024, MAX_EFFECTIVE_KEYLENGTH = 1024};
|
||||||
|
|
|
||||||
1
rc5.h
1
rc5.h
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct RC5_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 0, 255>, public VariableRounds<16>
|
struct RC5_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 0, 255>, public VariableRounds<16>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "RC5";}
|
static const char *StaticAlgorithmName() {return "RC5";}
|
||||||
|
|
|
||||||
1
rc6.h
1
rc6.h
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct RC6_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 255>, public VariableRounds<20>
|
struct RC6_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 255>, public VariableRounds<20>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "RC6";}
|
static const char *StaticAlgorithmName() {return "RC6";}
|
||||||
|
|
|
||||||
43
regtest.cpp
43
regtest.cpp
|
|
@ -16,23 +16,32 @@
|
||||||
#include "camellia.h"
|
#include "camellia.h"
|
||||||
#include "shacal2.h"
|
#include "shacal2.h"
|
||||||
#include "tea.h"
|
#include "tea.h"
|
||||||
|
#include "panama.h"
|
||||||
|
|
||||||
USING_NAMESPACE(CryptoPP)
|
USING_NAMESPACE(CryptoPP)
|
||||||
|
|
||||||
void RegisterFactories()
|
void RegisterFactories()
|
||||||
{
|
{
|
||||||
RegisterDefaultFactoryFor<SimpleKeyAgreementDomain, DH>("DH");
|
static bool s_registered = false;
|
||||||
RegisterDefaultFactoryFor<HashTransformation, SHA1>("SHA-1");
|
if (s_registered)
|
||||||
RegisterDefaultFactoryFor<HashTransformation, SHA256>("SHA-256");
|
return;
|
||||||
|
|
||||||
|
RegisterDefaultFactoryFor<SimpleKeyAgreementDomain, DH>();
|
||||||
|
RegisterDefaultFactoryFor<HashTransformation, SHA1>();
|
||||||
|
RegisterDefaultFactoryFor<HashTransformation, SHA256>();
|
||||||
#ifdef WORD64_AVAILABLE
|
#ifdef WORD64_AVAILABLE
|
||||||
RegisterDefaultFactoryFor<HashTransformation, SHA384>("SHA-384");
|
RegisterDefaultFactoryFor<HashTransformation, SHA384>();
|
||||||
RegisterDefaultFactoryFor<HashTransformation, SHA512>("SHA-512");
|
RegisterDefaultFactoryFor<HashTransformation, SHA512>();
|
||||||
|
RegisterDefaultFactoryFor<HashTransformation, Whirlpool>();
|
||||||
#endif
|
#endif
|
||||||
RegisterDefaultFactoryFor<HashTransformation, Whirlpool>("Whirlpool");
|
RegisterDefaultFactoryFor<HashTransformation, PanamaHash<LittleEndian> >();
|
||||||
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<MD5> >("HMAC(MD5)");
|
RegisterDefaultFactoryFor<HashTransformation, PanamaHash<BigEndian> >();
|
||||||
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA1> >("HMAC(SHA-1)");
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<MD5> >();
|
||||||
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<RIPEMD160> >("HMAC(RIPEMD-160)");
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<SHA1> >();
|
||||||
RegisterDefaultFactoryFor<MessageAuthenticationCode, TTMAC >("Two-Track-MAC");
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, HMAC<RIPEMD160> >();
|
||||||
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, TTMAC>();
|
||||||
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, PanamaMAC<LittleEndian> >();
|
||||||
|
RegisterDefaultFactoryFor<MessageAuthenticationCode, PanamaMAC<BigEndian> >();
|
||||||
RegisterAsymmetricCipherDefaultFactories<RSAES<OAEP<SHA1> > >("RSA/OAEP-MGF1(SHA-1)");
|
RegisterAsymmetricCipherDefaultFactories<RSAES<OAEP<SHA1> > >("RSA/OAEP-MGF1(SHA-1)");
|
||||||
RegisterAsymmetricCipherDefaultFactories<DLIES<> >("DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES)");
|
RegisterAsymmetricCipherDefaultFactories<DLIES<> >("DLIES(NoCofactorMultiplication, KDF2(SHA-1), XOR, HMAC(SHA-1), DHAES)");
|
||||||
RegisterSignatureSchemeDefaultFactories<DSA>("DSA(1363)");
|
RegisterSignatureSchemeDefaultFactories<DSA>("DSA(1363)");
|
||||||
|
|
@ -43,11 +52,15 @@ void RegisterFactories()
|
||||||
RegisterSignatureSchemeDefaultFactories<ESIGN<SHA1> >("ESIGN/EMSA5-MGF1(SHA-1)");
|
RegisterSignatureSchemeDefaultFactories<ESIGN<SHA1> >("ESIGN/EMSA5-MGF1(SHA-1)");
|
||||||
RegisterSignatureSchemeDefaultFactories<RWSS<P1363_EMSA2, SHA1> >("RW/EMSA2(SHA-1)");
|
RegisterSignatureSchemeDefaultFactories<RWSS<P1363_EMSA2, SHA1> >("RW/EMSA2(SHA-1)");
|
||||||
RegisterSignatureSchemeDefaultFactories<RSASS<PSS, SHA1> >("RSA/PSS-MGF1(SHA-1)");
|
RegisterSignatureSchemeDefaultFactories<RSASS<PSS, SHA1> >("RSA/PSS-MGF1(SHA-1)");
|
||||||
RegisterSymmetricCipherDefaultFactories<SEAL<> >("SEAL-3.0-BE");
|
RegisterSymmetricCipherDefaultFactories<SEAL<> >();
|
||||||
RegisterSymmetricCipherDefaultFactories<ECB_Mode<SHACAL2> >("SHACAL-2(ECB)");
|
RegisterSymmetricCipherDefaultFactories<ECB_Mode<SHACAL2> >();
|
||||||
#ifdef WORD64_AVAILABLE
|
#ifdef WORD64_AVAILABLE
|
||||||
RegisterSymmetricCipherDefaultFactories<ECB_Mode<Camellia> >("Camellia(ECB)");
|
RegisterSymmetricCipherDefaultFactories<ECB_Mode<Camellia> >();
|
||||||
#endif
|
#endif
|
||||||
RegisterSymmetricCipherDefaultFactories<ECB_Mode<TEA> >("TEA(ECB)");
|
RegisterSymmetricCipherDefaultFactories<ECB_Mode<TEA> >();
|
||||||
RegisterSymmetricCipherDefaultFactories<ECB_Mode<XTEA> >("XTEA(ECB)");
|
RegisterSymmetricCipherDefaultFactories<ECB_Mode<XTEA> >();
|
||||||
|
RegisterSymmetricCipherDefaultFactories<PanamaCipher<LittleEndian> >();
|
||||||
|
RegisterSymmetricCipherDefaultFactories<PanamaCipher<BigEndian> >();
|
||||||
|
|
||||||
|
s_registered = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct Rijndael_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
|
struct Rijndael_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
|
||||||
{
|
{
|
||||||
CRYPTOPP_DLL static const char * StaticAlgorithmName() {return "Rijndael";}
|
CRYPTOPP_DLL static const char * StaticAlgorithmName() {return "Rijndael";}
|
||||||
|
|
|
||||||
6
rsa.h
6
rsa.h
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL RSAFunction : public TrapdoorFunction, public X509PublicKey
|
class CRYPTOPP_DLL RSAFunction : public TrapdoorFunction, public X509PublicKey
|
||||||
{
|
{
|
||||||
typedef RSAFunction ThisClass;
|
typedef RSAFunction ThisClass;
|
||||||
|
|
@ -48,7 +48,7 @@ protected:
|
||||||
Integer m_n, m_e;
|
Integer m_n, m_e;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL InvertibleRSAFunction : public RSAFunction, public TrapdoorFunctionInverse, public PKCS8PrivateKey
|
class CRYPTOPP_DLL InvertibleRSAFunction : public RSAFunction, public TrapdoorFunctionInverse, public PKCS8PrivateKey
|
||||||
{
|
{
|
||||||
typedef InvertibleRSAFunction ThisClass;
|
typedef InvertibleRSAFunction ThisClass;
|
||||||
|
|
@ -97,7 +97,7 @@ protected:
|
||||||
Integer m_d, m_p, m_q, m_dp, m_dq, m_u;
|
Integer m_d, m_p, m_q, m_dp, m_dq, m_u;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! RSA
|
||||||
struct CRYPTOPP_DLL RSA
|
struct CRYPTOPP_DLL RSA
|
||||||
{
|
{
|
||||||
static std::string StaticAlgorithmName() {return "RSA";}
|
static std::string StaticAlgorithmName() {return "RSA";}
|
||||||
|
|
|
||||||
16
rw.h
16
rw.h
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class RWFunction : virtual public TrapdoorFunction, public PublicKey
|
class RWFunction : virtual public TrapdoorFunction, public PublicKey
|
||||||
{
|
{
|
||||||
typedef RWFunction ThisClass;
|
typedef RWFunction ThisClass;
|
||||||
|
|
@ -38,7 +38,7 @@ protected:
|
||||||
Integer m_n;
|
Integer m_n;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class InvertibleRWFunction : public RWFunction, public TrapdoorFunctionInverse, public PrivateKey
|
class InvertibleRWFunction : public RWFunction, public TrapdoorFunctionInverse, public PrivateKey
|
||||||
{
|
{
|
||||||
typedef InvertibleRWFunction ThisClass;
|
typedef InvertibleRWFunction ThisClass;
|
||||||
|
|
@ -74,7 +74,7 @@ protected:
|
||||||
Integer m_p, m_q, m_u;
|
Integer m_p, m_q, m_u;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class EMSA2Pad : public EMSA2HashIdLookup<PK_DeterministicSignatureMessageEncodingMethod>
|
class EMSA2Pad : public EMSA2HashIdLookup<PK_DeterministicSignatureMessageEncodingMethod>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -88,14 +88,18 @@ public:
|
||||||
byte *representative, unsigned int representativeBitLength) const;
|
byte *representative, unsigned int representativeBitLength) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! EMSA2, for use with RW
|
//! EMSA2, for use with RWSS
|
||||||
/*! See pssr.h for a list of hash functions supported by this signature standard. */
|
/*! Only the following hash functions are supported by this signature standard:
|
||||||
|
\dontinclude pssr.h
|
||||||
|
\skip can be instantiated
|
||||||
|
\until end of list
|
||||||
|
*/
|
||||||
struct P1363_EMSA2 : public SignatureStandard
|
struct P1363_EMSA2 : public SignatureStandard
|
||||||
{
|
{
|
||||||
typedef EMSA2Pad SignatureMessageEncodingMethod;
|
typedef EMSA2Pad SignatureMessageEncodingMethod;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! RW
|
||||||
struct RW
|
struct RW
|
||||||
{
|
{
|
||||||
static std::string StaticAlgorithmName() {return "RW";}
|
static std::string StaticAlgorithmName() {return "RW";}
|
||||||
|
|
|
||||||
2
safer.h
2
safer.h
|
|
@ -38,6 +38,7 @@ public:
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
struct SAFER_K_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13>
|
struct SAFER_K_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "SAFER-K";}
|
static const char *StaticAlgorithmName() {return "SAFER-K";}
|
||||||
|
|
@ -64,6 +65,7 @@ public:
|
||||||
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
|
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
struct SAFER_SK_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13>
|
struct SAFER_SK_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "SAFER-SK";}
|
static const char *StaticAlgorithmName() {return "SAFER-SK";}
|
||||||
|
|
|
||||||
1
seal.h
1
seal.h
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class B = BigEndian>
|
template <class B = BigEndian>
|
||||||
struct SEAL_Info : public FixedKeyLength<20, SimpleKeyingInterface::INTERNALLY_GENERATED_IV>
|
struct SEAL_Info : public FixedKeyLength<20, SimpleKeyingInterface::INTERNALLY_GENERATED_IV>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
35
seckey.h
35
seckey.h
|
|
@ -16,7 +16,7 @@ inline CipherDir ReverseCipherDir(CipherDir dir)
|
||||||
return (dir == ENCRYPTION) ? DECRYPTION : ENCRYPTION;
|
return (dir == ENCRYPTION) ? DECRYPTION : ENCRYPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! .
|
//! to be inherited by block ciphers with fixed block size
|
||||||
template <unsigned int N>
|
template <unsigned int N>
|
||||||
class FixedBlockSize
|
class FixedBlockSize
|
||||||
{
|
{
|
||||||
|
|
@ -26,7 +26,7 @@ public:
|
||||||
|
|
||||||
// ************** rounds ***************
|
// ************** rounds ***************
|
||||||
|
|
||||||
//! .
|
//! to be inherited by ciphers with fixed number of rounds
|
||||||
template <unsigned int R>
|
template <unsigned int R>
|
||||||
class FixedRounds
|
class FixedRounds
|
||||||
{
|
{
|
||||||
|
|
@ -45,7 +45,7 @@ protected:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! to be inherited by ciphers with variable number of rounds
|
||||||
template <unsigned int D, unsigned int N=1, unsigned int M=INT_MAX> // use INT_MAX here because enums are treated as signed ints
|
template <unsigned int D, unsigned int N=1, unsigned int M=INT_MAX> // use INT_MAX here because enums are treated as signed ints
|
||||||
class VariableRounds
|
class VariableRounds
|
||||||
{
|
{
|
||||||
|
|
@ -72,7 +72,7 @@ protected:
|
||||||
|
|
||||||
// ************** key length ***************
|
// ************** key length ***************
|
||||||
|
|
||||||
//! .
|
//! to be inherited by keyed algorithms with fixed key length
|
||||||
template <unsigned int N, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
|
template <unsigned int N, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
|
||||||
class FixedKeyLength
|
class FixedKeyLength
|
||||||
{
|
{
|
||||||
|
|
@ -137,7 +137,7 @@ static inline void CheckedSetKey(T *obj, CipherDir dir, const byte *key, unsigne
|
||||||
obj->UncheckedSetKey(dir, key, length);
|
obj->UncheckedSetKey(dir, key, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE, class INFO = BASE>
|
template <class BASE, class INFO = BASE>
|
||||||
class CRYPTOPP_NO_VTABLE SimpleKeyingInterfaceImpl : public BASE
|
class CRYPTOPP_NO_VTABLE SimpleKeyingInterfaceImpl : public BASE
|
||||||
{
|
{
|
||||||
|
|
@ -153,13 +153,13 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class INFO, class BASE = BlockCipher>
|
template <class INFO, class BASE = BlockCipher>
|
||||||
class CRYPTOPP_NO_VTABLE BlockCipherImpl : public AlgorithmImpl<SimpleKeyingInterfaceImpl<BASE, INFO>, INFO>, public INFO
|
class CRYPTOPP_NO_VTABLE BlockCipherImpl : public AlgorithmImpl<SimpleKeyingInterfaceImpl<TwoBases<BASE, INFO> > >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
unsigned int BlockSize() const {return this->BLOCKSIZE;}
|
unsigned int BlockSize() const {return this->BLOCKSIZE;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <CipherDir DIR, class BASE>
|
template <CipherDir DIR, class BASE>
|
||||||
class BlockCipherFinal : public ClonableImpl<BlockCipherFinal<DIR, BASE>, BASE>
|
class BlockCipherFinal : public ClonableImpl<BlockCipherFinal<DIR, BASE>, BASE>
|
||||||
{
|
{
|
||||||
|
|
@ -180,23 +180,18 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE, class INFO = BASE>
|
template <class BASE, class INFO = BASE>
|
||||||
class MessageAuthenticationCodeImpl : public
|
class MessageAuthenticationCodeImpl : public AlgorithmImpl<SimpleKeyingInterfaceImpl<BASE, INFO>, INFO>
|
||||||
#ifdef CRYPTOPP_DOXYGEN_PROCESSING
|
|
||||||
MessageAuthenticationCode
|
|
||||||
#else
|
|
||||||
AlgorithmImpl<SimpleKeyingInterfaceImpl<BASE, INFO>, INFO>
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void SetKey(const byte *key, unsigned int length, const NameValuePairs ¶m = g_nullNameValuePairs)
|
void SetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms = g_nullNameValuePairs)
|
||||||
{
|
{
|
||||||
CheckedSetKey(this, Empty(), key, length, param);
|
CheckedSetKey(this, Empty(), key, length, params);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
template <class BASE>
|
template <class BASE>
|
||||||
class MessageAuthenticationCodeFinal : public ClonableImpl<MessageAuthenticationCodeFinal<BASE>, MessageAuthenticationCodeImpl<BASE> >
|
class MessageAuthenticationCodeFinal : public ClonableImpl<MessageAuthenticationCodeFinal<BASE>, MessageAuthenticationCodeImpl<BASE> >
|
||||||
{
|
{
|
||||||
|
|
@ -222,8 +217,10 @@ struct BlockCipherDocumentation
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! \brief Each class derived from this one defines two types, Encryption and Decryption,
|
/*! \brief Each class derived from this one defines two types, Encryption and Decryption,
|
||||||
both of which implement the SymmetricCipher interface. See CipherModeDocumentation
|
both of which implement the SymmetricCipher interface. Two types of classes derive
|
||||||
for information about using block ciphers. */
|
from this class: stream ciphers and block cipher modes. Stream ciphers can be used
|
||||||
|
alone, cipher mode classes need to be used with a block cipher. See CipherModeDocumentation
|
||||||
|
for more for information about using cipher modes and block ciphers. */
|
||||||
struct SymmetricCipherDocumentation
|
struct SymmetricCipherDocumentation
|
||||||
{
|
{
|
||||||
//! implements the SymmetricCipher interface
|
//! implements the SymmetricCipher interface
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 1, 32>, public FixedRounds<32>
|
struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 1, 32>, public FixedRounds<32>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "Serpent";}
|
static const char *StaticAlgorithmName() {return "Serpent";}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct SHACAL2_Info : public FixedBlockSize<32>, public VariableKeyLength<16, 16, 64>
|
struct SHACAL2_Info : public FixedBlockSize<32>, public VariableKeyLength<16, 16, 64>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "SHACAL-2";}
|
static const char *StaticAlgorithmName() {return "SHACAL-2";}
|
||||||
|
|
|
||||||
1
shark.h
1
shark.h
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct SHARK_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 16>, public VariableRounds<6, 2>
|
struct SHARK_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 16>, public VariableRounds<6, 2>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "SHARK-E";}
|
static const char *StaticAlgorithmName() {return "SHARK-E";}
|
||||||
|
|
|
||||||
18
simple.h
18
simple.h
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class DERIVED, class BASE>
|
template <class DERIVED, class BASE>
|
||||||
class CRYPTOPP_NO_VTABLE ClonableImpl : public BASE
|
class CRYPTOPP_NO_VTABLE ClonableImpl : public BASE
|
||||||
{
|
{
|
||||||
|
|
@ -18,28 +19,30 @@ public:
|
||||||
Clonable * Clone() const {return new DERIVED(*static_cast<const DERIVED *>(this));}
|
Clonable * Clone() const {return new DERIVED(*static_cast<const DERIVED *>(this));}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class BASE, class ALGORITHM_INFO = BASE>
|
//! _
|
||||||
|
template <class BASE, class ALGORITHM_INFO=BASE>
|
||||||
class CRYPTOPP_NO_VTABLE AlgorithmImpl : public BASE
|
class CRYPTOPP_NO_VTABLE AlgorithmImpl : public BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static std::string StaticAlgorithmName() {return ALGORITHM_INFO::StaticAlgorithmName();}
|
||||||
std::string AlgorithmName() const {return ALGORITHM_INFO::StaticAlgorithmName();}
|
std::string AlgorithmName() const {return ALGORITHM_INFO::StaticAlgorithmName();}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL InvalidKeyLength : public InvalidArgument
|
class CRYPTOPP_DLL InvalidKeyLength : public InvalidArgument
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit InvalidKeyLength(const std::string &algorithm, unsigned int length) : InvalidArgument(algorithm + ": " + IntToString(length) + " is not a valid key length") {}
|
explicit InvalidKeyLength(const std::string &algorithm, unsigned int length) : InvalidArgument(algorithm + ": " + IntToString(length) + " is not a valid key length") {}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class CRYPTOPP_DLL InvalidRounds : public InvalidArgument
|
class CRYPTOPP_DLL InvalidRounds : public InvalidArgument
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit InvalidRounds(const std::string &algorithm, unsigned int rounds) : InvalidArgument(algorithm + ": " + IntToString(rounds) + " is not a valid number of rounds") {}
|
explicit InvalidRounds(const std::string &algorithm, unsigned int rounds) : InvalidArgument(algorithm + ": " + IntToString(rounds) + " is not a valid number of rounds") {}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
// TODO: look into this virtual inheritance
|
// TODO: look into this virtual inheritance
|
||||||
class CRYPTOPP_DLL ASN1CryptoMaterial : virtual public ASN1Object, virtual public CryptoMaterial
|
class CRYPTOPP_DLL ASN1CryptoMaterial : virtual public ASN1Object, virtual public CryptoMaterial
|
||||||
{
|
{
|
||||||
|
|
@ -52,6 +55,7 @@ public:
|
||||||
|
|
||||||
// *****************************
|
// *****************************
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE Bufferless : public T
|
class CRYPTOPP_NO_VTABLE Bufferless : public T
|
||||||
{
|
{
|
||||||
|
|
@ -59,6 +63,7 @@ public:
|
||||||
bool IsolatedFlush(bool hardFlush, bool blocking) {return false;}
|
bool IsolatedFlush(bool hardFlush, bool blocking) {return false;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE Unflushable : public T
|
class CRYPTOPP_NO_VTABLE Unflushable : public T
|
||||||
{
|
{
|
||||||
|
|
@ -82,6 +87,7 @@ protected:
|
||||||
virtual bool InputBufferIsEmpty() const {return false;}
|
virtual bool InputBufferIsEmpty() const {return false;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE InputRejecting : public T
|
class CRYPTOPP_NO_VTABLE InputRejecting : public T
|
||||||
{
|
{
|
||||||
|
|
@ -100,6 +106,7 @@ public:
|
||||||
bool ChannelMessageSeriesEnd(const std::string &, int, bool) {throw InputRejected();}
|
bool ChannelMessageSeriesEnd(const std::string &, int, bool) {throw InputRejected();}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE CustomFlushPropagation : public T
|
class CRYPTOPP_NO_VTABLE CustomFlushPropagation : public T
|
||||||
{
|
{
|
||||||
|
|
@ -110,6 +117,7 @@ private:
|
||||||
bool IsolatedFlush(bool hardFlush, bool blocking) {assert(false); return false;}
|
bool IsolatedFlush(bool hardFlush, bool blocking) {assert(false); return false;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE CustomSignalPropagation : public CustomFlushPropagation<T>
|
class CRYPTOPP_NO_VTABLE CustomSignalPropagation : public CustomFlushPropagation<T>
|
||||||
{
|
{
|
||||||
|
|
@ -120,6 +128,7 @@ private:
|
||||||
void IsolatedInitialize(const NameValuePairs ¶meters) {assert(false);}
|
void IsolatedInitialize(const NameValuePairs ¶meters) {assert(false);}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE Multichannel : public CustomFlushPropagation<T>
|
class CRYPTOPP_NO_VTABLE Multichannel : public CustomFlushPropagation<T>
|
||||||
{
|
{
|
||||||
|
|
@ -149,6 +158,7 @@ public:
|
||||||
virtual bool ChannelFlush(const std::string &channel, bool hardFlush, int propagation=-1, bool blocking=true) =0;
|
virtual bool ChannelFlush(const std::string &channel, bool hardFlush, int propagation=-1, bool blocking=true) =0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class T>
|
template <class T>
|
||||||
class CRYPTOPP_NO_VTABLE AutoSignaling : public T
|
class CRYPTOPP_NO_VTABLE AutoSignaling : public T
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct SKIPJACK_Info : public FixedBlockSize<8>, public FixedKeyLength<10>
|
struct SKIPJACK_Info : public FixedBlockSize<8>, public FixedKeyLength<10>
|
||||||
{
|
{
|
||||||
CRYPTOPP_DLL static const char * StaticAlgorithmName() {return "SKIPJACK";}
|
CRYPTOPP_DLL static const char * StaticAlgorithmName() {return "SKIPJACK";}
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ private:
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! socket-based implementation of NetworkSource
|
||||||
class SocketSource : public NetworkSource, public Socket
|
class SocketSource : public NetworkSource, public Socket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -196,7 +196,7 @@ private:
|
||||||
SocketReceiver m_receiver;
|
SocketReceiver m_receiver;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! socket-based implementation of NetworkSink
|
||||||
class SocketSink : public NetworkSink, public Socket
|
class SocketSink : public NetworkSink, public Socket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
1
square.h
1
square.h
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct Square_Info : public FixedBlockSize<16>, public FixedKeyLength<16>, FixedRounds<8>
|
struct Square_Info : public FixedBlockSize<16>, public FixedKeyLength<16>, FixedRounds<8>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "Square";}
|
static const char *StaticAlgorithmName() {return "Square";}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
(since it's an additive cipher, i.e., it xors a keystream into the plaintext).
|
(since it's an additive cipher, i.e., it xors a keystream into the plaintext).
|
||||||
See this line in seal.h:
|
See this line in seal.h:
|
||||||
|
|
||||||
typedef SymmetricCipherFinal<ConcretePolicyHolder<SEAL_Policy<B>, AdditiveCipherTemplate<> > > Encryption;
|
typedef SymmetricCipherFinal\<ConcretePolicyHolder\<SEAL_Policy\<B\>, AdditiveCipherTemplate\<\> \> \> Encryption;
|
||||||
|
|
||||||
AdditiveCipherTemplate and CFB_CipherTemplate are designed so that they don't need
|
AdditiveCipherTemplate and CFB_CipherTemplate are designed so that they don't need
|
||||||
to take a policy class as a template parameter (although this is allowed), so that
|
to take a policy class as a template parameter (although this is allowed), so that
|
||||||
|
|
@ -263,6 +263,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS CFB_CipherTemplate<AbstractPolicyHolder<CFB_CipherAb
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS CFB_EncryptionTemplate<>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS CFB_EncryptionTemplate<>;
|
||||||
CRYPTOPP_DLL_TEMPLATE_CLASS CFB_DecryptionTemplate<>;
|
CRYPTOPP_DLL_TEMPLATE_CLASS CFB_DecryptionTemplate<>;
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class BASE, class INFO = BASE>
|
template <class BASE, class INFO = BASE>
|
||||||
class SymmetricCipherFinal : public AlgorithmImpl<SimpleKeyingInterfaceImpl<BASE, INFO>, INFO>
|
class SymmetricCipherFinal : public AlgorithmImpl<SimpleKeyingInterfaceImpl<BASE, INFO>, INFO>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
3
tea.h
3
tea.h
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct TEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32>
|
struct TEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "TEA";}
|
static const char *StaticAlgorithmName() {return "TEA";}
|
||||||
|
|
@ -47,6 +48,7 @@ public:
|
||||||
typedef TEA::Encryption TEAEncryption;
|
typedef TEA::Encryption TEAEncryption;
|
||||||
typedef TEA::Decryption TEADecryption;
|
typedef TEA::Decryption TEADecryption;
|
||||||
|
|
||||||
|
//! _
|
||||||
struct XTEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32>
|
struct XTEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "XTEA";}
|
static const char *StaticAlgorithmName() {return "XTEA";}
|
||||||
|
|
@ -82,6 +84,7 @@ public:
|
||||||
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
|
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
struct BTEA_Info : public FixedKeyLength<16>
|
struct BTEA_Info : public FixedKeyLength<16>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "BTEA";}
|
static const char *StaticAlgorithmName() {return "BTEA";}
|
||||||
|
|
|
||||||
3
test.cpp
3
test.cpp
|
|
@ -80,9 +80,6 @@ void FIPS140_GenerateRandomFiles();
|
||||||
|
|
||||||
bool Validate(int, bool, const char *);
|
bool Validate(int, bool, const char *);
|
||||||
|
|
||||||
void RegisterFactories();
|
|
||||||
bool RunTestDataFile(const char *filename);
|
|
||||||
|
|
||||||
int (*AdhocTest)(int argc, char *argv[]) = NULL;
|
int (*AdhocTest)(int argc, char *argv[]) = NULL;
|
||||||
|
|
||||||
#ifdef __BCPLUSPLUS__
|
#ifdef __BCPLUSPLUS__
|
||||||
|
|
|
||||||
6
ttmac.h
6
ttmac.h
|
|
@ -7,9 +7,8 @@
|
||||||
#include "iterhash.h"
|
#include "iterhash.h"
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
//! <a href="http://www.eskimo.com/~weidai/scan-mirror/mac.html#Two-Track-MAC">Two-Track-MAC</a>
|
|
||||||
/*! 160 Bit MAC with 160 Bit Key */
|
|
||||||
|
|
||||||
|
//! _
|
||||||
class CRYPTOPP_NO_VTABLE TTMAC_Base : public FixedKeyLength<20>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>
|
class CRYPTOPP_NO_VTABLE TTMAC_Base : public FixedKeyLength<20>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -31,7 +30,8 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
//! <a href="http://www.weidai.com/scan-mirror/mac.html#TTMAC">Two-Track-MAC</a>
|
//! <a href="http://www.weidai.com/scan-mirror/mac.html#TTMAC">Two-Track-MAC</a>
|
||||||
typedef MessageAuthenticationCodeFinal<TTMAC_Base> TTMAC;
|
/*! 160 Bit MAC with 160 Bit Key */
|
||||||
|
DOCUMENTED_TYPEDEF(MessageAuthenticationCodeFinal<TTMAC_Base>, TTMAC)
|
||||||
|
|
||||||
NAMESPACE_END
|
NAMESPACE_END
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
struct Twofish_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 32>, FixedRounds<16>
|
struct Twofish_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 0, 32>, FixedRounds<16>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return "Twofish";}
|
static const char *StaticAlgorithmName() {return "Twofish";}
|
||||||
|
|
|
||||||
128
validat3.cpp
128
validat3.cpp
|
|
@ -13,8 +13,6 @@
|
||||||
#include "tiger.h"
|
#include "tiger.h"
|
||||||
#include "ripemd.h"
|
#include "ripemd.h"
|
||||||
#include "haval.h"
|
#include "haval.h"
|
||||||
#include "panama.h"
|
|
||||||
#include "whrlpool.h"
|
|
||||||
|
|
||||||
#include "xormac.h"
|
#include "xormac.h"
|
||||||
#include "md5mac.h"
|
#include "md5mac.h"
|
||||||
|
|
@ -377,135 +375,17 @@ bool ValidateHAVAL()
|
||||||
|
|
||||||
bool ValidatePanama()
|
bool ValidatePanama()
|
||||||
{
|
{
|
||||||
bool pass=true;
|
cout << "\nPanama validation suite running...\n";
|
||||||
|
|
||||||
// the first two test vectors are from the reference implementation
|
return RunTestDataFile("TestVectors/panama.txt");
|
||||||
// the rest were generated by Crypto++
|
|
||||||
HashTestTuple testSet1[] =
|
|
||||||
{
|
|
||||||
HashTestTuple("", "\xaa\x0c\xc9\x54\xd7\x57\xd7\xac\x77\x79\xca\x33\x42\x33\x4c\xa4\x71\xab\xd4\x7d\x59\x52\xac\x91\xed\x83\x7e\xcd\x5b\x16\x92\x2b"),
|
|
||||||
HashTestTuple("The quick brown fox jumps over the lazy dog", "\x5f\x5c\xa3\x55\xb9\x0a\xc6\x22\xb0\xaa\x7e\x65\x4e\xf5\xf2\x7e\x9e\x75\x11\x14\x15\xb4\x8b\x8a\xfe\x3a\xdd\x1c\x6b\x89\xcb\xa1"),
|
|
||||||
HashTestTuple("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "\xaf\x9c\x66\xfb\x60\x58\xe2\x23\x2a\x5d\xfb\xa0\x63\xee\x14\xb0\xf8\x6f\x0e\x33\x4e\x16\x58\x12\x55\x94\x35\x46\x4d\xd9\xbb\x60", 15625)
|
|
||||||
};
|
|
||||||
HashTestTuple testSet2[] =
|
|
||||||
{
|
|
||||||
HashTestTuple("", "\xe8\x1a\xa0\x45\x23\x53\x2d\xd7\x26\x7e\x5c\x5b\xc3\xba\x0e\x28\x98\x37\xa6\x2b\xa0\x32\x35\x03\x51\x98\x0e\x96\x0a\x84\xb0\xaf"),
|
|
||||||
HashTestTuple("The quick brown fox jumps over the lazy dog", "\x8f\xa7\xda\xdc\xe0\x11\x0f\x97\x9a\x0b\x79\x5e\x76\xb2\xc2\x56\x28\xd8\xbd\xa8\x87\x47\x75\x81\x49\xc4\x2e\x3b\xc1\x3f\x85\xbc"),
|
|
||||||
HashTestTuple("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "\xcb\x34\xf0\x93\x7e\x8d\x87\x0d\x3b\xd7\xff\x63\x11\x76\x5f\x2c\x22\x9a\x6c\x21\x54\xe4\xdb\x11\x95\x38\xdb\x51\x59\x43\x7c\xab", 15625)
|
|
||||||
};
|
|
||||||
|
|
||||||
cout << "\nPanama Hash Function (little endian) validation suite running...\n\n";
|
|
||||||
PanamaHash<LittleEndian> panamaLE;
|
|
||||||
pass = HashModuleTest(panamaLE, testSet1, sizeof(testSet1)/sizeof(testSet1[0])) && pass;
|
|
||||||
|
|
||||||
cout << "\nPanama Hash Function (big endian) validation suite running...\n\n";
|
|
||||||
PanamaHash<BigEndian> panamaBE;
|
|
||||||
pass = HashModuleTest(panamaBE, testSet2, sizeof(testSet2)/sizeof(testSet2[0])) && pass;
|
|
||||||
|
|
||||||
// these were generated by Crypto++
|
|
||||||
unsigned char Key0[] = {
|
|
||||||
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
|
|
||||||
0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
|
|
||||||
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
|
|
||||||
0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,
|
|
||||||
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
|
|
||||||
0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
|
|
||||||
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
|
|
||||||
0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f};
|
|
||||||
unsigned char Input0l[] = {
|
|
||||||
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
|
|
||||||
0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
|
|
||||||
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
|
|
||||||
0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f};
|
|
||||||
unsigned char Output0l[] = {
|
|
||||||
0xF0,0x7F,0x5F,0xF2,0xCC,0xD0,0x1A,0x0A,
|
|
||||||
0x7D,0x44,0xAC,0xD6,0xD2,0x39,0xC2,0xAF,
|
|
||||||
0x0D,0xA1,0xFF,0x35,0x27,0x5B,0xAF,0x5D,
|
|
||||||
0xFA,0x6E,0x09,0x41,0x1B,0x79,0xD8,0xB9};
|
|
||||||
unsigned char Input0b[] = {
|
|
||||||
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
|
|
||||||
0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
|
|
||||||
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
|
|
||||||
0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f};
|
|
||||||
unsigned char Output0b[] = {
|
|
||||||
0xE1,0x2E,0x2F,0x6B,0xA4,0x1A,0xE8,0x32,
|
|
||||||
0xD8,0x88,0xDA,0x9F,0xA6,0x86,0x3B,0xC3,
|
|
||||||
0x7C,0x0E,0x99,0x6F,0x19,0x0A,0x17,0x11,
|
|
||||||
0x33,0x03,0x22,0xD3,0x7B,0xD9,0x8C,0xA4};
|
|
||||||
|
|
||||||
// VC60 workaround: auto_ptr lacks reset()
|
|
||||||
member_ptr<StreamTransformation> cipher;
|
|
||||||
bool fail;
|
|
||||||
|
|
||||||
cout << "\nPanama Cipher (little endian) validation suite running...\n\n";
|
|
||||||
|
|
||||||
cipher.reset(new PanamaCipher<LittleEndian>::Encryption(Key0, 64));
|
|
||||||
cipher->ProcessString(Input0l, sizeof(Input0l));
|
|
||||||
fail = memcmp(Input0l, Output0l, sizeof(Input0l)) != 0;
|
|
||||||
cout << (fail ? "FAILED" : "passed") << " Test 0" << endl;
|
|
||||||
pass = pass && !fail;
|
|
||||||
|
|
||||||
cout << "\nPanama Cipher (big endian) validation suite running...\n\n";
|
|
||||||
|
|
||||||
cipher.reset(new PanamaCipher<BigEndian>::Encryption(Key0, 64));
|
|
||||||
cipher->ProcessString(Input0b, sizeof(Input0b));
|
|
||||||
fail = memcmp(Input0b, Output0b, sizeof(Input0b)) != 0;
|
|
||||||
cout << (fail ? "FAILED" : "passed") << " Test 0" << endl;
|
|
||||||
pass = pass && !fail;
|
|
||||||
|
|
||||||
return pass;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ValidateWhirlpool()
|
bool ValidateWhirlpool()
|
||||||
{
|
{
|
||||||
cout << "\nWhirlpool Hash Function validation suite running...\n\n";
|
cout << "\nWhirlpool Hash Function validation suite running...\n";
|
||||||
|
|
||||||
#ifdef WORD64_AVAILABLE
|
#ifdef WORD64_AVAILABLE
|
||||||
// Selected test vectors from the Whirlpool NESSIE submission.
|
return RunTestDataFile("TestVectors/whrlpool.txt");
|
||||||
|
|
||||||
const char Output0[] =
|
|
||||||
"\x47\x0F\x04\x09\xAB\xAA\x44\x6E\x49\x66\x7D\x4E\xBE\x12\xA1\x43"
|
|
||||||
"\x87\xCE\xDB\xD1\x0D\xD1\x7B\x82\x43\xCA\xD5\x50\xA0\x89\xDC\x0F"
|
|
||||||
"\xEE\xA7\xAA\x40\xF6\xC2\xAA\xAB\x71\xC6\xEB\xD0\x76\xE4\x3C\x7C"
|
|
||||||
"\xFC\xA0\xAD\x32\x56\x78\x97\xDC\xB5\x96\x98\x61\x04\x9A\x0F\x5A";
|
|
||||||
const char Output1[] =
|
|
||||||
"\xEB\xAA\x1D\xF2\xE9\x71\x13\xBE\x18\x7E\xB0\x30\x3C\x66\x0F\x6E"
|
|
||||||
"\x64\x3E\x2C\x09\x0E\xF2\xCD\xA9\xA2\xEA\x6D\xCF\x50\x02\x14\x7D"
|
|
||||||
"\x1D\x0E\x1E\x9D\x99\x6E\x87\x9C\xEF\x9D\x26\x89\x66\x30\xA5\xDB"
|
|
||||||
"\x33\x08\xD5\xA0\xDC\x23\x5B\x19\x9C\x38\x92\x3B\xE2\x25\x9E\x03";
|
|
||||||
const char Output16[] =
|
|
||||||
"\x40\x23\x8F\x57\xB2\x7D\x07\x4F\x9C\x8D\x04\x3D\xBD\x27\x07\xC7"
|
|
||||||
"\x18\xFC\x34\x49\xCC\x1F\x49\x0C\xA2\xF3\x24\xDF\xEC\x48\xB0\x5A"
|
|
||||||
"\xE7\x2D\x02\x6D\x89\x1C\xC0\x80\xE6\x31\x1F\xC3\x2E\xCF\xFC\x30"
|
|
||||||
"\xF4\x23\xDA\x7E\x63\xE3\x98\x7C\xA0\xCD\x37\xBF\xFD\x97\xCA\x56";
|
|
||||||
const char Output32[] =
|
|
||||||
"\x48\xCC\xE9\x1F\x62\xB6\xD9\x35\x13\x38\x30\x1D\xF1\x82\xF4\x6A"
|
|
||||||
"\xD0\x7B\xB7\xB2\x33\xC1\x19\xCA\x2C\x1F\xC2\x19\xFF\xF9\x49\x85"
|
|
||||||
"\x8D\x47\xE5\x0D\x69\x18\xEB\xDC\xDF\x5F\x82\x98\x05\xFB\x86\x07"
|
|
||||||
"\x22\x76\x35\x69\xE6\xAB\x73\x41\x05\x4C\x38\x9C\xE9\xD6\xEB\xAC";
|
|
||||||
const char Output33[] =
|
|
||||||
"\x60\x4B\x8B\x59\x15\xA7\xD6\x21\x42\x78\xDF\x08\x13\x53\x1F\xF2"
|
|
||||||
"\x60\xE1\x46\x51\xEC\xAC\xEC\x57\x6F\x01\xC4\x05\x42\x8F\x8D\x55"
|
|
||||||
"\x45\xB7\xEA\x6E\x65\x75\x8E\x5E\x83\xA4\x29\xD8\x52\xF4\x8C\x16"
|
|
||||||
"\x50\x6B\xBF\x00\xB5\x28\x51\x9B\x14\x2A\x77\x45\xF8\x31\x84\xD4";
|
|
||||||
const char Output64[] =
|
|
||||||
"\xA0\x72\x51\x3B\x2A\xA9\xE0\x72\x26\xBA\x01\xE7\xD5\xB2\xB6\x26"
|
|
||||||
"\xE3\x62\xB1\x40\x1E\x1A\xEC\xF1\x68\xB9\x53\x32\x42\xC0\x18\xFF"
|
|
||||||
"\xEA\x81\x83\x7F\x7B\xD1\x60\xD1\xD0\xA9\x64\x4C\x8E\xD6\x41\x50"
|
|
||||||
"\xE6\x40\x6D\x2C\x1B\x74\x56\x02\x4F\x10\x98\x53\x90\x81\xFC\x77";
|
|
||||||
|
|
||||||
HashTestTuple testSet[] =
|
|
||||||
{
|
|
||||||
HashTestTuple("", 0, Output0, 1),
|
|
||||||
HashTestTuple("\0", 1, Output1, 1),
|
|
||||||
HashTestTuple("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16, Output16, 1),
|
|
||||||
HashTestTuple("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16, Output32, 2),
|
|
||||||
HashTestTuple("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 33, Output33, 1),
|
|
||||||
HashTestTuple("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16, Output64, 4),
|
|
||||||
};
|
|
||||||
|
|
||||||
Whirlpool whirlpool;
|
|
||||||
return HashModuleTest(whirlpool, testSet, sizeof(testSet)/sizeof(testSet[0]));
|
|
||||||
#else
|
#else
|
||||||
cout << "word64 not available, skipping Whirlpool validation." << endl;
|
cout << "word64 not available, skipping Whirlpool validation." << endl;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -74,5 +74,6 @@ bool ValidateECDSA();
|
||||||
bool ValidateESIGN();
|
bool ValidateESIGN();
|
||||||
|
|
||||||
CryptoPP::RandomPool & GlobalRNG();
|
CryptoPP::RandomPool & GlobalRNG();
|
||||||
|
bool RunTestDataFile(const char *filename);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
24
wake.h
24
wake.h
|
|
@ -7,12 +7,20 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
|
//! _
|
||||||
template <class B = BigEndian>
|
template <class B = BigEndian>
|
||||||
struct WAKE_Info : public FixedKeyLength<32>
|
struct WAKE_CFB_Info : public FixedKeyLength<32>
|
||||||
{
|
{
|
||||||
static const char *StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "WAKE-CFB-LE" : "WAKE-CFB-BE";}
|
static const char *StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "WAKE-CFB-LE" : "WAKE-CFB-BE";}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//! _
|
||||||
|
template <class B = BigEndian>
|
||||||
|
struct WAKE_OFB_Info : public FixedKeyLength<32>
|
||||||
|
{
|
||||||
|
static const char *StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "WAKE-OFB-LE" : "WAKE-OFB-BE";}
|
||||||
|
};
|
||||||
|
|
||||||
class CRYPTOPP_NO_VTABLE WAKE_Base
|
class CRYPTOPP_NO_VTABLE WAKE_Base
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
@ -24,8 +32,8 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class B = BigEndian>
|
template <class B = BigEndian>
|
||||||
class CRYPTOPP_NO_VTABLE WAKE_Policy : public WAKE_Info<B>
|
class CRYPTOPP_NO_VTABLE WAKE_Policy
|
||||||
, public CFB_CipherConcretePolicy<word32, 1>
|
: public CFB_CipherConcretePolicy<word32, 1>
|
||||||
, public AdditiveCipherConcretePolicy<word32, 1, 64>
|
, public AdditiveCipherConcretePolicy<word32, 1, 64>
|
||||||
, protected WAKE_Base
|
, protected WAKE_Base
|
||||||
{
|
{
|
||||||
|
|
@ -41,17 +49,17 @@ protected:
|
||||||
|
|
||||||
//! <a href="http://www.weidai.com/scan-mirror/cs.html#WAKE-CFB-BE">WAKE-CFB-BE</a>
|
//! <a href="http://www.weidai.com/scan-mirror/cs.html#WAKE-CFB-BE">WAKE-CFB-BE</a>
|
||||||
template <class B = BigEndian>
|
template <class B = BigEndian>
|
||||||
struct WAKE_CFB : public WAKE_Info<B>, public SymmetricCipherDocumentation
|
struct WAKE_CFB : public WAKE_CFB_Info<B>, public SymmetricCipherDocumentation
|
||||||
{
|
{
|
||||||
typedef SymmetricCipherFinal<ConcretePolicyHolder<WAKE_Policy<B>, CFB_EncryptionTemplate<> > > Encryption;
|
typedef SymmetricCipherFinal<ConcretePolicyHolder<WAKE_Policy<B>, CFB_EncryptionTemplate<> >, WAKE_CFB_Info<B> > Encryption;
|
||||||
typedef SymmetricCipherFinal<ConcretePolicyHolder<WAKE_Policy<B>, CFB_DecryptionTemplate<> > > Decryption;
|
typedef SymmetricCipherFinal<ConcretePolicyHolder<WAKE_Policy<B>, CFB_DecryptionTemplate<> >, WAKE_CFB_Info<B> > Decryption;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! WAKE-OFB
|
//! WAKE-OFB
|
||||||
template <class B = BigEndian>
|
template <class B = BigEndian>
|
||||||
struct WAKE_OFB : public WAKE_Info<B>, public SymmetricCipherDocumentation
|
struct WAKE_OFB : public WAKE_OFB_Info<B>, public SymmetricCipherDocumentation
|
||||||
{
|
{
|
||||||
typedef SymmetricCipherFinal<ConcretePolicyHolder<WAKE_Policy<B>, AdditiveCipherTemplate<> > > Encryption;
|
typedef SymmetricCipherFinal<ConcretePolicyHolder<WAKE_Policy<B>, AdditiveCipherTemplate<> >, WAKE_OFB_Info<B> > Encryption;
|
||||||
typedef Encryption Decryption;
|
typedef Encryption Decryption;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! <a href="http://www.eskimo.com/~weidai/scan-mirror/md.html#Whirlpool">Whirlpool</a>
|
//! <a href="http://www.weidai.com/scan-mirror/md.html#Whirlpool">Whirlpool</a>
|
||||||
/*! 512 Bit Hash */
|
/*! 512 Bit Hash */
|
||||||
class Whirlpool : public IteratedHashWithStaticTransform<word64, BigEndian, 64, 64, Whirlpool>
|
class Whirlpool : public IteratedHashWithStaticTransform<word64, BigEndian, 64, 64, Whirlpool>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ protected:
|
||||||
{assert(result==TRUE || result==FALSE); if (!result) HandleError(operation);}
|
{assert(result==TRUE || result==FALSE); if (!result) HandleError(operation);}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! pipe-based implementation of NetworkReceiver
|
||||||
class WindowsPipeReceiver : public WindowsPipe, public NetworkReceiver
|
class WindowsPipeReceiver : public WindowsPipe, public NetworkReceiver
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -79,7 +79,7 @@ private:
|
||||||
bool m_eofReceived;
|
bool m_eofReceived;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! .
|
//! pipe-based implementation of NetworkSender
|
||||||
class WindowsPipeSender : public WindowsPipe, public NetworkSender
|
class WindowsPipeSender : public WindowsPipe, public NetworkSender
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class LowFirstBitWriter : public Filter
|
class LowFirstBitWriter : public Filter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
NAMESPACE_BEGIN(CryptoPP)
|
NAMESPACE_BEGIN(CryptoPP)
|
||||||
|
|
||||||
//! .
|
//! _
|
||||||
class LowFirstBitReader
|
class LowFirstBitReader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue