summaryrefslogtreecommitdiff
path: root/src/fundamental/sha256.c
Commit message (Collapse)AuthorAgeFilesLines
* meson: use 0|1 for SD_BOOTZbigniew Jędrzejewski-Szmek2023-01-101-1/+1
| | | | | | | We converted to not using #ifdef for most of our defines because the syntax is nicer and we are protected against typos and can set -Werror=undef. Let's do the same for SD_BOOT. The define is nicely hidden in build.h for normal builds, and for EFI builds we were already setting SD_BOOT on the commandline.
* sha256: port to new generic IS_ALIGNED32() macroLennart Poettering2022-12-081-14/+5
| | | | | | | | | This drops the special casing for s390 and other archs, which was cargo-culted from glibc. Given it's not obvious why it exists, and is at best an optimization let's simply avoid it, in particular as the archs are relatively non-mainstream. Inspired by: #25636
* sha256: move to unaligned_write_ne32()Lennart Poettering2022-12-081-5/+2
|
* tree-wide: use ASSERT_PTR moreDavid Tardon2022-09-131-2/+1
|
* sha256: add sha256_direct()/SHA256_DIRECT() helpersLennart Poettering2022-08-191-0/+7
|
* sha256: change digest buffer type to uint8_t[]Lennart Poettering2022-08-191-2/+2
| | | | | This way we can specify a size with "static". All users use uint8_t already, hence this comes at no price.
* sha256: Use stdbool and uintptr_tJan Janssen2022-06-241-13/+5
| | | | | | This also syncs the copyright blurb with current glibc sources. The written by line does not appear in upstream, so it should be okay to remove.
* sha256: fix compilation on efi-ia32Zbigniew Jędrzejewski-Szmek2022-06-031-1/+1
| | | | | | | | | | | | | | | | /usr/bin/gcc -c ../src/fundamental/sha256.c -o src/boot/efi/sha256.c.o -Wno-format-signedness -Wno-missing-field-initializers -Wno-unused-parameter -Wdate-time -Wendif-labels -Werror=format=2 -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wno-unused-result -fno-stack-protector -fno-strict-aliasing -fpic -fwide-exec-charset=UCS2 -Wall -Wextra -Wsign-compare -nostdlib -std=gnu99 -ffreestanding -fshort-wchar -fvisibility=hidden -isystem /usr/include/efi -isystem /usr/include/efi/ia32 -I /builddir/build/BUILD/systemd-stable-250.7/src/fundamental -DSD_BOOT -DGNU_EFI_USE_MS_ABI -include src/boot/efi/efi_config.h -include version.h -mno-sse -mno-mmx -flto -O2 -flto=auto ../src/fundamental/sha256.c: In function ‘sha256_finish_ctx’: ../src/fundamental/sha256.c:61:25: error: ‘false’ undeclared (first use in this function) 61 | # define UNALIGNED_P(p) false | ^~~~~ ../src/fundamental/sha256.c:136:21: note: in expansion of macro ‘UNALIGNED_P’ 136 | if (UNALIGNED_P(resbuf)) | ^~~~~~~~~~~ ../src/fundamental/sha256.c:32:1: note: ‘false’ is defined in header ‘<stdbool.h>’; did you forget to ‘#include <stdbool.h>’? 31 | #include "sha256.h" +++ |+#include <stdbool.h> 32 | ...
* sha256: use memcpy() when result buffer is unalignedYu Watanabe2022-06-021-19/+20
| | | | Fixes #23578.
* boot: Use memcmp/memcpy/memsetJan Janssen2022-05-311-2/+4
|
* boot/sha256: sd-ify and move to src/fundamentalLuca Boccassi2021-10-081-0/+296