-uns
-encode_image_obj_signature(byte *buf, struct image_signature *sig)
-{
- /* signatures should be short enough to fit one attribute */
- byte tmp[sizeof(struct image_signature)];
- uns size = put_image_signature(tmp, sig);
- ASSERT(MAX_ATTR_SIZE > BASE224_ENC_LENGTH(size));
- uns len = base224_encode(buf, tmp, size);
- buf[len] = 0;
- return len;
-}
-
-uns
-decode_image_obj_signature(byte *buf, struct image_signature *sig)
-{
- if (!buf)
- return 0;
- byte tmp[sizeof(struct image_signature)];
- UNUSED uns size = base224_decode(tmp, buf, strlen(buf));
- ASSERT(size == image_signature_size(*tmp));
- get_image_signature(tmp, sig);
- return 1;
-}
-