1From 19aee91e45788d594615a9be58fa5d0879ec816a Mon Sep 17 00:00:00 2001
2From: youcai <omegacoleman@gmail.com>
3Date: Tue, 18 Aug 2020 00:43:16 +0800
4Subject: [PATCH] rename sha256_state to rtl_sha256_state to avoid name
5 conflict with crypto
6
7[Upstream: https://github.com/abperiasamy/rtl8812AU_8821AU_linux/pull/338/commits/af6f6c1578f16145478326a939bb7593bbcdb4e7.patch]
8Signed-off-by: Coleman <omegacoleman@gmail.com>
9Signed-off-by: Christian Stewart <christian@paral.in>
10---
11 core/rtw_security.c    | 10 +++++-----
12 include/rtw_security.h |  2 +-
13 2 files changed, 6 insertions(+), 6 deletions(-)
14
15diff --git a/core/rtw_security.c b/core/rtw_security.c
16index d54e6af..de2d91f 100644
17--- a/core/rtw_security.c
18+++ b/core/rtw_security.c
19@@ -2200,7 +2200,7 @@ BIP_exit:
20
21 #ifndef PLATFORM_FREEBSD
22 /* compress 512-bits */
23-static int sha256_compress(struct sha256_state *md, unsigned char *buf)
24+static int sha256_compress(struct rtl_sha256_state *md, unsigned char *buf)
25 {
26 	u32 S[8], W[64], t0, t1;
27 	u32 t;
28@@ -2249,7 +2249,7 @@ static int sha256_compress(struct sha256_state *md, unsigned char *buf)
29 }
30
31 /* Initialize the hash state */
32-static void sha256_init(struct sha256_state *md)
33+static void sha256_init(struct rtl_sha256_state *md)
34 {
35 	md->curlen = 0;
36 	md->length = 0;
37@@ -2270,7 +2270,7 @@ static void sha256_init(struct sha256_state *md)
38    @param inlen  The length of the data (octets)
39    @return CRYPT_OK if successful
40 */
41-static int sha256_process(struct sha256_state *md, unsigned char *in,
42+static int sha256_process(struct rtl_sha256_state *md, unsigned char *in,
43                           unsigned long inlen)
44 {
45 	unsigned long n;
46@@ -2311,7 +2311,7 @@ static int sha256_process(struct sha256_state *md, unsigned char *in,
47    @param out [out] The destination of the hash (32 bytes)
48    @return CRYPT_OK if successful
49 */
50-static int sha256_done(struct sha256_state *md, unsigned char *out)
51+static int sha256_done(struct rtl_sha256_state *md, unsigned char *out)
52 {
53 	int i;
54
55@@ -2363,7 +2363,7 @@ static int sha256_done(struct sha256_state *md, unsigned char *out)
56 static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len,
57                          u8 *mac)
58 {
59-	struct sha256_state ctx;
60+	struct rtl_sha256_state ctx;
61 	size_t i;
62
63 	sha256_init(&ctx);
64diff --git a/include/rtw_security.h b/include/rtw_security.h
65index d41014e..98feb69 100644
66--- a/include/rtw_security.h
67+++ b/include/rtw_security.h
68@@ -233,7 +233,7 @@ struct security_priv {
69 #endif /* DBG_SW_SEC_CNT */
70 };
71
72-struct sha256_state {
73+struct rtl_sha256_state {
74 	u64 length;
75 	u32 state[8], curlen;
76 	u8 buf[64];
77--
782.28.0
79
80