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
|
// wrapper arround malloc/free
|
||||||
type Buffer struct {
|
type Buffer struct {
|
||||||
ptr unsafe.Pointer;
|
ptr unsafe.Pointer
|
||||||
length C.int;
|
length C.int
|
||||||
size C.size_t;
|
size C.size_t
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// wrapper arround nacl.malloc
|
// 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 {
|
func LoadSignKey(seed []byte) *KeyPair {
|
||||||
seed_len := C.crypto_sign_seedbytes()
|
seed_len := C.crypto_sign_seedbytes()
|
||||||
if C.size_t(len(seed)) != seed_len {
|
if C.size_t(len(seed)) != seed_len {
|
||||||
return nil
|
panic(fmt.Sprintf("Bad seed length %d bytes", len(seed)))
|
||||||
}
|
}
|
||||||
seedbuff := NewBuffer(seed)
|
seedbuff := NewBuffer(seed)
|
||||||
defer seedbuff.Free()
|
defer seedbuff.Free()
|
||||||
@ -109,7 +109,6 @@ func GenBoxKeypair() *KeyPair {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// get public key from secret key
|
// get public key from secret key
|
||||||
func GetBoxPubkey(sk []byte) []byte {
|
func GetBoxPubkey(sk []byte) []byte {
|
||||||
sk_len := C.crypto_box_seedbytes()
|
sk_len := C.crypto_box_seedbytes()
|
||||||
@ -170,7 +169,6 @@ func CryptoSignPublicLen() int {
|
|||||||
return int(C.crypto_sign_publickeybytes())
|
return int(C.crypto_sign_publickeybytes())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func CryptoSignSecretLen() int {
|
func CryptoSignSecretLen() int {
|
||||||
return int(C.crypto_sign_secretkeybytes())
|
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())
|
return int(C.crypto_sign_secretkeybytes())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// initialize sodium
|
// initialize sodium
|
||||||
func init() {
|
func init() {
|
||||||
status := C.sodium_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>
|
// #include <sodium.h>
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
|
||||||
// sign data detached with secret key sk
|
// sign data detached with secret key sk
|
||||||
func CryptoSignDetached(msg, sk []byte) []byte {
|
func CryptoSignDetached(msg, sk []byte) []byte {
|
||||||
msgbuff := NewBuffer(msg)
|
msgbuff := NewBuffer(msg)
|
||||||
@ -31,7 +30,6 @@ func CryptoSignDetached(msg, sk []byte) []byte {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// sign data with secret key sk
|
// sign data with secret key sk
|
||||||
// return detached sig
|
// return detached sig
|
||||||
// this uses crypto_sign instead pf crypto_sign_detached
|
// 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
|
// TOY encrypted authenticated stream protocol like tls
|
||||||
|
|
||||||
|
|
||||||
var BadHandshake = errors.New("Bad handshake")
|
var BadHandshake = errors.New("Bad handshake")
|
||||||
var ShortWrite = errors.New("short write")
|
var ShortWrite = errors.New("short write")
|
||||||
var ShortRead = errors.New("short read")
|
var ShortRead = errors.New("short read")
|
||||||
@ -211,7 +210,6 @@ func (cs *CryptoStream) Handshake() (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// create a client
|
// create a client
|
||||||
func Client(stream io.ReadWriteCloser, local_sk, remote_pk []byte) (c *CryptoStream) {
|
func Client(stream io.ReadWriteCloser, local_sk, remote_pk []byte) (c *CryptoStream) {
|
||||||
c = &CryptoStream{
|
c = &CryptoStream{
|
||||||
@ -227,7 +225,6 @@ func Client(stream io.ReadWriteCloser, local_sk, remote_pk []byte) (c *CryptoStr
|
|||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type CryptoConn struct {
|
type CryptoConn struct {
|
||||||
stream *CryptoStream
|
stream *CryptoStream
|
||||||
conn net.Conn
|
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>
|
// #include <sodium.h>
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
|
||||||
// verify a fucky detached sig
|
// verify a fucky detached sig
|
||||||
func CryptoVerifyFucky(msg, sig, pk []byte) bool {
|
func CryptoVerifyFucky(msg, sig, pk []byte) bool {
|
||||||
var smsg []byte
|
var smsg []byte
|
||||||
|
Reference in New Issue
Block a user