LCOV - code coverage report
Current view: top level - third_party/heimdal/lib/hcrypto/libtommath - bn_mp_shrink.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 0 9 0.0 %
Date: 2024-04-21 15:09:00 Functions: 0 1 0.0 %

          Line data    Source code
       1             : #include "tommath_private.h"
       2             : #ifdef BN_MP_SHRINK_C
       3             : /* LibTomMath, multiple-precision integer library -- Tom St Denis */
       4             : /* SPDX-License-Identifier: Unlicense */
       5             : 
       6             : /* shrink a bignum */
       7           0 : mp_err mp_shrink(mp_int *a)
       8             : {
       9           0 :    mp_digit *tmp;
      10           0 :    int alloc = MP_MAX(MP_MIN_PREC, a->used);
      11           0 :    if (a->alloc != alloc) {
      12           0 :       if ((tmp = (mp_digit *) MP_REALLOC(a->dp,
      13             :                                          (size_t)a->alloc * sizeof(mp_digit),
      14             :                                          (size_t)alloc * sizeof(mp_digit))) == NULL) {
      15           0 :          return MP_MEM;
      16             :       }
      17           0 :       a->dp    = tmp;
      18           0 :       a->alloc = alloc;
      19             :    }
      20           0 :    return MP_OKAY;
      21             : }
      22             : #endif

Generated by: LCOV version 1.14