Skip to content

Instantly share code, notes, and snippets.

View nolash's full-sized avatar

lash nolash

View GitHub Profile
@nolash
nolash / argon2_key.c
Last active May 21, 2018 00:29
example on encryption using libsodium kdf key
#include <stdio.h>
#include <sodium.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#define SUBKEYS_COUNT 8
#define SUBKEYS_SIZE crypto_secretstream_xchacha20poly1305_KEYBYTES
#define SUBKEYS_CONTEXT "foo"
@nolash
nolash / maparraybench_test.go
Created June 4, 2018 09:57
benchmark map versus array retrievals in go
package maparraybench
import (
"fmt"
"os"
"testing"
)
const (
itemCount = 100
@nolash
nolash / gist:9434ea24a71474bebcd0341c98685ff4
Last active September 6, 2020 21:47
POC bzzkey over ENR
package main
import (
"bytes"
"crypto/ecdsa"
"flag"
"fmt"
"io"
"math/rand"
"net"
@nolash
nolash / gist:c232e32e019ea1e78cf6a00f22dfc8a7
Last active May 8, 2019 13:08
Some thoughts on chats using with shuffling feed and pss locations

I am currently experimenting with a concept for chat rooms using a combination of swarm feeds and pss. And right now an idea has come up of enabling “band changes” in the chat updates that only the participants will know of.

Here’s some background on swarm feeds if necessary: ethersphere/swarm#881 and ethersphere/swarm#1332

I’ll try to keep this simple, some constraints:

  • We can exchange session public keys without outside entities associating them with identity used in initial discovery/connect.
  • We assume peer discovery and service discovery exists.
  • We assume we can promiscuously connect to pss nodes to send and receive in exchange for payment.
  • Consensus between peers on who chatroom participants are is out of scope.