MCPcopy
hub / github.com/shadowsocks/shadowsocks / encrypt

Method encrypt

shadowsocks/encrypt.py:112–119  ·  view source on GitHub ↗
(self, buf)

Source from the content-addressed store, hash-verified

110 return m[2](method, key, iv, op)
111
112 def encrypt(self, buf):
113 if len(buf) == 0:
114 return buf
115 if self.iv_sent:
116 return self.cipher.update(buf)
117 else:
118 self.iv_sent = True
119 return self.cipher_iv + self.cipher.update(buf)
120
121 def decrypt(self, buf):
122 if len(buf) == 0:

Callers 5

test_encryptorFunction · 0.95
_handle_stage_addrMethod · 0.80
_handle_stage_streamMethod · 0.80
_on_remote_readMethod · 0.80

Calls 1

updateMethod · 0.45

Tested by 1

test_encryptorFunction · 0.76