Re: [PATCH v2 1/3] ima: use ahash API for file hash calculation

2014-07-02 Thread Mimi Zohar
On Wed, 2014-07-02 at 21:21 +0300, Dmitry Kasatkin wrote: > On 2 July 2014 20:44, Mimi Zohar wrote: > > On Tue, 2014-07-01 at 23:12 +0300, Dmitry Kasatkin wrote: > > > >> -/* > >> - * Calculate the MD5/SHA1 file digest > >> - */ > >> +static struct crypto_ahash *ima_alloc_atfm(enum hash_algo algo

Re: [PATCH v2 1/3] ima: use ahash API for file hash calculation

2014-07-02 Thread Mimi Zohar
On Wed, 2014-07-02 at 21:20 +0300, Dmitry Kasatkin wrote: > On 2 July 2014 19:40, Mimi Zohar wrote: > > On Tue, 2014-07-01 at 23:12 +0300, Dmitry Kasatkin wrote: > >> Async hash API allows to use HW acceleration for hash calculation. > >> It may give significant performance gain or/and reduce pow

Re: [PATCH v2 1/3] ima: use ahash API for file hash calculation

2014-07-02 Thread Dave Hansen
On 07/02/2014 11:40 AM, Dmitry Kasatkin wrote: >> > We should reserve command-line parameters for things that really need >> > tweaking in early boot or are _needed_ to boot. ... > Is module param good enough or it should be sysctl? Doesn't matter to me much. sysctls seem to be the easiest things

Re: [PATCH v2 1/3] ima: use ahash API for file hash calculation

2014-07-02 Thread Dmitry Kasatkin
On 2 July 2014 21:33, Dave Hansen wrote: > On 07/01/2014 01:12 PM, Dmitry Kasatkin wrote: >> + ima_ahash= [IMA] Asynchronous hash usage parameters >> + Format: >> + Set the minimal file size when use asynchronous hash. >> + If i

Re: [PATCH v2 1/3] ima: use ahash API for file hash calculation

2014-07-02 Thread Dave Hansen
On 07/01/2014 01:12 PM, Dmitry Kasatkin wrote: > + ima_ahash= [IMA] Asynchronous hash usage parameters > + Format: > + Set the minimal file size when use asynchronous hash. > + If ima_ahash is not provided, ahash usage is disable

Re: [PATCH v2 1/3] ima: use ahash API for file hash calculation

2014-07-02 Thread Dmitry Kasatkin
On 2 July 2014 20:44, Mimi Zohar wrote: > On Tue, 2014-07-01 at 23:12 +0300, Dmitry Kasatkin wrote: > >> -/* >> - * Calculate the MD5/SHA1 file digest >> - */ >> +static struct crypto_ahash *ima_alloc_atfm(enum hash_algo algo) >> +{ >> + struct crypto_ahash *tfm = ima_ahash_tfm; >> + int r

Re: [PATCH v2 1/3] ima: use ahash API for file hash calculation

2014-07-02 Thread Dmitry Kasatkin
On 2 July 2014 19:40, Mimi Zohar wrote: > On Tue, 2014-07-01 at 23:12 +0300, Dmitry Kasatkin wrote: >> Async hash API allows to use HW acceleration for hash calculation. >> It may give significant performance gain or/and reduce power consumption, >> which might be very beneficial for battery power

Re: [PATCH v2 1/3] ima: use ahash API for file hash calculation

2014-07-02 Thread Mimi Zohar
On Tue, 2014-07-01 at 23:12 +0300, Dmitry Kasatkin wrote: > -/* > - * Calculate the MD5/SHA1 file digest > - */ > +static struct crypto_ahash *ima_alloc_atfm(enum hash_algo algo) > +{ > + struct crypto_ahash *tfm = ima_ahash_tfm; > + int rc; > + > + if ((algo != ima_hash_algo && algo <

Re: [PATCH v2 1/3] ima: use ahash API for file hash calculation

2014-07-02 Thread Mimi Zohar
On Tue, 2014-07-01 at 23:12 +0300, Dmitry Kasatkin wrote: > Async hash API allows to use HW acceleration for hash calculation. > It may give significant performance gain or/and reduce power consumption, > which might be very beneficial for battery powered devices. > > This patch introduces hash c

[PATCH v2 1/3] ima: use ahash API for file hash calculation

2014-07-01 Thread Dmitry Kasatkin
Async hash API allows to use HW acceleration for hash calculation. It may give significant performance gain or/and reduce power consumption, which might be very beneficial for battery powered devices. This patch introduces hash calculation using ahash API. ahash performance depends on data size a