diff options
| author | jsing <> | 2024-11-16 14:56:39 +0000 |
|---|---|---|
| committer | jsing <> | 2024-11-16 14:56:39 +0000 |
| commit | e7a6ae25b19891efd234d6f7c2769d1c20f3969f (patch) | |
| tree | 440bdcfa47dd4c46b50b948e6099723d92a1e59b /src/lib/libcrypto/sha/sha512_amd64.c | |
| parent | d5d56fc45a9988f5488f0a2804155ccc5067def3 (diff) | |
| download | openbsd-e7a6ae25b19891efd234d6f7c2769d1c20f3969f.tar.gz openbsd-e7a6ae25b19891efd234d6f7c2769d1c20f3969f.tar.bz2 openbsd-e7a6ae25b19891efd234d6f7c2769d1c20f3969f.zip | |
Provide a replacement assembly implementation for SHA-512 on amd64.
Replace the perlasm generated SHA-512 assembly with a more readable
version and the same C wrapper introduced for SHA-256. As for SHA-256,
on a modern CPU the performance is largely the same.
ok tb@
Diffstat (limited to 'src/lib/libcrypto/sha/sha512_amd64.c')
| -rw-r--r-- | src/lib/libcrypto/sha/sha512_amd64.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/libcrypto/sha/sha512_amd64.c b/src/lib/libcrypto/sha/sha512_amd64.c new file mode 100644 index 0000000000..0b54243020 --- /dev/null +++ b/src/lib/libcrypto/sha/sha512_amd64.c | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* $OpenBSD: sha512_amd64.c,v 1.1 2024/11/16 14:56:39 jsing Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | ||
| 4 | * | ||
| 5 | * Permission to use, copy, modify, and distribute this software for any | ||
| 6 | * purpose with or without fee is hereby granted, provided that the above | ||
| 7 | * copyright notice and this permission notice appear in all copies. | ||
| 8 | * | ||
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #include <openssl/sha.h> | ||
| 19 | |||
| 20 | void sha512_block_generic(SHA512_CTX *ctx, const void *in, size_t num); | ||
| 21 | |||
| 22 | void | ||
| 23 | sha512_block_data_order(SHA512_CTX *ctx, const void *in, size_t num) | ||
| 24 | { | ||
| 25 | sha512_block_generic(ctx, in, num); | ||
| 26 | } | ||
