staging: crypto: skein: rename enums
authorAnton Saraev <antonysaraev@gmail.com>
Mon, 19 May 2014 08:09:57 +0000 (12:09 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 May 2014 21:18:14 +0000 (14:18 -0700)
Linux Kernel use capitalized names for enum. To prepare skein
driver to mainline inclusion, we rename all enums to capitalized
names.

Signed-off-by: Anton Saraev <antonysaraev@gmail.com>
Reviewed-by: Jake Edge <jake@lwn.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/skein/include/skein.h
drivers/staging/skein/include/skeinApi.h
drivers/staging/skein/include/threefishApi.h
drivers/staging/skein/skeinApi.c
drivers/staging/skein/skeinBlockNo3F.c
drivers/staging/skein/skein_block.c
drivers/staging/skein/threefishApi.c

index 09e96d6..8ecd720 100644 (file)
@@ -293,7 +293,7 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val);
 ** Skein block function constants (shared across Ref and Opt code)
 ******************************************************************/
 enum {
-           /* Skein_256 round rotation constants */
+           /* SKEIN_256 round rotation constants */
        R_256_0_0 = 14, R_256_0_1 = 16,
        R_256_1_0 = 52, R_256_1_1 = 57,
        R_256_2_0 = 23, R_256_2_1 = 40,
@@ -303,7 +303,7 @@ enum {
        R_256_6_0 = 58, R_256_6_1 = 22,
        R_256_7_0 = 32, R_256_7_1 = 32,
 
-           /* Skein_512 round rotation constants */
+           /* SKEIN_512 round rotation constants */
        R_512_0_0 = 46, R_512_0_1 = 36, R_512_0_2 = 19, R_512_0_3 = 37,
        R_512_1_0 = 33, R_512_1_1 = 27, R_512_1_2 = 14, R_512_1_3 = 42,
        R_512_2_0 = 17, R_512_2_1 = 49, R_512_2_2 = 36, R_512_2_3 = 39,
@@ -313,7 +313,7 @@ enum {
        R_512_6_0 = 25, R_512_6_1 = 29, R_512_6_2 = 39, R_512_6_3 = 43,
        R_512_7_0 =  8, R_512_7_1 = 35, R_512_7_2 = 56, R_512_7_3 = 22,
 
-           /* Skein1024 round rotation constants */
+           /* SKEIN_1024 round rotation constants */
        R1024_0_0 = 24, R1024_0_1 = 13, R1024_0_2 =  8, R1024_0_3 = 47,
        R1024_0_4 =  8, R1024_0_5 = 17, R1024_0_6 = 22, R1024_0_7 = 37,
        R1024_1_0 = 38, R1024_1_1 = 19, R1024_1_2 = 10, R1024_1_3 = 55,
index 850d5c9..b4e879d 100644 (file)
@@ -50,7 +50,7 @@ OTHER DEALINGS IN THE SOFTWARE.
  * struct skein_ctx ctx;             // a Skein hash or MAC context
  *
  * // prepare context, here for a Skein with a state size of 512 bits.
- * skein_ctx_prepare(&ctx, Skein512);
+ * skein_ctx_prepare(&ctx, SKEIN_512);
  *
  * // Initialize the context to set the requested hash length in bits
  * // here request a output hash size of 31 bits (Skein supports variable
@@ -85,9 +85,9 @@ OTHER DEALINGS IN THE SOFTWARE.
  * Which Skein size to use
  */
 enum skein_size {
-       Skein256 = 256,     /*!< Skein with 256 bit state */
-       Skein512 = 512,     /*!< Skein with 512 bit state */
-       Skein1024 = 1024    /*!< Skein with 1024 bit state */
+       SKEIN_256 = 256,     /*!< Skein with 256 bit state */
+       SKEIN_512 = 512,     /*!< Skein with 512 bit state */
+       SKEIN_1024 = 1024    /*!< Skein with 1024 bit state */
 };
 
 /**
index 37f6e63..63030e5 100644 (file)
  * functions.
  *
 @code
-    // Threefish cipher context data
-    struct threefish_key key_ctx;
+       // Threefish cipher context data
+       struct threefish_key key_ctx;
 
-    // Initialize the context
-    threefish_set_key(&key_ctx, Threefish512, key, tweak);
+       // Initialize the context
+       threefish_set_key(&key_ctx, THREEFISH_512, key, tweak);
 
-    // Encrypt
-    threefish_encrypt_block_bytes(&key_ctx, input, cipher);
+       // Encrypt
+       threefish_encrypt_block_bytes(&key_ctx, input, cipher);
 @endcode
  */
 
@@ -37,9 +37,9 @@
  * Which Threefish size to use
  */
 enum threefish_size {
-       Threefish256 = 256,     /*!< Skein with 256 bit state */
-       Threefish512 = 512,     /*!< Skein with 512 bit state */
-       Threefish1024 = 1024    /*!< Skein with 1024 bit state */
+       THREEFISH_256 = 256,     /*!< Skein with 256 bit state */
+       THREEFISH_512 = 512,     /*!< Skein with 512 bit state */
+       THREEFISH_1024 = 1024    /*!< Skein with 1024 bit state */
 };
 
 /**
index 3426392..87b3ff2 100644 (file)
@@ -57,15 +57,15 @@ int skein_init(struct skein_ctx *ctx, size_t hash_bit_len)
         * the save chaining variables.
         */
        switch (ctx->skein_size) {
-       case Skein256:
+       case SKEIN_256:
                ret = skein_256_init_ext(&ctx->m.s256, hash_bit_len,
                                         tree_info, NULL, 0);
                break;
-       case Skein512:
+       case SKEIN_512:
                ret = skein_512_init_ext(&ctx->m.s512, hash_bit_len,
                                         tree_info, NULL, 0);
                break;
-       case Skein1024:
+       case SKEIN_1024:
                ret = skein_1024_init_ext(&ctx->m.s1024, hash_bit_len,
                                          tree_info, NULL, 0);
                break;
@@ -97,18 +97,18 @@ int skein_mac_init(struct skein_ctx *ctx, const u8 *key, size_t key_len,
        Skein_Assert(hash_bit_len, SKEIN_BAD_HASHLEN);
 
        switch (ctx->skein_size) {
-       case Skein256:
+       case SKEIN_256:
                ret = skein_256_init_ext(&ctx->m.s256, hash_bit_len,
                                         tree_info,
                                         (const u8 *)key, key_len);
 
                break;
-       case Skein512:
+       case SKEIN_512:
                ret = skein_512_init_ext(&ctx->m.s512, hash_bit_len,
                                         tree_info,
                                         (const u8 *)key, key_len);
                break;
-       case Skein1024:
+       case SKEIN_1024:
                ret = skein_1024_init_ext(&ctx->m.s1024, hash_bit_len,
                                          tree_info,
                                          (const u8 *)key, key_len);
@@ -152,15 +152,15 @@ int skein_update(struct skein_ctx *ctx, const u8 *msg,
        Skein_Assert(ctx, SKEIN_FAIL);
 
        switch (ctx->skein_size) {
-       case Skein256:
+       case SKEIN_256:
                ret = skein_256_update(&ctx->m.s256, (const u8 *)msg,
                                       msg_byte_cnt);
                break;
-       case Skein512:
+       case SKEIN_512:
                ret = skein_512_update(&ctx->m.s512, (const u8 *)msg,
                                       msg_byte_cnt);
                break;
-       case Skein1024:
+       case SKEIN_1024:
                ret = skein_1024_update(&ctx->m.s1024, (const u8 *)msg,
                                        msg_byte_cnt);
                break;
@@ -225,13 +225,13 @@ int skein_final(struct skein_ctx *ctx, u8 *hash)
        Skein_Assert(ctx, SKEIN_FAIL);
 
        switch (ctx->skein_size) {
-       case Skein256:
+       case SKEIN_256:
                ret = skein_256_final(&ctx->m.s256, (u8 *)hash);
                break;
-       case Skein512:
+       case SKEIN_512:
                ret = skein_512_final(&ctx->m.s512, (u8 *)hash);
                break;
-       case Skein1024:
+       case SKEIN_1024:
                ret = skein_1024_final(&ctx->m.s1024, (u8 *)hash);
                break;
        }
index 55c6831..716b78e 100644 (file)
@@ -34,7 +34,7 @@ void skein_256_process_block(struct skein_256_ctx *ctx, const u8 *blk_ptr,
                tweak[0] |= (words[1] & 0xffffffffL) << 32;
                tweak[1] |= words[2] & 0xffffffffL;
 
-               threefish_set_key(&key, Threefish256, ctx->X, tweak);
+               threefish_set_key(&key, THREEFISH_256, ctx->X, tweak);
 
                /* get input block in little-endian format */
                Skein_Get64_LSB_First(w, blk_ptr, SKEIN_256_STATE_WORDS);
@@ -85,7 +85,7 @@ void skein_512_process_block(struct skein_512_ctx *ctx, const u8 *blk_ptr,
                tweak[0] |= (words[1] & 0xffffffffL) << 32;
                tweak[1] |= words[2] & 0xffffffffL;
 
-               threefish_set_key(&key, Threefish512, ctx->X, tweak);
+               threefish_set_key(&key, THREEFISH_512, ctx->X, tweak);
 
                /* get input block in little-endian format */
                Skein_Get64_LSB_First(w, blk_ptr, SKEIN_512_STATE_WORDS);
@@ -140,7 +140,7 @@ void skein_1024_process_block(struct skein_1024_ctx *ctx, const u8 *blk_ptr,
                tweak[0] |= (words[1] & 0xffffffffL) << 32;
                tweak[1] |= words[2] & 0xffffffffL;
 
-               threefish_set_key(&key, Threefish1024, ctx->X, tweak);
+               threefish_set_key(&key, THREEFISH_1024, ctx->X, tweak);
 
                /* get input block in little-endian format */
                Skein_Get64_LSB_First(w, blk_ptr, SKEIN1024_STATE_WORDS);
index c9db6d6..ebd4af1 100644 (file)
@@ -37,7 +37,7 @@
 #define DebugSaveTweak(ctx)
 #endif
 
-/*****************************  Skein_256 ******************************/
+/*****************************  SKEIN_256 ******************************/
 #if !(SKEIN_USE_ASM & 256)
 void skein_256_process_block(struct skein_256_ctx *ctx, const u8 *blk_ptr,
                             size_t blk_cnt, size_t byte_cnt_add)
@@ -246,7 +246,7 @@ unsigned int skein_256_unroll_cnt(void)
 #endif
 #endif
 
-/*****************************  Skein_512 ******************************/
+/*****************************  SKEIN_512 ******************************/
 #if !(SKEIN_USE_ASM & 512)
 void skein_512_process_block(struct skein_512_ctx *ctx, const u8 *blk_ptr,
                             size_t blk_cnt, size_t byte_cnt_add)
@@ -477,7 +477,7 @@ unsigned int skein_512_unroll_cnt(void)
 #endif
 #endif
 
-/*****************************  Skein1024 ******************************/
+/*****************************  SKEIN_1024 ******************************/
 #if !(SKEIN_USE_ASM & 1024)
 void skein_1024_process_block(struct skein_1024_ctx *ctx, const u8 *blk_ptr,
                              size_t blk_cnt, size_t byte_cnt_add)
index 67ba9a6..17a314b 100644 (file)
@@ -38,13 +38,13 @@ void threefish_encrypt_block_words(struct threefish_key *key_ctx, u64 *in,
                                   u64 *out)
 {
        switch (key_ctx->state_size) {
-       case Threefish256:
+       case THREEFISH_256:
                threefish_encrypt_256(key_ctx, in, out);
                break;
-       case Threefish512:
+       case THREEFISH_512:
                threefish_encrypt_512(key_ctx, in, out);
                break;
-       case Threefish1024:
+       case THREEFISH_1024:
                threefish_encrypt_1024(key_ctx, in, out);
                break;
        }
@@ -65,13 +65,13 @@ void threefish_decrypt_block_words(struct threefish_key *key_ctx, u64 *in,
                                   u64 *out)
 {
        switch (key_ctx->state_size) {
-       case Threefish256:
+       case THREEFISH_256:
                threefish_decrypt_256(key_ctx, in, out);
                break;
-       case Threefish512:
+       case THREEFISH_512:
                threefish_decrypt_512(key_ctx, in, out);
                break;
-       case Threefish1024:
+       case THREEFISH_1024:
                threefish_decrypt_1024(key_ctx, in, out);
                break;
        }