what-the-bank/sources/org/bouncycastle/crypto/CipherKeyGenerator.java

21 lines
552 B
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.crypto;
import java.security.SecureRandom;
/* loaded from: classes6.dex */
public class CipherKeyGenerator {
public SecureRandom random;
public int strength;
public void init(KeyGenerationParameters keyGenerationParameters) {
this.random = keyGenerationParameters.getRandom();
this.strength = (keyGenerationParameters.getStrength() + 7) / 8;
}
public byte[] generateKey() {
byte[] bArr = new byte[this.strength];
this.random.nextBytes(bArr);
return bArr;
}
}