changed names

This commit is contained in:
vadym 2021-09-09 10:30:55 +03:00
parent f4a4274967
commit 052fdd3edf
37 changed files with 240 additions and 240 deletions

View file

@ -1,6 +1,6 @@
/*
This file generates crypto keys for [ansible-yggdrasil](https://github.com/jcgruenhage/ansible-yggdrasil/)
This file generates crypto keys for [ansible-mesh](https://github.com/jcgruenhage/ansible-mesh/)
*/
package main
@ -57,8 +57,8 @@ func main() {
return
}
defer file.Close()
file.WriteString(fmt.Sprintf("yggdrasil_public_key: %v\n", hex.EncodeToString(keys[i].pub)))
file.WriteString("yggdrasil_private_key: \"{{ vault_yggdrasil_private_key }}\"\n")
file.WriteString(fmt.Sprintf("mesh_public_key: %v\n", hex.EncodeToString(keys[i].pub)))
file.WriteString("mesh_private_key: \"{{ vault_mesh_private_key }}\"\n")
file.WriteString(fmt.Sprintf("ansible_host: %v\n", keys[i].ip))
file, err = os.Create(fmt.Sprintf("host_vars/%x/vault", i))
@ -66,7 +66,7 @@ func main() {
return
}
defer file.Close()
file.WriteString(fmt.Sprintf("vault_yggdrasil_private_key: %v\n", hex.EncodeToString(keys[i].priv)))
file.WriteString(fmt.Sprintf("vault_mesh_private_key: %v\n", hex.EncodeToString(keys[i].priv)))
bar.Increment()
}
bar.Finish()

View file

