Notation/operator for bit-length function

27 Views Asked by At

Defining the bit-length function over natural numbers as $BL(n) = \left\lceil \log_2(n+1) \right\rceil $

What are common notations for such bit-length function? It is frequently denoted as $|n|$ in cryptography, but this would collide with the absolute value function $|x| = \left\{\begin{matrix} x \text{ if } x \geq 0 \\ -x \text{ if } x < 0 \end{matrix}\right.$

1

There are 1 best solutions below

0
On

The bit-length function of a natural number $n$ gives the length of the binary word representing $n$. For instance, the binary representation of $22$ is $10110$ so $BL(22) = 5$. Now, $|u|$ is a standard notation to denote the length of a word $u$ on a finite alphabet. Thus the notation used in cryptography is just a shortcut consisting of identifying an integer with its binary representation.

Note that there is little risk of confusion with the absolute value, since the absolute value of a natural number $n$ is $n$ and hence is probably not used in this context.