[PATCH CIFS] use CryptoAPI MD4/MD5

Erlend Aasland erlend-a at ux.his.no
Sun Oct 5 12:29:25 GMT 2003


On 10/04/03 11:51, dean gaudet wrote:
> this CIFS patch alone replaces 89 lines with 250 lines of code!
... you forgot that if we find a nice way to use the CryptoAPI, we can
remove the old md4/md5 code: that makes 631 lines of code go away!

> the code does not look anywhere near as readable as the original.  but perhaps
> that's just because i've dealt with the same trivial MD5Init/Update/Final
> API for years.
I agree that it could have been a bit more readable.

It is trivial to wrap the code that deals with the CryptoAPI into nice
"helper" functions. For example the cifs_do_hash() function does exactly
that. Putting scatterlist setup into one function will probably help a
lot on code readability and code size.

> i gather a lot of this comes from the desire to have run-time selectable
> sw and hw implementations of various algorithms for "optimal" performance.
> but there generally isn't an optimal algorithm for all situations.
> for small short digests like passwords it's probably more overhead to
> use the cryptoapi than is saved from any blindingly fast implementation
> behind the scenes.
True, I agree that it's perhaps a bit overkill. Anyway, this is just a
project for me to learn more about the kernel; it's not like I have a
burning desire to convert CIFS to use the CryptoAPI ;-)


More information about the samba-technical mailing list