|
|
@ -10,6 +10,9 @@ import "golang.org/x/crypto/curve25519"
|
|
|
|
// Private represents a curve25519 private key.
|
|
|
|
// Private represents a curve25519 private key.
|
|
|
|
type Private [32]byte
|
|
|
|
type Private [32]byte
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Private reports whether p is the zero value.
|
|
|
|
|
|
|
|
func (p Private) IsZero() bool { return p == Private{} }
|
|
|
|
|
|
|
|
|
|
|
|
// B32 returns k as the *[32]byte type that's used by the
|
|
|
|
// B32 returns k as the *[32]byte type that's used by the
|
|
|
|
// golang.org/x/crypto packages. This allocates; it might
|
|
|
|
// golang.org/x/crypto packages. This allocates; it might
|
|
|
|
// not be appropriate for performance-sensitive paths.
|
|
|
|
// not be appropriate for performance-sensitive paths.
|
|
|
@ -18,6 +21,9 @@ func (k Private) B32() *[32]byte { return (*[32]byte)(&k) }
|
|
|
|
// Public represents a curve25519 public key.
|
|
|
|
// Public represents a curve25519 public key.
|
|
|
|
type Public [32]byte
|
|
|
|
type Public [32]byte
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Public reports whether p is the zero value.
|
|
|
|
|
|
|
|
func (p Public) IsZero() bool { return p == Public{} }
|
|
|
|
|
|
|
|
|
|
|
|
// B32 returns k as the *[32]byte type that's used by the
|
|
|
|
// B32 returns k as the *[32]byte type that's used by the
|
|
|
|
// golang.org/x/crypto packages. This allocates; it might
|
|
|
|
// golang.org/x/crypto packages. This allocates; it might
|
|
|
|
// not be appropriate for performance-sensitive paths.
|
|
|
|
// not be appropriate for performance-sensitive paths.
|
|
|
|