2010-11-05 17:59:53

by Allyn, Mark A

[permalink] [raw]
Subject: [PATCH 1/1] crypto: api.c: doc on crypto_alg_lookup, crypto_larval_lookup, and crypto_alg_mod_lookup

Resubmit due to errors on patch submitted 11/4/2010

Signed-off-by: Mark A. Allyn <[email protected]>
---
crypto/api.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/crypto/api.c b/crypto/api.c
index 033a714..d8a7c35 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -193,6 +193,14 @@ static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg)
return alg;
}

+/**
+ * crypto_alg_lookup() - get the crypto_alg structure for an algorithm
+ * @name: text string containing name of algorithm
+ * @type: crypto type defined in include/linux/crypto.h
+ * @mask: mask of allowable crypto types (use or'd list
+ * of types as defined in include/linux/crypto.h)
+ * @returns: pointer to crypto_alg structure
+ */
struct crypto_alg *crypto_alg_lookup(const char *name, u32 type, u32 mask)
{
struct crypto_alg *alg;
@@ -205,6 +213,15 @@ struct crypto_alg *crypto_alg_lookup(const char *name, u32 type, u32 mask)
}
EXPORT_SYMBOL_GPL(crypto_alg_lookup);

+/**
+ * crypto_larval_lookup() - gets large value (larval) crypto_alg
+ * structure for an algorithm
+ * @name: text string containing name of algorithm
+ * @type: crypto type defined in include/linux/crypto.h
+ * @mask: mask of allowable crypto types (use or'd list
+ * of types as defined in include/linux/crypto.h)
+ * @returns: pointer to crypto_alg structure
+ */
struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)
{
struct crypto_alg *alg;
@@ -247,6 +264,14 @@ int crypto_probing_notify(unsigned long val, void *v)
}
EXPORT_SYMBOL_GPL(crypto_probing_notify);

+/**
+ * crypto_alg_mod_lookup() - gets the algorithm module
+ * @name: text string containing name of algorithm
+ * @type: crypto type defined in include/linux/crypto.h
+ * @mask: mask of allowable crypto types (use or'd list
+ * of types as defined in include/linux/crypto.h)
+ * @returns: pointer to crypto_alg structure
+ */
struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask)
{
struct crypto_alg *alg;
--
1.6.3.3


2010-11-05 18:27:55

by Lee Nipper

[permalink] [raw]
Subject: Re: [PATCH 1/1] crypto: api.c: doc on crypto_alg_lookup, crypto_larval_lookup, and crypto_alg_mod_lookup

On Fri, Nov 5, 2010 at 13:05, Mark Allyn <[email protected]> wrote:
> Resubmit due to errors on patch submitted 11/4/2010
>
> Signed-off-by: Mark A. Allyn <[email protected]>
> ---
> ?crypto/api.c | ? 25 +++++++++++++++++++++++++
> ?1 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/crypto/api.c b/crypto/api.c
> index 033a714..d8a7c35 100644
> --- a/crypto/api.c
> +++ b/crypto/api.c
> @@ -193,6 +193,14 @@ static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg)
> ? ? ? ?return alg;
> ?}
>
> +/**
> + * crypto_alg_lookup() - get the crypto_alg structure for an algorithm
> + * @name: ? ? ?text string containing name of algorithm
> + * @type: ? ? ?crypto type defined in include/linux/crypto.h
> + * @mask: ? ? ?mask of allowable crypto types (use or'd list
> + * ? ? ? ? ? ? of types as defined in include/linux/crypto.h)
> + * @returns: ? pointer to crypto_alg structure
> + */
> ?struct crypto_alg *crypto_alg_lookup(const char *name, u32 type, u32 mask)
> ?{
> ? ? ? ?struct crypto_alg *alg;
> @@ -205,6 +213,15 @@ struct crypto_alg *crypto_alg_lookup(const char *name, u32 type, u32 mask)
> ?}
> ?EXPORT_SYMBOL_GPL(crypto_alg_lookup);
>
> +/**
> + * crypto_larval_lookup() - gets large value (larval) crypto_alg
> + * ? ? structure for an algorithm

larval is an adjective. omit "large value", as it only adds confusion.

> + * @name: ? ? ?text string containing name of algorithm
> + * @type: ? ? ?crypto type defined in include/linux/crypto.h
> + * @mask: ? ? ?mask of allowable crypto types (use or'd list
> + * ? ? ? ? ? ? of types as defined in include/linux/crypto.h)
> + * @returns: ? pointer to crypto_alg structure
> + */
> ?struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)
> ?{
> ? ? ? ?struct crypto_alg *alg;
> @@ -247,6 +264,14 @@ int crypto_probing_notify(unsigned long val, void *v)
> ?}
> ?EXPORT_SYMBOL_GPL(crypto_probing_notify);
>
> +/**
> + * crypto_alg_mod_lookup() - gets the algorithm module
> + * @name: ? ? ?text string containing name of algorithm
> + * @type: ? ? ?crypto type defined in include/linux/crypto.h
> + * @mask: ? ? ?mask of allowable crypto types (use or'd list
> + * ? ? ? ? ? ? of types as defined in include/linux/crypto.h)
> + * @returns: ? pointer to crypto_alg structure
> + */
> ?struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask)
> ?{
> ? ? ? ?struct crypto_alg *alg;
> --

2010-11-05 18:28:15

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH 1/1] crypto: api.c: doc on crypto_alg_lookup, crypto_larval_lookup, and crypto_alg_mod_lookup

