Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
rc5.h80 linesDownload Raw Back to openssl
1/*2 * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.3 *4 * Licensed under the Apache License 2.0 (the "License").  You may not use5 * this file except in compliance with the License.  You can obtain a copy6 * in the file LICENSE in the source distribution or at7 * https://www.openssl.org/source/license.html8 */9 10#ifndef OPENSSL_RC5_H11# define OPENSSL_RC5_H12# pragma once13 14# include <openssl/macros.h>15# ifndef OPENSSL_NO_DEPRECATED_3_016#  define HEADER_RC5_H17# endif18 19# include <openssl/opensslconf.h>20 21# ifndef OPENSSL_NO_RC522#  ifdef  __cplusplus23extern "C" {24#  endif25 26#  define RC5_32_BLOCK            827#  define RC5_32_KEY_LENGTH       16/* This is a default, max is 255 */28 29#  ifndef OPENSSL_NO_DEPRECATED_3_030#   define RC5_ENCRYPT     131#   define RC5_DECRYPT     032 33#   define RC5_32_INT unsigned int34 35/*36 * This are the only values supported.  Tweak the code if you want more The37 * most supported modes will be RC5-32/12/16 RC5-32/16/838 */39#   define RC5_8_ROUNDS    840#   define RC5_12_ROUNDS   1241#   define RC5_16_ROUNDS   1642 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;48#  endif49#  ifndef OPENSSL_NO_DEPRECATED_3_050OSSL_DEPRECATEDIN_3_0 int RC5_32_set_key(RC5_32_KEY *key, int len,51                                         const unsigned char *data,52                                         int rounds);53OSSL_DEPRECATEDIN_3_0 void RC5_32_ecb_encrypt(const unsigned char *in,54                                              unsigned char *out,55                                              RC5_32_KEY *key,56                                              int enc);57OSSL_DEPRECATEDIN_3_0 void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key);58OSSL_DEPRECATEDIN_3_0 void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key);59OSSL_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,62                                              int enc);63OSSL_DEPRECATEDIN_3_0 void RC5_32_cfb64_encrypt(const unsigned char *in,64                                                unsigned char *out, long length,65                                                RC5_32_KEY *schedule,66                                                unsigned char *ivec, int *num,67                                                int enc);68OSSL_DEPRECATEDIN_3_0 void RC5_32_ofb64_encrypt(const unsigned char *in,69                                                unsigned char *out, long length,70                                                RC5_32_KEY *schedule,71                                                unsigned char *ivec, int *num);72#  endif73 74#  ifdef  __cplusplus75}76#  endif77# endif78 79#endif80 
codekingpro/portable-devtools · Team Ai