Browse Source

Merge pull request 'hush/dev pull' (#7) from hush/SilentDragonLite:dev into dev

Reviewed-on: lucretius/SilentDragonLite#7
pull/142/head
lucretius 4 months ago
parent
commit
d8b88dcb3b
  1. 3
      README.md
  2. 23
      build.sh
  3. 16
      lib/src/lib.rs
  4. 4
      res/libsodium/buildlibsodium.sh
  5. 2
      silentdragon-lite.pro
  6. 4
      src/version.h

3
README.md

@ -66,7 +66,10 @@ Compiling can take some time, so be patient and wait for it to finish. It will t
git clone https://git.hush.is/hush/SilentDragonLite git clone https://git.hush.is/hush/SilentDragonLite
cd SilentDragonLite cd SilentDragonLite
./build.sh linguist ./build.sh linguist
# This defaults to using 2 cores to compile
./build.sh ./build.sh
# To use a custom number of cores to compile, such as 8 :
# ./build.sh -j8
./SilentDragonLite ./SilentDragonLite
``` ```

23
build.sh

@ -1,19 +1,9 @@
#!/bin/bash #!/usr/bin/env bash
# Copyright 2019-2024 The Hush Developers # Copyright 2019-2024 The Hush Developers
# Released under the GPLv3 # Released under the GPLv3
UNAME=$(uname) UNAME=$(uname)
if [ "$UNAME" == "Linux" ] ; then
JOBS=2
elif [ "$UNAME" == "FreeBSD" ] ; then
JOBS=$(nproc)
elif [ "$UNAME" == "Darwin" ] ; then
JOBS=$(sysctl -n hw.ncpu)
else
JOBS=1
fi
# check if rustc and cargo are installed, otherwise exit with error # check if rustc and cargo are installed, otherwise exit with error
if ! command -v rustc &> /dev/null if ! command -v rustc &> /dev/null
then then
@ -39,8 +29,8 @@ then
exit 1 exit 1
fi fi
VERSION=$(cat src/version.h |cut -d\" -f2) VERSION=$(grep APP_VERSION src/version.h |cut -d\" -f2)
echo "Compiling SilentDragonLite $VERSION with $JOBS threads..." echo "Compiling SilentDragonLite $VERSION on $UNAME with args=$@"
CONF=silentdragon-lite.pro CONF=silentdragon-lite.pro
set -e set -e
@ -48,7 +38,8 @@ qbuild () {
qmake $CONF CONFIG+=debug qmake $CONF CONFIG+=debug
#lupdate $CONF #lupdate $CONF
#lrelease $CONF #lrelease $CONF
make -j$JOBS # default to 2 jobs or use the -j value given as argument to this script
make -j2 "$@"
} }
if [ "$1" == "clean" ]; then if [ "$1" == "clean" ]; then
@ -58,7 +49,7 @@ elif [ "$1" == "linguist" ]; then
lrelease $CONF lrelease $CONF
elif [ "$1" == "cleanbuild" ]; then elif [ "$1" == "cleanbuild" ]; then
make clean make clean
qbuild qbuild "$@"
else else
qbuild qbuild "$@"
fi fi

16
lib/src/lib.rs

@ -44,13 +44,15 @@ pub extern fn blake3_PW(pw: *const c_char) -> *mut c_char{
}; };
let data = passwd.as_bytes(); let data = passwd.as_bytes();
// Hash an input all at once. // Hash an input all at once.
let hash1 = blake3::hash(data).to_hex(); let hash1 = blake3::hash(data).to_hex();
println!("\nBlake3 Hash: {}", hash1); // This is sensitive metadata, do not log it to stdout
//println!("\nBlake3 Hash: {}", hash1);
//let sttring = CString::new(hash1).unwrap(); println!("\nBlake3 Hash calculated");
let e_str = CString::new(format!("{}", hash1)).unwrap();
return e_str.into_raw(); //let sttring = CString::new(hash1).unwrap();
let e_str = CString::new(format!("{}", hash1)).unwrap();
return e_str.into_raw();
} }
/// Create a new wallet and return the seed for the newly created wallet. /// Create a new wallet and return the seed for the newly created wallet.

4
res/libsodium/buildlibsodium.sh

@ -47,9 +47,9 @@ make clean
echo "Compiling libsodium $VERSION" echo "Compiling libsodium $VERSION"
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
make CFLAGS="-mmacosx-version-min=10.11" CPPFLAGS="-mmacosx-version-min=10.11" -j4 make CFLAGS="-mmacosx-version-min=10.11" CPPFLAGS="-mmacosx-version-min=10.11" -j8 # "$@"
else else
make -j8 make -j8 # "$@"
fi fi
cd .. cd ..

2
silentdragon-lite.pro

@ -184,7 +184,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
libsodium.target = $$PWD/res/libsodium.a libsodium.target = $$PWD/res/libsodium.a
libsodium.commands = res/libsodium/buildlibsodium.sh libsodium.commands = res/libsodium/buildlibsodium.sh "$@"
unix: librust.target = $$PWD/lib/target/release/libsilentdragonlite.a unix: librust.target = $$PWD/lib/target/release/libsilentdragonlite.a
else:win32: librust.target = $$PWD/lib/target/x86_64-pc-windows-gnu/release/silentdragonlite.lib else:win32: librust.target = $$PWD/lib/target/x86_64-pc-windows-gnu/release/silentdragonlite.lib

4
src/version.h

@ -1,3 +1 @@
// Copyright 2019-2024 The Hush developers #define APP_VERSION "2.0.1"
// Released under the GPLv3
#define APP_VERSION "2.0.0"

Loading…
Cancel
Save