m_wp.c 812 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* crypto/evp/m_wp.c */
  2. #include <stdio.h>
  3. #include "cryptlib.h"
  4. #ifndef OPENSSL_NO_WHIRLPOOL
  5. #include <openssl/evp.h>
  6. #include <openssl/objects.h>
  7. #include <openssl/x509.h>
  8. #include <openssl/whrlpool.h>
  9. #include "evp_locl.h"
  10. static int init(EVP_MD_CTX *ctx)
  11. { return WHIRLPOOL_Init(ctx->md_data); }
  12. static int update(EVP_MD_CTX *ctx,const void *data,size_t count)
  13. { return WHIRLPOOL_Update(ctx->md_data,data,count); }
  14. static int final(EVP_MD_CTX *ctx,unsigned char *md)
  15. { return WHIRLPOOL_Final(md,ctx->md_data); }
  16. static const EVP_MD whirlpool_md=
  17. {
  18. NID_whirlpool,
  19. 0,
  20. WHIRLPOOL_DIGEST_LENGTH,
  21. 0,
  22. init,
  23. update,
  24. final,
  25. NULL,
  26. NULL,
  27. EVP_PKEY_NULL_method,
  28. WHIRLPOOL_BBLOCK/8,
  29. sizeof(EVP_MD *)+sizeof(WHIRLPOOL_CTX),
  30. };
  31. const EVP_MD *EVP_whirlpool(void)
  32. {
  33. return(&whirlpool_md);
  34. }
  35. #endif