Drop reusability of digest context 24/77024/2
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Tue, 28 Jun 2016 09:33:57 +0000 (11:33 +0200)
committerLukasz Pawelczyk <l.pawelczyk@samsung.com>
Tue, 28 Jun 2016 14:27:25 +0000 (16:27 +0200)
Adding reusability to sign/encrypt contexts proved to be too difficult
and prone to errors for the feature to be worth altogether.

Change-Id: I5aaf1db54c482950cb00079e488433c35b5e1b1b

api/yaca/yaca_digest.h
src/digest.c

index f45f25b..0aac56c 100644 (file)
@@ -87,10 +87,6 @@ int yaca_digest_update(yaca_context_h ctx, const char *data, size_t data_len);
  *
  * @since_tizen 3.0
  *
- * @remarks  After returning from this function the context is ready to be reused for another
- *           message digest calculation. There's no need to initialize it again with
- *           yaca_digest_initialize().
- *
  * @remarks  Skipping yaca_digest_update() and calling only yaca_digest_finalize() will produce an
  *           empty message digest.
  *
index 6062a2b..b003e97 100644 (file)
@@ -204,14 +204,6 @@ API int yaca_digest_finalize(yaca_context_h ctx, char *digest, size_t *digest_le
                return ret;
        }
 
-       /* Make it reusable */
-       ret = c->mdctx->digest->init(c->mdctx);
-       if (ret != 1) {
-               ret = YACA_ERROR_INTERNAL;
-               ERROR_DUMP(ret);
-               return ret;
-       }
-
        *digest_len = len;
 
        return YACA_ERROR_NONE;