mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-14 15:21:32 +00:00
Generalisation of a message digest algorithm
This commit is contained in:
parent
0566ab2a2f
commit
1ddfce2308
44
src/include/gpxe/crypto.h
Normal file
44
src/include/gpxe/crypto.h
Normal file
@ -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 */
|
Loading…
Reference in New Issue
Block a user