Skip to contentSkip to conversation

crypto/des_generic: Make des_ekey prototype more specific.

PATCH In review George Spelvin 1 participant 1 message Feb 8, 2009 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 7/10 crypto/des_generic: Make des_ekey prototype more specific.

The C compiler treats it equivalently, but it's nice documentation to explain how big the arrays pointed to are.

---
 crypto/des_generic.c |    4 ++--
 include/crypto/des.h |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
crypto/des_generic.c +2 -2
index 647189e..656039b 100644
@@ -588,7 +588,7 @@ static const u32 S8[64] = {
  *   Choice 1 has operated on the key.
  *
  */
-unsigned long des_ekey(u32 *pe, const u8 *k)
+unsigned long des_ekey(u32 pe[DES_EXPKEY_WORDS], const u8 k[DES_KEY_SIZE])
 {
 	/* K&R: long is at least 32 bits */
 	unsigned long a, b, c, d, w;
@@ -668,7 +668,7 @@ EXPORT_SYMBOL_GPL(des_ekey);
  * No weak key checking is performed, as this is only used by triple DES
  *
  */
-static void dkey(u32 *pe, const u8 *k)
+sstatic void des_dkey(u32 pe[DES_EXPKEY_WORDS], const u8 k[DES_KEY_SIZE])
 {
 	/* K&R: long is at least 32 bits */
 	unsigned long a, b, c, d;
include/crypto/des.h +1 -1
index 2971c63..b99ea2a 100644
@@ -14,6 +14,6 @@
 #define DES3_EDE_BLOCK_SIZE	DES_BLOCK_SIZE
 
 
-extern unsigned long des_ekey(u32 *pe, const u8 *k);
+unsigned long des_ekey(u32 pe[DES_EXPKEY_WORDS], const u8 k[DES_KEY_SIZE]);
 
 #endif /* __CRYPTO_DES_H */
Signature · 1 line
1.6.0.6