mirror of
https://github.com/PurpleI2P/i2pd-tools
synced 2025-01-15 17:20:08 +00:00
o2 flag + fedora depedencies support + #92 issue
This commit is contained in:
parent
314ab73ab5
commit
92989e649a
2
Makefile
2
Makefile
@ -7,7 +7,7 @@ LIBI2PD_PATH = $(I2PD_PATH)/libi2pd
|
|||||||
LIBI2PD_CLIENT_PATH = $(I2PD_PATH)/libi2pd_client
|
LIBI2PD_CLIENT_PATH = $(I2PD_PATH)/libi2pd_client
|
||||||
|
|
||||||
CXX ?= g++
|
CXX ?= g++
|
||||||
CXXFLAGS = -Wall -std=c++17
|
CXXFLAGS = -Wall -std=c++17 -O2
|
||||||
INCFLAGS = -I$(LIBI2PD_PATH) -I$(LIBI2PD_CLIENT_PATH)
|
INCFLAGS = -I$(LIBI2PD_PATH) -I$(LIBI2PD_CLIENT_PATH)
|
||||||
DEFINES = -DOPENSSL_SUPPRESS_DEPRECATED
|
DEFINES = -DOPENSSL_SUPPRESS_DEPRECATED
|
||||||
|
|
||||||
|
@ -8,36 +8,33 @@ dependNix="libboost-chrono-dev \
|
|||||||
libboost-thread-dev \
|
libboost-thread-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
zlib1g-dev"
|
zlib1g-dev"
|
||||||
|
|
||||||
dependWin="mingw-w64-x86_64-boost \
|
dependWin="mingw-w64-x86_64-boost \
|
||||||
mingw-w64-x86_64-openssl \
|
mingw-w64-x86_64-openssl \
|
||||||
mingw-w64-x86_64-zlib"
|
mingw-w64-x86_64-zlib"
|
||||||
|
|
||||||
kernel=`uname -a`
|
kernel=$(uname -a)
|
||||||
function isLsbReleaseExists() {
|
|
||||||
if which lsb_release > /dev/null; # do whereis can be too?
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function anotherDistr() {
|
function anotherDistr() {
|
||||||
echo "Just install libboost and libopenssl dev packages on your pc";
|
echo "Just install libboost and libopenssl dev packages on your pc"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function installDnf() {
|
||||||
|
sudo dnf install boost-devel g++
|
||||||
|
}
|
||||||
|
|
||||||
function installDeb() {
|
function installDeb() {
|
||||||
sudo apt-get install $dependNix;
|
sudo apt-get install $dependNix
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function installOnGentoo() {
|
function installOnGentoo() {
|
||||||
sudo emerge --deep --newuse dev-libs/boost dev-libs/openssl;
|
sudo emerge --deep --newuse dev-libs/boost dev-libs/openssl
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function installOnWin() {
|
function installOnWin() {
|
||||||
pacman -S $depenWin;
|
pacman -S $dependWin
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,17 +49,23 @@ case "$1" in
|
|||||||
*MINGW64*)
|
*MINGW64*)
|
||||||
installOnWin
|
installOnWin
|
||||||
;;
|
;;
|
||||||
|
*dnf*)
|
||||||
|
installDnf
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
anotherDistr
|
anotherDistr
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
if isLsbReleaseExists ;
|
isLsbReleaseExists=$(which lsb_release > /dev/null 2>&1; echo $?)
|
||||||
then
|
if [ $isLsbReleaseExists -eq 0 ]; then
|
||||||
distr=`lsb_release -i`
|
distr=$(lsb_release -i)
|
||||||
doInstallDepencies "$distr"
|
doInstallDepencies "$distr"
|
||||||
else #
|
elif test -e /etc/fedora-release || which dnf > /dev/null; then
|
||||||
|
printf "Like you use fedora/redhat distr\n"
|
||||||
|
doInstallDepencies "dnf"
|
||||||
|
else
|
||||||
doInstallDepencies "$kernel"
|
doInstallDepencies "$kernel"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
9
vain.cpp
9
vain.cpp
@ -404,10 +404,7 @@ int main (int argc, char * argv[])
|
|||||||
{
|
{
|
||||||
//keys = i2p::data::PrivateKeys::CreateRandomKeys (options.signature);
|
//keys = i2p::data::PrivateKeys::CreateRandomKeys (options.signature);
|
||||||
//RAND_bytes( KeyBuf+MutateByte , 90 ); // FoundNonce is
|
//RAND_bytes( KeyBuf+MutateByte , 90 ); // FoundNonce is
|
||||||
|
DELKEYBUFS(options.threads);
|
||||||
for (unsigned i = options.threads-1;i--;)
|
|
||||||
delete [] KeyBufs[i];
|
|
||||||
delete [] KeyBufs;
|
|
||||||
std::cout << "(Generate a new keypair) Attempts #" << ++attempts << std::endl;
|
std::cout << "(Generate a new keypair) Attempts #" << ++attempts << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -445,9 +442,7 @@ int main (int argc, char * argv[])
|
|||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
f.write ((char *)KeyBuf, keys_len);
|
f.write ((char *)KeyBuf, keys_len);
|
||||||
for (unsigned i = options.threads-1;i--;)
|
DELKEYBUFS(options.threads);
|
||||||
delete [] KeyBufs[i];
|
|
||||||
delete [] KeyBufs;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
std::cout << "Can't create file " << options.outputpath << std::endl;
|
std::cout << "Can't create file " << options.outputpath << std::endl;
|
||||||
|
@ -84,3 +84,8 @@ const uint8_t lastBlock[64] =
|
|||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x38 // 3128 bits (391 bytes)
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x38 // 3128 bits (391 bytes)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define DELKEYBUFS(S) {\
|
||||||
|
for (unsigned i = S-1;i--;) \
|
||||||
|
delete [] KeyBufs[i];\
|
||||||
|
delete [] KeyBufs;}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user