tabify
This commit is contained in:
parent
cc5d94ee5f
commit
d61228215e
7
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/buffer.go
generated
vendored
7
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/buffer.go
generated
vendored
@ -17,10 +17,9 @@ import (
|
||||
|
||||
// wrapper arround malloc/free
|
||||
type Buffer struct {
|
||||
ptr unsafe.Pointer;
|
||||
length C.int;
|
||||
size C.size_t;
|
||||
|
||||
ptr unsafe.Pointer
|
||||
length C.int
|
||||
size C.size_t
|
||||
}
|
||||
|
||||
// wrapper arround nacl.malloc
|
||||
|
4
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/key.go
generated
vendored
4
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/key.go
generated
vendored
@ -78,7 +78,7 @@ func GetSignPubkey(sk []byte) ([]byte, error) {
|
||||
func LoadSignKey(seed []byte) *KeyPair {
|
||||
seed_len := C.crypto_sign_seedbytes()
|
||||
if C.size_t(len(seed)) != seed_len {
|
||||
return nil
|
||||
panic(fmt.Sprintf("Bad seed length %d bytes", len(seed)))
|
||||
}
|
||||
seedbuff := NewBuffer(seed)
|
||||
defer seedbuff.Free()
|
||||
@ -109,7 +109,6 @@ func GenBoxKeypair() *KeyPair {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
// get public key from secret key
|
||||
func GetBoxPubkey(sk []byte) []byte {
|
||||
sk_len := C.crypto_box_seedbytes()
|
||||
@ -170,7 +169,6 @@ func CryptoSignPublicLen() int {
|
||||
return int(C.crypto_sign_publickeybytes())
|
||||
}
|
||||
|
||||
|
||||
func CryptoSignSecretLen() int {
|
||||
return int(C.crypto_sign_secretkeybytes())
|
||||
}
|
||||
|
1
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/nacl.go
generated
vendored
1
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/nacl.go
generated
vendored
@ -35,7 +35,6 @@ func CryptoSignPrivKeySize() int {
|
||||
return int(C.crypto_sign_secretkeybytes())
|
||||
}
|
||||
|
||||
|
||||
// initialize sodium
|
||||
func init() {
|
||||
status := C.sodium_init()
|
||||
|
2
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/sign.go
generated
vendored
2
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/sign.go
generated
vendored
@ -6,7 +6,6 @@ package nacl
|
||||
// #include <sodium.h>
|
||||
import "C"
|
||||
|
||||
|
||||
// sign data detached with secret key sk
|
||||
func CryptoSignDetached(msg, sk []byte) []byte {
|
||||
msgbuff := NewBuffer(msg)
|
||||
@ -31,7 +30,6 @@ func CryptoSignDetached(msg, sk []byte) []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
// sign data with secret key sk
|
||||
// return detached sig
|
||||
// this uses crypto_sign instead pf crypto_sign_detached
|
||||
|
3
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/stream.go
generated
vendored
3
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/stream.go
generated
vendored
@ -10,7 +10,6 @@ import (
|
||||
|
||||
// TOY encrypted authenticated stream protocol like tls
|
||||
|
||||
|
||||
var BadHandshake = errors.New("Bad handshake")
|
||||
var ShortWrite = errors.New("short write")
|
||||
var ShortRead = errors.New("short read")
|
||||
@ -211,7 +210,6 @@ func (cs *CryptoStream) Handshake() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// create a client
|
||||
func Client(stream io.ReadWriteCloser, local_sk, remote_pk []byte) (c *CryptoStream) {
|
||||
c = &CryptoStream{
|
||||
@ -227,7 +225,6 @@ func Client(stream io.ReadWriteCloser, local_sk, remote_pk []byte) (c *CryptoStr
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
type CryptoConn struct {
|
||||
stream *CryptoStream
|
||||
conn net.Conn
|
||||
|
1
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/verfiy.go
generated
vendored
1
contrib/backends/srndv2/src/srnd/vendor/github.com/majestrate/nacl/verfiy.go
generated
vendored
@ -6,7 +6,6 @@ package nacl
|
||||
// #include <sodium.h>
|
||||
import "C"
|
||||
|
||||
|
||||
// verify a fucky detached sig
|
||||
func CryptoVerifyFucky(msg, sig, pk []byte) bool {
|
||||
var smsg []byte
|
||||
|
Reference in New Issue
Block a user