# Difference between symmetric and asymmetric hash function?

The Linux kernel supports symmetric and asymmetric hash functions. E.g. sha1, sha256, ...

See tcrypt.c and search for test_hash_speed and test_ahash_speed.

I know what the difference is between symmetric and asymmetric ciphers, where the encryption and decryption key is not the same.

Question

What is the difference between symmetric and asymmetric hash functions?

-
Can you provide some source for that claim? I've never heard of asymmetric hash functions. Hashes like SHA-x are unkeyed and symmetric. –  CodesInChaos Dec 30 '12 at 18:00
There is symmetric(AES) and asymmetric(RSA) encryption. And there is symmetric authentication(MAC) and asymmetric authentication(RSA signatures). Many authentication schemes use hashes, but they aren't hashes. –  CodesInChaos Dec 30 '12 at 18:01
That isn't about asymmetric hashes, but about asynchronous implementations of symmetric hashes. The code doesn't contain the word asymmetric anywhere. | Async in that context means that you order some computation, then do something else, and once the computation is finished(probably on another thread) you receive the result. –  CodesInChaos Dec 30 '12 at 18:45

Hashes like SHA-x are symmetric and unkeyed. I have never heard of asymmetric hashes.

Your question is based on a misunderstanding. You can implement computations in an asynchronous fashion, where you request some computation, then your thread is free to do something else, and at some later point when the computation is finished you do something with the result. The code file you link implements hash functions in an asynchronous fashion.

Async/asynchronous and asymmetric are not related in any way.

-

It is probably not the case of your example, but in some sense "asymmetric hash functions" do exists: they are called trapdoor hash functions (or also chameleon hash functions).

Very briefly, they are collision resistant only if you don't know their trapdoor secret key. Such functions take 2 arguments (instead of the usual one), and the second argument is used as randomness.

So, without the trapdoor secret key it is infeasible to find 2 "messages" $m_1,m_2$ and 2 randomness values $r_1,r_2$ such that $H(m_1,r_1)=H(m_2,r_2)$; while, with the trapdoor key, you can efficiently compute (for any given triple $m_1,m_2,r_1$) a value $r_2$ such that $H(m_1,r_1)=H(m_2,r_2)$.

Hope this is clear enough. If you want, you can also see this article by Shamir and Tauman or this one by Krawczyk and T Rabin

-