Skip to content

Commit e7887ae

Browse files
author
aldoli
committed
make aes ctr encryption can set iv
1 parent c44bb41 commit e7887ae

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [5.6.58]
9+
- make aes ctr encryption mode can set iv
10+
811
## [5.6.57]
912
- update AudioAuditing api
1013
- add VideoAuditing new params

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.qcloud</groupId>
66
<artifactId>cos_api</artifactId>
7-
<version>5.6.57</version>
7+
<version>5.6.58</version>
88
<packaging>jar</packaging>
99
<name>cos-java-sdk</name>
1010
<description>java sdk for qcloud cos</description>

src/main/java/com/qcloud/cos/internal/crypto/AesCtr.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020

2121
class AesCtr extends ContentCryptoScheme {
2222

23+
private byte[] iv = null;
24+
2325
@Override String getKeyGeneratorAlgorithm() { return AES_GCM.getKeyGeneratorAlgorithm(); }
2426
@Override String getCipherAlgorithm() { return "AES/CTR/NoPadding"; }
2527
@Override int getKeyLengthInBits() { return AES_GCM.getKeyLengthInBits(); }
2628
@Override int getBlockSizeInBytes() { return AES_GCM.getBlockSizeInBytes(); }
2729
@Override int getIVLengthInBytes() { return 16; }
2830
@Override long getMaxPlaintextSize() { return MAX_CTR_BYTES; }
29-
@Override byte[] getIV() { return null; }
30-
@Override void setIV(byte[] iv) {}
31+
@Override byte[] getIV() { return this.iv; }
32+
@Override void setIV(byte[] iv) { this.iv = iv; }
3133

3234
@Override
3335
byte[] adjustIV(byte[] iv, long byteOffset) {

0 commit comments

Comments
 (0)