Clean up the DES_key_schedule logic.
It's not clear why OpenSSL had a union. The comment says something about sizes
of long, since OpenSSL doesn't use stdint.h. But the variable is treated as a
bunch of uint32_t's, not DES_cblocks.
The key schedule is also always used by iterating or indexing into a uint32_t*,
treating the 16 2-word subkeys as a single uint32_t[32]. Instead, index into
them properly shush any picky tools. The compiler should be able to figure out
what's going on and optimize it appropriately.
BUG=517495
Change-Id: I83d0e63ac2c6fb76fac1dceda9f2fd6762074341
Reviewed-on: https://boringssl-review.googlesource.com/5627
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/include/openssl/des.h b/include/openssl/des.h
index 25a7468..f9db62d 100644
--- a/include/openssl/des.h
+++ b/include/openssl/des.h
@@ -72,12 +72,7 @@
} DES_cblock;
typedef struct DES_ks {
- union {
- DES_cblock cblock;
- /* make sure things are correct size on machines with
- * 8 byte longs */
- uint32_t deslong[2];
- } ks[16];
+ uint32_t subkeys[16][2];
} DES_key_schedule;