home / posts

Vector Encodings for Inner Product Predicates

Vector Encoding Schemes

In (key-policy) attribute-based encryption (ABE) and predicate encryption (PE) a ciphertext is associated with an attribute $a$ and the ciphertext can only be decrypted if a party has a secret key for a predicate $f$ such that $f(a) = 1$. In the former, the attribute is public whereas in the latter, the attribute is hidden. Inner product predicates are a powerful class of predicates that are supported by several schemes, starting with the PE scheme of Katz, Sahai and Waters [1]. With inner product predicates, an attribute $a$ corresponds to a vector $\mathbf{x}_a \in \mathbb{Z}_q^n$ and a predicate $f$ corresponds to a vector $\mathbf{y}_f \in \mathbb{Z}_q^n$ and it holds that $f(a) = 1$ if and only if $\langle\mathbf{x}_a, \mathbf{y}_f \rangle \equiv 0 \mod{q}$ where the notation $\langle \cdot, \cdot \rangle$ denotes the inner product of the two vectors. Now this turns out to be quite an expressive notion as many families of predicates can be realized. For each class of predicates, an encoding must be devised to map an attribute $a$ to a vector $\mathbf{x}_a \in \mathbb{Z}_q^n$ for some dimension $n$ and modulus $q$. In addition the encoding specifies how a policy $f$ is encoded to a vector $\mathbf{y}_f \in \mathbb{Z}_q^n$. In this post, I examine such vector encodings. An interesting paper to read concerning vector encodings for various classes of predicates is [2]. This paper studies the complexity of $n$ and $q$ for several classes of widely-used predicates. We now formalize the notion of a vector encoding for inner product predicates. From now on, we omit the mod $q$ and assume that all arithmetic is performed in $\mathbb{Z}_q$.

1. A vector encoding scheme $\mathcal{E}_{\mathbb{F}, \mathbb{A}}$ for a class of predicates $\mathbb{F}$ and a set of attributes $\mathbb{A}$ is a tuple of probabilistic polynomial time (PPT) algorithms defined as folows:
2. Encoding Equivalence: Two encodings $\mathbb{x} \in X$ and $\mathbb{x'} \in X$ are said to be equivalent, denoted by $\mathbb{x} \equiv \mathbb{x'}$, if and only if for all $f \in \mathbb{F}$ and all $\mathbb{y}_f \in Y_f$, it holds that $$ \langle \mathbb{x}, \mathbb{y}_f \rangle = 0 \iff \langle \mathbb{x'}, \mathbb{y}_f \rangle = 0.$$


For any attribute $a \in \mathbb{A}$ and encoding $\mathbb{x}_a \in X_a$, and any predicate $f \in \mathbb{F}$ and encoding $\mathbb{y}_f \in Y_f$, the following properties hold:

  1. $f(a) \iff \langle \mathbb{x}_a, \mathbb{y}_f \rangle = 0$
  2. For any $r \in \mathbb{Z}_q$, we have $r \cdot \mathbb{x}_a \in X_a$ and $r \cdot \mathbb{y}_f \in Y_f$.
  3. $(X, +)$ is an additive group which has $(X_a, +)$ as a subgroup.
  4. For any $a' \in \mathbb{A}$ and $\mathbb{x}_{a'} \in X_{a'}$. it holds that $$ \mathbb{x}_a + \mathbb{x}_{a'} \equiv \mathbb{x}_{a \odot a'} $$ where $\mathbb{x}_{a \odot a'} \in X_{a \odot a'}$ is an encoding of $a \odot a'$ where $(\mathbb{A}, \odot)$ is a semilattice.

Note that property 4 is of relevance only to homomorphic schemes - if this is of interest, see [3] and my previous post.

Matching Words over a "Large" Alphabet

I'm not sure if the encoding below has already been described somewhere else; I have personally not come across it. It is quite simple and natural, and may be useful.

Let $\Sigma$ be an alphabet of size $m = |\Sigma|$. For the encoding we present below, we allow $m$ to be superpolynomial in $\lambda$. Consider attributes that are words in $\Sigma^\ast$ of length at most $\ell$. Therefore, we define the set of attributes as $$\mathbb{A} := \{w \in \Sigma^\ast : |w| \leq \ell\}.$$ A predicate is associated with a pattern which consists of a mix of symbols from $\Sigma$ and wildcards or "don't cares", signified with the special symbol $\ast$. At some position $i$, a symbol from $\Sigma$ in the pattern at that position matches only that exact symbol in the attribute word occurring at that position whereas if the wildcard symbol appears at position $i$ in the pattern, it matches any symbol in the attribute word occurring at that position. Formally, the set of predicates is thus defined $$ \mathbb{F} := \{\mathsf{match}_p : p \in (\Sigma \cup \{\ast\})^\ell\}$$ where the predicate $\mathsf{match}_p$ is defined as follows $$\mathsf{match}_p(w) = \bigwedge_{i \in [\ell]} (p_i = \ast) \lor (i \leq |w| \land p_i = w_i).$$

Now we give the vector encoding scheme for such a pair $(\mathbb{F}, \mathbb{A})$.

Note that in the above encoding for predicates, the statement $y_i \gets \psi(p_i)^{-1}$ means that we are setting $y_i$ to the inverse element in $\mathbb{Z}_q$ of the element $\psi(p_i)$; in particular, it does not refer to inverting the map $\psi$ (which we would alternately write as $\psi^{-1}$). Furthermore, the variable $k$ signifies the number of non-wildcard symbols in the pattern $p$.

So that's it for now. I dont' have much else to say about vector encodings for the moment.


  1. Predicate Encryption Supporting Disjunctions, Polynomial Equations, and Inner Products.. Jonathan Katz, Amit Sahai and Brent Waters. EUROCRYPT. 2008.
  2. On the Inner Product Predicate and a Generalization of Matching Vector Families.. Balthazar Bauer, Jevgenijs Vihrovs and Hoeteck Wee. IACR Cryptology ePrint Archive. 2018.
  3. A Note on Attribute-Based Group Homomorphic Encryption.Michael Clear and Ciaran McGoldrick. Cryptology ePrint Archive, Report 2017/752. 2017.
Raw form (ExtMarkdown)