Blame include/openssl/rc5.h

Packit c4476c
/*
Packit c4476c
 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
 *
Packit c4476c
 * Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
 * this file except in compliance with the License.  You can obtain a copy
Packit c4476c
 * in the file LICENSE in the source distribution or at
Packit c4476c
 * https://www.openssl.org/source/license.html
Packit c4476c
 */
Packit c4476c
Packit c4476c
#ifndef HEADER_RC5_H
Packit c4476c
# define HEADER_RC5_H
Packit c4476c
Packit c4476c
# include <openssl/opensslconf.h>
Packit c4476c
Packit c4476c
# ifndef OPENSSL_NO_RC5
Packit c4476c
# ifdef  __cplusplus
Packit c4476c
extern "C" {
Packit c4476c
# endif
Packit c4476c
Packit c4476c
# define RC5_ENCRYPT     1
Packit c4476c
# define RC5_DECRYPT     0
Packit c4476c
Packit c4476c
# define RC5_32_INT unsigned int
Packit c4476c
Packit c4476c
# define RC5_32_BLOCK            8
Packit c4476c
# define RC5_32_KEY_LENGTH       16/* This is a default, max is 255 */
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * This are the only values supported.  Tweak the code if you want more The
Packit c4476c
 * most supported modes will be RC5-32/12/16 RC5-32/16/8
Packit c4476c
 */
Packit c4476c
# define RC5_8_ROUNDS    8
Packit c4476c
# define RC5_12_ROUNDS   12
Packit c4476c
# define RC5_16_ROUNDS   16
Packit c4476c
Packit c4476c
typedef struct rc5_key_st {
Packit c4476c
    /* Number of rounds */
Packit c4476c
    int rounds;
Packit c4476c
    RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)];
Packit c4476c
} RC5_32_KEY;
Packit c4476c
Packit c4476c
void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
Packit c4476c
                    int rounds);
Packit c4476c
void RC5_32_ecb_encrypt(const unsigned char *in, unsigned char *out,
Packit c4476c
                        RC5_32_KEY *key, int enc);
Packit c4476c
void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key);
Packit c4476c
void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key);
Packit c4476c
void RC5_32_cbc_encrypt(const unsigned char *in, unsigned char *out,
Packit c4476c
                        long length, RC5_32_KEY *ks, unsigned char *iv,
Packit c4476c
                        int enc);
Packit c4476c
void RC5_32_cfb64_encrypt(const unsigned char *in, unsigned char *out,
Packit c4476c
                          long length, RC5_32_KEY *schedule,
Packit c4476c
                          unsigned char *ivec, int *num, int enc);
Packit c4476c
void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out,
Packit c4476c
                          long length, RC5_32_KEY *schedule,
Packit c4476c
                          unsigned char *ivec, int *num);
Packit c4476c
Packit c4476c
# ifdef  __cplusplus
Packit c4476c
}
Packit c4476c
# endif
Packit c4476c
# endif
Packit c4476c
Packit c4476c
#endif