Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging/skein: rename files and clean up directory structure

Clean up file names and locations. Get rid of include/ directory and move
those up to the top-level. Rename files to get rid of upper case. Remove
skeinBlockNo3F.c as it was unused (temporary file or something?).

Signed-off-by: Jake Edge <jake@lwn.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jake Edge and committed by
Greg Kroah-Hartman
85dfd522 19440266

+21 -201
+5 -7
drivers/staging/skein/Makefile
··· 1 1 # 2 2 # Makefile for the skein secure hash algorithm 3 3 # 4 - subdir-ccflags-y := -I$(src)/include/ 5 - 6 4 obj-$(CONFIG_CRYPTO_SKEIN) += skein.o \ 7 - skeinApi.o \ 5 + skein_api.o \ 8 6 skein_block.o 9 7 10 - obj-$(CONFIG_CRYPTO_THREEFISH) += threefish1024Block.o \ 11 - threefish256Block.o \ 12 - threefish512Block.o \ 13 - threefishApi.o 8 + obj-$(CONFIG_CRYPTO_THREEFISH) += threefish_1024_block.o \ 9 + threefish_256_block.o \ 10 + threefish_512_block.o \ 11 + threefish_api.o
-1
drivers/staging/skein/TODO
··· 1 1 skein/threefish TODO 2 2 3 - - rename files 4 3 - move macros into appropriate header files 5 4 - add / pass test vectors 6 5 - module support
drivers/staging/skein/include/skein.h drivers/staging/skein/skein.h
+3 -3
drivers/staging/skein/include/skeinApi.h drivers/staging/skein/skein_api.h
··· 28 28 #define SKEINAPI_H 29 29 30 30 /** 31 - * @file skeinApi.h 31 + * @file skein_api.h 32 32 * @brief A Skein API and its functions. 33 33 * @{ 34 34 * ··· 44 44 * 45 45 * @code 46 46 * 47 - * #include <skeinApi.h> 47 + * #include "skein_api.h" 48 48 * 49 49 * ... 50 50 * struct skein_ctx ctx; // a Skein hash or MAC context ··· 79 79 */ 80 80 81 81 #include <linux/types.h> 82 - #include <skein.h> 82 + #include "skein.h" 83 83 84 84 /** 85 85 * Which Skein size to use
+1 -1
drivers/staging/skein/include/skein_block.h drivers/staging/skein/skein_block.h
··· 10 10 #ifndef _SKEIN_BLOCK_H_ 11 11 #define _SKEIN_BLOCK_H_ 12 12 13 - #include <skein.h> /* get the Skein API definitions */ 13 + #include "skein.h" /* get the Skein API definitions */ 14 14 15 15 void skein_256_process_block(struct skein_256_ctx *ctx, const u8 *blk_ptr, 16 16 size_t blk_cnt, size_t byte_cnt_add);
+1 -1
drivers/staging/skein/include/skein_iv.h drivers/staging/skein/skein_iv.h
··· 1 1 #ifndef _SKEIN_IV_H_ 2 2 #define _SKEIN_IV_H_ 3 3 4 - #include <skein.h> /* get Skein macros and types */ 4 + #include "skein.h" /* get Skein macros and types */ 5 5 6 6 /* 7 7 ***************** Pre-computed Skein IVs *******************
+2 -2
drivers/staging/skein/include/threefishApi.h drivers/staging/skein/threefish_api.h
··· 3 3 #define THREEFISHAPI_H 4 4 5 5 /** 6 - * @file threefishApi.h 6 + * @file threefish_api.h 7 7 * @brief A Threefish cipher API and its functions. 8 8 * @{ 9 9 * ··· 29 29 */ 30 30 31 31 #include <linux/types.h> 32 - #include <skein.h> 32 + #include "skein.h" 33 33 34 34 #define KEY_SCHEDULE_CONST 0x1BD11BDAA9FC1A22L 35 35
+3 -3
drivers/staging/skein/skein.c
··· 11 11 #define SKEIN_PORT_CODE /* instantiate any code in skein_port.h */ 12 12 13 13 #include <linux/string.h> /* get the memcpy/memset functions */ 14 - #include <skein.h> /* get the Skein API definitions */ 15 - #include <skein_iv.h> /* get precomputed IVs */ 16 - #include <skein_block.h> 14 + #include "skein.h" /* get the Skein API definitions */ 15 + #include "skein_iv.h" /* get precomputed IVs */ 16 + #include "skein_block.h" 17 17 18 18 /*****************************************************************/ 19 19 /* 256-bit Skein */
+1 -1
drivers/staging/skein/skeinApi.c drivers/staging/skein/skein_api.c
··· 25 25 */ 26 26 27 27 #include <linux/string.h> 28 - #include <skeinApi.h> 28 + #include "skein_api.h" 29 29 30 30 int skein_ctx_prepare(struct skein_ctx *ctx, enum skein_size size) 31 31 {
-175
drivers/staging/skein/skeinBlockNo3F.c
··· 1 - 2 - #include <linux/string.h> 3 - #include <skein.h> 4 - #include <threefishApi.h> 5 - 6 - 7 - /***************************** Skein_256 ******************************/ 8 - void skein_256_process_block(struct skein_256_ctx *ctx, const u8 *blk_ptr, 9 - size_t blk_cnt, size_t byte_cnt_add) 10 - { 11 - struct threefish_key key; 12 - u64 tweak[2]; 13 - int i; 14 - u64 w[SKEIN_256_STATE_WORDS]; /* local copy of input block */ 15 - u64 words[3]; 16 - 17 - skein_assert(blk_cnt != 0); /* never call with blk_cnt == 0! */ 18 - tweak[0] = ctx->h.T[0]; 19 - tweak[1] = ctx->h.T[1]; 20 - 21 - do { 22 - u64 carry = byte_cnt_add; 23 - 24 - words[0] = tweak[0] & 0xffffffffL; 25 - words[1] = ((tweak[0] >> 32) & 0xffffffffL); 26 - words[2] = (tweak[1] & 0xffffffffL); 27 - 28 - for (i = 0; i < 3; i++) { 29 - carry += words[i]; 30 - words[i] = carry; 31 - carry >>= 32; 32 - } 33 - tweak[0] = words[0] & 0xffffffffL; 34 - tweak[0] |= (words[1] & 0xffffffffL) << 32; 35 - tweak[1] |= words[2] & 0xffffffffL; 36 - 37 - threefish_set_key(&key, THREEFISH_256, ctx->X, tweak); 38 - 39 - /* get input block in little-endian format */ 40 - skein_get64_lsb_first(w, blk_ptr, SKEIN_256_STATE_WORDS); 41 - 42 - threefish_encrypt_block_words(&key, w, ctx->X); 43 - 44 - blk_ptr += SKEIN_256_BLOCK_BYTES; 45 - 46 - /* do the final "feedforward" xor, update ctx chaining vars */ 47 - ctx->X[0] = ctx->X[0] ^ w[0]; 48 - ctx->X[1] = ctx->X[1] ^ w[1]; 49 - ctx->X[2] = ctx->X[2] ^ w[2]; 50 - ctx->X[3] = ctx->X[3] ^ w[3]; 51 - 52 - tweak[1] &= ~SKEIN_T1_FLAG_FIRST; 53 - } while (--blk_cnt); 54 - 55 - ctx->h.T[0] = tweak[0]; 56 - ctx->h.T[1] = tweak[1]; 57 - } 58 - 59 - void skein_512_process_block(struct skein_512_ctx *ctx, const u8 *blk_ptr, 60 - size_t blk_cnt, size_t byte_cnt_add) 61 - { 62 - struct threefish_key key; 63 - u64 tweak[2]; 64 - int i; 65 - u64 words[3]; 66 - u64 w[SKEIN_512_STATE_WORDS]; /* local copy of input block */ 67 - 68 - skein_assert(blk_cnt != 0); /* never call with blk_cnt == 0! */ 69 - tweak[0] = ctx->h.T[0]; 70 - tweak[1] = ctx->h.T[1]; 71 - 72 - do { 73 - u64 carry = byte_cnt_add; 74 - 75 - words[0] = tweak[0] & 0xffffffffL; 76 - words[1] = ((tweak[0] >> 32) & 0xffffffffL); 77 - words[2] = (tweak[1] & 0xffffffffL); 78 - 79 - for (i = 0; i < 3; i++) { 80 - carry += words[i]; 81 - words[i] = carry; 82 - carry >>= 32; 83 - } 84 - tweak[0] = words[0] & 0xffffffffL; 85 - tweak[0] |= (words[1] & 0xffffffffL) << 32; 86 - tweak[1] |= words[2] & 0xffffffffL; 87 - 88 - threefish_set_key(&key, THREEFISH_512, ctx->X, tweak); 89 - 90 - /* get input block in little-endian format */ 91 - skein_get64_lsb_first(w, blk_ptr, SKEIN_512_STATE_WORDS); 92 - 93 - threefish_encrypt_block_words(&key, w, ctx->X); 94 - 95 - blk_ptr += SKEIN_512_BLOCK_BYTES; 96 - 97 - /* do the final "feedforward" xor, update ctx chaining vars */ 98 - ctx->X[0] = ctx->X[0] ^ w[0]; 99 - ctx->X[1] = ctx->X[1] ^ w[1]; 100 - ctx->X[2] = ctx->X[2] ^ w[2]; 101 - ctx->X[3] = ctx->X[3] ^ w[3]; 102 - ctx->X[4] = ctx->X[4] ^ w[4]; 103 - ctx->X[5] = ctx->X[5] ^ w[5]; 104 - ctx->X[6] = ctx->X[6] ^ w[6]; 105 - ctx->X[7] = ctx->X[7] ^ w[7]; 106 - 107 - tweak[1] &= ~SKEIN_T1_FLAG_FIRST; 108 - } while (--blk_cnt); 109 - 110 - ctx->h.T[0] = tweak[0]; 111 - ctx->h.T[1] = tweak[1]; 112 - } 113 - 114 - void skein_1024_process_block(struct skein_1024_ctx *ctx, const u8 *blk_ptr, 115 - size_t blk_cnt, size_t byte_cnt_add) 116 - { 117 - struct threefish_key key; 118 - u64 tweak[2]; 119 - int i; 120 - u64 words[3]; 121 - u64 w[SKEIN_1024_STATE_WORDS]; /* local copy of input block */ 122 - 123 - skein_assert(blk_cnt != 0); /* never call with blk_cnt == 0! */ 124 - tweak[0] = ctx->h.T[0]; 125 - tweak[1] = ctx->h.T[1]; 126 - 127 - do { 128 - u64 carry = byte_cnt_add; 129 - 130 - words[0] = tweak[0] & 0xffffffffL; 131 - words[1] = ((tweak[0] >> 32) & 0xffffffffL); 132 - words[2] = (tweak[1] & 0xffffffffL); 133 - 134 - for (i = 0; i < 3; i++) { 135 - carry += words[i]; 136 - words[i] = carry; 137 - carry >>= 32; 138 - } 139 - tweak[0] = words[0] & 0xffffffffL; 140 - tweak[0] |= (words[1] & 0xffffffffL) << 32; 141 - tweak[1] |= words[2] & 0xffffffffL; 142 - 143 - threefish_set_key(&key, THREEFISH_1024, ctx->X, tweak); 144 - 145 - /* get input block in little-endian format */ 146 - skein_get64_lsb_first(w, blk_ptr, SKEIN_1024_STATE_WORDS); 147 - 148 - threefish_encrypt_block_words(&key, w, ctx->X); 149 - 150 - blk_ptr += SKEIN_1024_BLOCK_BYTES; 151 - 152 - /* do the final "feedforward" xor, update ctx chaining vars */ 153 - ctx->X[0] = ctx->X[0] ^ w[0]; 154 - ctx->X[1] = ctx->X[1] ^ w[1]; 155 - ctx->X[2] = ctx->X[2] ^ w[2]; 156 - ctx->X[3] = ctx->X[3] ^ w[3]; 157 - ctx->X[4] = ctx->X[4] ^ w[4]; 158 - ctx->X[5] = ctx->X[5] ^ w[5]; 159 - ctx->X[6] = ctx->X[6] ^ w[6]; 160 - ctx->X[7] = ctx->X[7] ^ w[7]; 161 - ctx->X[8] = ctx->X[8] ^ w[8]; 162 - ctx->X[9] = ctx->X[9] ^ w[9]; 163 - ctx->X[10] = ctx->X[10] ^ w[10]; 164 - ctx->X[11] = ctx->X[11] ^ w[11]; 165 - ctx->X[12] = ctx->X[12] ^ w[12]; 166 - ctx->X[13] = ctx->X[13] ^ w[13]; 167 - ctx->X[14] = ctx->X[14] ^ w[14]; 168 - ctx->X[15] = ctx->X[15] ^ w[15]; 169 - 170 - tweak[1] &= ~SKEIN_T1_FLAG_FIRST; 171 - } while (--blk_cnt); 172 - 173 - ctx->h.T[0] = tweak[0]; 174 - ctx->h.T[1] = tweak[1]; 175 - }
+1 -1
drivers/staging/skein/skein_block.c
··· 15 15 ************************************************************************/ 16 16 17 17 #include <linux/string.h> 18 - #include <skein.h> 18 + #include "skein.h" 19 19 20 20 #ifndef SKEIN_USE_ASM 21 21 #define SKEIN_USE_ASM (0) /* default is all C code (no ASM) */
+1 -1
drivers/staging/skein/threefish1024Block.c drivers/staging/skein/threefish_1024_block.c
··· 1 1 #include <linux/string.h> 2 - #include <threefishApi.h> 2 + #include "threefish_api.h" 3 3 4 4 5 5 void threefish_encrypt_1024(struct threefish_key *key_ctx, u64 *input,
+1 -1
drivers/staging/skein/threefish256Block.c drivers/staging/skein/threefish_256_block.c
··· 1 1 #include <linux/string.h> 2 - #include <threefishApi.h> 2 + #include "threefish_api.h" 3 3 4 4 5 5 void threefish_encrypt_256(struct threefish_key *key_ctx, u64 *input,
+1 -1
drivers/staging/skein/threefish512Block.c drivers/staging/skein/threefish_512_block.c
··· 1 1 #include <linux/string.h> 2 - #include <threefishApi.h> 2 + #include "threefish_api.h" 3 3 4 4 5 5 void threefish_encrypt_512(struct threefish_key *key_ctx, u64 *input,
+1 -3
drivers/staging/skein/threefishApi.c drivers/staging/skein/threefish_api.c
··· 1 - 2 - 3 1 #include <linux/string.h> 4 - #include <threefishApi.h> 2 + #include "threefish_api.h" 5 3 6 4 void threefish_set_key(struct threefish_key *key_ctx, 7 5 enum threefish_size state_size,