diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/restricted/aws/s2n/pq-crypto/bike_r2/sha.h | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/restricted/aws/s2n/pq-crypto/bike_r2/sha.h')
-rw-r--r-- | contrib/restricted/aws/s2n/pq-crypto/bike_r2/sha.h | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/contrib/restricted/aws/s2n/pq-crypto/bike_r2/sha.h b/contrib/restricted/aws/s2n/pq-crypto/bike_r2/sha.h index 63687055f2..f323cd6b67 100644 --- a/contrib/restricted/aws/s2n/pq-crypto/bike_r2/sha.h +++ b/contrib/restricted/aws/s2n/pq-crypto/bike_r2/sha.h @@ -1,41 +1,41 @@ -/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0" - * - * Written by Nir Drucker and Shay Gueron - * AWS Cryptographic Algorithms Group. - * (ndrucker@amazon.com, gueron@amazon.com) - */ - -#pragma once - -#include "cleanup.h" -#include "types.h" -#include "utilities.h" -#include <openssl/sha.h> - -#define SHA384_HASH_SIZE 48ULL -#define SHA384_HASH_QWORDS (SHA384_HASH_SIZE / 8) - -typedef struct sha384_hash_s -{ - union { - uint8_t raw[SHA384_HASH_SIZE]; - uint64_t qw[SHA384_HASH_QWORDS]; - } u; -} sha384_hash_t; -bike_static_assert(sizeof(sha384_hash_t) == SHA384_HASH_SIZE, sha384_hash_size); - -typedef sha384_hash_t sha_hash_t; - -_INLINE_ void -sha_hash_cleanup(IN OUT sha_hash_t *o) -{ - secure_clean(o->u.raw, sizeof(*o)); -} - -_INLINE_ int -sha(OUT sha_hash_t *hash_out, IN const uint32_t byte_len, IN const uint8_t *msg) -{ - SHA384(msg, byte_len, hash_out->u.raw); - return 1; -} +/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0" + * + * Written by Nir Drucker and Shay Gueron + * AWS Cryptographic Algorithms Group. + * (ndrucker@amazon.com, gueron@amazon.com) + */ + +#pragma once + +#include "cleanup.h" +#include "types.h" +#include "utilities.h" +#include <openssl/sha.h> + +#define SHA384_HASH_SIZE 48ULL +#define SHA384_HASH_QWORDS (SHA384_HASH_SIZE / 8) + +typedef struct sha384_hash_s +{ + union { + uint8_t raw[SHA384_HASH_SIZE]; + uint64_t qw[SHA384_HASH_QWORDS]; + } u; +} sha384_hash_t; +bike_static_assert(sizeof(sha384_hash_t) == SHA384_HASH_SIZE, sha384_hash_size); + +typedef sha384_hash_t sha_hash_t; + +_INLINE_ void +sha_hash_cleanup(IN OUT sha_hash_t *o) +{ + secure_clean(o->u.raw, sizeof(*o)); +} + +_INLINE_ int +sha(OUT sha_hash_t *hash_out, IN const uint32_t byte_len, IN const uint8_t *msg) +{ + SHA384(msg, byte_len, hash_out->u.raw); + return 1; +} |