lkml.org 
[lkml]   [2004]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH/proposal] dm-crypt: add digest-based iv generation mode
    On Tue, 24 Feb 2004, Jean-Luc Cooke wrote:

    > On Tue, Feb 24, 2004 at 05:17:12PM -0500, James Morris wrote:
    > > On Tue, 24 Feb 2004, Jean-Luc Cooke wrote:
    > >
    > > > The two patches are:
    > > > - http://jlcooke.ca/lkml/ctr_and_omac.patch
    > > > (added ctr to cipher.c and omac.c)
    > > > Using the init/update/final interface.
    > > > - http://jlcooke.ca/lkml/ctr_and_omac2.patch
    > > > (added ctr to cipher.c and integrated OMAC into all
    > > > existing modes of operation. If cipher_tfm.cit_omac!=NULL, OMAC is stored
    > > > into cipher_tfm.cit_omac)
    > >
    > > Looks good so far, although the duplicated scatterwalk code needs to be
    > > put into a separate file (e.g. scatterwalk.c).
    >
    > OK. So which patch do you want? :) The omac.c with scatterwalk, or the
    > cipher.c with omac performed in-place when needed?

    I think the latter is preferrable. OMAC should probably be a config
    option as well.

    >
    > > > ps. Will crypto_cipher_encrypt/crypto_cipher_decrypt *always* be called in
    > > > onesies? I need to perform come final() code on the OMAC before it's
    > > > ready to pass test vectors - how do I know when we're done?
    > >
    > > I don't understand what you mean here.
    >
    > finish_omac() needs to be called once all data is processed. How do I know
    > for sure the caller is done with this cipher context instance?
    >
    > For example:
    > loop {
    > /* get more data into sgin */
    > crypto_cipher_encrypt(tfm, sgout, sgin, len);
    > /* send our data out of sgout */
    > }
    > /* get the 128bit OMAC and send it since we're done with all our encryption */
    >
    > And decryption:
    > loop {
    > /* get more data into sgin */
    > crypto_cipher_decrypt(tfm, sgout, sgin, len);
    > /* send our data out of sgout */
    > }
    > /* get the 128bit OMAC and compare it with transmitted OMAC since we're done
    > with all our decryption */
    >
    > There is no explicit/implicit "crypto_cipher_encrypt_final()" to inform the
    > API to finalise the OMAC.

    You could add something like crypto_cipher_omac_final(), to be used by the
    calling code once it needs the OMAC value, which then calls
    crypto_cipher_get_omac().


    - James
    --
    James Morris
    <jmorris@redhat.com>


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:01    [W:0.026 / U:0.040 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site