LCOV - code coverage report
Current view: top level - third_party/heimdal/lib/hcrypto/libtommath - bn_mp_signed_rsh.c (source / functions) Hit Total Coverage
Test: coverage report for master 70ed9daf Lines: 0 9 0.0 %
Date: 2024-01-11 09:59:51 Functions: 0 1 0.0 %

          Line data    Source code
       1             : #include "tommath_private.h"
       2             : #ifdef BN_MP_SIGNED_RSH_C
       3             : /* LibTomMath, multiple-precision integer library -- Tom St Denis */
       4             : /* SPDX-License-Identifier: Unlicense */
       5             : 
       6             : /* shift right by a certain bit count with sign extension */
       7           0 : mp_err mp_signed_rsh(const mp_int *a, int b, mp_int *c)
       8             : {
       9           0 :    mp_err res;
      10           0 :    if (a->sign == MP_ZPOS) {
      11           0 :       return mp_div_2d(a, b, c, NULL);
      12             :    }
      13             : 
      14           0 :    res = mp_add_d(a, 1uL, c);
      15           0 :    if (res != MP_OKAY) {
      16           0 :       return res;
      17             :    }
      18             : 
      19           0 :    res = mp_div_2d(c, b, c, NULL);
      20           0 :    return (res == MP_OKAY) ? mp_sub_d(c, 1uL, c) : res;
      21             : }
      22             : #endif

Generated by: LCOV version 1.14