/** * Default 0-arguments constructor. */ public ARCFourRandomSpi() { super(); adaptee = PRNGFactory.getInstance(Registry.ARCFOUR_PRNG); virgin = true; }
public ARCFourSpi() { super(); keystream = PRNGFactory.getInstance(Registry.ARCFOUR_PRNG); }
keystream = PRNGFactory.getInstance(keystreamName); cpStream = PRNGFactory.getInstance(keystreamName); cpStream = PRNGFactory.getInstance(keystreamName); ipStream = PRNGFactory.getInstance(keystreamName);
private SecretKeySpec genkey(PBEKey key) throws InvalidKeyException { IRandom kdf = PRNGFactory.getInstance("PBKDF2-" + macName); if (kdf == null) { throw new IllegalArgumentException("no such KDF: PBKDF2-" + macName); } HashMap attrib = new HashMap(); attrib.put(IPBE.ITERATION_COUNT, new Integer(key.getIterationCount())); attrib.put(IPBE.PASSWORD, key.getPassword()); attrib.put(IPBE.SALT, key.getSalt()); try { kdf.init(attrib); } catch (IllegalArgumentException iae) { throw new InvalidKeyException(iae.toString()); } byte[] dk = new byte[mode.defaultKeySize()]; try { kdf.nextBytes(dk, 0, dk.length); } catch (LimitReachedException shouldNotHappen) { // throw new Error(shouldNotHappen); throw new Error(String.valueOf(shouldNotHappen)); } return new SecretKeySpec(dk, cipher.name()); }
throw new InvalidKeySpecException("not a PBEKeySpec"); IRandom kdf = PRNGFactory.getInstance("PBKDF2-"+macName); HashMap attr = new HashMap(); attr.put(IPBE.PASSWORD, ((PBEKeySpec) spec).getPassword());
pbAttr.put(IPBE.SALT, salt); pbAttr.put(IPBE.ITERATION_COUNT, ITERATION_COUNT); IRandom kdf = PRNGFactory.getInstance("PBKDF2-HMAC-SHA"); kdf.init(pbAttr);
pbAttr.put(IPBE.SALT, salt); pbAttr.put(IPBE.ITERATION_COUNT, ITERATION_COUNT); IRandom kdf = PRNGFactory.getInstance("PBKDF2-HMAC-SHA"); kdf.init(pbAttr);