wolfSSL RC2 template.

This commit is contained in:
David Garske
2020-09-18 17:04:26 -07:00
committed by Chris Conlon
parent ab88ab160c
commit b58ea5842a
5 changed files with 103 additions and 0 deletions

View File

@ -2781,6 +2781,19 @@ else
fi fi
# RC2
AC_ARG_ENABLE([rc2],
[AS_HELP_STRING([--enable-rc2],[Enable RC2 encryption (default: disabled)])],
[ ENABLED_RC2=$enableval ],
[ ENABLED_RC2=no ]
)
if test "$ENABLED_RC2" = "yes"
then
AM_CFLAGS="$AM_CFLAGS -DWC_RC2"
fi
# FIPS # FIPS
AS_CASE([$FIPS_VERSION], AS_CASE([$FIPS_VERSION],
["v2"],[ ["v2"],[
@ -5751,6 +5764,7 @@ AM_CONDITIONAL([BUILD_HASHFLAGS],[test "x$ENABLED_HASHFLAGS" = "xyes"])
AM_CONDITIONAL([BUILD_LINUXKM],[test "$ENABLED_LINUXKM" = "yes"]) AM_CONDITIONAL([BUILD_LINUXKM],[test "$ENABLED_LINUXKM" = "yes"])
AM_CONDITIONAL([BUILD_NO_LIBRARY],[test "$ENABLED_NO_LIBRARY" = "yes"]) AM_CONDITIONAL([BUILD_NO_LIBRARY],[test "$ENABLED_NO_LIBRARY" = "yes"])
AM_CONDITIONAL([BUILD_DEBUG],[test "$ax_enable_debug" = "yes" || test "$ENABLED_STACKSIZE" = "yes"]) AM_CONDITIONAL([BUILD_DEBUG],[test "$ax_enable_debug" = "yes" || test "$ENABLED_STACKSIZE" = "yes"])
AM_CONDITIONAL([BUILD_RC2],[test "x$ENABLED_RC2" = "xyes"])
CREATE_HEX_VERSION CREATE_HEX_VERSION

View File

@ -208,6 +208,10 @@ endif
endif endif
endif endif
if BUILD_RC2
src_libwolfssl_la_SOURCES += wolfcrypt/src/rc2.c
endif
if BUILD_SP if BUILD_SP
if BUILD_SP_C if BUILD_SP_C
src_libwolfssl_la_SOURCES += wolfcrypt/src/sp_c32.c src_libwolfssl_la_SOURCES += wolfcrypt/src/sp_c32.c

43
wolfcrypt/src/rc2.c Normal file
View File

@ -0,0 +1,43 @@
/* rc2.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/*
DESCRIPTION
This library provides the interface to the RC2 encryption algorithm.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef WC_RC2
#include <wolfssl/wolfcrypt/rc2.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#endif /* WC_RC2 */

View File

@ -43,6 +43,7 @@ nobase_include_HEADERS+= \
wolfssl/wolfcrypt/random.h \ wolfssl/wolfcrypt/random.h \
wolfssl/wolfcrypt/ripemd.h \ wolfssl/wolfcrypt/ripemd.h \
wolfssl/wolfcrypt/rsa.h \ wolfssl/wolfcrypt/rsa.h \
wolfssl/wolfcrypt/rc2.h \
wolfssl/wolfcrypt/settings.h \ wolfssl/wolfcrypt/settings.h \
wolfssl/wolfcrypt/sha256.h \ wolfssl/wolfcrypt/sha256.h \
wolfssl/wolfcrypt/sha512.h \ wolfssl/wolfcrypt/sha512.h \

41
wolfssl/wolfcrypt/rc2.h Normal file
View File

@ -0,0 +1,41 @@
/* rc2.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifndef WOLF_CRYPT_RC2_H
#define WOLF_CRYPT_RC2_H
#include <wolfssl/wolfcrypt/types.h>
#ifdef WC_RC2
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* WC_RC2 */
#endif /* WOLF_CRYPT_RC2_H */