mirror of
https://github.com/ipxe/ipxe
synced 2025-12-28 02:28:57 +03:00
[crypto] Split crypto_algorithm into {digest,cipher,pubkey}_algorithm
The various types of cryptographic algorithm are fundamentally different, and it was probably a mistake to try to handle them via a single common type. pubkey_algorithm is a placeholder type for now.
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
* @v key Key
|
||||
* @v key_len Length of key
|
||||
*/
|
||||
static void hmac_reduce_key ( struct crypto_algorithm *digest,
|
||||
static void hmac_reduce_key ( struct digest_algorithm *digest,
|
||||
void *key, size_t *key_len ) {
|
||||
uint8_t digest_ctx[digest->ctxsize];
|
||||
|
||||
@@ -58,7 +58,7 @@ static void hmac_reduce_key ( struct crypto_algorithm *digest,
|
||||
* will be replaced with its own digest, and key_len will be updated
|
||||
* accordingly).
|
||||
*/
|
||||
void hmac_init ( struct crypto_algorithm *digest, void *digest_ctx,
|
||||
void hmac_init ( struct digest_algorithm *digest, void *digest_ctx,
|
||||
void *key, size_t *key_len ) {
|
||||
unsigned char k_ipad[digest->blocksize];
|
||||
unsigned int i;
|
||||
@@ -93,7 +93,7 @@ void hmac_init ( struct crypto_algorithm *digest, void *digest_ctx,
|
||||
* will be replaced with its own digest, and key_len will be updated
|
||||
* accordingly).
|
||||
*/
|
||||
void hmac_final ( struct crypto_algorithm *digest, void *digest_ctx,
|
||||
void hmac_final ( struct digest_algorithm *digest, void *digest_ctx,
|
||||
void *key, size_t *key_len, void *hmac ) {
|
||||
unsigned char k_opad[digest->blocksize];
|
||||
unsigned int i;
|
||||
|
||||
Reference in New Issue
Block a user