read iv from chiffre (still not correct but at least less wrong now)
This commit is contained in:
parent
3bc74649ad
commit
e04a341fc6
3 changed files with 8 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue