Re: [RFC] CryptoAPI & Compression

Artem B. Bityuckiy
2005-03-31T10:44:22Z

Hello Herbert,

> The GNU coding style is completely different from Linux.
Ok, NP.

> Please reformat it when you fix up the overhead calculation.
Sure.

> Good catch. I'll apply this one.
Only one small note: I've spotted this but didn't test. I didn't make
sure this is OK if we haven't ever used the compression and remove the
deflate module. (i.e, in this case we call zlib_[in|de]flateEnd() while
we haven't ever called zlib_[in|de]flate()). Although I believe it must
be OK, we need to try it.

So please, test it or wait while I'll do it.

> The crypto API needs to operate on buffers that's bigger than that so
> we need to have a correct upper bound the maximum expansion.
Well, I'm still not sure. I guess that we call deflate with Z_SYNC_FLUSH
so most data is already in the output buffer and we only need to provide
some room for end markers and the like at the final Z_FINISH call. And I
guess 12 bytes is enough. But again, this is only my guess. I need to
delve into zlib internals to explore this.

So, it seems I can't just port the JFFS2 stuff. I need to explore zlib
more closely. Thus, I need some time. I'll inform you about my results.

> I believe this bit of code originally came from FreeS/WAN and was
> written by Svenning Srensen. Maybe he or Yoshifuji-san can tell
> us why?
If you find some information about the issue, please, let me know.