summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sha/sha256_amd64.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/sha/sha256_amd64.c')
-rw-r--r--src/lib/libcrypto/sha/sha256_amd64.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/libcrypto/sha/sha256_amd64.c b/src/lib/libcrypto/sha/sha256_amd64.c
index f7531b340f..6c5d3e897f 100644
--- a/src/lib/libcrypto/sha/sha256_amd64.c
+++ b/src/lib/libcrypto/sha/sha256_amd64.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sha256_amd64.c,v 1.1 2024/11/08 15:09:48 jsing Exp $ */ 1/* $OpenBSD: sha256_amd64.c,v 1.2 2024/11/16 15:31:36 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -17,10 +17,18 @@
17 17
18#include <openssl/sha.h> 18#include <openssl/sha.h>
19 19
20#include "crypto_arch.h"
21
20void sha256_block_generic(SHA256_CTX *ctx, const void *in, size_t num); 22void sha256_block_generic(SHA256_CTX *ctx, const void *in, size_t num);
23void sha256_block_shani(SHA256_CTX *ctx, const void *in, size_t num);
21 24
22void 25void
23sha256_block_data_order(SHA256_CTX *ctx, const void *in, size_t num) 26sha256_block_data_order(SHA256_CTX *ctx, const void *in, size_t num)
24{ 27{
28 if ((crypto_cpu_caps_amd64 & CRYPTO_CPU_CAPS_AMD64_SHA) != 0) {
29 sha256_block_shani(ctx, in, num);
30 return;
31 }
32
25 sha256_block_generic(ctx, in, num); 33 sha256_block_generic(ctx, in, num);
26} 34}