Documentation
¶
Overview ¶
Package libcrypto implements okapi interfaces using OpenSSL's libcrypto library.
Index ¶
- Variables
- type Cipher
- func (c *Cipher) BlockSize() int
- func (c *Cipher) BufferedSize() int
- func (c *Cipher) Close()
- func (c *Cipher) Finish(out []byte) int
- func (c *Cipher) GCMGetTag(out []byte) int
- func (c *Cipher) GCMSetTag(in []byte) int
- func (c *Cipher) KeySize() int
- func (c *Cipher) Update(in, out []byte) (int, int)
- type CipherSpec
- type Hash
- type HashSpec
- type MACSpec
- type PKey
- func (key *PKey) Close()
- func (key *PKey) Decrypt(encrypted []byte) (decrypted []byte, err error)
- func (key *PKey) Derive(peer okapi.PublicKey) (secret []byte, err error)
- func (key *PKey) Encrypt(plain []byte) (encrypted []byte, err error)
- func (key *PKey) KeySize() int
- func (key *PKey) PublicKey() okapi.PublicKey
- func (key *PKey) Sign(digest []byte) (signature []byte, err error)
- func (key *PKey) Verify(signature []byte, digest []byte) (valid bool, err error)
- type Random
- type RandomSpec
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RC4 = CipherSpec{0: C.EVP_rc4()} AES_ECB = CipherSpec{16: C.EVP_aes_128_ecb(), 24: C.EVP_aes_192_ecb(), 32: C.EVP_aes_256_ecb()} AES_CBC = CipherSpec{16: C.EVP_aes_128_cbc(), 24: C.EVP_aes_192_cbc(), 32: C.EVP_aes_256_cbc()} AES_CFB = CipherSpec{16: C.EVP_aes_128_cfb(), 24: C.EVP_aes_192_cfb(), 32: C.EVP_aes_256_cfb()} AES_OFB = CipherSpec{16: C.EVP_aes_128_ofb(), 24: C.EVP_aes_192_ofb(), 32: C.EVP_aes_256_ofb()} AES_CTR = CipherSpec{16: C.EVP_aes_128_ctr(), 24: C.EVP_aes_192_ctr(), 32: C.EVP_aes_256_ctr()} AES_GCM = CipherSpec{16: C.EVP_aes_128_gcm(), 24: C.EVP_aes_192_gcm(), 32: C.EVP_aes_256_gcm()} AES_CCM = CipherSpec{16: C.EVP_aes_128_ccm(), 24: C.EVP_aes_192_ccm(), 32: C.EVP_aes_256_ccm()} AES_XTS = CipherSpec{16: C.EVP_aes_128_xts(), 32: C.EVP_aes_256_xts()} BF_ECB = CipherSpec{0: C.EVP_bf_ecb()} BF_CBC = CipherSpec{0: C.EVP_bf_cbc()} BF_CFB = CipherSpec{0: C.EVP_bf_cfb()} BF_OFB = CipherSpec{0: C.EVP_bf_ofb()} DES3_ECB = CipherSpec{0: C.EVP_des_ede3_ecb()} DES3_CBC = CipherSpec{0: C.EVP_des_ede3_cbc()} DES3_CFB = CipherSpec{0: C.EVP_des_ede3_cfb()} DES3_OFB = CipherSpec{0: C.EVP_des_ede3_ofb()} )
View Source
var ( DH = dhParameters{/* contains filtered or unexported fields */} ECDH = dhParameters{/* contains filtered or unexported fields */} )
View Source
var ( DSA_SHA1 = dsaParameters{C.EVP_sha1()} DSA_SHA224 = dsaParameters{C.EVP_sha224()} DSA_SHA256 = dsaParameters{C.EVP_sha256()} DSA_SHA384 = dsaParameters{C.EVP_sha384()} DSA_SHA512 = dsaParameters{C.EVP_sha512()} )
View Source
var ( MD4 = HashSpec{C.EVP_md4()} MD5 = HashSpec{C.EVP_md5()} SHA1 = HashSpec{C.EVP_sha1()} SHA224 = HashSpec{C.EVP_sha224()} SHA256 = HashSpec{C.EVP_sha256()} SHA384 = HashSpec{C.EVP_sha384()} SHA512 = HashSpec{C.EVP_sha512()} RIPEMD160 = HashSpec{C.EVP_ripemd160()} )
View Source
var ( RSA = rsaParameters{C.RSA_PKCS1_PADDING, nil} RSA_OAEP = rsaParameters{C.RSA_PKCS1_OAEP_PADDING, nil} RSA_MD5 = rsaParameters{C.RSA_PKCS1_PADDING, C.EVP_md5()} RSA_SHA1 = rsaParameters{C.RSA_PKCS1_PADDING, C.EVP_sha1()} RSA_SHA224 = rsaParameters{C.RSA_PKCS1_PADDING, C.EVP_sha224()} RSA_SHA256 = rsaParameters{C.RSA_PKCS1_PADDING, C.EVP_sha256()} RSA_SHA384 = rsaParameters{C.RSA_PKCS1_PADDING, C.EVP_sha384()} RSA_SHA512 = rsaParameters{C.RSA_PKCS1_PADDING, C.EVP_sha512()} RSA_PSS_MD5 = rsaParameters{C.RSA_PKCS1_PSS_PADDING, C.EVP_md5()} RSA_PSS_SHA1 = rsaParameters{C.RSA_PKCS1_PSS_PADDING, C.EVP_sha1()} RSA_PSS_SHA224 = rsaParameters{C.RSA_PKCS1_PSS_PADDING, C.EVP_sha224()} RSA_PSS_SHA256 = rsaParameters{C.RSA_PKCS1_PSS_PADDING, C.EVP_sha256()} RSA_PSS_SHA384 = rsaParameters{C.RSA_PKCS1_PSS_PADDING, C.EVP_sha384()} RSA_PSS_SHA512 = rsaParameters{C.RSA_PKCS1_PSS_PADDING, C.EVP_sha512()} )
View Source
var (
DefaultRandom = RandomSpec{}
)
View Source
var (
HMAC = MACSpec{}
)
Functions ¶
This section is empty.
Types ¶
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
func (*Cipher) BufferedSize ¶
type CipherSpec ¶
type CipherSpec map[int]*C.EVP_CIPHER
CipherSpec represents a cipher algorithm. Different map entries correspond to implementations for different key sizes. Variable key size algorithms have single map entry with key 0.
func (CipherSpec) NewReader ¶
func (cs CipherSpec) NewReader(in io.Reader, key, iv, buffer []byte) *okapi.CipherReader
func (CipherSpec) NewWriter ¶
func (cs CipherSpec) NewWriter(out io.Writer, key, iv, buffer []byte) *okapi.CipherWriter
type RandomSpec ¶
type RandomSpec struct{}
func (RandomSpec) New ¶
func (rs RandomSpec) New() okapi.Random
Click to show internal directories.
Click to hide internal directories.