summaryrefslogtreecommitdiff
path: root/lib/libcrypto/sha
AgeCommit message (Collapse)Author
2023-04-15Apply style(9) (first pass).Joel Sing
2023-04-15Import sha3_internal.h.Joel Sing
2023-04-15Add license to sha3 files.Joel Sing
2023-04-15Import tiny_sha3Joel Sing
This is a minimal and readable SHA3 implementation. ok tb@
2023-04-14Add support for truncated SHA512 variants.Joel Sing
This adds support for SHA512/224 and SHA512/256, as specified in FIPS FIPS 180-4. These are truncated versions of the SHA512 hash. ok tb@
2023-04-14Use memset() and only initialise non-zero struct members.Joel Sing
ok tb@
2023-04-12Remove now unused sha_local.h.Joel Sing
2023-04-12Provide and use crypto_ro{l,r}_u{32,64}().Joel Sing
Various code in libcrypto needs bitwise rotation - rather than defining different versions across the code base, provide a common set that can be reused. Any sensible compiler optimises these to a single instruction where the architecture supports it, which means we can ditch the inline assembly. On the chance that we need to provide a platform specific versions, this follows the approach used in BN where a MD crypto_arch.h header could be added in the future, which would then provide more specific versions of these functions. ok tb@
2023-04-12Provide and use crypto_store_htobe64().Joel Sing
It is common to need to store data in a specific endianness - rather than handrolling and deduplicating code to do this, provide a crypto_store_htobe64() function that converts from host endian to big endian, before storing the data to a location with unknown alignment. ok tb@
2023-04-11Recommit jsing's r1.27 - portable is readyTheo Buehler
Use htobe64() instead of testing BYTE_ORDER and then handrolling htobe64(). Thanks to tobhe for providing most of the fix via openiked-portable
2023-04-11Back out r1.27 using htobe64() - apparently some OS don't have it.Theo Buehler
ok jsing
2023-04-11Consolidate sha1 into a single file.Joel Sing
2023-04-11Simplify handling of big vs little endian.Joel Sing
Rather than sprinkling BYTE_ORDER checks throughout the implementation, always define PULL64 - on big endian platforms it just becomes a no-op. ok tb@
2023-04-11Use htobe64() instead of testing BYTE_ORDER and then handrolling htobe64().Joel Sing
ok tb@
2023-04-11Omit sha512_block_data_order() prototype when assembly is not being used.Joel Sing
In the case that the pure C implementation of SHA512 is being used, the prototype is unnecessary as the function is declared static and exists in dependency order. Simply omit the prototype rather than using #ifndef to toggle the static prefix. ok tb@
2023-04-11Remove less than useful implementation notes.Joel Sing
ok tb@
2023-03-29More whitespace fixes.Joel Sing
Another set of mechnical replacements for "a,b" with "a, b". No change in generated assembly.
2023-03-29Whitespace fixes.Joel Sing
Mechanically replace "a,b" with "a, b". No change to generated assembly.
2023-03-29Whitespace fixes.Joel Sing
Mechanically replace "a,b" with "a, b", followed with some manual indentation clean up. No change in generated assembly.
2023-03-29Use multiple statements instead of a statement with multiple expressions.Joel Sing
No change in generated assembly.
2023-03-29Mop up MD32_XARRAY from SHA1.Joel Sing
MD32_XARRAY (formerly SHA_XARRAY) was added as a workaround for a broken HP C compiler (circa 1999). Clean it up to simplify the code. No change in generated assembly. ok miod@ tb@
2023-03-29Inline initial hash data values for SHA1.Joel Sing
This follows what is done for other SHA implementations. ok miod@ tb@
2023-03-27Reorder functions/code.Joel Sing
No intended functional change.
2023-03-27Tidy includes.Joel Sing
2023-03-26Replace HASH_BLOCK_DATA_ORDER with sha1_block_data_order.Joel Sing
The only reason to use HASH_BLOCK_DATA_ORDER in the implementation is to make the code harder to read.
2023-03-26Remove unnecessary HIDDEN_DECLS.Joel Sing
2023-03-26Removes some unwanted spaces.Joel Sing
2023-03-26Whack sha1dgst.c with the style(9) stick again.Joel Sing
2023-03-26Tidy up includes.Joel Sing
2023-03-26Inline sha_local.h in sha1dgst.c.Joel Sing
Nothing other than sha1dst.c uses this header - pull it in to sha1dgst.c directly (sha_local.h will be removed at a later date).
2023-03-26Add license to sha256.c/sha512.c.Joel Sing
2023-03-26Use multiple statements instead of comma separated expressions.Joel Sing
No change to generated assembly.
2023-03-26Add blank lines for readability.Joel Sing
2023-03-26Add some blank lines for readability, along with some more style(9) tweaks.Joel Sing
2023-03-26Whack sha with a style(9) stick.Joel Sing
No change in generated assembly.
2023-02-23Use explicit .text instead of .previous to please Windows/MinGW on amd64Theo Buehler
ok miod
2023-02-09Use .section .rodata instead of a plain .rodataTheo Buehler
At least gcc 12 on Fedora is very unhappy about a plain .rodata and throws Error: unknown pseudo-op: `.rodata'. So add a .section in front of it to make it happy. ok deraadt miod
2023-02-02Remove AIX toc data after every function. NFCMiod Vallat
2010-10-01import OpenSSL-1.0.0aDamien Miller
2023-02-02Move all data blocks from .text to .rodata and cleanup up and homogeneize codeMiod Vallat
responsible from getting the proper address of those blocks.
2023-02-01Move all data blocks from .text to .rodata and cleanup up and homogeneize codeMiod Vallat
responsible from getting the proper address of those blocks. ok tb@ jsing@
2023-02-01For xonly, move sha512-ppc.pl's table from text to rodataGeorge Koehler
OpenBSD/macppc will enforce xonly on PowerPC G5, then libcrypto's sha256 would crash by SIGSEGV, because it can't read text. Use ELF relocations "@ha" and "@l" to find the table in rodata. This might break the PowerPC asm on a not-ELF platform (like AIX or Mac OS) if someone would try it there. ok kettenis@ deraadt@
2010-10-01import OpenSSL-1.0.0aDamien Miller
2023-01-19Remove various unused assembly files and assembly generation scripts.Joel Sing
These are just creating clutter and cause grep noise. ok miod@
2023-01-14Move constants out of text segment into rodata to prepare for xonly supportTheo de Raadt
on amd64. no pic handling is neccessary since amd64 has full reach. ok kettenis
2023-01-13Move all data tables from .text section to .rodata, and update the code toMiod Vallat
fetch them correctly when building PIC. Also drop unused data, and remove --no-execute-only from linker flags. ok kettenis@
2023-01-13Move all data tables from .text section to .rodata, and update the code toMiod Vallat
fetch them correctly when building PIC. Also drop unused data, and remove --no-execute-only from linker flags. ok jsing@ kettenis@
2010-10-01import OpenSSL-1.0.0aDamien Miller
2022-12-26spelling fixes; from paul tagliamonteJason McIntyre
i removed the arithmetics -> arithmetic changes, as i felt they were not clearly correct ok tb
2010-10-01import OpenSSL-1.0.0aDamien Miller