HomeSort by relevance Sort by last modified time
    Searched refs:salt (Results 1 - 25 of 77) sorted by null

1 2 3 4

  /libcore/luni/src/main/java/javax/crypto/spec/
PBEParameterSpec.java 32 private final byte[] salt; field in class:PBEParameterSpec
36 * Creates a new <code>PBEParameterSpec</code> with the specified salt and
39 * @param salt
40 * the salt.
44 * if salt is null.
46 public PBEParameterSpec(byte[] salt, int iterationCount) {
47 if (salt == null) {
48 throw new NullPointerException("salt == null");
50 this.salt = new byte[salt.length]
    [all...]
PBEKeySpec.java 32 private final byte[] salt; field in class:PBEKeySpec
49 salt = null;
55 * Creates a new <code>PBEKeySpec</code> with the specified password, salt,
60 * @param salt
61 * the salt.
67 * if the salt is null.
69 * if the salt is empty, iteration count is zero or negative or
72 public PBEKeySpec(char[] password, byte[] salt, int iterationCount,
74 if (salt == null) {
75 throw new NullPointerException("salt == null")
    [all...]
  /libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/
PBEParameterSpecTest.java 45 * PBEParameterSpec(byte[] salt, int iterationCount) method testing.
56 byte[] salt = {1, 2, 3, 4, 5};
62 + "in the case of null salt.");
66 PBEParameterSpec pbeps = new PBEParameterSpec(salt, iterationCount);
67 salt[0] ++;
68 assertFalse("The change of salt specified in the constructor "
70 salt[0] == pbeps.getSalt()[0]);
74 * getSalt() method testing. Tests that returned salt is equal
75 * to the salt specified in the constructor and that the change of
85 byte[] salt = new byte[] {1, 2, 3, 4, 5}
    [all...]
PBEKeySpecTest.java 73 * PBEKeySpec(char[] password, byte[] salt, int iterationCount, int
86 byte[] salt = new byte[] {1, 2, 3, 4, 5};
91 PBEKeySpec pbeks = new PBEKeySpec(null, salt,
104 + "in the case of null salt.");
113 + "in the case of empty salt.");
118 new PBEKeySpec(password, salt, -1, keyLength);
125 new PBEKeySpec(password, salt, iterationCount, -1);
132 new PBEKeySpec(password, salt, 0, keyLength);
139 new PBEKeySpec(password, salt, iterationCount, 0);
145 PBEKeySpec pbeks = new PBEKeySpec(password, salt,
    [all...]
  /external/bouncycastle/src/main/java/org/bouncycastle/crypto/
PBEParametersGenerator.java 11 protected byte[] salt; field in class:PBEParametersGenerator
25 * @param salt the salt to be mixed with the password.
31 byte[] salt,
35 this.salt = salt;
50 * return the salt byte array.
52 * @return the salt byte array.
56 return salt;
  /external/openssl/crypto/asn1/
p5_pbe.c 68 ASN1_SIMPLE(PBEPARAM, salt, ASN1_OCTET_STRING),
78 const unsigned char *salt, int saltlen)
99 if (!ASN1_STRING_set(pbe->salt, NULL, saltlen))
104 sstr = ASN1_STRING_data(pbe->salt);
105 if (salt)
106 memcpy(sstr, salt, saltlen);
133 const unsigned char *salt, int saltlen)
143 if (PKCS5_pbe_set0_algor(ret, alg, iter, salt, saltlen))
p5_pbev2.c 75 ASN1_SIMPLE(PBKDF2PARAM, salt, ASN1_ANY),
90 unsigned char *salt, int saltlen,
154 if (salt) memcpy (osalt->data, salt, saltlen);
160 /* Now include salt in kdf structure */
161 kdf->salt->value.octet_string = osalt;
162 kdf->salt->type = V_ASN1_OCTET_STRING;
232 unsigned char *salt, int saltlen)
234 return PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, NULL, -1);
  /external/openssl/crypto/pkcs12/
