Documentation
¶
Index ¶
- Constants
- Variables
- func Curve25519FromEd25519PrivateKey(x ed25519.PrivateKey) [32]byte
- func Curve25519FromEd25519PublicKey(x ed25519.PublicKey) [32]byte
- func GenEd25519Key(r io.Reader) (ed25519.PublicKey, ed25519.PrivateKey, error)
- func LoadEd25519Key(filename string) (pubk ed25519.PublicKey, prik ed25519.PrivateKey, err error)
- func MarshalPacket(p *Packet) ([]byte, error)
- func NewGCM(secret []byte) (cipher.AEAD, error)
- func ReadBufferWithSize(rd io.Reader, ptr *[]byte) (err error)
- func SecretFromEd25519(pubk ed25519.PublicKey, prik ed25519.PrivateKey) []byte
- func WithCryptor(x Cryptor) option.ApplyOption
- func WithSigner(x Signer) option.ApplyOption
- func WriteBufferWithSize(wr io.Writer, buf []byte) (err error)
- type Cryptor
- type DecryptOption
- type EncryptOption
- type Packet
- type Signer
Constants ¶
View Source
const ( OPTION_SIGNER = "signer" OPTION_CRYPTOR = "cryptor" )
Variables ¶
View Source
var ( ErrInvalidBuffer = fmt.Errorf("invalid buffer") ErrInvalidSignature = fmt.Errorf("invalid signature") )
View Source
var DefaultMarshaler = &marshaler{magicCode: MAGIC_CODE[:]}
View Source
var (
MAGIC_CODE = []byte{0x3E, 0xE0}
)
Functions ¶
func Curve25519FromEd25519PrivateKey ¶
func Curve25519FromEd25519PrivateKey(x ed25519.PrivateKey) [32]byte
func GenEd25519Key ¶
func LoadEd25519Key ¶
func MarshalPacket ¶
func SecretFromEd25519 ¶
func SecretFromEd25519(pubk ed25519.PublicKey, prik ed25519.PrivateKey) []byte
func WithCryptor ¶
func WithCryptor(x Cryptor) option.ApplyOption
func WithSigner ¶
func WithSigner(x Signer) option.ApplyOption
Types ¶
type DecryptOption ¶
type DecryptOption = crypto_interface.DecryptOption
type EncryptOption ¶
type EncryptOption = crypto_interface.EncryptOption
Click to show internal directories.
Click to hide internal directories.