On Fri, 5 Nov 2010 11:05:46 -0700 Mark Allyn wrote:

> Resubmit due to errors on patch submitted 11/4/2010
>
> Signed-off-by: Mark A. Allyn <[email protected]>

Acked-by: Randy Dunlap <[email protected]>

Thanks, Mark.


> ---
> crypto/api.c | 25 +++++++++++++++++++++++++
> 1 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/crypto/api.c b/crypto/api.c
> index 033a714..d8a7c35 100644
> --- a/crypto/api.c
> +++ b/crypto/api.c
> @@ -193,6 +193,14 @@ static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg)
> return alg;
> }
>
> +/**
> + * crypto_alg_lookup() - get the crypto_alg structure for an algorithm
> + * @name: text string containing name of algorithm
> + * @type: crypto type defined in include/linux/crypto.h
> + * @mask: mask of allowable crypto types (use or'd list
> + * of types as defined in include/linux/crypto.h)
> + * @returns: pointer to crypto_alg structure
> + */
> struct crypto_alg *crypto_alg_lookup(const char *name, u32 type, u32 mask)
> {
> struct crypto_alg *alg;
> @@ -205,6 +213,15 @@ struct crypto_alg *crypto_alg_lookup(const char *name, u32 type, u32 mask)
> }
> EXPORT_SYMBOL_GPL(crypto_alg_lookup);
>
> +/**
> + * crypto_larval_lookup() - gets large value (larval) crypto_alg
> + * structure for an algorithm
> + * @name: text string containing name of algorithm
> + * @type: crypto type defined in include/linux/crypto.h
> + * @mask: mask of allowable crypto types (use or'd list
> + * of types as defined in include/linux/crypto.h)
> + * @returns: pointer to crypto_alg structure
> + */
> struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)
> {
> struct crypto_alg *alg;
> @@ -247,6 +264,14 @@ int crypto_probing_notify(unsigned long val, void *v)
> }
> EXPORT_SYMBOL_GPL(crypto_probing_notify);
>
> +/**
> + * crypto_alg_mod_lookup() - gets the algorithm module
> + * @name: text string containing name of algorithm
> + * @type: crypto type defined in include/linux/crypto.h
> + * @mask: mask of allowable crypto types (use or'd list
> + * of types as defined in include/linux/crypto.h)
> + * @returns: pointer to crypto_alg structure
> + */
> struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask)
> {
> struct crypto_alg *alg;
> --

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

2010-11-05 18:36:45

by Allyn, Mark A

[permalink] [raw]
Subject: RE: [PATCH 1/1] crypto: api.c: doc on crypto_alg_lookup, crypto_larval_lookup, and crypto_alg_mod_lookup

Can you please explain what larval means in this context? I tried googling it an could not find anything meaningful.

What is the difference between crypto_alg_lookup and crypto_larval_lookup?

I was making an assumption that larval is shorthand for large value as there is nothing meaningful in google except for a type of wormlike form.

Thank you

Mark Allyn

-----Original Message-----
From: Lee Nipper [mailto:[email protected]]
Sent: Friday, November 05, 2010 11:28 AM
To: Allyn, Mark A
Cc: [email protected]
Subject: Re: [PATCH 1/1] crypto: api.c: doc on crypto_alg_lookup, crypto_larval_lookup, and crypto_alg_mod_lookup

On Fri, Nov 5, 2010 at 13:05, Mark Allyn <[email protected]> wrote:
> Resubmit due to errors on patch submitted 11/4/2010
>
> Signed-off-by: Mark A. Allyn <[email protected]>
> ---
> ?crypto/api.c | ? 25 +++++++++++++++++++++++++
> ?1 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/crypto/api.c b/crypto/api.c
> index 033a714..d8a7c35 100644
> --- a/crypto/api.c
> +++ b/crypto/api.c
> @@ -193,6 +193,14 @@ static struct crypto_alg *crypto_larval_wait(struct crypto_alg *alg)
> ? ? ? ?return alg;
> ?}
>
> +/**
> + * crypto_alg_lookup() - get the crypto_alg structure for an algorithm
> + * @name: ? ? ?text string containing name of algorithm
> + * @type: ? ? ?crypto type defined in include/linux/crypto.h
> + * @mask: ? ? ?mask of allowable crypto types (use or'd list
> + * ? ? ? ? ? ? of types as defined in include/linux/crypto.h)
> + * @returns: ? pointer to crypto_alg structure
> + */
> ?struct crypto_alg *crypto_alg_lookup(const char *name, u32 type, u32 mask)
> ?{
> ? ? ? ?struct crypto_alg *alg;
> @@ -205,6 +213,15 @@ struct crypto_alg *crypto_alg_lookup(const char *name, u32 type, u32 mask)
> ?}
> ?EXPORT_SYMBOL_GPL(crypto_alg_lookup);
>
> +/**
> + * crypto_larval_lookup() - gets large value (larval) crypto_alg
> + * ? ? structure for an algorithm

larval is an adjective. omit "large value", as it only adds confusion.

> + * @name: ? ? ?text string containing name of algorithm
> + * @type: ? ? ?crypto type defined in include/linux/crypto.h
> + * @mask: ? ? ?mask of allowable crypto types (use or'd list
> + * ? ? ? ? ? ? of types as defined in include/linux/crypto.h)
> + * @returns: ? pointer to crypto_alg structure
> + */
> ?struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)
> ?{
> ? ? ? ?struct crypto_alg *alg;
> @@ -247,6 +264,14 @@ int crypto_probing_notify(unsigned long val, void *v)
> ?}
> ?EXPORT_SYMBOL_GPL(crypto_probing_notify);
>
> +/**
> + * crypto_alg_mod_lookup() - gets the algorithm module
> + * @name: ? ? ?text string containing name of algorithm
> + * @type: ? ? ?crypto type defined in include/linux/crypto.h
> + * @mask: ? ? ?mask of allowable crypto types (use or'd list
> + * ? ? ? ? ? ? of types as defined in include/linux/crypto.h)
> + * @returns: ? pointer to crypto_alg structure
> + */
> ?struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask)
> ?{
> ? ? ? ?struct crypto_alg *alg;
> --

2010-11-05 19:57:05

by Lee Nipper

[permalink] [raw]
Subject: Re: [PATCH 1/1] crypto: api.c: doc on crypto_alg_lookup, crypto_larval_lookup, and crypto_alg_mod_lookup

On Fri, Nov 5, 2010 at 13:36, Allyn, Mark A <[email protected]> wrote:
> Can you please explain what larval means in this context? I tried googling it an could not find anything meaningful.
>
> What is the difference between crypto_alg_lookup and crypto_larval_lookup?
>

In the kernel crypto context,
I think larval means that the lookup
may load a module, if necessary, to provide support for the algorithm.

I defer to Herbert Xu for any further explanation.

2010-11-07 01:10:22

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 1/1] crypto: api.c: doc on crypto_alg_lookup, crypto_larval_lookup, and crypto_alg_mod_lookup

Allyn, Mark A <[email protected]> wrote:
>
> I was making an assumption that larval is shorthand for large value as there is nothing meaningful in google except for a type of wormlike form.

Larval means not fully grown in this context, i.e., the algorithm
that we've constructed will be filled in later to become a real
algorithm object.

Cheers,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt