]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/openssl/rc5.h
Rename OPENSSL_CTX prefix to OSSL_LIB_CTX
[thirdparty/openssl.git] / include / openssl / rc5.h
CommitLineData
21dcbebc 1/*
33388b44 2 * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
0f113f3e 3 *
48f4ad77 4 * Licensed under the Apache License 2.0 (the "License"). You may not use
21dcbebc
RS
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
58964a49
RE
8 */
9
ae4186b0
DMSP
10#ifndef OPENSSL_RC5_H
11# define OPENSSL_RC5_H
d86167ec
DMSP
12# pragma once
13
14# include <openssl/macros.h>
936c2b9e 15# ifndef OPENSSL_NO_DEPRECATED_3_0
d86167ec
DMSP
16# define HEADER_RC5_H
17# endif
58964a49 18
3c27208f 19# include <openssl/opensslconf.h>
f1185145 20
3c27208f 21# ifndef OPENSSL_NO_RC5
26aae513 22# ifdef __cplusplus
58964a49 23extern "C" {
26aae513 24# endif
f5d7a031 25
26aae513
P
26# define RC5_32_BLOCK 8
27# define RC5_32_KEY_LENGTH 16/* This is a default, max is 255 */
58964a49 28
62c3fed0
P
29# ifndef OPENSSL_NO_DEPRECATED_3_0
30# define RC5_ENCRYPT 1
31# define RC5_DECRYPT 0
32
33# define RC5_32_INT unsigned int
34
0f113f3e
MC
35/*
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
58964a49 38 */
62c3fed0
P
39# define RC5_8_ROUNDS 8
40# define RC5_12_ROUNDS 12
41# define RC5_16_ROUNDS 16
58964a49 42
0f113f3e
MC
43typedef struct rc5_key_st {
44 /* Number of rounds */
45 int rounds;
46 RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)];
47} RC5_32_KEY;
62c3fed0 48# endif
58964a49 49
62c3fed0
P
50DEPRECATEDIN_3_0(int RC5_32_set_key(RC5_32_KEY *key, int len,
51 const unsigned char *data, int rounds))
52DEPRECATEDIN_3_0(void RC5_32_ecb_encrypt(const unsigned char *in,
53 unsigned char *out, RC5_32_KEY *key,
54 int enc))
55DEPRECATEDIN_3_0(void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key))
56DEPRECATEDIN_3_0(void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key))
57DEPRECATEDIN_3_0(void RC5_32_cbc_encrypt(const unsigned char *in,
58 unsigned char *out, long length,
59 RC5_32_KEY *ks, unsigned char *iv,
60 int enc))
61DEPRECATEDIN_3_0(void RC5_32_cfb64_encrypt(const unsigned char *in,
62 unsigned char *out, long length,
63 RC5_32_KEY *schedule,
64 unsigned char *ivec, int *num,
65 int enc))
66DEPRECATEDIN_3_0(void RC5_32_ofb64_encrypt(const unsigned char *in,
67 unsigned char *out, long length,
68 RC5_32_KEY *schedule,
69 unsigned char *ivec, int *num))
58964a49 70
26aae513 71# ifdef __cplusplus
58964a49 72}
26aae513 73# endif
3c27208f 74# endif
58964a49
RE
75
76#endif