aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/crypto/crypto_null.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpxe/src/crypto/crypto_null.c')
-rw-r--r--gpxe/src/crypto/crypto_null.c62
1 files changed, 39 insertions, 23 deletions
diff --git a/gpxe/src/crypto/crypto_null.c b/gpxe/src/crypto/crypto_null.c
index 120ef0a6..8cc9217a 100644
--- a/gpxe/src/crypto/crypto_null.c
+++ b/gpxe/src/crypto/crypto_null.c
@@ -25,45 +25,61 @@
#include <string.h>
#include <gpxe/crypto.h>
-static void null_init ( void *ctx __unused ) {
+static void digest_null_init ( void *ctx __unused ) {
/* Do nothing */
}
-static int null_setkey ( void *ctx __unused, const void *key __unused,
- size_t keylen __unused ) {
+static void digest_null_update ( void *ctx __unused, const void *src __unused,
+ size_t len __unused ) {
/* Do nothing */
- return 0;
}
-static void null_setiv ( void *ctx __unused, const void *iv __unused ) {
+static void digest_null_final ( void *ctx __unused, void *out __unused ) {
/* Do nothing */
}
-static void null_encode ( void *ctx __unused, const void *src,
- void *dst, size_t len ) {
- if ( dst )
- memcpy ( dst, src, len );
-}
+struct digest_algorithm digest_null = {
+ .name = "null",
+ .ctxsize = 0,
+ .blocksize = 1,
+ .digestsize = 0,
+ .init = digest_null_init,
+ .update = digest_null_update,
+ .final = digest_null_final,
+};
-static void null_decode ( void *ctx __unused, const void *src,
- void *dst, size_t len ) {
- if ( dst )
- memcpy ( dst, src, len );
+static int cipher_null_setkey ( void *ctx __unused, const void *key __unused,
+ size_t keylen __unused ) {
+ /* Do nothing */
+ return 0;
}
-static void null_final ( void *ctx __unused, void *out __unused ) {
+static void cipher_null_setiv ( void *ctx __unused,
+ const void *iv __unused ) {
/* Do nothing */
}
-struct crypto_algorithm crypto_null = {
+static void cipher_null_encrypt ( void *ctx __unused, const void *src,
+ void *dst, size_t len ) {
+ memcpy ( dst, src, len );
+}
+
+static void cipher_null_decrypt ( void *ctx __unused, const void *src,
+ void *dst, size_t len ) {
+ memcpy ( dst, src, len );
+}
+
+struct cipher_algorithm cipher_null = {
.name = "null",
.ctxsize = 0,
.blocksize = 1,
- .digestsize = 0,
- .init = null_init,
- .setkey = null_setkey,
- .setiv = null_setiv,
- .encode = null_encode,
- .decode = null_decode,
- .final = null_final,
+ .setkey = cipher_null_setkey,
+ .setiv = cipher_null_setiv,
+ .encrypt = cipher_null_encrypt,
+ .decrypt = cipher_null_decrypt,
+};
+
+struct pubkey_algorithm pubkey_null = {
+ .name = "null",
+ .ctxsize = 0,
};