Lines Matching refs:akey
262 struct aes_context *akey; in aes_encrypt_init() local
280 akey = os_zalloc(sizeof(*akey)); in aes_encrypt_init()
281 if (akey == NULL) in aes_encrypt_init()
284 if (!CryptAcquireContext(&akey->prov, NULL, in aes_encrypt_init()
289 os_free(akey); in aes_encrypt_init()
293 if (!CryptImportKey(akey->prov, (BYTE *) &key_blob, sizeof(key_blob), in aes_encrypt_init()
294 0, 0, &akey->ckey)) { in aes_encrypt_init()
297 CryptReleaseContext(akey->prov, 0); in aes_encrypt_init()
298 os_free(akey); in aes_encrypt_init()
302 if (!CryptSetKeyParam(akey->ckey, KP_MODE, (BYTE *) &mode, 0)) { in aes_encrypt_init()
305 CryptDestroyKey(akey->ckey); in aes_encrypt_init()
306 CryptReleaseContext(akey->prov, 0); in aes_encrypt_init()
307 os_free(akey); in aes_encrypt_init()
311 return akey; in aes_encrypt_init()
317 struct aes_context *akey = ctx; in aes_encrypt() local
322 if (!CryptEncrypt(akey->ckey, 0, FALSE, 0, crypt, &dlen, 16)) { in aes_encrypt()
332 struct aes_context *akey = ctx; in aes_encrypt_deinit() local
333 if (akey) { in aes_encrypt_deinit()
334 CryptDestroyKey(akey->ckey); in aes_encrypt_deinit()
335 CryptReleaseContext(akey->prov, 0); in aes_encrypt_deinit()
336 os_free(akey); in aes_encrypt_deinit()
349 struct aes_context *akey = ctx; in aes_decrypt() local
355 if (!CryptDecrypt(akey->ckey, 0, FALSE, 0, plain, &dlen)) { in aes_decrypt()