summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2006-09-11 18:29:45 +0200
committerMichael Brown2006-09-11 18:29:45 +0200
commit1ddfce2308e0d9c4babf383f142d6014f18023c8 (patch)
treeb9e6ff8a9960bc82af215cf89b90bf70321f1d76 /src
parentAdded geometry-guessing code based on the partition table (diff)
downloadipxe-1ddfce2308e0d9c4babf383f142d6014f18023c8.tar.gz
ipxe-1ddfce2308e0d9c4babf383f142d6014f18023c8.tar.xz
ipxe-1ddfce2308e0d9c4babf383f142d6014f18023c8.zip
Generalisation of a message digest algorithm
Diffstat (limited to 'src')
-rw-r--r--src/include/gpxe/crypto.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/include/gpxe/crypto.h b/src/include/gpxe/crypto.h
new file mode 100644
index 000000000..e2a728fda
--- /dev/null
+++ b/src/include/gpxe/crypto.h
@@ -0,0 +1,44 @@
+#ifndef _GPXE_CRYPTO_H
+#define _GPXE_CRYPTO_H
+
+/** @file
+ *
+ * Cryptographic API
+ *
+ */
+
+#include <stdint.h>
+
+/**
+ * A message-digest algorithm
+ *
+ */
+struct digest_algorithm {
+ /** Size of a context for this algorithm */
+ size_t context_len;
+ /** Size of a message digest for this algorithm */
+ size_t digest_len;
+ /**
+ * Initialise digest algorithm
+ *
+ * @v context Context for digest operations
+ */
+ void ( * init ) ( void *context );
+ /**
+ * Calculate digest over data buffer
+ *
+ * @v context Context for digest operations
+ * @v data Data buffer
+ * @v len Length of data buffer
+ */
+ void ( * update ) ( void *context, const void *data, size_t len );
+ /**
+ * Finish calculating digest
+ *
+ * @v context Context for digest operations
+ * @v digest Buffer for message digest
+ */
+ void ( * finish ) ( void *context, void *digest );
+};
+
+#endif /* _GPXE_CRYPTO_H */