diff options
| author | Eugen Wissner <belka@caraus.de> | 2016-12-13 10:57:12 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2016-12-13 10:57:12 +0100 |
| commit | 54d0597657c5991d1c2630c2e834f26f9ecd607e (patch) | |
| tree | d171119108f5c99188b6d5d0405d9ececaf833e0 | |
| parent | ab9f96e0c7d158cbb83185ed5abe75f23a39ccd2 (diff) | |
| download | tanya-54d0597657c5991d1c2630c2e834f26f9ecd607e.tar.gz | |
Use resizeArray instead of expand/shrinkArray
| -rw-r--r-- | source/tanya/crypto/mode.d | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/tanya/crypto/mode.d b/source/tanya/crypto/mode.d index 0179f89..be02d10 100644 --- a/source/tanya/crypto/mode.d +++ b/source/tanya/crypto/mode.d @@ -60,21 +60,21 @@ body final switch (mode) with (PaddingMode) { case zero: - allocator.expandArray(input, needed); + allocator.resizeArray(input, input.length + needed); break; case pkcs7: if (needed) { - allocator.expandArray(input, needed); + allocator.resizeArray(input, input.length + needed); input[input.length - needed ..$].each!((ref e) => e = needed); } else { - allocator.expandArray(input, blockSize); + allocator.resizeArray(input, input.length + blockSize); } break; case ansiX923: - allocator.expandArray(input, needed ? needed : blockSize); + allocator.resizeArray(input, input.length + (needed ? needed : blockSize)); input[$ - 1] = needed; break; } @@ -220,7 +220,7 @@ body case ansiX923: immutable last = input[$ - 1]; - allocator.shrinkArray(input, last ? last : blockSize); + allocator.resizeArray(input, input.length - (last ? last : blockSize)); break; } |
