Skip to content

Instantly share code, notes, and snippets.

@starius
starius / main.go
Created July 1, 2021 11:50
TLS server and client built on known ed25519 public key
package main
// See https://golang.org/src/crypto/tls/generate_cert.go
// See https://gist.github.com/denji/12b3a568f092ab951456
import (
"bytes"
"crypto/ed25519"
"crypto/rand"
"crypto/tls"
package main
import (
"crypto/aes"
"crypto/rand"
"crypto/sha256"
"fmt"
"hash"
"github.com/dchest/wots"
"""
Order copier
"""
# API key основного аккаунта
API_KEY = '69eQkHl0R0vgPod21c3XjQsT'
API_SECRET = 'EFAHxtJiOVYHSWa_HPtLAW50GpV31G_2GVSdm1gBZKH85Ltv'
# Список API ключей куда нужно транслировать ордера
API_KYES = ['hLlWHxkqxs42g-WeEt1_wC20']
diff --git a/range_test.go b/range_test.go
index c3b4c71..3f380aa 100644
--- a/range_test.go
+++ b/range_test.go
@@ -200,6 +200,12 @@ func TestBuildVerifyRangeProof(t *testing.T) {
if !VerifyRangeProof(leafData[start*leafSize:end*leafSize], blake, leafSize, start, end, proof, smallRoot) {
t.Errorf("BuildRangeProof constructed an incorrect proof for range %v-%v", start, end)
}
+ if end == start + 1 {
+ singleProof := append([][]byte{leafData[start*leafSize:end*leafSize]}, proof...)
package main
import (
"flag"
"fmt"
"io"
"io/ioutil"
"math/rand"
"os"
"time"
package main
import (
"flag"
"fmt"
"io"
"math/rand"
"os"
"time"
@starius
starius / err
Created October 15, 2017 23:17
# github.com/coreos/etcd/etcdserver/api/v3lock/v3lockpb/gw
../github.com/coreos/etcd/etcdserver/api/v3lock/v3lockpb/gw/v3lock.pb.gw.go:100:39: not enough arguments in call to runtime.AnnotateContext
have ("context".Context, *http.Request)
want ("context".Context, *runtime.ServeMux, *http.Request)
../github.com/coreos/etcd/etcdserver/api/v3lock/v3lockpb/gw/v3lock.pb.gw.go:102:21: not enough arguments in call to runtime.HTTPError
have ("context".Context, runtime.Marshaler, http.ResponseWriter, *http.Request, error)
want ("context".Context, *runtime.ServeMux, runtime.Marshaler, http.ResponseWriter, *http.Request, error)
../github.com/coreos/etcd/etcdserver/api/v3lock/v3lockpb/gw/v3lock.pb.gw.go:107:21: not enough arguments in call to runtime.HTTPError
have ("context".Context, runtime.Marshaler, http.ResponseWriter, *http.Request, error)
want ("context".Context, *runtime.ServeMux, runtime.Marshaler, http.ResponseWriter, *http.Request, error)
package main
import (
"github.com/coreos/etcd/embed"
"log"
"time"
)
func main() {
cfg := embed.NewConfig()
@starius
starius / gist:3d9f2b875a341b5c219fe0b1133e198a
Created October 11, 2017 15:42
diff -u from_386.obdjump from_amd64.obdjump
--- from_386.obdjump 2017-10-11 17:40:14.459226137 +0200
+++ from_amd64.obdjump 2017-10-11 17:40:23.407289448 +0200
@@ -1,5 +1,5 @@
-from_386: file format elf32-i386
+from_amd64: file format elf32-i386
Disassembly of section .text:
@@ -90090,7 +90090,7 @@
@starius
starius / -
Created October 11, 2017 15:41
123