You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

axtls_sha1.c 561B

1234567891011121314151617181920212223242526
  1. #include "crypto/axtls/crypto.h"
  2. #include <gpxe/crypto.h>
  3. #include <gpxe/sha1.h>
  4. static void sha1_init ( void *ctx ) {
  5. SHA1Init ( ctx );
  6. }
  7. static void sha1_update ( void *ctx, const void *data, void *dst __unused,
  8. size_t len ) {
  9. SHA1Update ( ctx, data, len );
  10. }
  11. static void sha1_final ( void *ctx, void *out ) {
  12. SHA1Final ( ctx, out );
  13. }
  14. struct crypto_algorithm sha1_algorithm = {
  15. .name = "sha1",
  16. .ctxsize = SHA1_CTX_SIZE,
  17. .blocksize = 64,
  18. .digestsize = SHA1_DIGEST_SIZE,
  19. .init = sha1_init,
  20. .encode = sha1_update,
  21. .final = sha1_final,
  22. };