Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@google.com>2015-10-28 02:07:26 +0300
committerAdam Langley <agl@google.com>2015-10-28 02:07:26 +0300
commit13f1dd497fdb2b107f80fab092785d67f70b0083 (patch)
treee7a3f1f8dce35ac7fb99de34f996228a5a3e97c4 /crypto/rc4
parent96c2a2817108afcbb338f9113b3d2295b0e7f02e (diff)
Fix a couple more signed/unsigned compares.
Different compilers find different problems. Change-Id: I732611005ae1cbfcb4bc70c3f98af2c18b0a04da
Diffstat (limited to 'crypto/rc4')
-rw-r--r--crypto/rc4/rc4.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/crypto/rc4/rc4.c b/crypto/rc4/rc4.c
index aa19dc28..b8e1d9f0 100644
--- a/crypto/rc4/rc4.c
+++ b/crypto/rc4/rc4.c
@@ -234,23 +234,22 @@ void RC4(RC4_KEY *key, size_t len, const uint8_t *in, uint8_t *out) {
void RC4_set_key(RC4_KEY *rc4key, unsigned len, const uint8_t *key) {
uint32_t tmp;
- int id1, id2;
+ unsigned i, id1, id2;
uint32_t *d;
- unsigned int i;
d = &rc4key->data[0];
rc4key->x = 0;
rc4key->y = 0;
id1 = id2 = 0;
-#define SK_LOOP(d, n) \
- { \
- tmp = d[(n)]; \
+#define SK_LOOP(d, n) \
+ { \
+ tmp = d[(n)]; \
id2 = (key[id1] + tmp + id2) & 0xff; \
- if (++id1 == len) \
- id1 = 0; \
- d[(n)] = d[id2]; \
- d[id2] = tmp; \
+ if (++id1 == len) \
+ id1 = 0; \
+ d[(n)] = d[id2]; \
+ d[id2] = tmp; \
}
for (i = 0; i < 256; i++) {