1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: other mut vlib test fixes

This commit is contained in:
Delyan Angelov
2020-09-27 11:18:55 +03:00
parent aa889b0edc
commit 03258db26d
4 changed files with 9 additions and 7 deletions

View File

@@ -105,7 +105,8 @@ pub fn (mut x AesCbc) decrypt_blocks(mut dst []byte, src []byte) {
// Loop over all but the first block.
for start > 0 {
x.b.decrypt(mut (*dst).slice(start, end), mut src.slice(start, end))
mut src_chunk := src.slice(start, end)
x.b.decrypt(mut (*dst).slice(start, end), mut src_chunk)
cipher.xor_bytes(mut (*dst).slice(start, end), (*dst).slice(start, end), src.slice(prev, start))
end = start
@@ -114,7 +115,8 @@ pub fn (mut x AesCbc) decrypt_blocks(mut dst []byte, src []byte) {
}
// The first block is special because it uses the saved iv.
x.b.decrypt(mut (*dst).slice(start, end), mut src.slice(start, end))
mut src_chunk := src.slice(start, end)
x.b.decrypt(mut (*dst).slice(start, end), mut src_chunk)
cipher.xor_bytes(mut (*dst).slice(start, end), (*dst).slice(start, end), x.iv)

View File

@@ -15,7 +15,7 @@ fn test_crypto_rc4() {
mut src := 'toencrypt'.bytes()
// src & dst same, encrypt in place
c.xor_key_stream(mut src, src) // encrypt data
c.xor_key_stream(mut src, mut src) // encrypt data
c.reset()