LCOV - code coverage report
Current view: top level - third_party/heimdal/lib/hcrypto/libtommath - bn_mp_mulmod.c (source / functions) Hit Total Coverage
Test: coverage report for v4-17-test 1498b464 Lines: 7 9 77.8 %
Date: 2024-06-13 04:01:37 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include "tommath_private.h"
       2             : #ifdef BN_MP_MULMOD_C
       3             : /* LibTomMath, multiple-precision integer library -- Tom St Denis */
       4             : /* SPDX-License-Identifier: Unlicense */
       5             : 
       6             : /* d = a * b (mod c) */
       7         229 : mp_err mp_mulmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d)
       8             : {
       9             :    mp_err err;
      10             :    mp_int t;
      11             : 
      12         229 :    if ((err = mp_init_size(&t, c->used)) != MP_OKAY) {
      13           0 :       return err;
      14             :    }
      15             : 
      16         229 :    if ((err = mp_mul(a, b, &t)) != MP_OKAY) {
      17           0 :       goto LBL_ERR;
      18             :    }
      19         229 :    err = mp_mod(&t, c, d);
      20             : 
      21         229 : LBL_ERR:
      22         229 :    mp_clear(&t);
      23         229 :    return err;
      24             : }
      25             : #endif

Generated by: LCOV version 1.13