summaryrefslogtreecommitdiffstats
path: root/src/crypto/axtls_sha1.c
blob: 3eb8912d323559de960c5da89b99ee8fcfd6e642 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "crypto/axtls/crypto.h"
#include <ipxe/crypto.h>
#include <ipxe/sha1.h>

static void sha1_init ( void *ctx ) {
	SHA1Init ( ctx );
}

static void sha1_update ( void *ctx, const void *data, size_t len ) {
	SHA1Update ( ctx, data, len );
}

static void sha1_final ( void *ctx, void *out ) {
	SHA1Final ( ctx, out );
}

struct digest_algorithm sha1_algorithm = {
	.name		= "sha1",
	.ctxsize	= SHA1_CTX_SIZE,
	.blocksize	= 64,
	.digestsize	= SHA1_DIGEST_SIZE,
	.init		= sha1_init,
	.update		= sha1_update,
	.final		= sha1_final,
};