diff options
author | Raimo Niskanen <[email protected]> | 2019-02-08 16:18:58 +0100 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2019-02-13 14:18:22 +0100 |
commit | 38ce21e37be4578a7a89856ddb91516279e58c13 (patch) | |
tree | dc11b7d43da11e6b3053fb0c11a2fffe5aeb51bd /lib/ssl/src/ssl_cipher.erl | |
parent | bdcfbe7966328a07814c301787173b80e5c20aa6 (diff) | |
download | otp-38ce21e37be4578a7a89856ddb91516279e58c13.tar.gz otp-38ce21e37be4578a7a89856ddb91516279e58c13.tar.bz2 otp-38ce21e37be4578a7a89856ddb91516279e58c13.zip |
Small binary handling optimizations
Diffstat (limited to 'lib/ssl/src/ssl_cipher.erl')
-rw-r--r-- | lib/ssl/src/ssl_cipher.erl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl index da2be0e50f..fce48d1678 100644 --- a/lib/ssl/src/ssl_cipher.erl +++ b/lib/ssl/src/ssl_cipher.erl @@ -113,12 +113,11 @@ nonce_seed(Seed, CipherState) -> %% data is calculated and the data plus the HMAC is ecncrypted. %%------------------------------------------------------------------- cipher(?NULL, CipherState, <<>>, Fragment, _Version) -> - GenStreamCipherList = [Fragment, <<>>], - {GenStreamCipherList, CipherState}; + {iolist_to_binary(Fragment), CipherState}; cipher(?RC4, CipherState = #cipher_state{state = State0}, Mac, Fragment, _Version) -> GenStreamCipherList = [Fragment, Mac], {State1, T} = crypto:stream_encrypt(State0, GenStreamCipherList), - {T, CipherState#cipher_state{state = State1}}; + {iolist_to_binary(T), CipherState#cipher_state{state = State1}}; cipher(?DES, CipherState, Mac, Fragment, Version) -> block_cipher(fun(Key, IV, T) -> crypto:block_encrypt(des_cbc, Key, IV, T) |