blake2_prov.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include <openssl/crypto.h>
  10. #include "prov/blake2.h"
  11. #include "prov/digestcommon.h"
  12. #include "prov/implementations.h"
  13. int ossl_blake2s256_init(void *ctx)
  14. {
  15. BLAKE2S_PARAM P;
  16. ossl_blake2s_param_init(&P);
  17. return ossl_blake2s_init((BLAKE2S_CTX *)ctx, &P);
  18. }
  19. int ossl_blake2b512_init(void *ctx)
  20. {
  21. BLAKE2B_PARAM P;
  22. ossl_blake2b_param_init(&P);
  23. return ossl_blake2b_init((BLAKE2B_CTX *)ctx, &P);
  24. }
  25. /* ossl_blake2s256_functions */
  26. IMPLEMENT_digest_functions(blake2s256, BLAKE2S_CTX,
  27. BLAKE2S_BLOCKBYTES, BLAKE2S_DIGEST_LENGTH, 0,
  28. ossl_blake2s256_init, ossl_blake2s_update,
  29. ossl_blake2s_final)
  30. /* ossl_blake2b512_functions */
  31. IMPLEMENT_digest_functions(blake2b512, BLAKE2B_CTX,
  32. BLAKE2B_BLOCKBYTES, BLAKE2B_DIGEST_LENGTH, 0,
  33. ossl_blake2b512_init, ossl_blake2b_update,
  34. ossl_blake2b_final)