Skip to content
Snippets Groups Projects
  • da1l6's avatar
    e0e61f6f
    Fix hash head not correctly calculated on key slot init. · e0e61f6f
    da1l6 authored
    The buffer that was used to calculate it did not contain the current salt.
    Instead of creating a new buffer, we now use the sha1 block functions directly
    and hash key and salt in two calls.
    
    Additionally a ctx2hashhead function is added to convert only the first 4 bytes
    of the hash instead of converting all 20 bytes and throwing 16 bytes away afterwards.
    e0e61f6f
    History
    Fix hash head not correctly calculated on key slot init.
    da1l6 authored
    The buffer that was used to calculate it did not contain the current salt.
    Instead of creating a new buffer, we now use the sha1 block functions directly
    and hash key and salt in two calls.
    
    Additionally a ctx2hashhead function is added to convert only the first 4 bytes
    of the hash instead of converting all 20 bytes and throwing 16 bytes away afterwards.