Skip to contentSkip to conversation

Question on structures

DISCUSSION Mark Allyn 2 participants 3 messages Oct 25, 2010 – Oct 27, 2010 Crypto API

lore
Share & tools
lore

Mark Allyn

author
#0 lore raw

Folks:

Perhaps this is due to me being a neophyte . . .

I notice that some of the structure have two different sets of functions.

For example, the ahash_alg structure has .init and then .base.cra_init. What is the difference between the two?

Thanks

Truly,

Mark Allyn
Portland, Oregon
www.allyn.com
971-563-7588

maintainer
#1 lore raw
Quoted 9 lines · Mark Allyn

Folks:

Perhaps this is due to me being a neophyte . . .

I notice that some of the structure have two different sets of functions.

For example, the ahash_alg structure has .init and then .base.cra_init. What is the difference between the two?

cra_init initialises a tfm object, while init is an operation specific to hash algorithms --- it initialises the hash state.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
author
#2 lore raw

I am still confused.

I have a hardware device whose driver has its own initialization API that accepts the space for its own format for context as well as the mode.

Would I use that api for both the algorithm init and the context init as the format of the context is unique to the hardware that I am using?

The docs don't explain this (unless there is documentation elsewhere outside the kernel tree)

Truly,

Mark Allyn
Portland, Oregon
www.allyn.com
971-563-7588

Quoted 21 lines · Herbert Xu
Quoted 9 lines · Mark Allyn

Folks:

Perhaps this is due to me being a neophyte . . .

I notice that some of the structure have two different sets of functions.

For example, the ahash_alg structure has .init and then .base.cra_init. What is the difference between the two?

cra_init initialises a tfm object, while init is an operation specific to hash algorithms --- it initialises the hash state.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt