Documentation ¶
Index ¶
- Constants
- type Curve25519ECDH
- func (c *Curve25519ECDH) Identity() []byte
- func (c *Curve25519ECDH) MidPublicKey() []byte
- func (c *Curve25519ECDH) Name() string
- func (c *Curve25519ECDH) PrivateKey() []byte
- func (c *Curve25519ECDH) PrivateKeyBase64() string
- func (c *Curve25519ECDH) PublicKey() []byte
- func (c *Curve25519ECDH) PublicKeyBase64() string
- func (c *Curve25519ECDH) SetPrivateKey(prk []byte) (err error)
- func (c *Curve25519ECDH) SharedSecret(pbk []byte) []byte
- type HeaderCurve
- func (h *HeaderCurve) Bytes() []byte
- func (h *HeaderCurve) Counter() uint64
- func (h *HeaderCurve) EphermeralBytes() []byte
- func (h *HeaderCurve) Flag() uint16
- func (h *HeaderCurve) HMACBytes() []byte
- func (h *HeaderCurve) IdentityBytes() []byte
- func (h *HeaderCurve) NonceBytes() []byte
- func (h *HeaderCurve) SetCounter(counter uint64)
- func (h *HeaderCurve) SetFlag(flag uint16)
- func (h *HeaderCurve) SetTypeAndPayloadSize(t int, s int)
- func (h *HeaderCurve) SetVersion(major int, minor int)
- func (h *HeaderCurve) Size() int
- func (h *HeaderCurve) StaticBytes() []byte
- func (h *HeaderCurve) TimestampBytes() []byte
- func (h *HeaderCurve) TypeAndPayloadSize() (t int, s int)
- func (h *HeaderCurve) Version() (int, int)
Constants ¶
View Source
const ( PrivateKeySize = 32 PublicKeySize = 32 )
View Source
const ( HeaderCommonSize = 24 HashSize = 32 GCMNonceSize = 12 GCMTagSize = 16 TimestampSize = 8 HeaderSize = HeaderCommonSize + PublicKeySize + PublicKeySize + GCMTagSize + TimestampSize + GCMTagSize + HashSize )
View Source
const ( NHP_FLAG_EXTENDEDLENGTH = 1 << iota NHP_FLAG_COMPRESS )
header flags (bit 0 - bit 11)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Curve25519ECDH ¶
type Curve25519ECDH struct { PrivKey [PrivateKeySize]byte PubKey [PublicKeySize]byte PrivKeyBase64 string PubKeyBase64 string BriefName string }
func NewECDH ¶
func NewECDH() *Curve25519ECDH
func (*Curve25519ECDH) Identity ¶
func (c *Curve25519ECDH) Identity() []byte
func (*Curve25519ECDH) MidPublicKey ¶
func (c *Curve25519ECDH) MidPublicKey() []byte
func (*Curve25519ECDH) Name ¶
func (c *Curve25519ECDH) Name() string
func (*Curve25519ECDH) PrivateKey ¶
func (c *Curve25519ECDH) PrivateKey() []byte
func (*Curve25519ECDH) PrivateKeyBase64 ¶
func (c *Curve25519ECDH) PrivateKeyBase64() string
func (*Curve25519ECDH) PublicKey ¶
func (c *Curve25519ECDH) PublicKey() []byte
func (*Curve25519ECDH) PublicKeyBase64 ¶
func (c *Curve25519ECDH) PublicKeyBase64() string
func (*Curve25519ECDH) SetPrivateKey ¶
func (c *Curve25519ECDH) SetPrivateKey(prk []byte) (err error)
func (*Curve25519ECDH) SharedSecret ¶
func (c *Curve25519ECDH) SharedSecret(pbk []byte) []byte
type HeaderCurve ¶
type HeaderCurve struct { HeaderCommon [HeaderCommonSize]byte Ephermeral [PublicKeySize]byte Static [PublicKeySize + GCMTagSize]byte Timestamp [TimestampSize + GCMTagSize]byte HMAC [HashSize]byte }
func (*HeaderCurve) Bytes ¶
func (h *HeaderCurve) Bytes() []byte
func (*HeaderCurve) Counter ¶
func (h *HeaderCurve) Counter() uint64
func (*HeaderCurve) EphermeralBytes ¶
func (h *HeaderCurve) EphermeralBytes() []byte
func (*HeaderCurve) Flag ¶
func (h *HeaderCurve) Flag() uint16
func (*HeaderCurve) HMACBytes ¶
func (h *HeaderCurve) HMACBytes() []byte
func (*HeaderCurve) IdentityBytes ¶
func (h *HeaderCurve) IdentityBytes() []byte
func (*HeaderCurve) NonceBytes ¶
func (h *HeaderCurve) NonceBytes() []byte
func (*HeaderCurve) SetCounter ¶
func (h *HeaderCurve) SetCounter(counter uint64)
func (*HeaderCurve) SetFlag ¶
func (h *HeaderCurve) SetFlag(flag uint16)
func (*HeaderCurve) SetTypeAndPayloadSize ¶
func (h *HeaderCurve) SetTypeAndPayloadSize(t int, s int)
func (*HeaderCurve) SetVersion ¶
func (h *HeaderCurve) SetVersion(major int, minor int)
func (*HeaderCurve) Size ¶
func (h *HeaderCurve) Size() int
func (*HeaderCurve) StaticBytes ¶
func (h *HeaderCurve) StaticBytes() []byte
func (*HeaderCurve) TimestampBytes ¶
func (h *HeaderCurve) TimestampBytes() []byte
func (*HeaderCurve) TypeAndPayloadSize ¶
func (h *HeaderCurve) TypeAndPayloadSize() (t int, s int)
curve header implementations
func (*HeaderCurve) Version ¶
func (h *HeaderCurve) Version() (int, int)
Click to show internal directories.
Click to hide internal directories.