mirror of https://github.com/thesofproject/sof.git
hash: Remove old hash functions
Removed currently unused functions. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
This commit is contained in:
parent
d258ea23fc
commit
6c7a1512c6
58
src/hash.c
58
src/hash.c
|
@ -194,61 +194,3 @@ int hash_sha384(const void *data, size_t size, void *output, size_t output_len)
|
||||||
{
|
{
|
||||||
return hash_single(data, size, EVP_sha384(), output, output_len);
|
return hash_single(data, size, EVP_sha384(), output, output_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void module_sha256_create(struct image *image)
|
|
||||||
{
|
|
||||||
image->md = EVP_sha256();
|
|
||||||
image->mdctx = EVP_MD_CTX_new();
|
|
||||||
|
|
||||||
EVP_DigestInit_ex(image->mdctx, image->md, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void module_sha_update(struct image *image, uint8_t *data, size_t bytes)
|
|
||||||
{
|
|
||||||
EVP_DigestUpdate(image->mdctx, data, bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
void module_sha_complete(struct image *image, uint8_t *hash)
|
|
||||||
{
|
|
||||||
unsigned char md_value[EVP_MAX_MD_SIZE];
|
|
||||||
unsigned int md_len;
|
|
||||||
#if DEBUG_HASH
|
|
||||||
int i;
|
|
||||||
#endif
|
|
||||||
EVP_DigestFinal_ex(image->mdctx, md_value, &md_len);
|
|
||||||
EVP_MD_CTX_free(image->mdctx);
|
|
||||||
|
|
||||||
memcpy(hash, md_value, md_len);
|
|
||||||
#if DEBUG_HASH
|
|
||||||
fprintf(stdout, "Module digest is: ");
|
|
||||||
for (i = 0; i < md_len; i++)
|
|
||||||
fprintf(stdout, "%02x", md_value[i]);
|
|
||||||
fprintf(stdout, "\n");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void ri_sha256(struct image *image, unsigned int offset, unsigned int size,
|
|
||||||
uint8_t *hash)
|
|
||||||
{
|
|
||||||
assert((uint64_t)size + offset <= image->adsp->image_size);
|
|
||||||
module_sha256_create(image);
|
|
||||||
module_sha_update(image, image->fw_image + offset, size);
|
|
||||||
module_sha_complete(image, hash);
|
|
||||||
}
|
|
||||||
|
|
||||||
void module_sha384_create(struct image *image)
|
|
||||||
{
|
|
||||||
image->md = EVP_sha384();
|
|
||||||
image->mdctx = EVP_MD_CTX_new();
|
|
||||||
|
|
||||||
EVP_DigestInit_ex(image->mdctx, image->md, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ri_sha384(struct image *image, unsigned int offset, unsigned int size,
|
|
||||||
uint8_t *hash)
|
|
||||||
{
|
|
||||||
assert((uint64_t)size + offset <= image->adsp->image_size);
|
|
||||||
module_sha384_create(image);
|
|
||||||
module_sha_update(image, image->fw_image + offset, size);
|
|
||||||
module_sha_complete(image, hash);
|
|
||||||
}
|
|
||||||
|
|
|
@ -170,20 +170,11 @@ struct adsp {
|
||||||
int exec_boot_ldr;
|
int exec_boot_ldr;
|
||||||
};
|
};
|
||||||
|
|
||||||
void module_sha256_create(struct image *image);
|
|
||||||
void module_sha384_create(struct image *image);
|
|
||||||
void module_sha_update(struct image *image, uint8_t *data, size_t bytes);
|
|
||||||
void module_sha_complete(struct image *image, uint8_t *hash);
|
|
||||||
int ri_manifest_sign_v1_5(struct image *image);
|
int ri_manifest_sign_v1_5(struct image *image);
|
||||||
int ri_manifest_sign_v1_8(struct image *image);
|
int ri_manifest_sign_v1_8(struct image *image);
|
||||||
int ri_manifest_sign_v2_5(struct image *image);
|
int ri_manifest_sign_v2_5(struct image *image);
|
||||||
int ri_manifest_sign_ace_v1_5(struct image *image);
|
int ri_manifest_sign_ace_v1_5(struct image *image);
|
||||||
|
|
||||||
void ri_sha256(struct image *image, unsigned int offset, unsigned int size,
|
|
||||||
uint8_t *hash);
|
|
||||||
void ri_sha384(struct image *image, unsigned int offset, unsigned int size,
|
|
||||||
uint8_t *hash);
|
|
||||||
|
|
||||||
int pkcs_v1_5_sign_man_v1_5(struct image *image,
|
int pkcs_v1_5_sign_man_v1_5(struct image *image,
|
||||||
struct fw_image_manifest_v1_5 *man,
|
struct fw_image_manifest_v1_5 *man,
|
||||||
void *ptr1, unsigned int size1);
|
void *ptr1, unsigned int size1);
|
||||||
|
|
Loading…
Reference in New Issue