1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
3 #include "tomcrypt_private.h"
4 
5 /**
6    @file pmac_ntz.c
7    PMAC implementation, internal function, by Tom St Denis
8 */
9 
10 #ifdef LTC_PMAC
11 
12 /**
13   Internal PMAC function
14 */
pmac_ntz(unsigned long x)15 int pmac_ntz(unsigned long x)
16 {
17    int c;
18    x &= 0xFFFFFFFFUL;
19    c = 0;
20    while ((x & 1) == 0) {
21       ++c;
22       x >>= 1;
23    }
24    return c;
25 }
26 
27 #endif
28