Commit Graph

50 Commits

Author SHA1 Message Date
Colin Cronin
20ba458156 Drivers: staging: skein: skein_api: Fixed spelling errors
Fixed a few spelling errors in comments.

Signed-off-by: Colin Cronin <colinpatrickcronin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 10:30:40 +09:00
Vatika Harlalka
2f1758d606 Staging: skein: Remove do-while(0) from single statement macros
Remove unneeded do-while(0) loop from single statement macros.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:15 +01:00
Mathieu Poirier
b6fe6e0608 staging: skein: Fixing single statement macro checkpatch warning
WARNING: Single statement macros should not use a do {} while (0) loop

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by:  Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:05:52 -08:00
Mathieu Poirier
1fab3fde75 staging: skein: Fixing trailing whitespace error
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by:  Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:05:52 -08:00
Domagoj Trsan
337832b791 staging: skein: fix sparse warnings related to shift operator
Fix warnings:
drivers/staging/skein/skein_base.h:89:30: warning: shift too big (50) for type int
...
drivers/staging/skein/skein_base.h:89:30: warning: shift too big (39)for type int
drivers/staging/skein/skein_base.h:89:19: warning: too many warnings

Signed-off-by: Domagoj Trsan <domagoj.trsan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-22 10:53:09 -08:00
Niklas Svensson
1ef3988da4 staging: skein: fixed sparse warnings related to static declarations
drivers/staging/skein/skein_generic.c:30:5: warning: symbol 'skein256_update' was not declared. Should it be static?
drivers/staging/skein/skein_generic.c:65:5: warning: symbol 'skein512_update' was not declared. Should it be static?
drivers/staging/skein/skein_generic.c💯5: warning: symbol 'skein1024_update' was not declared. Should it be static?

Signed-off-by: Niklas Svensson <nks@flawful.org>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-22 10:53:09 -08:00
Eric Rost
8369e382bd staging: skein: Removes skein_debug include
Removes skein_debug.h include since skein_debug.h is nonexistent.
Removes unneeded debug empty macro defines and their uses.

Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
Reviewed-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:32:24 -07:00
Mikael Svantesson
2d37545751 staging: skein: skein_api.c: removed space before ','
Signed-off-by: Mikael Svantesson <mikael@distopic.net>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 16:20:56 -07:00
Eric Rost
71077bb2fc staging: skein: Removes unneeded #define
Removes unneeded #define SKEIN_PORT_CODE since skein_port.h is
nonexistent.

Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
Reviewed-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 16:39:58 +08:00
Eric Rost
c4597c4426 staging: skein: Inlines rotl_64
Inlines the rotl_64 macro.

Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
Reviewed-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 16:39:58 +08:00
Eric Rost
075c267566 staging: skein: Adds Loadable Module Support
Adds loadable module support to the Skein Hashing Algorithm driver.

Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
Reviewed-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 16:39:58 +08:00
Eric Rost
f96d8ced8e staging: skein: Adds CryptoAPI Support
Adds CryptoAPI support to the Skein Hashing Algorithm driver.

Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
Reviewed-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 16:39:58 +08:00
Eric Rost
c17cdeb419 staging: skein: Renames skein to skein_base
Renames skein.c to skein_base.c and skein.h to skein_base.h in
preparation for naming loadable module skein.ko

Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
Reviewed-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 16:39:58 +08:00
Eric Rost
24443a244b staging: skein: Collapses threefish module
Collapses threefish module into skein module.

Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
Reviewed-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 16:39:58 +08:00
Eric Rost
468d958d24 staging: skein: File Reorg
Reorganizes file to remove #defines from middle of functions. Also
removes #if'd loop declarations and adds ternary if driven loops.

Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 11:27:52 +08:00
Eric Rost
6ffb16475c staging: skein: Whitespace cleanup
Pretties up multiline #defines and many other whitespace issues

Signed-off-by: Eric Rost <eric.rost@mybabylon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 11:27:52 +08:00
Blaj Roxana
297cbdaeca staging: skein: replace spaces with tabs
This fixes the error and warning:
ERROR: code indent should use tabs where possible
WARNING: please, no spaces at the start of a line

Signed-off-by: Blaj Roxana <roxanagabriela10@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 17:27:28 -07:00
James A Shackleford
df37d1ac58 staging: skein: fix sparse warning for static arrays
This patch fixes the following sparse warnings:

