LCOV - code coverage report
Current view: top level - third_party/heimdal/lib/hcrypto/libtommath - bn_mp_abs.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 0 7 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_ABS_C
       3             : /* LibTomMath, multiple-precision integer library -- Tom St Denis */
       4             : /* SPDX-License-Identifier: Unlicense */
       5             : 
       6             : /* b = |a|
       7             :  *
       8             :  * Simple function copies the input and fixes the sign to positive
       9             :  */
      10           0 : mp_err mp_abs(const mp_int *a, mp_int *b)
      11             : {
      12           0 :    mp_err     err;
      13             : 
      14             :    /* copy a to b */
      15           0 :    if (a != b) {
      16           0 :       if ((err = mp_copy(a, b)) != MP_OKAY) {
      17           0 :          return err;
      18             :       }
      19             :    }
      20             : 
      21             :    /* force the sign of b to positive */
      22           0 :    b->sign = MP_ZPOS;
      23             : 
      24           0 :    return MP_OKAY;
      25             : }
      26             : #endif

Generated by: LCOV version 1.14