Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:48

0001 /*
0002  * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
0003  *
0004  * Licensed under the Apache License 2.0 (the "License").  You may not use
0005  * this file except in compliance with the License.  You can obtain a copy
0006  * in the file LICENSE in the source distribution or at
0007  * https://www.openssl.org/source/license.html
0008  */
0009 
0010 #ifndef OPENSSL_RC5_H
0011 # define OPENSSL_RC5_H
0012 # pragma once
0013 
0014 # include <openssl/macros.h>
0015 # ifndef OPENSSL_NO_DEPRECATED_3_0
0016 #  define HEADER_RC5_H
0017 # endif
0018 
0019 # include <openssl/opensslconf.h>
0020 
0021 # ifndef OPENSSL_NO_RC5
0022 #  ifdef  __cplusplus
0023 extern "C" {
0024 #  endif
0025 
0026 #  define RC5_32_BLOCK            8
0027 #  define RC5_32_KEY_LENGTH       16/* This is a default, max is 255 */
0028 
0029 #  ifndef OPENSSL_NO_DEPRECATED_3_0
0030 #   define RC5_ENCRYPT     1
0031 #   define RC5_DECRYPT     0
0032 
0033 #   define RC5_32_INT unsigned int
0034 
0035 /*
0036  * This are the only values supported.  Tweak the code if you want more The
0037  * most supported modes will be RC5-32/12/16 RC5-32/16/8
0038  */
0039 #   define RC5_8_ROUNDS    8
0040 #   define RC5_12_ROUNDS   12
0041 #   define RC5_16_ROUNDS   16
0042 
0043 typedef struct rc5_key_st {
0044     /* Number of rounds */
0045     int rounds;
0046     RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)];
0047 } RC5_32_KEY;
0048 #  endif
0049 #  ifndef OPENSSL_NO_DEPRECATED_3_0
0050 OSSL_DEPRECATEDIN_3_0 int RC5_32_set_key(RC5_32_KEY *key, int len,
0051                                          const unsigned char *data,
0052                                          int rounds);
0053 OSSL_DEPRECATEDIN_3_0 void RC5_32_ecb_encrypt(const unsigned char *in,
0054                                               unsigned char *out,
0055                                               RC5_32_KEY *key,
0056                                               int enc);
0057 OSSL_DEPRECATEDIN_3_0 void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key);
0058 OSSL_DEPRECATEDIN_3_0 void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key);
0059 OSSL_DEPRECATEDIN_3_0 void RC5_32_cbc_encrypt(const unsigned char *in,
0060                                               unsigned char *out, long length,
0061                                               RC5_32_KEY *ks, unsigned char *iv,
0062                                               int enc);
0063 OSSL_DEPRECATEDIN_3_0 void RC5_32_cfb64_encrypt(const unsigned char *in,
0064                                                 unsigned char *out, long length,
0065                                                 RC5_32_KEY *schedule,
0066                                                 unsigned char *ivec, int *num,
0067                                                 int enc);
0068 OSSL_DEPRECATEDIN_3_0 void RC5_32_ofb64_encrypt(const unsigned char *in,
0069                                                 unsigned char *out, long length,
0070                                                 RC5_32_KEY *schedule,
0071                                                 unsigned char *ivec, int *num);
0072 #  endif
0073 
0074 #  ifdef  __cplusplus
0075 }
0076 #  endif
0077 # endif
0078 
0079 #endif