skein_iv.h:23:11: warning: symbol 'SKEIN_256_IV_128' was not declared. Should it be static?
skein_iv.h:31:11: warning: symbol 'SKEIN_256_IV_160' was not declared. Should it be static?
skein_iv.h:39:11: warning: symbol 'SKEIN_256_IV_224' was not declared. Should it be static?
skein_iv.h:47:11: warning: symbol 'SKEIN_256_IV_256' was not declared. Should it be static?
skein_iv.h:55:11: warning: symbol 'SKEIN_512_IV_128' was not declared. Should it be static?
skein_iv.h:67:11: warning: symbol 'SKEIN_512_IV_160' was not declared. Should it be static?
skein_iv.h:79:11: warning: symbol 'SKEIN_512_IV_224' was not declared. Should it be static?
skein_iv.h:91:11: warning: symbol 'SKEIN_512_IV_256' was not declared. Should it be static?
skein_iv.h:103:11: warning: symbol 'SKEIN_512_IV_384' was not declared. Should it be static?
skein_iv.h:115:11: warning: symbol 'SKEIN_512_IV_512' was not declared. Should it be static?
skein_iv.h:127:11: warning: symbol 'SKEIN_1024_IV_384' was not declared. Should it be static?
skein_iv.h:147:11: warning: symbol 'SKEIN_1024_IV_512' was not declared. Should it be static?
skein_iv.h:167:11: warning: symbol 'SKEIN_1024_IV_1024' was not declared. Should it be static?

by declaring the initialization vectors in question as static.  The header
skein_iv.h is only included by skein.c

Signed-off-by: James A Shackleford <shack@linux.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 16:56:43 -07:00
James A Shackleford
7eb843aa50 staging: skein: fix sparse warning for static declarations
This patch fixes the following sparse warnings:

skein_block.c:43:6: warning: symbol 'skein_256_process_block' was not declared. Should it be static?
skein_block.c:252:6: warning: symbol 'skein_512_process_block' was not declared. Should it be static?
skein_block.c:483:6: warning: symbol 'skein_1024_process_block' was not declared. Should it be static?

by including the header skein_block.h, which contains the declarations in
question.

Signed-off-by: James A Shackleford <shack@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-01 16:58:59 -07:00
Jake Edge
007dfe5ad6 staging/skein: variable/member name cleanup
Rename a few more variables and structure member names to lower case.

Signed-off-by: Jake Edge <jake@lwn.net>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-21 11:17:42 +09:00
Jake Edge
a82100e78c staging/skein: comment typos
fix some comment typos

Signed-off-by: Jake Edge <jake@lwn.net>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-21 11:17:42 +09:00
Jake Edge
0109ce7304 staging/skein: move all threefish block functions to one file
move all threefish block functions to one file, remove unneeded include

Signed-off-by: Jake Edge <jake@lwn.net>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-21 11:17:42 +09:00
Jake Edge
85dfd522f8 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>
2014-05-19 17:32:27 -07:00
Anton Saraev
0264b7b7fb staging: crypto: skein: rename macros
Mixing upper and lower case in names of macros like It_Is_Macro is
not accepted in the Linux Kernel. To prepare skein driver for mainline
inclusion, we rename all macros to uppercase or lowercase 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>
2014-05-19 14:18:14 -07:00
Anton Saraev
9435d3ace6 staging: crypto: skein: rename enums
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>
2014-05-19 14:18:14 -07:00
Anton Saraev
3201b7f25e staging: crypto: skein: rename skein1024_ctx to skein_1024_ctx
Code have skein_512_ctx and skein_256_ctx but skein1024_ctx.
It would be logical to convert these names to a single form.

Signed-off-by: Anton Saraev <antonysaraev@gmail.com>
Reviewed-by: Jake Edge <jake@lwn.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-19 14:18:14 -07:00
Anton Saraev
95f1840a7e staging: crypto: skein: rename camelcase vars
camelCase is not accepted in the Linux Kernel. To prepare skein
driver for mainline inclusion, we rename all vars to
non-camelCase equivalents.

Signed-off-by: Anton Saraev <antonysaraev@gmail.com>
Reviewed-by: Jake Edge <jake@lwn.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-19 14:18:14 -07:00
Anton Saraev
68ace624a6 staging: crypto: skein: rename camelcase functions
camelCase is not accepted in the Linux Kernel. To prepare skein
driver for mainline inclusion, we rename all functions to
non-camelCase equivalents.

Signed-off-by: Anton Saraev <antonysaraev@gmail.com>
Reviewed-by: Jake Edge <jake@lwn.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-19 13:20:08 -07:00
Jason Cooper
6559e221a1 staging: crypto: skein: depend upon CRYPTO
Fengguang's randconfig kernel build tester discovered the following
warnings:

warning: (CRYPTO_THREEFISH) selects CRYPTO_ALGAPI which has unmet direct dependencies (CRYPTO)
warning: (DM_VERITY && CRYPTO_SKEIN) selects CRYPTO_HASH which has unmet direct dependencies (CRYPTO)

