summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibrhash/librhash/sha256.c
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-04-07 18:54:54 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-04-07 18:54:54 (GMT)
commitd54f0aa9b71dfcc04f077e5b19c6122cb4b98d83 (patch)
tree987fbabfbdda89ed4aaea7fa9c99ee99f4e27084 /Utilities/cmlibrhash/librhash/sha256.c
parent2f949be4b3a4e9da43a1c445300084a2d63837e2 (diff)
parentb8b804e2ed8dca3c6d116a6e8a1cb66cbd6ad241 (diff)
downloadCMake-d54f0aa9b71dfcc04f077e5b19c6122cb4b98d83.zip
CMake-d54f0aa9b71dfcc04f077e5b19c6122cb4b98d83.tar.gz
CMake-d54f0aa9b71dfcc04f077e5b19c6122cb4b98d83.tar.bz2
Merge branch 'master' into ninja-order-depends
Diffstat (limited to 'Utilities/cmlibrhash/librhash/sha256.c')
-rw-r--r--Utilities/cmlibrhash/librhash/sha256.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/Utilities/cmlibrhash/librhash/sha256.c b/Utilities/cmlibrhash/librhash/sha256.c
index af5b0fe..21a69aa 100644
--- a/Utilities/cmlibrhash/librhash/sha256.c
+++ b/Utilities/cmlibrhash/librhash/sha256.c
@@ -1,18 +1,18 @@
/* sha256.c - an implementation of SHA-256/224 hash functions
* based on FIPS 180-3 (Federal Information Processing Standart).
*
- * Copyright: 2010-2012 Aleksey Kravchenko <rhash.admin@gmail.com>
+ * Copyright (c) 2010, Aleksey Kravchenko <rhash.admin@gmail.com>
*
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so.
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted.
*
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. Use this program at your own risk!
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
*/
#include <string.h>
@@ -65,7 +65,7 @@ static const unsigned rhash_k256[64] = {
*
* @param ctx context to initialize
*/
-void rhash_sha256_init(sha256_ctx *ctx)
+void rhash_sha256_init(sha256_ctx* ctx)
{
/* Initial values. These words were obtained by taking the first 32
* bits of the fractional parts of the square roots of the first
@@ -87,7 +87,7 @@ void rhash_sha256_init(sha256_ctx *ctx)
*
* @param ctx context to initialize
*/
-void rhash_sha224_init(struct sha256_ctx *ctx)
+void rhash_sha224_init(struct sha256_ctx* ctx)
{
/* Initial values from FIPS 180-3. These words were obtained by taking
* bits from 33th to 64th of the fractional parts of the square
@@ -113,7 +113,7 @@ static void rhash_sha256_process_block(unsigned hash[8], unsigned block[16])
{
unsigned A, B, C, D, E, F, G, H;
unsigned W[16];
- const unsigned *k;
+ const unsigned* k;
int i;
A = hash[0], B = hash[1], C = hash[2], D = hash[3];
@@ -168,7 +168,7 @@ static void rhash_sha256_process_block(unsigned hash[8], unsigned block[16])
* @param msg message chunk
* @param size length of the message chunk
*/
-void rhash_sha256_update(sha256_ctx *ctx, const unsigned char *msg, size_t size)
+void rhash_sha256_update(sha256_ctx* ctx, const unsigned char* msg, size_t size)
{
size_t index = (size_t)ctx->length & 63;
ctx->length += size;
@@ -210,7 +210,7 @@ void rhash_sha256_update(sha256_ctx *ctx, const unsigned char *msg, size_t size)
* @param ctx the algorithm context containing current hashing state
* @param result calculated hash in binary form
*/
-void rhash_sha256_final(sha256_ctx *ctx, unsigned char* result)
+void rhash_sha256_final(sha256_ctx* ctx, unsigned char* result)
{
size_t index = ((unsigned)ctx->length & 63) >> 2;
unsigned shift = ((unsigned)ctx->length & 3) * 8;