5

I've seen := used in several cryptography papers where the this symbol has been used instead of assignment operator ($ \leftarrow $ ) or equal sign (=), but never with an accompanying explanation. It's not exactly possible to search the precise meaning of operator ":= ". What is the exact meaning of this symbol in terms of mathematics in cryptography is concerned.

Sumit Jaiswal
  • 63
  • 1
  • 1
  • 9

2 Answers2

8

Lindell and Katz, in their book Introduction to Modern Cryptography, use;

  • $\leftarrow$ as possibly probabilistic process assignment.

    Some others use $\stackrel{r}{\gets}$, $\stackrel{\\\$}{\gets}$, $\gets_{R}$, and $\gets_{\\\$} $

    Actually, the $\gets_{\\\$}$ fairly common.

  • $:=$ for the deterministic process assignment.

    In some context, the $\leftarrow$ can be the same as Lindell and Katz 's $:=$. This former is more common. In some contexts, it is $=$

  • $=$ for equality


  • $\stackrel{def}{=}$ for defining a variable.

More on $\leftarrow$ and variants

  • When $X$ is a value, the $x \leftarrow X$ is used for deterministic assignment, and

  • When $X$ is a probability distribution, the $x \leftarrow X$ is used for sampling.

  • When $X$ is a set, the $x \leftarrow_R X$ is used to denote sampling from the uniform distribution over the set $X$.


Note:

  • In reading books, one needs to check the existence of the notation page(s) or the notation section. Many good books have a section like L&K's Index of Common Notation section (page #533 in the second edition).
  • In the articles, the authors usually define them where they first occur, therefore, look for the first occurrence of the symbol.
kelalaka
  • 49,797
  • 12
  • 123
  • 211
7

There is not a single standard for pseudocode. The := operator is the assignment operator from Pascal, a programming language which was in widespread usage in the 1970s and 1980s, especially for teaching purposes. Many academics have thus been exposed to Pascal and remember it. In Pascal, the equality comparison is =, which matches mathematical practice.

By comparison, the C language (and languages that build on its syntactic conventions, including Java, C# and Javascript) uses = for assignment, thus requiring a distinct operator (==) for equality comparison.

Nowadays, article writers tend to use the left arrow ($\leftarrow$) for assignment (or even a right arrow, with the destination on the right), which is more intuitive for the reader and does not require background knowledge of Pascal, but it is less easy to type on a keyboard. Old-timers, who know Pascal and wrote articles before the generalization of LaTeX, tend to favour the := operator.

Thomas Pornin
  • 88,324
  • 16
  • 246
  • 315