If we're looking for something to drop in to Mesa to avoid a dependency maybe we could look at simpler hashing algorithms too. For the shader cache presumably we don't care about the hash being cryptographically secure, just that it is unlikely to *accidentally* make a hash collision. I think it would be fine to use MD5 in this case so one of these short implementations might be suitable:
http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 http://people.csail.mit.edu/rivest/Md5.c - Neil Emil Velikov <[email protected]> writes: > On 11/12/14 21:51, Carl Worth wrote: >> From: Kristian Høgsberg <[email protected]> >> >> The upcoming shader cache uses the SHA-1 algorithm for cryptographic >> naming. These new mesa_sha1 functions are implemented with the nettle >> library. >> --- >> >> This patch is another in support of my upcoming shader-cache work. Thanks to >> Kritian for coding this piece. >> >> As currently written, this patch introduces a new dependency of Mesa on the >> Nettle library to implement SHA-1. I'm open to recommendations if people >> would prefer some other option. >> >> For example, the xserver can be configured to get a SHA-1 implementation from >> libmd, libc, CommonCrypto, CryptoAPI, libnettle, libgcrypt, libsha1, or >> openssl. >> >> I don't know if it's important to offer as many options as that, which is why >> I'm asking for opinions here. >> > Hi Carl, > > Can we try to avoid adding new dependencies to mesa unless absolutely > needed. Neither of the proprietary drivers does so presently, so it will > be nice to keep the trend. > > While currently the steam runtime does not include libnettle I can > envision one day that they will/might. Even with steam aside I think > that this might cause issues with gnome & others' sandboxing. > > Long story short - can we import a sha1 implementation from another > project ? It will save us the "libstdc++ style steam runtime" issues, > plus it will ease the question of what to do under Windows :) > > > Thanks > Emil > > _______________________________________________ > mesa-dev mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/mesa-dev _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
