1 // SPDX-License-Identifier: BSD-2-Clause
2 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3  *
4  * LibTomCrypt is a library that provides various cryptographic
5  * algorithms in a highly modular and flexible manner.
6  *
7  * The library is free for all purposes without any express
8  * guarantee it works.
9  */
10 #include "tomcrypt_private.h"
11 
12 /**
13    @file pmac_ntz.c
14    PMAC implementation, internal function, by Tom St Denis
15 */
16 
17 #ifdef LTC_PMAC
18 
19 /**
20   Internal PMAC function
21 */
pmac_ntz(unsigned long x)22 int pmac_ntz(unsigned long x)
23 {
24    int c;
25    x &= 0xFFFFFFFFUL;
26    c = 0;
27    while ((x & 1) == 0) {
28       ++c;
29       x >>= 1;
30    }
31    return c;
32 }
33 
34 #endif
35 
36 /* ref:         $Format:%D$ */
37 /* git commit:  $Format:%H$ */
38 /* commit time: $Format:%ai$ */
39