diff options
author | Michael Brown | 2007-01-31 13:24:01 +0100 |
---|---|---|
committer | Michael Brown | 2007-01-31 13:24:01 +0100 |
commit | c1aa1d0764113ee108acf47d1ddb42dbf2880a76 (patch) | |
tree | a7d98e0c69bfe10a136339110a6951e414f23361 /src/crypto | |
parent | Adding missing include (diff) | |
download | ipxe-c1aa1d0764113ee108acf47d1ddb42dbf2880a76.tar.gz ipxe-c1aa1d0764113ee108acf47d1ddb42dbf2880a76.tar.xz ipxe-c1aa1d0764113ee108acf47d1ddb42dbf2880a76.zip |
Add wrapper around axtls' sha1 code
Diffstat (limited to 'src/crypto')
-rw-r--r-- | src/crypto/axtls_sha1.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/crypto/axtls_sha1.c b/src/crypto/axtls_sha1.c new file mode 100644 index 00000000..17c08797 --- /dev/null +++ b/src/crypto/axtls_sha1.c @@ -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, +}; |