p12_crpt.c 74 unsigned char *salt; local
93 salt = pbe->salt->data;
94 saltlen = pbe->salt->length;
95 if (!PKCS12_key_gen (pass, passlen, salt, saltlen, PKCS12_KEY_ID,
101 if (!PKCS12_key_gen (pass, passlen, salt, saltlen, PKCS12_IV_ID,
p12_mutl.c 72 unsigned char key[EVP_MAX_MD_SIZE], *salt; local
82 salt = p12->mac->salt->data;
83 saltlen = p12->mac->salt->length;
94 if(!PKCS12_key_gen (pass, passlen, salt, saltlen, PKCS12_MAC_ID, iter,
129 unsigned char *salt, int saltlen, int iter, const EVP_MD *md_type)
135 if (PKCS12_setup_mac (p12, iter, salt, saltlen, md_type) ==
152 int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen,
167 p12->mac->salt->length = saltlen;
168 if (!(p12->mac->salt->data = OPENSSL_malloc (saltlen)))
    [all...]
p12_p8e.c 65 unsigned char *salt, int saltlen, int iter,
76 if(pbe_nid == -1) pbe = PKCS5_pbe2_set(cipher, iter, salt, saltlen);
77 else pbe = PKCS5_pbe_set(pbe_nid, iter, salt, saltlen);
  /external/bouncycastle/src/main/java/org/bouncycastle/asn1/pkcs/
MacData.java 21 byte[] salt; field in class:MacData
44 this.salt = ((ASN1OctetString)seq.getObjectAt(1)).getOctets();
58 byte[] salt,
62 this.salt = salt;
73 return salt;
97 v.add(new DEROctetString(salt));
  /frameworks/base/libs/utils/tests/
ObbFile_test.cpp 68 unsigned char salt[SALT_SIZE] = {0x01, 0x10, 0x55, 0xAA, 0xFF, 0x00, 0x5A, 0xA5}; local
69 EXPECT_TRUE(mObbFile->setSalt(salt, SALT_SIZE))
70 << "Salt should be successfully set";
89 EXPECT_EQ(sizeof(salt), saltLen)
90 << "salt sizes were not the same";
92 for (int i = 0; i < sizeof(salt); i++) {
93 EXPECT_EQ(salt[i], newSalt[i])
94 << "salt character " << i << " should be equal";
96 EXPECT_TRUE(memcmp(newSalt, salt, sizeof(salt)) == 0
    [all...]
  /external/bouncycastle/src/main/java/org/bouncycastle/crypto/generators/
OpenSSLPBEParametersGenerator.java 33 * @param salt salt to use.
37 byte[] salt)
39 super.init(password, salt, 1);
43 * the derived key function, the ith hash of the password and the salt.
55 digest.update(salt, 0, salt.length);
79 * Generate a key parameter derived from the password, salt, and iteration
98 * the password, salt, and iteration count we are currently initialised
120 * salt, and iteration count we are currently initialised with
    [all...]
  /frameworks/base/tools/obbtool/
pbkdf2gen.cpp 29 * Will print out the salt and key in hex.
50 unsigned char salt[SALT_LEN]; local
52 if (read(fd, &salt, SALT_LEN) != SALT_LEN) {
53 fprintf(stderr, "Could not read salt from /dev/urandom: %s\n", strerror(errno));
61 if (PKCS5_PBKDF2_HMAC_SHA1(argv[1], strlen(argv[1]), salt, SALT_LEN,
67 printf("salt=");
69 printf("%02x", salt[i]);
  /external/dropbear/libtomcrypt/src/pk/pkcs1/
pkcs_1_pss_encode.c 24 @param saltlen The length of the salt desired (octets)
39 unsigned char *DB, *mask, *salt, *hash; local
64 /* allocate ram for DB/mask/salt/hash of size modulus_len */
67 salt = XMALLOC(modulus_len);
69 if (DB == NULL || mask == NULL || salt == NULL || hash == NULL) {
76 if (salt != NULL) {
77 XFREE(salt);
86 /* generate random salt */
88 if (prng_descriptor[prng_idx].read(salt, saltlen, prng) != saltlen) {
94 /* M = (eight) 0x00 || msghash || salt, hash = H(M) *
    [all...]
  /external/openssl/crypto/evp/
p5_crpt.c 82 unsigned char *salt; local
101 salt = pbe->salt->data;
102 saltlen = pbe->salt->length;
110 EVP_DigestUpdate(&ctx, salt, saltlen);
p5_crpt2.c 80 const unsigned char *salt, int saltlen, int iter,
114 HMAC_Update(&hctx, salt, saltlen);
133 fprintf(stderr, "Salt:\n");
134 h__dump (salt, saltlen);
143 const unsigned char *salt, int saltlen, int iter,
146 return PKCS5_PBKDF2_HMAC(pass, passlen, salt, saltlen, iter, EVP_sha1(),
154 unsigned char salt[] = {0x12, 0x34, 0x56, 0x78}; local
155 PKCS5_PBKDF2_HMAC_SHA1("password", -1, salt, 4, 5, 4, out);
171 unsigned char *salt, key[EVP_MAX_KEY_LENGTH]; local
268 if(kdf->salt->type != V_ASN1_OCTET_STRING)
    [all...]
  /external/bouncycastle/src/main/java/org/bouncycastle/openssl/
PEMUtilities.java 99 byte[] salt = iv;
100 if (salt.length > 8)
102 salt = new byte[8];
103 System.arraycopy(iv, 0, salt, 0, 8);
123 sKey = getKey(password, "AES", keyBits / 8, salt);
157 byte[] salt)
159 return getKey(password, algorithm, keyLength, salt, false);
166 byte[] salt,
171 pGen.init(PBEParametersGenerator.PKCS5PasswordToBytes(password), salt); local
  /external/openssl/crypto/des/
fcrypt.c 27 /* Added more values to handle illegal salt values the way normal
61 char *DES_crypt(const char *buf, const char *salt)
66 return(DES_fcrypt(buf,salt,buff));
72 /* Copy at most 2 chars of salt */
73 if ((e_salt[0] = salt[0]) != '\0')
74 e_salt[1] = salt[1];
99 char *DES_fcrypt(const char *buf, const char *salt, char *ret)
119 x=ret[0]=((salt[0] == '\0')?'A':salt[0]);
121 x=ret[1]=((salt[1] == '\0')?'A':salt[1])
    [all...]
  /external/openssl/crypto/rsa/
rsa_pss.c 90 * -2 salt length is autorecovered from signature
179 unsigned char *H, *salt = NULL, *p; local
188 * -2 salt length is maximized
218 salt = OPENSSL_malloc(sLen);
219 if (!salt)
225 if (RAND_bytes(salt, sLen) <= 0)
235 EVP_DigestUpdate(&ctx, salt, sLen);
254 *p++ ^= salt[i];
266 if (salt)
267 OPENSSL_free(salt);
    [all...]
  /bootable/recovery/
encryptedfs_provisioning.h 36 char salt[ENCRYPTED_FS_SALT_SIZE]; member in struct:encrypted_fs_info
  /external/dropbear/libtomcrypt/src/misc/pkcs5/
pkcs_5_1.c 22 @param salt The salt (or nonce) which is 8 octets long
30 const unsigned char *salt,
40 LTC_ARGCHK(salt != NULL);
62 /* hash initial password + salt */
69 if ((err = hash_descriptor[hash_idx].process(md, salt, 8)) != CRYPT_OK) {
  /frameworks/base/core/java/android/content/res/
ObbInfo.java 52 * The salt for the encryption algorithm.
56 public byte[] salt; field in class:ObbInfo
85 dest.writeByteArray(salt);
104 salt = source.createByteArray();
  /libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/
CipherPBEThread.java 39 byte[] salt = new byte[8];
49 sr.nextBytes(salt);
50 PBEParameterSpec parSpec = new PBEParameterSpec(salt, getKeyLength());
  /frameworks/base/core/jni/
android_content_res_ObbScanner.cpp 35 jfieldID salt; member in struct:android::__anon8660
75 const unsigned char* salt = obb->getSalt(&saltLen); local
78 env->SetByteArrayRegion(saltArray, 0, saltLen, (jbyte*)salt);
79 env->SetObjectField(obbInfo, gObbInfoClassInfo.salt, saltArray);
111 GET_FIELD_ID(gObbInfoClassInfo.salt, gObbInfoClassInfo.clazz,
112 "salt", "[B");

Completed in 369 milliseconds

1 2 3 4