]>
git.ipfire.org Git - thirdparty/openssl.git/blob - include/openssl/rc5.h
2 * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
11 # define OPENSSL_RC5_H
14 # include <openssl/macros.h>
15 # ifndef OPENSSL_NO_DEPRECATED_3_0
19 # include <openssl/opensslconf.h>
21 # ifndef OPENSSL_NO_RC5
26 # define RC5_32_BLOCK 8
27 # define RC5_32_KEY_LENGTH 16/* This is a default, max is 255 */
29 # ifndef OPENSSL_NO_DEPRECATED_3_0
30 # define RC5_ENCRYPT 1
31 # define RC5_DECRYPT 0
33 # define RC5_32_INT unsigned int
36 * This are the only values supported. Tweak the code if you want more The
37 * most supported modes will be RC5-32/12/16 RC5-32/16/8
39 # define RC5_8_ROUNDS 8
40 # define RC5_12_ROUNDS 12
41 # define RC5_16_ROUNDS 16
43 typedef struct rc5_key_st
{
44 /* Number of rounds */
46 RC5_32_INT data
[2 * (RC5_16_ROUNDS
+ 1)];
49 # ifndef OPENSSL_NO_DEPRECATED_3_0
50 OSSL_DEPRECATEDIN_3_0
int RC5_32_set_key(RC5_32_KEY
*key
, int len
,
51 const unsigned char *data
,
53 OSSL_DEPRECATEDIN_3_0
void RC5_32_ecb_encrypt(const unsigned char *in
,
57 OSSL_DEPRECATEDIN_3_0
void RC5_32_encrypt(unsigned long *data
, RC5_32_KEY
*key
);
58 OSSL_DEPRECATEDIN_3_0
void RC5_32_decrypt(unsigned long *data
, RC5_32_KEY
*key
);
59 OSSL_DEPRECATEDIN_3_0
void RC5_32_cbc_encrypt(const unsigned char *in
,
60 unsigned char *out
, long length
,
61 RC5_32_KEY
*ks
, unsigned char *iv
,
63 OSSL_DEPRECATEDIN_3_0
void RC5_32_cfb64_encrypt(const unsigned char *in
,
64 unsigned char *out
, long length
,
66 unsigned char *ivec
, int *num
,
68 OSSL_DEPRECATEDIN_3_0
void RC5_32_ofb64_encrypt(const unsigned char *in
,
69 unsigned char *out
, long length
,
71 unsigned char *ivec
, int *num
);