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