Re: [PATCH/proposal] dm-crypt: add digest-based iv generation mode

From: James Morris
Date: Tue Feb 24 2004 - 15:02:48 EST


On Tue, 24 Feb 2004, Matt Mackall wrote:

> Something like:
>
> /* calculate the size of a tfm so that users can manage their own
> copies */
>
> int crypto_alg_size(const char *name);
>
> /* copy a TFM to a user-managed buffer, possibly on stack, with proper
> internal reference counting and any other necessary magic, size checks
> against boneheaded buffer sizing */
>
> crypto_copy_tfm(char *dst, const struct crypto_tfm *src, int size);

Does it need to be copied from an existing tfm? I think it would be
cleaner to provide just a way to initialize a tfm.

> /* do all the necessary bookkeeping to release a user-managed TFM, use
> char pointer to avoid alloc/free mismatch */
>
> crypto_copy_cleanup_tfm(char *usertfm);
>

This is doable.


- James
--
James Morris
<jmorris@xxxxxxxxxx>


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