Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Calculate proper keccak256/sha3 using parity. (#7953)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusdrw committed Feb 27, 2018
1 parent d274a0f commit 2490a49
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions scripts/gitlab-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ echo "Parity version: " $VER
echo "Branch: " $CI_BUILD_REF_NAME
echo "--------------------"

echo "Rhash version:"
# NOTE for md5 and sha256 we want to display filename as well
# hence we use --* instead of -p *
MD5_BIN="rhash --md5"
SHA256_BIN="rhash --sha256"
# NOTE For SHA3 we need only hash (hence -p)
SHA3_BIN="rhash -p %{sha3-256}"

set_env () {
echo "Set ENVIROMENT"
Expand Down Expand Up @@ -70,14 +67,12 @@ strip_binaries () {
calculate_checksums () {
echo "Checksum calculation:"
rhash --version

rm -rf *.md5
rm -rf *.sha256

export SHA3="$($SHA3_BIN target/$PLATFORM/release/parity$S3WIN)"
# NOTE rhash 1.3.1 doesnt support keccak, workaround
if [ "$SHA3" == "%{sha3-256}" ]; then
export SHA3="$(target/$PLATFORM/release/parity$S3WIN tools hash target/$PLATFORM/release/parity$S3WIN)"
fi
BIN="target/$PLATFORM/release/parity$S3WIN"
export SHA3="$($BIN tools hash $BIN)"

echo "Parity file SHA3: $SHA3"
$MD5_BIN target/$PLATFORM/release/parity$S3WIN > parity$S3WIN.md5
Expand Down

0 comments on commit 2490a49

Please sign in to comment.