crypto/digest: simply state in oneshot calculation
parent
86da6dc599
commit
dea8ded23e
|
@ -93,7 +93,10 @@ uint8_t apk_digest_from_blob(struct apk_digest *d, apk_blob_t b)
|
||||||
|
|
||||||
int apk_digest_calc(struct apk_digest *d, uint8_t alg, const void *ptr, size_t sz)
|
int apk_digest_calc(struct apk_digest *d, uint8_t alg, const void *ptr, size_t sz)
|
||||||
{
|
{
|
||||||
union digest_state state;
|
union {
|
||||||
|
br_sha1_context sha1;
|
||||||
|
br_md5_context md5;
|
||||||
|
} state;
|
||||||
|
|
||||||
switch (alg) {
|
switch (alg) {
|
||||||
case APK_DIGEST_SHA256:
|
case APK_DIGEST_SHA256:
|
||||||
|
|
Loading…
Reference in New Issue