Signed-off-by: Manu Kumar <mar...@gmx.com>
---
drivers/staging/skein/skein_base.c | 98 +++++++++++++++++++-------------------
1 file changed, 49 insertions(+), 49 deletions(-)

diff --git a/drivers/staging/skein/skein_base.c 
b/drivers/staging/skein/skein_base.c
index 25a01ca..3d9c632 100644
--- a/drivers/staging/skein/skein_base.c
+++ b/drivers/staging/skein/skein_base.c
@@ -58,7 +58,7 @@ int skein_256_init(struct skein_256_ctx *ctx, size_t 
hash_bit_len)
                cfg.w[1] = skein_swap64(hash_bit_len);
                cfg.w[2] = skein_swap64(SKEIN_CFG_TREE_INFO_SEQUENTIAL);
                /* zero pad config block */
-               memset(&cfg.w[3], 0, sizeof(cfg) - 3*sizeof(cfg.w[0]));
+               memset(&cfg.w[3], 0, sizeof(cfg) - 3 * sizeof(cfg.w[0]));

                /* compute the initial chaining values from config block */
                /* zero the chaining variables */
@@ -98,7 +98,7 @@ int skein_256_init_ext(struct skein_256_ctx *ctx, size_t 
hash_bit_len,
                skein_assert(sizeof(cfg.b) >= sizeof(ctx->x));
                /* do a mini-Init right here */
                /* set output hash bit count = state size */
-               ctx->h.hash_bit_len = 8*sizeof(ctx->x);
+               ctx->h.hash_bit_len = 8 * sizeof(ctx->x);
                /* set tweaks: T0 = 0; T1 = KEY type */
                skein_start_new_type(ctx, KEY);
                /* zero the initial chaining variables */
@@ -171,11 +171,11 @@ int skein_256_update(struct skein_256_ctx *ctx, const u8 
*msg,
                 */
                if (msg_byte_cnt > SKEIN_256_BLOCK_BYTES) {
                        /* number of full blocks to process */
-                       n = (msg_byte_cnt-1) / SKEIN_256_BLOCK_BYTES;
+                       n = (msg_byte_cnt - 1) / SKEIN_256_BLOCK_BYTES;
                        skein_256_process_block(ctx, msg, n,
                                                SKEIN_256_BLOCK_BYTES);
                        msg_byte_cnt -= n * SKEIN_256_BLOCK_BYTES;
-                       msg        += n * SKEIN_256_BLOCK_BYTES;
+                       msg          += n * SKEIN_256_BLOCK_BYTES;
                }
                skein_assert(ctx->h.b_cnt == 0);
        }
@@ -205,7 +205,7 @@ int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val)
        /* zero pad b[] if necessary */
        if (ctx->h.b_cnt < SKEIN_256_BLOCK_BYTES)
                memset(&ctx->b[ctx->h.b_cnt], 0,
-                       SKEIN_256_BLOCK_BYTES - ctx->h.b_cnt);
+                      SKEIN_256_BLOCK_BYTES - ctx->h.b_cnt);

        /* process the final block */
        skein_256_process_block(ctx, ctx->b, 1, ctx->h.b_cnt);
@@ -219,19 +219,19 @@ int skein_256_final(struct skein_256_ctx *ctx, u8 
*hash_val)
        memset(ctx->b, 0, sizeof(ctx->b));
        /* keep a local copy of counter mode "key" */
        memcpy(x, ctx->x, sizeof(x));
