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

          Line data    Source code
       1             : #include "tommath_private.h"
       2             : #ifdef BN_MP_INIT_COPY_C
       3             : /* LibTomMath, multiple-precision integer library -- Tom St Denis */
       4             : /* SPDX-License-Identifier: Unlicense */
       5             : 
       6             : /* creates "a" then copies b into it */
       7        3682 : mp_err mp_init_copy(mp_int *a, const mp_int *b)
       8             : {
       9         164 :    mp_err     err;
      10             : 
      11        3682 :    if ((err = mp_init_size(a, b->used)) != MP_OKAY) {
      12           0 :       return err;
      13             :    }
      14             : 
      15        3682 :    if ((err = mp_copy(b, a)) != MP_OKAY) {
      16           0 :       mp_clear(a);
      17             :    }
      18             : 
      19        3518 :    return err;
      20             : }
      21             : #endif

Generated by: LCOV version 1.14