diff --git a/seccure/aes256ctr.c b/seccure/aes256ctr.c index 8c8fa92..86b82a4 100644 --- a/seccure/aes256ctr.c +++ b/seccure/aes256ctr.c @@ -84,14 +84,16 @@ void aes256ctr_enc(struct aes256ctr *ac, char *buf, int len) full_blocks = (len / CIPHER_BLOCK_SIZE) * CIPHER_BLOCK_SIZE; err = gcry_cipher_encrypt(ac->ch, buf, full_blocks, NULL, 0); - assert(! gcry_err_code(err)); + if (gcry_err_code(err)) + abort(); len -= full_blocks; buf += full_blocks; if (len) { memset(ac->buf, 0, CIPHER_BLOCK_SIZE); err = gcry_cipher_encrypt(ac->ch, ac->buf, CIPHER_BLOCK_SIZE, NULL, 0); - assert(! gcry_err_code(err)); + if (gcry_err_code(err)) + abort(); ac->idx = 0; for(; len && (ac->idx < CIPHER_BLOCK_SIZE); len--) diff --git a/seccure/ecc.c b/seccure/ecc.c index 5d1076c..982fb21 100644 --- a/seccure/ecc.c +++ b/seccure/ecc.c @@ -125,7 +125,8 @@ int point_decompress(struct affine_point *p, const gcry_mpi_t x, int yflag, else gcry_mpi_sub(p->y, dp->m, y); rc = point_on_curve(p, dp); - assert(rc); + if (!rc) + abort(); } gcry_mpi_release(h); gcry_mpi_release(y); @@ -370,7 +371,8 @@ struct affine_point pointmul(const struct affine_point *p, R = jacobian_to_affine(&r, dp); jacobian_release(&r); rc = point_on_curve(&R, dp); - assert(rc); + if (!rc) + abort(); return R; }