Home | History | Annotate | Download | only in evp

Lines Matching defs:key

24 // Tests deriving a key using an empty password (specified both as NULL and as
30 uint8_t key[sizeof(kKey)];
33 EVP_sha1(), sizeof(kKey), key));
34 EXPECT_EQ(Bytes(kKey), Bytes(key));
37 EVP_sha1(), sizeof(kKey), key));
38 EXPECT_EQ(Bytes(kKey), Bytes(key));
41 // Tests deriving a key using an empty salt. Note that the expectation was
48 uint8_t key[sizeof(kKey)];
51 sizeof(kKey), key));
52 EXPECT_EQ(Bytes(kKey), Bytes(key));
55 EVP_sha256(), sizeof(kKey), key));
56 EXPECT_EQ(Bytes(kKey), Bytes(key));
70 uint8_t key[sizeof(kKey1)];
71 static_assert(sizeof(key) >= sizeof(kKey2), "output too small");
72 static_assert(sizeof(key) >= sizeof(kKey3), "output too small");
75 EVP_sha1(), sizeof(kKey1), key));
76 EXPECT_EQ(Bytes(kKey1), Bytes(key, sizeof(kKey1)));
79 EVP_sha1(), sizeof(kKey2), key));
80 EXPECT_EQ(Bytes(kKey2), Bytes(key, sizeof(kKey2)));
83 4096, EVP_sha1(), sizeof(kKey3), key));
84 EXPECT_EQ(Bytes(kKey3), Bytes(key, sizeof(kKey3)));
87 // Tests key derivation using SHA-2 digests.
106 uint8_t key[sizeof(kKey2)];
107 static_assert(sizeof(key) >= sizeof(kKey1), "output too small");
110 EVP_sha256(), sizeof(kKey1), key));
111 EXPECT_EQ(Bytes(kKey1), Bytes(key, sizeof(kKey1)));
116 36, 4096, EVP_sha512(), sizeof(kKey2), key));
117 EXPECT_EQ(Bytes(kKey2), Bytes(key, sizeof(kKey2)));
120 // Tests key derivation using iterations=0.
123 // key derivation with iterations=0 is ill-defined and should result in a
132 uint8_t key[10] = {0};
133 const size_t key_len = sizeof(key);
137 1 /* iterations */, digest, key_len, key));
139 // Flip the first key byte (so can later test if it got set).
140 const uint8_t expected_first_byte = key[0];
141 key[0] = ~key[0];
145 0 /* iterations */, digest, key_len, key));
148 // the out key.
149 EXPECT_EQ(expected_first_byte, key[0]);