MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / NewCipher

Function NewCipher

crypto/etls/encrypt.go:92–107  ·  view source on GitHub ↗

NewCipher creates a cipher that can be used in Dial(), Listen() etc.

(rawKey []byte)

Source from the content-addressed store, hash-verified

90
91// NewCipher creates a cipher that can be used in Dial(), Listen() etc.
92func NewCipher(rawKey []byte) (c *Cipher) {
93 mi := &cipherInfo{
94 32,
95 16,
96 newAESCFBDecStream,
97 newAESCFBEncStream,
98 }
99 hSuite := &hash.HashSuite{
100 HashLen: hash.HashBSize,
101 HashFunc: hash.DoubleHashB,
102 }
103 key := KeyDerivation(rawKey, mi.keyLen, hSuite)
104 c = &Cipher{key: key, info: mi}
105
106 return c
107}
108
109// initEncrypt Initializes the block cipher with CFB mode, returns IV.
110func (c *Cipher) initEncrypt() (iv []byte, err error) {

Callers 13

newFakeCallerFunction · 0.92
twopc_test.goFile · 0.92
PrepareMethod · 0.92
CommitMethod · 0.92
RollbackMethod · 0.92
TestAcceptFuncFunction · 0.92
serverHandshakeMethod · 0.92
DialExFunction · 0.92
conn_test.goFile · 0.85
clientFunction · 0.85
clientComplexFunction · 0.85
TestCryptoConn_RWFunction · 0.85

Calls 1

KeyDerivationFunction · 0.70

Tested by 9

newFakeCallerFunction · 0.74
PrepareMethod · 0.74
CommitMethod · 0.74
RollbackMethod · 0.74
TestAcceptFuncFunction · 0.74
clientFunction · 0.68
clientComplexFunction · 0.68
TestCryptoConn_RWFunction · 0.68
TestDialTimeoutFunction · 0.68