]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
* des.c (des_encrypt, des_decrypt): Assert that the key setup was
authorNiels Möller <nisse@lysator.liu.se>
Mon, 11 Jun 2001 23:51:39 +0000 (01:51 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 11 Jun 2001 23:51:39 +0000 (01:51 +0200)
successful.

Rev: src/nettle/des.c:1.2

des.c

diff --git a/des.c b/des.c
index 365113c0ede6778cc6394cf775f0fda5fd169f95..ce25f8ac23e07fb450597861e71a839914ca3a60 100644 (file)
--- a/des.c
+++ b/des.c
@@ -209,7 +209,8 @@ des_encrypt(struct des_ctx *ctx,
            const uint8_t *src)
 {
   assert(!(length % DES_BLOCK_SIZE));
-
+  assert(ctx->status == DES_OK);
+  
   while (length)
     {
       DesSmallFipsEncrypt(dst, ctx->key, src);
@@ -225,6 +226,7 @@ des_decrypt(struct des_ctx *ctx,
            const uint8_t *src)
 {
   assert(!(length % DES_BLOCK_SIZE));
+  assert(ctx->status == DES_OK);
 
   while (length)
     {