-       for (i = 0; i*SKEIN_256_BLOCK_BYTES < byte_cnt; i++) {
+       for (i = 0; i * SKEIN_256_BLOCK_BYTES < byte_cnt; i++) {
                /* build the counter block */
-               ((u64 *)ctx->b)[0] = skein_swap64((u64) i);
+               ((u64 *)ctx->b)[0] = skein_swap64((u64)i);
                skein_start_new_type(ctx, OUT_FINAL);
                /* run "counter mode" */
                skein_256_process_block(ctx, ctx->b, 1, sizeof(u64));
                /* number of output bytes left to go */
-               n = byte_cnt - i*SKEIN_256_BLOCK_BYTES;
+               n = byte_cnt - i * SKEIN_256_BLOCK_BYTES;
                if (n >= SKEIN_256_BLOCK_BYTES)
                        n  = SKEIN_256_BLOCK_BYTES;
                /* "output" the ctr mode bytes */
-               skein_put64_lsb_first(hash_val+i*SKEIN_256_BLOCK_BYTES, ctx->x,
-                                     n);
+               skein_put64_lsb_first(hash_val + i * SKEIN_256_BLOCK_BYTES,
+                                     ctx->x, n);
                /* restore the counter mode key for next time */
                memcpy(ctx->x, x, sizeof(x));
        }
@@ -282,7 +282,7 @@ int skein_512_init(struct skein_512_ctx *ctx, size_t 
hash_bit_len)
                cfg.w[1] = skein_swap64(hash_bit_len);
                cfg.w[2] = skein_swap64(SKEIN_CFG_TREE_INFO_SEQUENTIAL);
                /* zero pad config block */
-               memset(&cfg.w[3], 0, sizeof(cfg) - 3*sizeof(cfg.w[0]));
+               memset(&cfg.w[3], 0, sizeof(cfg) - 3 * sizeof(cfg.w[0]));

                /* compute the initial chaining values from config block */
                /* zero the chaining variables */
@@ -326,7 +326,7 @@ int skein_512_init_ext(struct skein_512_ctx *ctx, size_t 
hash_bit_len,
                skein_assert(sizeof(cfg.b) >= sizeof(ctx->x));
                /* do a mini-Init right here */
                /* set output hash bit count = state size */
-               ctx->h.hash_bit_len = 8*sizeof(ctx->x);
+               ctx->h.hash_bit_len = 8 * sizeof(ctx->x);
                /* set tweaks: T0 = 0; T1 = KEY type */
                skein_start_new_type(ctx, KEY);
                /* zero the initial chaining variables */
@@ -398,7 +398,7 @@ int skein_512_update(struct skein_512_ctx *ctx, const u8 
*msg,
                 */
                if (msg_byte_cnt > SKEIN_512_BLOCK_BYTES) {
                        /* number of full blocks to process */
-                       n = (msg_byte_cnt-1) / SKEIN_512_BLOCK_BYTES;
+                       n = (msg_byte_cnt - 1) / SKEIN_512_BLOCK_BYTES;
                        skein_512_process_block(ctx, msg, n,
                                                SKEIN_512_BLOCK_BYTES);
                        msg_byte_cnt -= n * SKEIN_512_BLOCK_BYTES;
@@ -432,7 +432,7 @@ int skein_512_final(struct skein_512_ctx *ctx, u8 *hash_val)
        /* zero pad b[] if necessary */
        if (ctx->h.b_cnt < SKEIN_512_BLOCK_BYTES)
                memset(&ctx->b[ctx->h.b_cnt], 0,
-                       SKEIN_512_BLOCK_BYTES - ctx->h.b_cnt);
+                      SKEIN_512_BLOCK_BYTES - ctx->h.b_cnt);

        /* process the final block */
        skein_512_process_block(ctx, ctx->b, 1, ctx->h.b_cnt);
@@ -446,19 +446,19 @@ int skein_512_final(struct skein_512_ctx *ctx, u8 
*hash_val)
        memset(ctx->b, 0, sizeof(ctx->b));
        /* keep a local copy of counter mode "key" */
        memcpy(x, ctx->x, sizeof(x));
-       for (i = 0; i*SKEIN_512_BLOCK_BYTES < byte_cnt; i++) {
+       for (i = 0; i * SKEIN_512_BLOCK_BYTES < byte_cnt; i++) {
                /* build the counter block */
-               ((u64 *)ctx->b)[0] = skein_swap64((u64) i);
+               ((u64 *)ctx->b)[0] = skein_swap64((u64)i);
                skein_start_new_type(ctx, OUT_FINAL);
                /* run "counter mode" */
                skein_512_process_block(ctx, ctx->b, 1, sizeof(u64));
                /* number of output bytes left to go */
-               n = byte_cnt - i*SKEIN_512_BLOCK_BYTES;
+               n = byte_cnt - i * SKEIN_512_BLOCK_BYTES;
                if (n >= SKEIN_512_BLOCK_BYTES)
                        n  = SKEIN_512_BLOCK_BYTES;
                /* "output" the ctr mode bytes */
-               skein_put64_lsb_first(hash_val+i*SKEIN_512_BLOCK_BYTES, ctx->x,
-                                     n);
+               skein_put64_lsb_first(hash_val + i * SKEIN_512_BLOCK_BYTES,
+                                     ctx->x, n);
                /* restore the counter mode key for next time */
                memcpy(ctx->x, x, sizeof(x));
        }
@@ -506,7 +506,7 @@ int skein_1024_init(struct skein_1024_ctx *ctx, size_t 
hash_bit_len)
                cfg.w[1] = skein_swap64(hash_bit_len);
                cfg.w[2] = skein_swap64(SKEIN_CFG_TREE_INFO_SEQUENTIAL);
                /* zero pad config block */
-               memset(&cfg.w[3], 0, sizeof(cfg) - 3*sizeof(cfg.w[0]));
+               memset(&cfg.w[3], 0, sizeof(cfg) - 3 * sizeof(cfg.w[0]));

                /* compute the initial chaining values from config block */
                /* zero the chaining variables */
@@ -547,7 +547,7 @@ int skein_1024_init_ext(struct skein_1024_ctx *ctx, size_t 
hash_bit_len,
                skein_assert(sizeof(cfg.b) >= sizeof(ctx->x));
                /* do a mini-Init right here */
                /* set output hash bit count = state size */
-               ctx->h.hash_bit_len = 8*sizeof(ctx->x);
+               ctx->h.hash_bit_len = 8 * sizeof(ctx->x);
                /* set tweaks: T0 = 0; T1 = KEY type */
                skein_start_new_type(ctx, KEY);
                /* zero the initial chaining variables */
@@ -606,8 +606,8 @@ int skein_1024_update(struct skein_1024_ctx *ctx, const u8 
*msg,
                                skein_assert(n < msg_byte_cnt);
                                memcpy(&ctx->b[ctx->h.b_cnt], msg, n);
                                msg_byte_cnt  -= n;
-                               msg         += n;
-                               ctx->h.b_cnt += n;
+                               msg           += n;
+                               ctx->h.b_cnt  += n;
                        }
                        skein_assert(ctx->h.b_cnt == SKEIN_1024_BLOCK_BYTES);
                        skein_1024_process_block(ctx, ctx->b, 1,
@@ -620,11 +620,11 @@ int skein_1024_update(struct skein_1024_ctx *ctx, const 
u8 *msg,
                 */
                if (msg_byte_cnt > SKEIN_1024_BLOCK_BYTES) {
                        /* number of full blocks to process */
-                       n = (msg_byte_cnt-1) / SKEIN_1024_BLOCK_BYTES;
+                       n = (msg_byte_cnt - 1) / SKEIN_1024_BLOCK_BYTES;
                        skein_1024_process_block(ctx, msg, n,
                                                 SKEIN_1024_BLOCK_BYTES);
                        msg_byte_cnt -= n * SKEIN_1024_BLOCK_BYTES;
-                       msg        += n * SKEIN_1024_BLOCK_BYTES;
+                       msg          += n * SKEIN_1024_BLOCK_BYTES;
                }
                skein_assert(ctx->h.b_cnt == 0);
        }
@@ -654,7 +654,7 @@ int skein_1024_final(struct skein_1024_ctx *ctx, u8 
*hash_val)
        /* zero pad b[] if necessary */
        if (ctx->h.b_cnt < SKEIN_1024_BLOCK_BYTES)
                memset(&ctx->b[ctx->h.b_cnt], 0,
-                       SKEIN_1024_BLOCK_BYTES - ctx->h.b_cnt);
+                      SKEIN_1024_BLOCK_BYTES - ctx->h.b_cnt);

        /* process the final block */
        skein_1024_process_block(ctx, ctx->b, 1, ctx->h.b_cnt);
@@ -668,19 +668,19 @@ int skein_1024_final(struct skein_1024_ctx *ctx, u8 
*hash_val)
        memset(ctx->b, 0, sizeof(ctx->b));
        /* keep a local copy of counter mode "key" */
        memcpy(x, ctx->x, sizeof(x));
-       for (i = 0; i*SKEIN_1024_BLOCK_BYTES < byte_cnt; i++) {
+       for (i = 0; i * SKEIN_1024_BLOCK_BYTES < byte_cnt; i++) {
                /* build the counter block */
-               ((u64 *)ctx->b)[0] = skein_swap64((u64) i);
+               ((u64 *)ctx->b)[0] = skein_swap64((u64)i);
                skein_start_new_type(ctx, OUT_FINAL);
                /* run "counter mode" */
                skein_1024_process_block(ctx, ctx->b, 1, sizeof(u64));
                /* number of output bytes left to go */
-               n = byte_cnt - i*SKEIN_1024_BLOCK_BYTES;
+               n = byte_cnt - i * SKEIN_1024_BLOCK_BYTES;
                if (n >= SKEIN_1024_BLOCK_BYTES)
                        n  = SKEIN_1024_BLOCK_BYTES;
                /* "output" the ctr mode bytes */
-               skein_put64_lsb_first(hash_val+i*SKEIN_1024_BLOCK_BYTES, ctx->x,
-                                     n);
+               skein_put64_lsb_first(hash_val + i * SKEIN_1024_BLOCK_BYTES,
+                                     ctx->x, n);
                /* restore the counter mode key for next time */
                memcpy(ctx->x, x, sizeof(x));
        }
@@ -702,7 +702,7 @@ int skein_256_final_pad(struct skein_256_ctx *ctx, u8 
*hash_val)
        /* zero pad b[] if necessary */
        if (ctx->h.b_cnt < SKEIN_256_BLOCK_BYTES)
                memset(&ctx->b[ctx->h.b_cnt], 0,
-                       SKEIN_256_BLOCK_BYTES - ctx->h.b_cnt);
+                      SKEIN_256_BLOCK_BYTES - ctx->h.b_cnt);
        /* process the final block */
        skein_256_process_block(ctx, ctx->b, 1, ctx->h.b_cnt);

@@ -724,7 +724,7 @@ int skein_512_final_pad(struct skein_512_ctx *ctx, u8 
*hash_val)
        /* zero pad b[] if necessary */
        if (ctx->h.b_cnt < SKEIN_512_BLOCK_BYTES)
                memset(&ctx->b[ctx->h.b_cnt], 0,
-                       SKEIN_512_BLOCK_BYTES - ctx->h.b_cnt);
+                      SKEIN_512_BLOCK_BYTES - ctx->h.b_cnt);
        /* process the final block */
        skein_512_process_block(ctx, ctx->b, 1, ctx->h.b_cnt);

@@ -746,7 +746,7 @@ int skein_1024_final_pad(struct skein_1024_ctx *ctx, u8 
*hash_val)
        /* zero pad b[] if necessary */
        if (ctx->h.b_cnt < SKEIN_1024_BLOCK_BYTES)
                memset(&ctx->b[ctx->h.b_cnt], 0,
-                       SKEIN_1024_BLOCK_BYTES - ctx->h.b_cnt);
+                      SKEIN_1024_BLOCK_BYTES - ctx->h.b_cnt);
        /* process the final block */
        skein_1024_process_block(ctx, ctx->b, 1, ctx->h.b_cnt);

@@ -775,19 +775,19 @@ int skein_256_output(struct skein_256_ctx *ctx, u8 
*hash_val)
        memset(ctx->b, 0, sizeof(ctx->b));
        /* keep a local copy of counter mode "key" */
        memcpy(x, ctx->x, sizeof(x));
-       for (i = 0; i*SKEIN_256_BLOCK_BYTES < byte_cnt; i++) {
+       for (i = 0; i * SKEIN_256_BLOCK_BYTES < byte_cnt; i++) {
                /* build the counter block */
-               ((u64 *)ctx->b)[0] = skein_swap64((u64) i);
+               ((u64 *)ctx->b)[0] = skein_swap64((u64)i);
                skein_start_new_type(ctx, OUT_FINAL);
                /* run "counter mode" */
                skein_256_process_block(ctx, ctx->b, 1, sizeof(u64));
                /* number of output bytes left to go */
-               n = byte_cnt - i*SKEIN_256_BLOCK_BYTES;
+               n = byte_cnt - i * SKEIN_256_BLOCK_BYTES;
                if (n >= SKEIN_256_BLOCK_BYTES)
                        n  = SKEIN_256_BLOCK_BYTES;
                /* "output" the ctr mode bytes */
-               skein_put64_lsb_first(hash_val+i*SKEIN_256_BLOCK_BYTES, ctx->x,
-                                     n);
+               skein_put64_lsb_first(hash_val + i * SKEIN_256_BLOCK_BYTES,
+                                     ctx->x, n);
                /* restore the counter mode key for next time */
                memcpy(ctx->x, x, sizeof(x));
        }
@@ -812,19 +812,19 @@ int skein_512_output(struct skein_512_ctx *ctx, u8 
*hash_val)
        memset(ctx->b, 0, sizeof(ctx->b));
        /* keep a local copy of counter mode "key" */
        memcpy(x, ctx->x, sizeof(x));
-       for (i = 0; i*SKEIN_512_BLOCK_BYTES < byte_cnt; i++) {
+       for (i = 0; i * SKEIN_512_BLOCK_BYTES < byte_cnt; i++) {
                /* build the counter block */
-               ((u64 *)ctx->b)[0] = skein_swap64((u64) i);
+               ((u64 *)ctx->b)[0] = skein_swap64((u64)i);
                skein_start_new_type(ctx, OUT_FINAL);
                /* run "counter mode" */
                skein_512_process_block(ctx, ctx->b, 1, sizeof(u64));
                /* number of output bytes left to go */
-               n = byte_cnt - i*SKEIN_512_BLOCK_BYTES;
+               n = byte_cnt - i * SKEIN_512_BLOCK_BYTES;
                if (n >= SKEIN_512_BLOCK_BYTES)
                        n  = SKEIN_512_BLOCK_BYTES;
                /* "output" the ctr mode bytes */
-               skein_put64_lsb_first(hash_val+i*SKEIN_512_BLOCK_BYTES, ctx->x,
-                                     n);
+               skein_put64_lsb_first(hash_val + i * SKEIN_512_BLOCK_BYTES,
+                                     ctx->x, n);
                /* restore the counter mode key for next time */
                memcpy(ctx->x, x, sizeof(x));
        }
@@ -849,19 +849,19 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 
*hash_val)
        memset(ctx->b, 0, sizeof(ctx->b));
        /* keep a local copy of counter mode "key" */
        memcpy(x, ctx->x, sizeof(x));
-       for (i = 0; i*SKEIN_1024_BLOCK_BYTES < byte_cnt; i++) {
+       for (i = 0; i * SKEIN_1024_BLOCK_BYTES < byte_cnt; i++) {
                /* build the counter block */
-               ((u64 *)ctx->b)[0] = skein_swap64((u64) i);
+               ((u64 *)ctx->b)[0] = skein_swap64((u64)i);
                skein_start_new_type(ctx, OUT_FINAL);
                /* run "counter mode" */
                skein_1024_process_block(ctx, ctx->b, 1, sizeof(u64));
                /* number of output bytes left to go */
-               n = byte_cnt - i*SKEIN_1024_BLOCK_BYTES;
+               n = byte_cnt - i * SKEIN_1024_BLOCK_BYTES;
                if (n >= SKEIN_1024_BLOCK_BYTES)
                        n  = SKEIN_1024_BLOCK_BYTES;
                /* "output" the ctr mode bytes */
-               skein_put64_lsb_first(hash_val+i*SKEIN_1024_BLOCK_BYTES, ctx->x,
-                                     n);
+               skein_put64_lsb_first(hash_val + i * SKEIN_1024_BLOCK_BYTES,
+                                     ctx->x, n);
                /* restore the counter mode key for next time */
                memcpy(ctx->x, x, sizeof(x));
        }
--
2.8.0
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to