Skip to content

Instantly share code, notes, and snippets.

@liamsi
liamsi / elagamal_test.go
Created January 21, 2016 21:24
Additively homomorphic ElGamal
package dlog
import (
"errors"
"fmt"
"github.com/dedis/crypto/abstract"
"github.com/dedis/crypto/nist"
"github.com/dedis/crypto/random"
)

Keybase proof

I hereby claim:

  • I am liamsi on github.
  • I am ismailk (https://keybase.io/ismailk) on keybase.
  • I have a public key whose fingerprint is 2BC7 09FB D0E5 0EB2 D727 2AD8 760D A791 7109 FB7B

To claim this, I am signing this object:

@liamsi
liamsi / certs.bro
Last active April 10, 2017 14:38
Intercept TLS handshakes and log hash, domain name, and base64 encoded cert (as JSON fields) into kafka
@load base/protocols/ssl
@load Bro/Kafka/logs-to-kafka.bro
module TLSFun;
export {
# Append the value LOG to the Log::ID enumerable.
redef enum Log::ID += { LOG };
type Info: record {
var test = require('tape')
const randomBytes = require('randombytes')
const bip39 = require('bip39')
test('generate wallet mnemonic', function (t) {
t.test('some bip39 experiments: can we "revert" "BytesToWords" with "WordsToBytes" like in TestCheckTypoDetection', function (t) {
// see https://github.com/tendermint/go-crypto/blob/906331a8d1661a504dc0eb2618a8767363fddb7c/keys/words/wordcodec_test.go#L146-L178
var strength = 128
for (var i = 0; i < 3400; i++) {
package main
import (
"fmt"
"github.com/tendermint/go-amino"
)
func main() {
fmt.Println(fmt.Sprintf("Expected field type %X, got %X", amino.Typ3_8Byte, amino.Typ3_Interface))
fmt.Println(fmt.Sprintf("Expected field type %v, got %v", amino.Typ3_8Byte, amino.Typ3_Interface))
package main
import (
"encoding/hex"
"fmt"
tyler "github.com/tyler-smith/go-bip39"
bartekn "github.com/bartekn/go-bip39"
)
package main
import (
"encoding/hex"
"fmt"
tyler "github.com/tyler-smith/go-bip39"
bartekn "github.com/bartekn/go-bip39"
)
// +build extensive_tests
// only built if manually enforced
package proto3
import (
"testing"
"github.com/golang/protobuf/proto"
pbf "github.com/golang/protobuf/proto/proto3_proto"
// compat.proto:
//
syntax = "proto3";
package proto3tests;
message Test32 {
fixed32 foo = 1;
int32 bar = 2;
}
@liamsi
liamsi / dump_privval_key.go
Last active January 8, 2019 15:03
dump validator privkey for kms
package main
import (
"fmt"
"io/ioutil"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/privval"
)