Lines Matching defs:alg
45 // key created for the specified |provider|. |alg| contains the algorithm of
47 // If |key_data| is intended to be used as an HMAC key, then |alg| should be
52 ALG_ID alg,
67 key_header->hdr.aiKeyAlg = alg;
73 if (alg == CALG_HMAC) {
105 ALG_ID alg = GetAESAlgIDForKeySize(key_size_in_bits);
106 if (alg == 0)
124 ok = CryptGenKey(safe_provider.get(), alg, CRYPT_EXPORTABLE,
136 // Section 3. |alg| is the hash function used in the HMAC.
137 bool CheckHMACKeySize(size_t key_size_in_bits, ALG_ID alg) {
139 switch (alg) {
163 // with the hash function |alg|.
164 // |key_size_in_bits| must be >= 1/2 the hash size of |alg| for security.
168 ALG_ID alg,
176 if (!CheckHMACKeySize(key_size_in_bits, alg))
367 ALG_ID alg = 0;
371 alg = GetAESAlgIDForKeySize(key_size_in_bits);
375 alg = CALG_HMAC;
381 if (provider_type == 0 || alg == 0)
452 if (!ImportRawKey(provider, alg, &generated_key[0], dkLen, &key))
467 ALG_ID alg = 0;
471 alg = GetAESAlgIDForKeySize(raw_key.size() * 8);
475 alg = CALG_HMAC;
481 if (provider_type == 0 || alg == 0)
491 if (!ImportRawKey(provider, alg, raw_key.data(), raw_key.size(), &key))