mirror of
https://github.com/xcat2/xNBA.git
synced 2025-01-26 19:09:09 +00:00
Add wrapper around axtls' sha1 code
This commit is contained in:
parent
869f9bcb23
commit
c1aa1d0764
26
src/crypto/axtls_sha1.c
Normal file
26
src/crypto/axtls_sha1.c
Normal file
@ -0,0 +1,26 @@
|
||||
#include "crypto/axtls/crypto.h"
|
||||
#include <gpxe/crypto.h>
|
||||
#include <gpxe/sha1.h>
|
||||
|
||||
static void sha1_init ( void *ctx ) {
|
||||
SHA1Init ( ctx );
|
||||
}
|
||||
|
||||
static void sha1_update ( void *ctx, const void *data, void *dst __unused,
|
||||
size_t len ) {
|
||||
SHA1Update ( ctx, data, len );
|
||||
}
|
||||
|
||||
static void sha1_final ( void *ctx, void *out ) {
|
||||
SHA1Final ( ctx, out );
|
||||
}
|
||||
|
||||
struct crypto_algorithm sha1_algorithm = {
|
||||
.name = "sha1",
|
||||
.ctxsize = sizeof ( SHA1_CTX ),
|
||||
.blocksize = 64,
|
||||
.digestsize = SHA1_SIZE,
|
||||
.init = sha1_init,
|
||||
.encode = sha1_update,
|
||||
.final = sha1_final,
|
||||
};
|
8
src/include/gpxe/sha1.h
Normal file
8
src/include/gpxe/sha1.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef _GPXE_SHA1_H
|
||||
#define _GPXE_SHA1_H
|
||||
|
||||
struct crypto_algorithm;
|
||||
|
||||
extern struct crypto_algorithm sha1_algorithm;
|
||||
|
||||
#endif /* _GPXE_SHA1_H */
|
Loading…
x
Reference in New Issue
Block a user