Documentation ¶
Index ¶
- func AESKeyUnwrap(key, cipherText []byte) ([]byte, error)
- func AESKeyWrap(key, plainText []byte) ([]byte, error)
- func Marshal(curve elliptic.Curve, x, y *big.Int) (buf []byte, bitSize int)
- func PadBuffer(buf []byte, blockLen int) []byte
- func Unmarshal(curve elliptic.Curve, data []byte) (x, y *big.Int)
- func UnpadBuffer(buf []byte, dataLen int) []byte
- type PrivateKey
- type PublicKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESKeyUnwrap ¶
AESKeyUnwrap implements RFC 3394 Key Unwrapping. See http://tools.ietf.org/html/rfc3394#section-2.2.1 Note: The second described algorithm ("index-based") is implemented here.
func AESKeyWrap ¶
AESKeyWrap implements RFC 3394 Key Wrapping. See https://tools.ietf.org/html/rfc3394#section-2.2.2 Note: The second described algorithm ("index-based") is implemented here.
func Marshal ¶
Marshal encodes point into either 0x4 uncompressed point form, or 0x40 compressed point for Curve 25519.
func PadBuffer ¶
PadBuffer pads byte buffer buf to a length being multiple of blockLen. Additional bytes appended to the buffer have value of the number padded bytes. E.g. if the buffer is 3 bytes short of being 40 bytes total, the appended bytes will be [03, 03, 03].
func Unmarshal ¶
Unmarshal converts point, serialized by Marshal, into x, y pair. For 0x40 compressed points (for Curve 25519), y will always be 0. It is an error if point is not on the curve, On error, x = nil.
func UnpadBuffer ¶
UnpadBuffer verifies that buffer contains proper padding and returns buffer without the padding, or nil if the padding was invalid.
Types ¶
type PrivateKey ¶
func GenerateKey ¶
func (*PrivateKey) DecryptShared ¶
func (e *PrivateKey) DecryptShared(X, Y *big.Int) []byte