Fix this in the Kconfig by depending on CRYPTO.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-19 12:56:58 -07:00
Jason Cooper
c5ace7bf7a staging: crypto: skein: add TODO file
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:43 -07:00
Jason Cooper
fc9824747c staging: crypto: skein: remove unnecessary line continuation
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:43 -07:00
Jason Cooper
7584a87871 staging: crypto: skein: remove braces from single-statement block
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:43 -07:00
Jason Cooper
906b492e77 staging: crypto: skein: remove externs from .c files
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:43 -07:00
Jason Cooper
522e358d2d staging: crypto: skein: wrap multi-line macros in do-while loops
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:43 -07:00
Jason Cooper
161a2afdf5 staging: crypto: skein: fix brace placement errors
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:42 -07:00
Jason Cooper
51cc00fd1e staging: crypto: skein: fix do/while brace formatting
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:42 -07:00
Jason Cooper
60eb817520 staging: crypto: skein: cleanup >80 character lines
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:42 -07:00
Jason Cooper
06a620f09e staging: crypto: skein: remove trailing whitespace
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:42 -07:00
Jason Cooper
39bd42b085 staging: crypto: skein: fix leading whitespace
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:42 -07:00
Jason Cooper
e6d336f5c6 staging: crypto: skein: dos2unix, remove executable perms
$ find drivers/staging/skein -type f | xargs todos -d
$ chmod -x drivers/staging/skein/skeinApi.c
$ chmod -x drivers/staging/skein/include/skeinApi.h

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:41 -07:00
Jason Cooper
a0d5dd8432 staging: crypto: skein: cleanup whitespace around operators/punc.
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:41 -07:00
Jason Cooper
cd4811a64c staging: crypto: skein: fixup pointer whitespace
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:41 -07:00
Jason Cooper
b9761ccb55 staging: crypto: skein: use u8, u64 vice uint*_t
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:41 -07:00
Jason Cooper
11d9ffb2ca staging: crypto: skein: remove all typedef {struct, enum}
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:41 -07:00
Jason Cooper
2ab31bba2d staging: crypto: skein: remove unneeded typedefs
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:40 -07:00
Jason Cooper
8eee37872e staging: crypto: skein: remove __cplusplus and an unneeded stddef.h
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:40 -07:00
Jason Cooper
da13dfd7e6 staging: crypto: skein: remove skein_port.h
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:40 -07:00
Jason Cooper
5057bbbe74 staging: crypto: skein: remove brg_*.h includes
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:47:40 -07:00
Jason Cooper
c2c7426bfc staging: crypto: skein: allow building statically
These are the minimum changes required to get the code to build
statically in the kernel.  It's necessary to do this first so that we
can empirically determine that future cleanup patches aren't changing
the generated object code.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:46:48 -07:00
Jason Cooper
449bb8125e staging: crypto: skein: import code from Skein3Fish.git
This is a byte-for-byte copy of the skein implementation found at:

  https://github.com/wernerd/Skein3Fish.git

Specifically, from the master branch at commit:

  00e925444c2c Merge pull request #4 from csm/master

The next commit will do the minimum necessary to build this code as a
module.

I've generated the sha256 sums of the files by:

$ (cd drivers/staging/skein; find . -type f | sort | xargs sha256sum)
bcd73168e5805b1b157dbf08863e6a8c217a7b270b6be1a361540591b00624e3  ./CMakeLists.txt
e1adb97dd9e87bc7c05892ed7863a66d1d9fde6728a97a8b7b092709da664d29  ./include/brg_endian.h
240329b4ca4d829ac4d1490e96e83118e161e719e448c7e8dbf15735ab8a8e87  ./include/brg_types.h
0d8f16438f641fa365844a5991220eb04969f0a19c60dff08e10f521e74db5c3  ./include/skein.h
8f7362796e9e43f7619d51020d6faeedce786492b65bebd2ff6a833b621051cb  ./include/skeinApi.h
90510d8a9f686c3bfbf6cf7737237e3fa263c1ed5046b0f19727ba55b9bffeb9  ./include/skein_iv.h
42c6c8eff8f364ee2f0de3177d468dbceba9c6a73222fea473fe6d603213806a  ./include/skein_port.h
0154a4b8d54f5aa424b39a7ee668b31f2522b907bf3a8536fe46440b584531a1  ./include/threefishApi.h
ac0fc0f95a48a716d30cf02e5adad77af17725a938f939cf94f6dfba42badeca  ./skein.c
7af70b177bc63690f68eebceca2dbfef8a4473dcc847ae3525508c65c7d7bcc1  ./skeinApi.c
d7ef7330be8253f7f061de3c36880dbc83b0f5d90c8f2b72d3478766f54fbff0  ./skeinBlockNo3F.c
8bb3d7864afc9eab5569949fb2799cb6f14e583ba00641313cf877a5aea1c763  ./skein_block.c
438e6cb59a0090166e8f1e39418c0a2d0036737a32c5e2822c2ed8b803e2132f  ./threefish1024Block.c
e812ec6f2881300e90c803cfd9d044e954f1ca64faa2fc17a709f56a2f122ff8  ./threefish256Block.c
926f680057e128cdd1feba4a8544c177a74420137af480267b949ae79f3d02b8  ./threefish512Block.c
19357f5d47e7183bc8558a8d0949a3f5a80a931848917d26f36eebb7d205f003  ./threefishApi.c

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18 15:46:48 -07:00