@ -1,7 +1,7 @@
# Last Modified: Fri Oct 30 11:33:31 2020
#include <tunables/global>
/usr/bin/yggdrasil {
/usr/bin/mesh {
#include <abstractions/base>
#include <abstractions/nameservice>
@ -12,6 +12,6 @@
/proc/sys/net/core/somaxconn r,
/sys/kernel/mm/transparent_hugepage/hpage_pmd_size r,
/etc/yggdrasil.conf rw,
/run/yggdrasil.sock rw,
/etc/mesh.conf rw,
/run/mesh.sock rw,
}

View file

@ -1,9 +1,9 @@
#!/bin/sh
CONFFILE="/etc/yggdrasil.conf"
CONFFILE="/etc/mesh.conf"
genconf() {
/usr/bin/yggdrasil -genconf > "$1"
/usr/bin/mesh -genconf > "$1"
return $?
}
@ -33,8 +33,8 @@ start() {
fi
fi
printf 'Starting yggdrasil: '
if start-stop-daemon -S -q -b -x /usr/bin/yggdrasil \
printf 'Starting mesh: '
if start-stop-daemon -S -q -b -x /usr/bin/mesh \
-- -useconffile "$CONFFILE"; then
echo "OK"
else
@ -43,8 +43,8 @@ start() {
}
stop() {
printf "Stopping yggdrasil: "
if start-stop-daemon -K -q -x /usr/bin/yggdrasil; then
printf "Stopping mesh: "
if start-stop-daemon -K -q -x /usr/bin/mesh; then
echo "OK"
else
echo "FAIL"
@ -52,8 +52,8 @@ stop() {
}
reload() {
printf "Reloading yggdrasil: "
if start-stop-daemon -K -q -s HUP -x /usr/bin/yggdrasil; then
printf "Reloading mesh: "
if start-stop-daemon -K -q -s HUP -x /usr/bin/mesh; then
echo "OK"
else
echo "FAIL"

View file

@ -1,7 +1,7 @@
#!/bin/sh
# This is a lazy script to create a .deb for Debian/Ubuntu. It installs
# yggdrasil and enables it in systemd. You can give it the PKGARCH= argument
# mesh and enables it in systemd. You can give it the PKGARCH= argument
# i.e. PKGARCH=i386 sh contrib/deb/generate.sh
if [ `pwd` != `git rev-parse --show-toplevel` ]
@ -15,10 +15,10 @@ PKGNAME=$(sh contrib/semver/name.sh)
PKGVERSION=$(sh contrib/semver/version.sh --bare)
PKGARCH=${PKGARCH-amd64}
PKGFILE=$PKGNAME-$PKGVERSION-$PKGARCH.deb
PKGREPLACES=yggdrasil
PKGREPLACES=mesh
if [ $PKGBRANCH = "master" ]; then
PKGREPLACES=yggdrasil-develop
PKGREPLACES=mesh-develop
fi
if [ $PKGARCH = "amd64" ]; then GOARCH=amd64 GOOS=linux ./build
@ -66,56 +66,56 @@ cat > /tmp/$PKGNAME/debian/docs << EOF
Please see https://github.com/RiV-chain/RiV-mesh/
EOF
cat > /tmp/$PKGNAME/debian/install << EOF
usr/bin/yggdrasil usr/bin
usr/bin/yggdrasilctl usr/bin
usr/bin/mesh usr/bin
usr/bin/meshctl usr/bin
etc/systemd/system/*.service etc/systemd/system
EOF
cat > /tmp/$PKGNAME/debian/postinst << EOF
#!/bin/sh
if ! getent group yggdrasil 2>&1 > /dev/null; then
groupadd --system --force yggdrasil || echo "Failed to create group 'yggdrasil' - please create it manually and reinstall"
if ! getent group mesh 2>&1 > /dev/null; then
groupadd --system --force mesh || echo "Failed to create group 'mesh' - please create it manually and reinstall"
fi
if [ -f /etc/yggdrasil.conf ];
if [ -f /etc/mesh.conf ];
then
mkdir -p /var/backups
echo "Backing up configuration file to /var/backups/yggdrasil.conf.`date +%Y%m%d`"
cp /etc/yggdrasil.conf /var/backups/yggdrasil.conf.`date +%Y%m%d`
echo "Normalising and updating /etc/yggdrasil.conf"
/usr/bin/yggdrasil -useconf -normaliseconf < /var/backups/yggdrasil.conf.`date +%Y%m%d` > /etc/yggdrasil.conf
chgrp yggdrasil /etc/yggdrasil.conf
echo "Backing up configuration file to /var/backups/mesh.conf.`date +%Y%m%d`"
cp /etc/mesh.conf /var/backups/mesh.conf.`date +%Y%m%d`
echo "Normalising and updating /etc/mesh.conf"
/usr/bin/mesh -useconf -normaliseconf < /var/backups/mesh.conf.`date +%Y%m%d` > /etc/mesh.conf
chgrp mesh /etc/mesh.conf
if command -v systemctl >/dev/null; then
systemctl daemon-reload >/dev/null || true
systemctl enable yggdrasil || true
systemctl start yggdrasil || true
systemctl enable mesh || true
systemctl start mesh || true
fi
else
echo "Generating initial configuration file /etc/yggdrasil.conf"
echo "Generating initial configuration file /etc/mesh.conf"
echo "Please familiarise yourself with this file before starting Mesh"
sh -c 'umask 0027 && /usr/bin/yggdrasil -genconf > /etc/yggdrasil.conf'
chgrp yggdrasil /etc/yggdrasil.conf
sh -c 'umask 0027 && /usr/bin/mesh -genconf > /etc/mesh.conf'
chgrp mesh /etc/mesh.conf
fi
EOF
cat > /tmp/$PKGNAME/debian/prerm << EOF
#!/bin/sh
if command -v systemctl >/dev/null; then
if systemctl is-active --quiet yggdrasil; then
systemctl stop yggdrasil || true
if systemctl is-active --quiet mesh; then
systemctl stop mesh || true
fi
systemctl disable yggdrasil || true
systemctl disable mesh || true
fi
EOF
cp yggdrasil /tmp/$PKGNAME/usr/bin/
cp yggdrasilctl /tmp/$PKGNAME/usr/bin/
cp mesh /tmp/$PKGNAME/usr/bin/
cp meshctl /tmp/$PKGNAME/usr/bin/
cp contrib/systemd/*.service /tmp/$PKGNAME/etc/systemd/system/
tar -czvf /tmp/$PKGNAME/data.tar.gz -C /tmp/$PKGNAME/ \
usr/bin/yggdrasil usr/bin/yggdrasilctl \
etc/systemd/system/yggdrasil.service \
etc/systemd/system/yggdrasil-default-config.service
usr/bin/mesh usr/bin/meshctl \
etc/systemd/system/mesh.service \
etc/systemd/system/mesh-default-config.service
tar -czvf /tmp/$PKGNAME/control.tar.gz -C /tmp/$PKGNAME/debian .
echo 2.0 > /tmp/$PKGNAME/debian-binary

View file

@ -9,8 +9,8 @@ RUN apk add git && ./build && go build -o /src/genkeys cmd/genkeys/main.go
FROM docker.io/alpine
COPY --from=builder /src/yggdrasil /usr/bin/yggdrasil
COPY --from=builder /src/yggdrasilctl /usr/bin/yggdrasilctl
COPY --from=builder /src/mesh /usr/bin/mesh
COPY --from=builder /src/meshctl /usr/bin/meshctl
COPY --from=builder /src/genkeys /usr/bin/genkeys
COPY contrib/docker/entrypoint.sh /usr/bin/entrypoint.sh

View file

@ -6,8 +6,8 @@ CONF_DIR="/etc/RiV-chain"
if [ ! -f "$CONF_DIR/config.conf" ]; then
echo "generate $CONF_DIR/config.conf"
yggdrasil --genconf > "$CONF_DIR/config.conf"
mesh --genconf > "$CONF_DIR/config.conf"
fi
yggdrasil --useconf < "$CONF_DIR/config.conf"
mesh --useconf < "$CONF_DIR/config.conf"
exit $?

View file

@ -1,72 +1,72 @@
#!/bin/sh
#
# Put the yggdrasil and yggdrasilctl binaries into /usr/local/bin
# Then copy this script into /etc/rc.d/yggdrasil
# Put the mesh and meshctl binaries into /usr/local/bin
# Then copy this script into /etc/rc.d/mesh
# Finally, run:
# 1. chmod +x /etc/rc.d/yggdrasil /usr/local/bin/{yggdrasil,yggdrasilctl}
# 2. echo "yggdrasil_enable=yes" >> /etc/rc.d
# 3. service yggdrasil start
# 1. chmod +x /etc/rc.d/mesh /usr/local/bin/{mesh,meshctl}
# 2. echo "mesh_enable=yes" >> /etc/rc.d
# 3. service mesh start
#
# PROVIDE: yggdrasil
# PROVIDE: mesh
# REQUIRE: networking
# KEYWORD:
. /etc/rc.subr
name="yggdrasil"
rcvar="yggdrasil_enable"
name="mesh"
rcvar="mesh_enable"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
pidfile="/var/run/yggdrasil/${name}.pid"
pidfile="/var/run/mesh/${name}.pid"
command="/usr/sbin/daemon"
command_args="-P ${pidfile} -r -f ${yggdrasil_command}"
command_args="-P ${pidfile} -r -f ${mesh_command}"
yggdrasil_start()
mesh_start()
{
test ! -x /usr/local/bin/yggdrasil && (
logger -s -t yggdrasil "Warning: /usr/local/bin/yggdrasil is missing or not executable"
logger -s -t yggdrasil "Copy the yggdrasil binary into /usr/local/bin and then chmod +x /usr/local/bin/yggdrasil"
test ! -x /usr/local/bin/mesh && (
logger -s -t mesh "Warning: /usr/local/bin/mesh is missing or not executable"
logger -s -t mesh "Copy the mesh binary into /usr/local/bin and then chmod +x /usr/local/bin/mesh"
return 1
)
test ! -f /etc/yggdrasil.conf && (
logger -s -t yggdrasil "Generating new configuration file into /etc/yggdrasil.conf"
/usr/local/bin/yggdrasil -genconf > /etc/yggdrasil.conf
test ! -f /etc/mesh.conf && (
logger -s -t mesh "Generating new configuration file into /etc/mesh.conf"
/usr/local/bin/mesh -genconf > /etc/mesh.conf
)
tap_path="$(cat /etc/yggdrasil.conf | egrep -o '/dev/tap[0-9]{1,2}$')"
tap_path="$(cat /etc/mesh.conf | egrep -o '/dev/tap[0-9]{1,2}$')"
tap_name="$(echo -n ${tap_path} | tr -d '/dev/')"
/sbin/ifconfig ${tap_name} >/dev/null 2>&1 || (
logger -s -t yggdrasil "Creating ${tap_name} adapter"
/sbin/ifconfig ${tap_name} create || logger -s -t yggdrasil "Failed to create ${tap_name} adapter"
logger -s -t mesh "Creating ${tap_name} adapter"
/sbin/ifconfig ${tap_name} create || logger -s -t mesh "Failed to create ${tap_name} adapter"
)
test ! -d /var/run/yggdrasil && mkdir -p /var/run/yggdrasil
test ! -d /var/run/mesh && mkdir -p /var/run/mesh
logger -s -t yggdrasil "Starting yggdrasil"
${command} ${command_args} /usr/local/bin/yggdrasil -useconffile /etc/yggdrasil.conf \
1>/var/log/yggdrasil.stdout.log \
2>/var/log/yggdrasil.stderr.log &
logger -s -t mesh "Starting mesh"
${command} ${command_args} /usr/local/bin/mesh -useconffile /etc/mesh.conf \
1>/var/log/mesh.stdout.log \
2>/var/log/mesh.stderr.log &
}
yggdrasil_stop()
mesh_stop()
{
logger -s -t yggdrasil "Stopping yggdrasil"
test -f /var/run/yggdrasil/${name}.pid && kill -TERM $(cat /var/run/yggdrasil/${name}.pid)
logger -s -t mesh "Stopping mesh"
test -f /var/run/mesh/${name}.pid && kill -TERM $(cat /var/run/mesh/${name}.pid)
tap_path="$(cat /etc/yggdrasil.conf | grep /dev/tap | egrep -o '/dev/.*$')"
tap_path="$(cat /etc/mesh.conf | grep /dev/tap | egrep -o '/dev/.*$')"
tap_name="$(echo -n ${tap_path} | tr -d '/dev/')"
/sbin/ifconfig ${tap_name} >/dev/null 2>&1 && (
logger -s -t yggdrasil "Destroying ${tap_name} adapter"
/sbin/ifconfig ${tap_name} destroy || logger -s -t yggdrasil "Failed to destroy ${tap_name} adapter"
logger -s -t mesh "Destroying ${tap_name} adapter"
/sbin/ifconfig ${tap_name} destroy || logger -s -t mesh "Failed to destroy ${tap_name} adapter"
)
}
load_rc_config $name
: ${yggdrasil_enable:=no}
: ${mesh_enable:=no}
run_rc_command "$1"

View file

@ -18,9 +18,9 @@ command -v mkbom >/dev/null 2>&1 || (
# Check if we can find the files we need - they should
# exist if you are running this script from the root of
# the RiV-mesh repo and you have ran ./build
test -f yggdrasil || (echo "yggdrasil binary not found"; exit 1)
test -f yggdrasilctl || (echo "yggdrasilctl binary not found"; exit 1)
test -f contrib/macos/yggdrasil.plist || (echo "contrib/macos/yggdrasil.plist not found"; exit 1)
test -f mesh || (echo "mesh binary not found"; exit 1)
test -f meshctl || (echo "meshctl binary not found"; exit 1)
test -f contrib/macos/mesh.plist || (echo "contrib/macos/mesh.plist not found"; exit 1)
test -f contrib/semver/version.sh || (echo "contrib/semver/version.sh not found"; exit 1)
# Delete the pkgbuild folder if it already exists
@ -34,37 +34,37 @@ mkdir -p pkgbuild/root/usr/local/bin
mkdir -p pkgbuild/root/Library/LaunchDaemons
# Copy package contents into the pkgbuild root
cp yggdrasil pkgbuild/root/usr/local/bin
cp yggdrasilctl pkgbuild/root/usr/local/bin
cp contrib/macos/yggdrasil.plist pkgbuild/root/Library/LaunchDaemons
cp mesh pkgbuild/root/usr/local/bin
cp meshctl pkgbuild/root/usr/local/bin
cp contrib/macos/mesh.plist pkgbuild/root/Library/LaunchDaemons
# Create the postinstall script
cat > pkgbuild/scripts/postinstall << EOF
#!/bin/sh
# Normalise the config if it exists, generate it if it doesn't
if [ -f /etc/yggdrasil.conf ];
if [ -f /etc/mesh.conf ];
then
mkdir -p /Library/Preferences/Mesh
echo "Backing up configuration file to /Library/Preferences/Mesh/yggdrasil.conf.`date +%Y%m%d`"
cp /etc/yggdrasil.conf /Library/Preferences/Mesh/yggdrasil.conf.`date +%Y%m%d`
echo "Normalising /etc/yggdrasil.conf"
/usr/local/bin/yggdrasil -useconffile /Library/Preferences/Mesh/yggdrasil.conf.`date +%Y%m%d` -normaliseconf > /etc/yggdrasil.conf
echo "Backing up configuration file to /Library/Preferences/Mesh/mesh.conf.`date +%Y%m%d`"
cp /etc/mesh.conf /Library/Preferences/Mesh/mesh.conf.`date +%Y%m%d`
echo "Normalising /etc/mesh.conf"
/usr/local/bin/mesh -useconffile /Library/Preferences/Mesh/mesh.conf.`date +%Y%m%d` -normaliseconf > /etc/mesh.conf
else
/usr/local/bin/yggdrasil -genconf > /etc/yggdrasil.conf
/usr/local/bin/mesh -genconf > /etc/mesh.conf
fi
# Unload existing Mesh launchd service, if possible
test -f /Library/LaunchDaemons/yggdrasil.plist && (launchctl unload /Library/LaunchDaemons/yggdrasil.plist || true)
test -f /Library/LaunchDaemons/mesh.plist && (launchctl unload /Library/LaunchDaemons/mesh.plist || true)
# Load Mesh launchd service and start Mesh
launchctl load /Library/LaunchDaemons/yggdrasil.plist
launchctl load /Library/LaunchDaemons/mesh.plist
EOF
# Set execution permissions
chmod +x pkgbuild/scripts/postinstall
chmod +x pkgbuild/root/usr/local/bin/yggdrasil
chmod +x pkgbuild/root/usr/local/bin/yggdrasilctl
chmod +x pkgbuild/root/usr/local/bin/mesh
chmod +x pkgbuild/root/usr/local/bin/meshctl
# Pack payload and scripts
( cd pkgbuild/scripts && find . | cpio -o --format odc --owner 0:80 | gzip -c ) > pkgbuild/flat/base.pkg/Scripts

View file

@ -3,12 +3,12 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>yggdrasil</string>
<string>mesh</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>/usr/local/bin/yggdrasil -useconffile /etc/yggdrasil.conf</string>
<string>/usr/local/bin/mesh -useconffile /etc/mesh.conf</string>
</array>
<key>KeepAlive</key>
<true/>
@ -17,8 +17,8 @@
<key>ProcessType</key>
<string>Interactive</string>
<key>StandardOutPath</key>
<string>/tmp/yggdrasil.stdout.log</string>
<string>/tmp/mesh.stdout.log</string>
<key>StandardErrorPath</key>
<string>/tmp/yggdrasil.stderr.log</string>
<string>/tmp/mesh.stderr.log</string>
</dict>
</plist>

View file

@ -58,9 +58,9 @@ cat > updateconfig.bat << EOF
if not exist %ALLUSERSPROFILE%\\Mesh (
mkdir %ALLUSERSPROFILE%\\Mesh
)
if not exist %ALLUSERSPROFILE%\\Mesh\\yggdrasil.conf (
if exist yggdrasil.exe (
yggdrasil.exe -genconf > %ALLUSERSPROFILE%\\Mesh\\yggdrasil.conf
if not exist %ALLUSERSPROFILE%\\Mesh\\mesh.conf (
if exist mesh.exe (
mesh.exe -genconf > %ALLUSERSPROFILE%\\Mesh\\mesh.conf
)
)
EOF
@ -139,9 +139,9 @@ cat > wix.xml << EOF
<Component Id="MainExecutable" Guid="c2119231-2aa3-4962-867a-9759c87beb24">
<File
Id="Mesh"
Name="yggdrasil.exe"
Name="mesh.exe"
DiskId="1"
Source="yggdrasil.exe"
Source="mesh.exe"
KeyPath="yes" />
<File
@ -160,12 +160,12 @@ cat > wix.xml << EOF
Name="Mesh"
Start="auto"
Type="ownProcess"
Arguments='-useconffile "%ALLUSERSPROFILE%\\Mesh\\yggdrasil.conf" -logto "%ALLUSERSPROFILE%\\Mesh\\yggdrasil.log"'
Arguments='-useconffile "%ALLUSERSPROFILE%\\Mesh\\mesh.conf" -logto "%ALLUSERSPROFILE%\\Mesh\\mesh.log"'
Vital="yes" />
<ServiceControl
Id="ServiceControl"
Name="yggdrasil"
Name="mesh"
Start="install"
Stop="both"
Remove="uninstall" />
@ -174,9 +174,9 @@ cat > wix.xml << EOF
<Component Id="CtrlExecutable" Guid="a916b730-974d-42a1-b687-d9d504cbb86a">
<File
Id="Meshctl"
Name="yggdrasilctl.exe"
Name="meshctl.exe"
DiskId="1"
Source="yggdrasilctl.exe"
Source="meshctl.exe"
KeyPath="yes"/>
</Component>

View file

@ -2,10 +2,10 @@
description="An experiment in scalable routing as an encrypted IPv6 overlay network."
CONFFILE="/etc/yggdrasil.conf"
CONFFILE="/etc/mesh.conf"
pidfile="/run/${RC_SVCNAME}.pid"
command="/usr/bin/yggdrasil"
command="/usr/bin/mesh"
extra_started_commands="reload"
depend() {
@ -36,8 +36,8 @@ start() {
--pidfile "${pidfile}" \
--make-pidfile \
--background \
--stdout /var/log/yggdrasil.stdout.log \
--stderr /var/log/yggdrasil.stderr.log \
--stdout /var/log/mesh.stdout.log \
--stderr /var/log/mesh.stderr.log \
--exec "${command}" -- -useconffile "${CONFFILE}"
eend $?
}

View file

@ -5,7 +5,7 @@ BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null)
# Complain if the git history is not available
if [ $? != 0 ] || [ -z "$BRANCH" ]; then
printf "yggdrasil"
printf "mesh"
exit 0
fi
@ -14,9 +14,9 @@ BRANCH=$(echo $BRANCH | tr -d "/")
# Check if the branch name is not master
if [ "$BRANCH" = "master" ]; then
printf "yggdrasil"
printf "mesh"
exit 0
fi
# If it is something other than master, append it
printf "yggdrasil-%s" "$BRANCH"
printf "mesh-%s" "$BRANCH"

View file

@ -1,13 +1,13 @@
[Unit]
Description=yggdrasil default config generator
ConditionPathExists=|!/etc/yggdrasil.conf
ConditionFileNotEmpty=|!/etc/yggdrasil.conf
Description=mesh default config generator
ConditionPathExists=|!/etc/mesh.conf
ConditionFileNotEmpty=|!/etc/mesh.conf
Wants=local-fs.target
After=local-fs.target
[Service]
Type=oneshot
Group=yggdrasil
StandardOutput=file:/etc/yggdrasil.conf
ExecStart=/usr/bin/yggdrasil -genconf
ExecStartPost=/usr/bin/chmod 0640 /etc/yggdrasil.conf
Group=mesh
StandardOutput=file:/etc/mesh.conf
ExecStart=/usr/bin/mesh -genconf
ExecStartPost=/usr/bin/chmod 0640 /etc/mesh.conf

View file

@ -1,18 +1,18 @@
[Unit]
Description=yggdrasil
Description=mesh
Wants=network.target
Wants=yggdrasil-default-config.service
Wants=mesh-default-config.service
After=network.target
After=yggdrasil-default-config.service
After=mesh-default-config.service
[Service]
Group=yggdrasil
Group=mesh
ProtectHome=true
ProtectSystem=true
SyslogIdentifier=yggdrasil
SyslogIdentifier=mesh
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE
ExecStartPre=+-/sbin/modprobe tun
ExecStart=/usr/bin/yggdrasil -useconffile /etc/yggdrasil.conf
ExecStart=/usr/bin/mesh -useconffile /etc/mesh.conf
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
TimeoutStopSec=5

View file

@ -1,12 +1,12 @@
.PHONY: all
all: util yggdrasil-brute-multi-curve25519 yggdrasil-brute-multi-ed25519
all: util mesh-brute-multi-curve25519 mesh-brute-multi-ed25519
util: util.c
gcc -Wall -std=c89 -O3 -c -o util.o util.c
yggdrasil-brute-multi-ed25519: yggdrasil-brute-multi-ed25519.c util.o
gcc -Wall -std=c89 -O3 -o yggdrasil-brute-multi-ed25519 -lsodium yggdrasil-brute-multi-ed25519.c util.o
mesh-brute-multi-ed25519: mesh-brute-multi-ed25519.c util.o
gcc -Wall -std=c89 -O3 -o mesh-brute-multi-ed25519 -lsodium mesh-brute-multi-ed25519.c util.o
yggdrasil-brute-multi-curve25519: yggdrasil-brute-multi-curve25519.c util.o
gcc -Wall -std=c89 -O3 -o yggdrasil-brute-multi-curve25519 -lsodium yggdrasil-brute-multi-curve25519.c util.o
mesh-brute-multi-curve25519: mesh-brute-multi-curve25519.c util.o
gcc -Wall -std=c89 -O3 -o mesh-brute-multi-curve25519 -lsodium mesh-brute-multi-curve25519.c util.o

View file

@ -1,4 +1,4 @@
# yggdrasil-brute-simple
# mesh-brute-simple
Simple program for finding curve25519 and ed25519 public keys whose sha512 hash has many leading ones.
Because ed25519 private keys consist of a seed that is hashed to find the secret part of the keypair,

View file

@ -1,4 +1,4 @@
#include "yggdrasil-brute.h"
#include "mesh-brute.h"
int find_where(unsigned char hash[64], unsigned char besthashlist[NUMKEYS][64]) {
/* Where to insert hash into sorted hashlist */
@ -28,7 +28,7 @@ void insert_32(unsigned char itemlist[NUMKEYS][32], unsigned char item[32], int
}
void make_addr(unsigned char addr[32], unsigned char hash[64]) {
/* Public key hash to yggdrasil ipv6 address */
/* Public key hash to mesh ipv6 address */
int i;
int offset;
unsigned char mask;

View file

@ -13,7 +13,7 @@ if besthash:
besthash = hash
*/
#include "yggdrasil-brute.h"
#include "mesh-brute.h"
void seed(unsigned char sk[32]) {
@ -43,7 +43,7 @@ int main(int argc, char **argv) {
int where;
if (argc != 2) {
fprintf(stderr, "usage: ./yggdrasil-brute-multi-curve25519 <seconds>\n");
fprintf(stderr, "usage: ./mesh-brute-multi-curve25519 <seconds>\n");
return 1;
}
@ -57,7 +57,7 @@ int main(int argc, char **argv) {
requestedtime = atoi(argv[1]);
if (requestedtime < 0) requestedtime = 0;
fprintf(stderr, "Searching for yggdrasil curve25519 keys (this will take slightly longer than %ld seconds)\n", requestedtime);
fprintf(stderr, "Searching for mesh curve25519 keys (this will take slightly longer than %ld seconds)\n", requestedtime);
sodium_memzero(bestsklist, NUMKEYS * 32);
sodium_memzero(bestpklist, NUMKEYS * 32);

View file

@ -20,7 +20,7 @@ if besthash:
besthash = hash
*/
#include "yggdrasil-brute.h"
#include "mesh-brute.h"
int main(int argc, char **argv) {
@ -41,7 +41,7 @@ int main(int argc, char **argv) {
int where;
if (argc != 2) {
fprintf(stderr, "usage: ./yggdrasil-brute-multi-curve25519 <seconds>\n");
fprintf(stderr, "usage: ./mesh-brute-multi-curve25519 <seconds>\n");
return 1;
}
@ -55,7 +55,7 @@ int main(int argc, char **argv) {
requestedtime = atoi(argv[1]);
if (requestedtime < 0) requestedtime = 0;
fprintf(stderr, "Searching for yggdrasil ed25519 keys (this will take slightly longer than %ld seconds)\n", requestedtime);
fprintf(stderr, "Searching for mesh ed25519 keys (this will take slightly longer than %ld seconds)\n", requestedtime);
sodium_memzero(bestsklist, NUMKEYS * 64);
sodium_memzero(besthashlist, NUMKEYS * 64);