Use a shared helper function instead of implementing practically same sequence separately for each hash function. Signed-off-by: Jouni Malinen <j@w1.fi>