hash_simple.c 315 B

1234567891011121314
  1. /*
  2. * Convenience function to hash a single piece of data, wrapping up
  3. * the faff of making and freeing an ssh_hash.
  4. */
  5. #include "ssh.h"
  6. void hash_simple(const ssh_hashalg *alg, ptrlen data, void *output)
  7. {
  8. ssh_hash *hash = ssh_hash_new(alg);
  9. put_datapl(hash, data);
  10. ssh_hash_final(hash, output);
  11. }