read iv from chiffre (still not correct but at least less wrong now)

This commit is contained in:
Sebastian Hugentobler 2022-03-22 19:38:52 +01:00
parent 3bc74649ad
commit e04a341fc6
Signed by: shu
GPG key ID: BB32CF3CA052C2F0
3 changed files with 8 additions and 8 deletions

View file

@ -8,8 +8,8 @@ public class CTR {
private final int iv;
private final int key;
public CTR(int key) {
this.iv = generateIV();
public CTR(int iv, int key) {
this.iv = iv;
this.key = key;
}
@ -17,7 +17,7 @@ public class CTR {
return iv;
}
public int generateIV() {
public static int generateIV() {
Random random = ThreadLocalRandom.current();
byte[] r = new byte[2];
random.nextBytes(r);