Lines Matching defs:salt
51 private byte[] salt = null;
61 static byte[] derive(char[] chars, byte[] salt,
82 int s = roundup(salt.length, v);
88 concat(salt, I, 0, s);
203 if (salt == null) {
206 // section B.4 to generate salt and iCount.
207 salt = new byte[DEFAULT_SALT_LENGTH];
208 SunJCE.RANDOM.nextBytes(salt);
211 PBEParameterSpec pbeSpec = new PBEParameterSpec(salt, iCount);
233 salt = null;
239 salt = pbeKey.getSalt(); // maybe null if unspecified
257 ((params == null) && ((salt == null) || (iCount == 0)))) {
263 // generate default for salt and iteration count if necessary
264 if (salt == null) {
265 salt = new byte[DEFAULT_SALT_LENGTH];
267 random.nextBytes(salt);
269 SunJCE.RANDOM.nextBytes(salt);
279 if (salt != null) {
280 if (!Arrays.equals(salt, pbeParams.getSalt())) {
282 ("Inconsistent value of salt between key and params");
285 salt = pbeParams.getSalt();
296 // salt is recommended to be ideally as long as the output
299 // salt length to be 8-byte which is what PKCS#5 recommends
301 if (salt.length < 8) {
309 byte[] derivedKey = derive(passwdChars, salt, iCount,
312 byte[] derivedIv = derive(passwdChars, salt, iCount, 8,