cgen: fix mutable array arguments (#5769)

This commit is contained in:
yuyi 2020-07-11 00:04:51 +08:00 committed by GitHub
parent 9fd0bc93f0
commit 0c9c66dd6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 12 deletions

View file

@ -21,7 +21,8 @@ fn test_crypto_aes() {
panic('ciphertext is not a multiple of the block size')
}
mode := aes.new_cbc(block, iv)
mode.encrypt_blocks(mut ciphertext, ciphertext)
cipher_clone := ciphertext.clone()
mode.encrypt_blocks(mut ciphertext, cipher_clone)
assert ciphertext.hex() == 'c210459b514668ddc44674885e4979215265a6c44431a248421254ef357a8c2a308a8bddf5623af9df91737562041cf1'
}