Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*
0002  * Copyright 2002-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_AES_H
0011 # define OPENSSL_AES_H
0012 # pragma once
0013 
0014 # include <openssl/macros.h>
0015 # ifndef OPENSSL_NO_DEPRECATED_3_0
0016 #  define HEADER_AES_H
0017 # endif
0018 
0019 # include <openssl/opensslconf.h>
0020 
0021 # include <stddef.h>
0022 # ifdef  __cplusplus
0023 extern "C" {
0024 # endif
0025 
0026 # define AES_BLOCK_SIZE 16
0027 
0028 # ifndef OPENSSL_NO_DEPRECATED_3_0
0029 
0030 #  define AES_ENCRYPT     1
0031 #  define AES_DECRYPT     0
0032 
0033 #  define AES_MAXNR 14
0034 
0035 
0036 /* This should be a hidden type, but EVP requires that the size be known */
0037 struct aes_key_st {
0038 #  ifdef AES_LONG
0039     unsigned long rd_key[4 * (AES_MAXNR + 1)];
0040 #  else
0041     unsigned int rd_key[4 * (AES_MAXNR + 1)];
0042 #  endif
0043     int rounds;
0044 };
0045 typedef struct aes_key_st AES_KEY;
0046 
0047 # endif
0048 # ifndef OPENSSL_NO_DEPRECATED_3_0
0049 OSSL_DEPRECATEDIN_3_0 const char *AES_options(void);
0050 OSSL_DEPRECATEDIN_3_0
0051 int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
0052                         AES_KEY *key);
0053 OSSL_DEPRECATEDIN_3_0
0054 int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
0055                         AES_KEY *key);
0056 OSSL_DEPRECATEDIN_3_0
0057 void AES_encrypt(const unsigned char *in, unsigned char *out,
0058                  const AES_KEY *key);
0059 OSSL_DEPRECATEDIN_3_0
0060 void AES_decrypt(const unsigned char *in, unsigned char *out,
0061                  const AES_KEY *key);
0062 OSSL_DEPRECATEDIN_3_0
0063 void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
0064                      const AES_KEY *key, const int enc);
0065 OSSL_DEPRECATEDIN_3_0
0066 void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
0067                      size_t length, const AES_KEY *key,
0068                      unsigned char *ivec, const int enc);
0069 OSSL_DEPRECATEDIN_3_0
0070 void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
0071                         size_t length, const AES_KEY *key,
0072                         unsigned char *ivec, int *num, const int enc);
0073 OSSL_DEPRECATEDIN_3_0
0074 void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
0075                       size_t length, const AES_KEY *key,
0076                       unsigned char *ivec, int *num, const int enc);
0077 OSSL_DEPRECATEDIN_3_0
0078 void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
0079                       size_t length, const AES_KEY *key,
0080                       unsigned char *ivec, int *num, const int enc);
0081 OSSL_DEPRECATEDIN_3_0
0082 void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
0083                         size_t length, const AES_KEY *key,
0084                         unsigned char *ivec, int *num);
0085 
0086 /* NB: the IV is _two_ blocks long */
0087 OSSL_DEPRECATEDIN_3_0
0088 void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
0089                      size_t length, const AES_KEY *key,
0090                      unsigned char *ivec, const int enc);
0091 /* NB: the IV is _four_ blocks long */
0092 OSSL_DEPRECATEDIN_3_0
0093 void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
0094                         size_t length, const AES_KEY *key, const AES_KEY *key2,
0095                         const unsigned char *ivec, const int enc);
0096 OSSL_DEPRECATEDIN_3_0
0097 int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
0098                  unsigned char *out, const unsigned char *in,
0099                  unsigned int inlen);
0100 OSSL_DEPRECATEDIN_3_0
0101 int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
0102                    unsigned char *out, const unsigned char *in,
0103                    unsigned int inlen);
0104 # endif
0105 
0106 
0107 # ifdef  __cplusplus
0108 }
0109 # endif
0110 
0111 #endif