On Fri, Feb 1, 2013 at 6:24 AM, Dutta Yashpal-B05456 <b05...@freescale.com> wrote: > Hi, > > In cryptodev, there are some scenarios where in/out parameters are allocated > on stack. One of few such cases is > as follows: > > During cryptodev_hash_init, the Mackey being passed to crypto_ahash_setkey > is on stack and resides on stack in > Crypto_create_session " uint8_t keyp[CRYPTO_HMAC_MAX_KEY_LEN]". This key may > be used by driver for HMAC update/final > processing. Is driver supposed to keep its copy of HMAC key because the stack > copy of the key will be lost once we > return from crypto_create_session? > > If an accelerate can generate an intermediate key like split-key from class-2 > HMAC key, is driver supposed to > Copy this key into a DMAable buffer for device to be able to read this key > and do processing?
This depends on the semantics of crypto_ahash_setkey(). Ok I see there is no text there, so I go on. If that is an issue for your driver cryptodev could keep a copy of the key in its hash_data structure which is available for the lifetime of the session. There is a CRYPTO_HMAC_MAX_KEY_LEN that can be used for that. regards, Nikos _______________________________________________ Cryptodev-linux-devel mailing list Cryptodev-linux-devel@gna.org https://mail.gna.org/listinfo/cryptodev-linux-devel