m_wp.c 790 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. static int init(EVP_MD_CTX *ctx)
  10. { return WHIRLPOOL_Init(ctx->md_data); }
  11. static int update(EVP_MD_CTX *ctx,const void *data,size_t count)
  12. { return WHIRLPOOL_Update(ctx->md_data,data,count); }
  13. static int final(EVP_MD_CTX *ctx,unsigned char *md)
  14. { return WHIRLPOOL_Final(md,ctx->md_data); }
  15. static const EVP_MD whirlpool_md=
  16. {
  17. NID_whirlpool,
  18. 0,
  19. WHIRLPOOL_DIGEST_LENGTH,
  20. 0,
  21. init,
  22. update,
  23. final,
  24. NULL,
  25. NULL,
  26. EVP_PKEY_NULL_method,
  27. WHIRLPOOL_BBLOCK/8,
  28. sizeof(EVP_MD *)+sizeof(WHIRLPOOL_CTX),
  29. };
  30. const EVP_MD *EVP_whirlpool(void)
  31. {
  32. return(&whirlpool_md);
  33. }
  34. #endif