]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/skein/skein_base.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[karo-tx-linux.git] / drivers / staging / skein / skein_base.c
index dde6f7ed2c3e9b1b74baffcdb07134c235de4c3a..c24a57396483df3ff72e2f9905dba5b037d141f1 100644 (file)
@@ -221,7 +221,7 @@ int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val)
        memcpy(x, ctx->x, sizeof(x));
        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));
@@ -230,7 +230,7 @@ int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val)
                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,
+               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));
@@ -448,7 +448,7 @@ int skein_512_final(struct skein_512_ctx *ctx, u8 *hash_val)
        memcpy(x, ctx->x, sizeof(x));
        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));
@@ -457,7 +457,7 @@ int skein_512_final(struct skein_512_ctx *ctx, u8 *hash_val)
                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,
+               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));
@@ -670,7 +670,7 @@ int skein_1024_final(struct skein_1024_ctx *ctx, u8 *hash_val)
        memcpy(x, ctx->x, sizeof(x));
        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));
@@ -679,7 +679,7 @@ int skein_1024_final(struct skein_1024_ctx *ctx, u8 *hash_val)
                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,
+               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));
@@ -777,7 +777,7 @@ int skein_256_output(struct skein_256_ctx *ctx, u8 *hash_val)
        memcpy(x, ctx->x, sizeof(x));
        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));
@@ -786,7 +786,7 @@ int skein_256_output(struct skein_256_ctx *ctx, u8 *hash_val)
                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,
+               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));
@@ -814,7 +814,7 @@ int skein_512_output(struct skein_512_ctx *ctx, u8 *hash_val)
        memcpy(x, ctx->x, sizeof(x));
        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));
@@ -823,7 +823,7 @@ int skein_512_output(struct skein_512_ctx *ctx, u8 *hash_val)
                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,
+               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));
@@ -851,7 +851,7 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val)
        memcpy(x, ctx->x, sizeof(x));
        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));
@@ -860,7 +860,7 @@ int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val)
                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,
+               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));