fix Trypt scramble (it did nothing, ever since its introduction)

This commit is contained in:
Daniella / Tove 2024-06-02 11:40:38 +02:00
parent 3df73ec4f6
commit 5df99b9b26
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -39,9 +39,12 @@ public class Trypt {
output[newLocation + 1] = (byte) (old ^ salt ^ key[(i++ ^ cRandE.nextInt(0x7fffffff)) % key.length]);
}
for (byte b = 0; b < input[cRandE.nextInt(input.length)]; b++) {
for (int i = 0; i < scramble; i++) {
byte b = input[cRandE.nextInt(input.length)];
for (int j = 0; j < b; j++) {
cRandE.nextLong();
}
}
return output;
}
@ -60,9 +63,12 @@ public class Trypt {
output[i] = (byte) (encrypted ^ salt ^ key[(i++ ^ cRandD.nextInt(0x7fffffff)) % key.length]);
}
for (byte b = 0; b < output[cRandD.nextInt(output.length)]; b++) {
for (int i = 0; i < scramble; i++) {
byte b = input[cRandD.nextInt(input.length)];
for (int j = 0; j < b; j++) {
cRandD.nextLong();
}
}
return output;
}