TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
aes.h
Go to the documentation of this file.
1 /*
2  * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the OpenSSL license (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
8  */
9 
10 #ifndef HEADER_AES_H
11 # define HEADER_AES_H
12 
13 # include <stddef.h>
14 
15 # ifdef __cplusplus
16 extern "C" {
17 # endif
18 
19 # define AES_ENCRYPT 1
20 # define AES_DECRYPT 0
21 
22 /*
23  * Because array size can't be a const in C, the following two are macros.
24  * Both sizes are in bytes.
25  */
26 # define AES_MAXNR 14
27 # define AES_BLOCK_SIZE 16
28 
29 /* This should be a hidden type, but EVP requires that the size be known */
30 struct aes_key_st {
31 # ifdef AES_LONG
32  unsigned long rd_key[4 * (AES_MAXNR + 1)];
33 # else
34  unsigned int rd_key[4 * (AES_MAXNR + 1)];
35 # endif
36  int rounds;
37 };
38 typedef struct aes_key_st AES_KEY;
39 
40 const char *AES_options(void);
41 
42 int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
43  AES_KEY *key);
44 int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
45  AES_KEY *key);
46 
47 void AES_encrypt(const unsigned char *in, unsigned char *out,
48  const AES_KEY *key);
49 void AES_decrypt(const unsigned char *in, unsigned char *out,
50  const AES_KEY *key);
51 
52 void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
53  const AES_KEY *key, const int enc);
54 void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
55  size_t length, const AES_KEY *key,
56  unsigned char *ivec, const int enc);
57 void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
58  size_t length, const AES_KEY *key,
59  unsigned char *ivec, int *num, const int enc);
60 void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
61  size_t length, const AES_KEY *key,
62  unsigned char *ivec, int *num, const int enc);
63 void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
64  size_t length, const AES_KEY *key,
65  unsigned char *ivec, int *num, const int enc);
66 void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
67  size_t length, const AES_KEY *key,
68  unsigned char *ivec, int *num);
69 /* NB: the IV is _two_ blocks long */
70 void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
71  size_t length, const AES_KEY *key,
72  unsigned char *ivec, const int enc);
73 /* NB: the IV is _four_ blocks long */
74 void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
75  size_t length, const AES_KEY *key,
76  const AES_KEY *key2, const unsigned char *ivec,
77  const int enc);
78 
79 int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
80  unsigned char *out,
81  const unsigned char *in, unsigned int inlen);
82 int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
83  unsigned char *out,
84  const unsigned char *in, unsigned int inlen);
85 
86 
87 # ifdef __cplusplus
88 }
89 # endif
90 
91 #endif
int AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key)
Expand the cipher key into the decryption key schedule.
Definition: aes_core.cpp:732
int AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key)
Expand the cipher key into the encryption key schedule.
Definition: aes_core.cpp:631
void AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key)
Definition: aes_core.cpp:983
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, size_t length, const AES_KEY *key, unsigned char *ivec, int *num)
void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, size_t length, const AES_KEY *key, const AES_KEY *key2, const unsigned char *ivec, const int enc)
static constexpr wchar_t key[]
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, size_t length, const AES_KEY *key, unsigned char *ivec, int *num, const int enc)
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key, const int enc)
Definition: aes_ecb.cpp:15
int rounds
Definition: aes.h:36
int AES_wrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, const unsigned char *in, unsigned int inlen)
#define AES_MAXNR
Definition: aes.h:26
Definition: aes.h:30
unsigned int rd_key[4 *(AES_MAXNR+1)]
Definition: aes.h:34
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, const unsigned char *in, unsigned int inlen)
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t length, const AES_KEY *key, unsigned char *ivec, const int enc)
Definition: aes_cbc.cpp:4
void AES_ige_encrypt(const unsigned char *in, unsigned char *out, size_t length, const AES_KEY *key, unsigned char *ivec, const int enc)
const char * AES_options(void)
void AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key)
Definition: aes_core.cpp:792
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, size_t length, const AES_KEY *key, unsigned char *ivec, int *num, const int enc)
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, size_t length, const AES_KEY *key, unsigned char *ivec, int *num, const int enc)