diff options
author | Mattias Andrée <maandree@kth.se> | 2020-10-21 16:22:41 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2020-10-21 16:22:41 +0200 |
commit | 1f16c1b20cc63bcf2adb91ab89098252ddcf005e (patch) | |
tree | 29f7545920cb88f015348b72db8c852bd5ffafc1 /Makefile | |
parent | Add -z (diff) | |
download | sha3sum-1f16c1b20cc63bcf2adb91ab89098252ddcf005e.tar.gz sha3sum-1f16c1b20cc63bcf2adb91ab89098252ddcf005e.tar.bz2 sha3sum-1f16c1b20cc63bcf2adb91ab89098252ddcf005e.tar.xz |
Add sha3sum for compatibility with busybox (-w and -s are however not support)
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -10,6 +10,7 @@ BIN =\ keccak-256sum\ keccak-384sum\ keccak-512sum\ + sha3sum\ sha3-224sum\ sha3-256sum\ sha3-384sum\ @@ -22,11 +23,12 @@ BIN =\ MAN1 = $(BIN:=.1) HDR = arg.h common.h +keccaksum = Keccak[] keccak-224sum = Keccak-224 keccak-256sum = Keccak-256 keccak-384sum = Keccak-384 keccak-512sum = Keccak-512 -keccaksum = Keccak[] +sha3sum = SHA3 sha3-224sum = SHA3-224 sha3-256sum = SHA3-256 sha3-384sum = SHA3-384 @@ -48,6 +50,11 @@ all: $(BIN) $(MAN1) %.1: xsum.man u=$$(printf '%s\n' $* | tr a-z A-Z); \ sed -e 's/xsum/$*/g' -e 's/XSUM/'"$$u"'/g' -e 's/Xsum/$($*)/g' < xsum.man > $@ + if test $* = sha3sum; then \ + sed -i 's/^\\# ONLY SHA3: //' $@; \ + else \ + sed -i '/^\\# ONLY SHA3: /d' $@; \ + fi keccak-%sum.c: printf '%s\n' '#include "common.h"' 'KECCAK_MAIN($*)' > $@ |