[lkml]   [2004]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subjectcryptoapi OMAC (was: cryptoapi highmem bug)
    On Wed, Feb 25, 2004 at 11:09:35AM -0500, Jean-Luc Cooke wrote:

    > will work.

    It didn't compile. I fixed some compile problems so that it works.
    I have disabled CRYPTO_OMAC though. And it goes boom when calling
    hmac_init (or something like that), the machine halts without Oops.

    I've seen the cit_omac is kmalloc'ed. Hmm. Didn't we want to try
    to avoid that? Well. Perhaps it should be allocated when the
    omac_init is called and freed after omac_final.

    Or what about this:
    If the user wants OMAC he calls omac_init and passes a pointer to
    a buffer where the omac will be computed. omac_init then sets
    the omac_update function so that xxx_process will call it. After
    the encryption is finished the user calls omac_final and finds
    the omac in his buffer.

    And shouldn't the omac functions be put into a separate omac.c?

    Moving the scatterwalk functions seems like a good idea to me.

    Well, here are the compile fixes:

    diff -Nur linux.orig/crypto/cipher.c linux/crypto/cipher.c
    --- linux.orig/crypto/cipher.c 2004-02-25 18:58:22.955601768 +0100
    +++ linux/crypto/cipher.c 2004-02-25 18:59:30.970261968 +0100
    @@ -280,7 +280,7 @@
    /* mac = Zeros */
    memset((u8*)tfm->crt_u.cipher.cit_omac, 0, crypto_tfm_alg_blocksize(tfm));
    +#endif /* CONFIG_CRYPTO_OMAC */

    return ret;
    @@ -475,9 +475,12 @@
    ops->cit_iv = kmalloc(ops->cit_ivsize, GFP_KERNEL);
    if (ops->cit_iv == NULL)
    ret = -ENOMEM;
    ops->cit_omac = kmalloc(ops->cit_ivsize, GFP_KERNEL);
    if (ops->cit_omac == NULL)
    ret = -ENOMEM;
    +#endif /* CONFIG_CRYPTO_OMAC */

    @@ -499,5 +502,5 @@
    if (tfm->crt_cipher.cit_omac)
    +#endif /* CONFIG_CRYPTO_OMAC */
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at
     \ /
      Last update: 2005-03-22 14:01    [W:0.022 / U:5.740 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site