mirror of
https://github.com/mangosfour/server.git
synced 2026-01-01 07:37:07 +00:00
Small update
This commit is contained in:
parent
0f43427d49
commit
cc6d0e0568
17 changed files with 152 additions and 742 deletions
|
|
@ -1,163 +0,0 @@
|
|||
/* ====================================================================
|
||||
* Copyright (c) 2003 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
#ifndef OPENSSL_FIPS
|
||||
#error FIPS is disabled.
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct dsa_st;
|
||||
struct evp_pkey_st;
|
||||
struct env_md_st;
|
||||
struct evp_cipher_st;
|
||||
struct evp_cipher_ctx_st;
|
||||
|
||||
int FIPS_mode_set(int onoff);
|
||||
int FIPS_mode(void);
|
||||
const void *FIPS_rand_check(void);
|
||||
int FIPS_selftest_failed(void);
|
||||
void FIPS_selftest_check(void);
|
||||
void FIPS_corrupt_sha1(void);
|
||||
int FIPS_selftest_sha1(void);
|
||||
void FIPS_corrupt_aes(void);
|
||||
int FIPS_selftest_aes(void);
|
||||
void FIPS_corrupt_des(void);
|
||||
int FIPS_selftest_des(void);
|
||||
void FIPS_corrupt_rsa(void);
|
||||
void FIPS_corrupt_rsa_keygen(void);
|
||||
int FIPS_selftest_rsa(void);
|
||||
void FIPS_corrupt_dsa(void);
|
||||
void FIPS_corrupt_dsa_keygen(void);
|
||||
int FIPS_selftest_dsa(void);
|
||||
void FIPS_corrupt_rng(void);
|
||||
void FIPS_rng_stick(void);
|
||||
int FIPS_selftest_rng(void);
|
||||
int FIPS_selftest_hmac(void);
|
||||
|
||||
int fips_pkey_signature_test(struct evp_pkey_st *pkey,
|
||||
const unsigned char *tbs, int tbslen,
|
||||
const unsigned char *kat, unsigned int katlen,
|
||||
const struct env_md_st *digest, unsigned int md_flags,
|
||||
const char *fail_str);
|
||||
|
||||
int fips_cipher_test(struct evp_cipher_ctx_st *ctx,
|
||||
const struct evp_cipher_st *cipher,
|
||||
const unsigned char *key,
|
||||
const unsigned char *iv,
|
||||
const unsigned char *plaintext,
|
||||
const unsigned char *ciphertext,
|
||||
int len);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
void ERR_load_FIPS_strings(void);
|
||||
|
||||
/* Error codes for the FIPS functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define FIPS_F_DH_BUILTIN_GENPARAMS 100
|
||||
#define FIPS_F_DSA_BUILTIN_PARAMGEN 101
|
||||
#define FIPS_F_DSA_DO_SIGN 102
|
||||
#define FIPS_F_DSA_DO_VERIFY 103
|
||||
#define FIPS_F_EVP_CIPHERINIT_EX 124
|
||||
#define FIPS_F_EVP_DIGESTINIT_EX 125
|
||||
#define FIPS_F_FIPS_CHECK_DSA 104
|
||||
#define FIPS_F_FIPS_CHECK_INCORE_FINGERPRINT 105
|
||||
#define FIPS_F_FIPS_CHECK_RSA 106
|
||||
#define FIPS_F_FIPS_DSA_CHECK 107
|
||||
#define FIPS_F_FIPS_MODE_SET 108
|
||||
#define FIPS_F_FIPS_PKEY_SIGNATURE_TEST 109
|
||||
#define FIPS_F_FIPS_SELFTEST_AES 110
|
||||
#define FIPS_F_FIPS_SELFTEST_DES 111
|
||||
#define FIPS_F_FIPS_SELFTEST_DSA 112
|
||||
#define FIPS_F_FIPS_SELFTEST_HMAC 113
|
||||
#define FIPS_F_FIPS_SELFTEST_RNG 114
|
||||
#define FIPS_F_FIPS_SELFTEST_SHA1 115
|
||||
#define FIPS_F_HASH_FINAL 123
|
||||
#define FIPS_F_RSA_BUILTIN_KEYGEN 116
|
||||
#define FIPS_F_RSA_EAY_PRIVATE_DECRYPT 117
|
||||
#define FIPS_F_RSA_EAY_PRIVATE_ENCRYPT 118
|
||||
#define FIPS_F_RSA_EAY_PUBLIC_DECRYPT 119
|
||||
#define FIPS_F_RSA_EAY_PUBLIC_ENCRYPT 120
|
||||
#define FIPS_F_RSA_X931_GENERATE_KEY_EX 121
|
||||
#define FIPS_F_SSLEAY_RAND_BYTES 122
|
||||
|
||||
/* Reason codes. */
|
||||
#define FIPS_R_CANNOT_READ_EXE 103
|
||||
#define FIPS_R_CANNOT_READ_EXE_DIGEST 104
|
||||
#define FIPS_R_CONTRADICTING_EVIDENCE 114
|
||||
#define FIPS_R_EXE_DIGEST_DOES_NOT_MATCH 105
|
||||
#define FIPS_R_FINGERPRINT_DOES_NOT_MATCH 110
|
||||
#define FIPS_R_FINGERPRINT_DOES_NOT_MATCH_NONPIC_RELOCATED 111
|
||||
#define FIPS_R_FINGERPRINT_DOES_NOT_MATCH_SEGMENT_ALIASING 112
|
||||
#define FIPS_R_FIPS_MODE_ALREADY_SET 102
|
||||
#define FIPS_R_FIPS_SELFTEST_FAILED 106
|
||||
#define FIPS_R_INVALID_KEY_LENGTH 109
|
||||
#define FIPS_R_KEY_TOO_SHORT 108
|
||||
#define FIPS_R_NON_FIPS_METHOD 100
|
||||
#define FIPS_R_PAIRWISE_TEST_FAILED 107
|
||||
#define FIPS_R_RSA_DECRYPT_ERROR 115
|
||||
#define FIPS_R_RSA_ENCRYPT_ERROR 116
|
||||
#define FIPS_R_SELFTEST_FAILED 101
|
||||
#define FIPS_R_TEST_FAILURE 117
|
||||
#define FIPS_R_UNSUPPORTED_PLATFORM 113
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
/* ====================================================================
|
||||
* Copyright (c) 2003 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core@openssl.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HEADER_FIPS_RAND_H
|
||||
#define HEADER_FIPS_RAND_H
|
||||
|
||||
#include "des.h"
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int FIPS_rand_set_key(const unsigned char *key, FIPS_RAND_SIZE_T keylen);
|
||||
int FIPS_rand_seed(const void *buf, FIPS_RAND_SIZE_T num);
|
||||
int FIPS_rand_bytes(unsigned char *out, FIPS_RAND_SIZE_T outlen);
|
||||
|
||||
int FIPS_rand_test_mode(void);
|
||||
void FIPS_rand_reset(void);
|
||||
int FIPS_rand_set_dt(unsigned char *dt);
|
||||
|
||||
int FIPS_rand_status(void);
|
||||
|
||||
const RAND_METHOD *FIPS_rand_method(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
/* crypto/mdc2/mdc2.h */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef HEADER_MDC2_H
|
||||
#define HEADER_MDC2_H
|
||||
|
||||
#include <openssl/des.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_NO_MDC2
|
||||
#error MDC2 is disabled.
|
||||
#endif
|
||||
|
||||
#define MDC2_BLOCK 8
|
||||
#define MDC2_DIGEST_LENGTH 16
|
||||
|
||||
typedef struct mdc2_ctx_st
|
||||
{
|
||||
int num;
|
||||
unsigned char data[MDC2_BLOCK];
|
||||
DES_cblock h,hh;
|
||||
int pad_type; /* either 1 or 2, default 1 */
|
||||
} MDC2_CTX;
|
||||
|
||||
|
||||
int MDC2_Init(MDC2_CTX *c);
|
||||
int MDC2_Update(MDC2_CTX *c, const unsigned char *data, unsigned long len);
|
||||
int MDC2_Final(unsigned char *md, MDC2_CTX *c);
|
||||
unsigned char *MDC2(const unsigned char *d, unsigned long n,
|
||||
unsigned char *md);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -2,6 +2,9 @@
|
|||
/* WARNING: Generated automatically from opensslconf.h.in by Configure. */
|
||||
|
||||
/* OpenSSL was configured with the following options: */
|
||||
#ifndef OPENSSL_SYSNAME_WIN32
|
||||
# define OPENSSL_SYSNAME_WIN32
|
||||
#endif
|
||||
#ifndef OPENSSL_DOING_MAKEDEPEND
|
||||
|
||||
|
||||
|
|
@ -38,8 +41,8 @@
|
|||
|
||||
#endif /* OPENSSL_DOING_MAKEDEPEND */
|
||||
|
||||
#ifndef OPENSSL_NO_DYNAMIC_ENGINE
|
||||
# define OPENSSL_NO_DYNAMIC_ENGINE
|
||||
#ifndef OPENSSL_THREADS
|
||||
# define OPENSSL_THREADS
|
||||
#endif
|
||||
|
||||
/* The OPENSSL_NO_* macros are also defined as NO_* if the application
|
||||
|
|
@ -101,8 +104,8 @@
|
|||
|
||||
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
|
||||
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
|
||||
#define ENGINESDIR "/usr/local/ssl/lib/engines"
|
||||
#define OPENSSLDIR "/usr/local/ssl"
|
||||
#define ENGINESDIR "G:\openssl_build/lib/engines"
|
||||
#define OPENSSLDIR "G:\openssl_build/ssl"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
@ -110,6 +113,7 @@
|
|||
#define OPENSSL_UNISTD <unistd.h>
|
||||
|
||||
#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
#define OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
|
||||
#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
|
||||
#define IDEA_INT unsigned int
|
||||
|
|
@ -154,7 +158,7 @@
|
|||
|
||||
#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
|
||||
#define CONFIG_HEADER_BN_H
|
||||
#undef BN_LLONG
|
||||
#define BN_LLONG
|
||||
|
||||
/* Should we define BN_DIV2W here? */
|
||||
|
||||
|
|
@ -173,7 +177,7 @@
|
|||
#define CONFIG_HEADER_RC4_LOCL_H
|
||||
/* if this is defined data[i] is used instead of *data, this is a %20
|
||||
* speedup on x86 */
|
||||
#undef RC4_INDEX
|
||||
#define RC4_INDEX
|
||||
#endif
|
||||
|
||||
#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
|
||||
|
|
|
|||
|
|
@ -1,121 +0,0 @@
|
|||
/* crypto/rc5/rc5.h */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
|
||||
#ifndef HEADER_RC5_H
|
||||
#define HEADER_RC5_H
|
||||
|
||||
#include <openssl/opensslconf.h> /* OPENSSL_NO_RC5 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_NO_RC5
|
||||
#error RC5 is disabled.
|
||||
#endif
|
||||
|
||||
#define RC5_ENCRYPT 1
|
||||
#define RC5_DECRYPT 0
|
||||
|
||||
/* 32 bit. For Alpha, things may get weird */
|
||||
#define RC5_32_INT unsigned long
|
||||
|
||||
#define RC5_32_BLOCK 8
|
||||
#define RC5_32_KEY_LENGTH 16 /* This is a default, max is 255 */
|
||||
|
||||
/* This are the only values supported. Tweak the code if you want more
|
||||
* The most supported modes will be
|
||||
* RC5-32/12/16
|
||||
* RC5-32/16/8
|
||||
*/
|
||||
#define RC5_8_ROUNDS 8
|
||||
#define RC5_12_ROUNDS 12
|
||||
#define RC5_16_ROUNDS 16
|
||||
|
||||
typedef struct rc5_key_st
|
||||
{
|
||||
/* Number of rounds */
|
||||
int rounds;
|
||||
RC5_32_INT data[2*(RC5_16_ROUNDS+1)];
|
||||
} RC5_32_KEY;
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
|
||||
int rounds);
|
||||
#endif
|
||||
void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
|
||||
int rounds);
|
||||
void RC5_32_ecb_encrypt(const unsigned char *in,unsigned char *out,RC5_32_KEY *key,
|
||||
int enc);
|
||||
void RC5_32_encrypt(unsigned long *data,RC5_32_KEY *key);
|
||||
void RC5_32_decrypt(unsigned long *data,RC5_32_KEY *key);
|
||||
void RC5_32_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, RC5_32_KEY *ks, unsigned char *iv,
|
||||
int enc);
|
||||
void RC5_32_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, RC5_32_KEY *schedule,
|
||||
unsigned char *ivec, int *num, int enc);
|
||||
void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, RC5_32_KEY *schedule,
|
||||
unsigned char *ivec, int *num);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue