Skip to content

Commit

Permalink
avoid deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Dec 6, 2024
1 parent 66d8d47 commit 6878189
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/cryptomator/siv/CustomCtrComputer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.bouncycastle.crypto.BlockCipher;
import org.bouncycastle.crypto.CipherParameters;
import org.bouncycastle.crypto.OutputLengthException;
import org.bouncycastle.crypto.modes.CTRModeCipher;
import org.bouncycastle.crypto.modes.SICBlockCipher;
import org.bouncycastle.crypto.params.KeyParameter;
import org.bouncycastle.crypto.params.ParametersWithIV;
Expand All @@ -22,7 +23,7 @@ public CustomCtrComputer(Supplier<BlockCipher> blockCipherSupplier) {

@Override
public byte[] computeCtr(byte[] input, byte[] key, byte[] iv) {
SICBlockCipher cipher = new SICBlockCipher(blockCipherSupplier.get());
CTRModeCipher cipher = SICBlockCipher.newInstance(blockCipherSupplier.get());
CipherParameters params = new ParametersWithIV(new KeyParameter(key), iv);
cipher.init(true, params);
try {
Expand Down

0 comments on commit 6878189

Please sign in to comment.