ahash.c (8c32c516eb1c1f9c14d25478442137c698788975) | ahash.c (093900c2b964da73daf234374225b5ce5d49f941) |
---|---|
1/* 2 * Asynchronous Cryptographic Hash operations. 3 * 4 * This is the asynchronous version of hash.c with notification of 5 * completion via a callback. 6 * 7 * Copyright (c) 2008 Loc Ho <lho@amcc.com> 8 * --- 131 unchanged lines hidden (view full) --- 140{ 141 struct ahash_alg *ahash = crypto_ahash_alg(tfm); 142 unsigned long alignmask = crypto_ahash_alignmask(tfm); 143 int ret; 144 u8 *buffer, *alignbuffer; 145 unsigned long absize; 146 147 absize = keylen + alignmask; | 1/* 2 * Asynchronous Cryptographic Hash operations. 3 * 4 * This is the asynchronous version of hash.c with notification of 5 * completion via a callback. 6 * 7 * Copyright (c) 2008 Loc Ho <lho@amcc.com> 8 * --- 131 unchanged lines hidden (view full) --- 140{ 141 struct ahash_alg *ahash = crypto_ahash_alg(tfm); 142 unsigned long alignmask = crypto_ahash_alignmask(tfm); 143 int ret; 144 u8 *buffer, *alignbuffer; 145 unsigned long absize; 146 147 absize = keylen + alignmask; |
148 buffer = kmalloc(absize, GFP_ATOMIC); | 148 buffer = kmalloc(absize, GFP_KERNEL); |
149 if (!buffer) 150 return -ENOMEM; 151 152 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); 153 memcpy(alignbuffer, key, keylen); 154 ret = ahash->setkey(tfm, alignbuffer, keylen); 155 kzfree(buffer); 156 return ret; --- 151 unchanged lines hidden --- | 149 if (!buffer) 150 return -ENOMEM; 151 152 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); 153 memcpy(alignbuffer, key, keylen); 154 ret = ahash->setkey(tfm, alignbuffer, keylen); 155 kzfree(buffer); 156 return ret; --- 151 unchanged lines hidden --- |