---
title: Function-Hiding Inner-Product Techniques
url: https://www.emergentmind.com/topics/function-hiding-inner-product-techniques
type: topic
---

# Function-Hiding Inner-Product Techniques

Function-hiding inner-product techniques are a class of functional encryption methods in which decryption reveals only an inner product $\langle \boldsymbol{x}, \boldsymbol{y} \rangle$ while intending to hide both the encrypted vector $\boldsymbol{y}$ and the function vector $\boldsymbol{x}$. In the pairing-based setting examined in "Privacy-Preserving Edge Computing from Pairing-Based Inner Product Functional Encryption" [2504.02068], the relevant technique is function-hiding inner product encryption (FHIPE), instantiated not through a new cryptographic construction but through an efficient implementation of the scheme of Kim et al. (SCN 2018) on the BLS12-381 pairing-friendly elliptic curve. The resulting framework positions FHIPE as a practical primitive for privacy-preserving edge computing, especially when the computation can be expressed as a bounded inner product.

## 1. Functional-encryption setting and the meaning of function hiding

Functional encryption (FE) is organized around the principle that decryption should reveal a prescribed function of encrypted data rather than the data itself. Within FE, inner-product encryption (IPE) specializes to the case where ciphertexts encrypt a vector $\boldsymbol{y}$, secret or functional keys encode a vector $\boldsymbol{x}$, and decryption returns the inner product
\[
\langle \boldsymbol{x}, \boldsymbol{y} \rangle.
\]
The function-hiding variant, FHIPE, is the form in which both vectors are intended to remain hidden and only the inner product is revealed [2504.02068].

The deployment model described in the paper is a two-party style computation. An encryptor holds a private input vector $\boldsymbol{y}$, a decryptor holds a functional key corresponding to a private function vector $\boldsymbol{x}$, and decryption reveals only $\langle \boldsymbol{x}, \boldsymbol{y} \rangle$. In the application settings discussed, this means that a client’s signal or fingerprint can remain hidden, while model weights or a database vector also remain hidden.

The paper is explicit that its contribution is not a new function-hiding construction. The FHIPE syntax, correctness relation, and security intent are inherited from the scheme of Kim et al.; the contribution lies in software realization, optimization, and deployment on an edge device using BLS12-381. This distinction is central to the topic: in this line of work, “function-hiding inner-product techniques” refers both to the underlying cryptographic method and to the implementation strategies that determine whether the method is operationally viable.

## 2. Bilinear-group formulation and cryptographic structure

The construction is pairing-based. The ambient algebraic setting uses bilinear groups $G_1$, $G_2$, and $G_T$ of prime order $q$, with
\[
Z=\mathbb{Z}_q,
\qquad
e : G_1 \times G_2 \rightarrow G_T,
\]
and bilinearity
\[
e(aP,bQ)=e(P,Q)^{ab}.
\]
Although the background notation is described as typographically inconsistent in places, the algorithmic presentation makes clear that the intended setting is the asymmetric pairing model $G_1 \times G_2 \to G_T$ [2504.02068].

The implementation uses BLS12-381, with curve equation
\[
E: y^2 = x^3 + 4,
\]
prime field size $\lceil \log_2 p \rceil = 381$, subgroup order size $\lceil \log_2 q \rceil = 255$, embedding degree $k=12$, and estimated security level $\approx 126$-bit. The paper contrasts this with BN-254 at $\approx 100$-bit and BN-462 at $\approx 134$-bit, and motivates BLS12-381 as a widely adopted point in the practical-security design space.

A further structural feature is the sextic twist $E'$ of BLS12-381, together with an isomorphism
\[
\Psi: E \to E',
\]
where
\[
E': y^2 = x^3 + 4(1+\alpha).
\]
This twist representation is used to represent one source group, simplifying pairing arithmetic and compressing elements. The paper attributes to this design a $6\times$ reduction in ciphertext size relative to an uncompressed alternative.

The security assumptions are not restated in full. The implementation paper inherits the assumptions of the Kim et al. FHIPE construction and emphasizes practical realization rather than new assumption formulations. A plausible implication is that the main research interest here is less the definition of a new hardness basis than the study of how far an established pairing-based FHIPE primitive can be pushed on constrained hardware.

## 3. Core FHIPE algorithms and correctness conditions

The scheme operates over vectors $\boldsymbol{x}, \boldsymbol{y} \in Z^n$, with an invertible matrix
\[
\boldsymbol{B} \in GL_n(Z)
\]
and its associated dual-form matrix
\[
\boldsymbol{B}^{*} = \det(\boldsymbol{B}) \cdot (\boldsymbol{B}^{-1})^T.
\]
Let $S \subset Z$ be a polynomial-size set of admissible inner products.

The setup algorithm
\[
\textsf{Setup}(1^\lambda, S) \to (pp, msk)
\]
samples an invertible matrix $\boldsymbol{B}$ and outputs public parameters
\[
pp = (G_1, G_2, G_T, q, e, S),
\]
together with a master secret key
\[
msk = (pp, G_1, G_2, \boldsymbol{B}, \boldsymbol{B}^{*}).
\]

Key generation
\[
\textsf{KeyGen}(msk, \boldsymbol{x}) \to sk_{\boldsymbol{x}}
\]
chooses random $\alpha \in Z$ and returns
\[
sk_{\boldsymbol{x}} = (k_1, \boldsymbol{k}_2),
\]
where
\[
k_1 = \alpha \cdot \det(\boldsymbol{B}) \, G_1,
\qquad
\boldsymbol{k}_2 = \alpha \cdot \boldsymbol{x}\boldsymbol{B}\, G_1.
\]

Encryption
\[
\textsf{Encrypt}(msk, \boldsymbol{y}) \to ct_{\boldsymbol{y}}
\]
chooses random $\beta \in Z$ and returns
\[
ct_{\boldsymbol{y}} = (c_1, \boldsymbol{c}_2),
\]
where
\[
c_1 = \beta G_2,
\qquad
\boldsymbol{c}_2 = \beta \cdot \boldsymbol{y}\boldsymbol{B}^{*}\, G_2.
\]

Decryption
\[
\textsf{Decrypt}(pp, sk_{\boldsymbol{x}}, ct_{\boldsymbol{y}}) \to z \in S \cup \{\perp\}
\]
computes
\[
d_1 = e(k_1, c_1) = e(G_1, G_2)^{\alpha \beta \cdot \det(\boldsymbol{B})},
\]
and
\[
d_2 = e(\boldsymbol{k}_2, \boldsymbol{c}_2)
    = e(G_1, G_2)^{\alpha \beta \cdot \boldsymbol{x}\boldsymbol{B}(\boldsymbol{B}^*)^T \boldsymbol{y}^T }.
\]
Using
\[
\boldsymbol{B}(\boldsymbol{B}^{*})^T = \det(\boldsymbol{B}) \cdot \boldsymbol{\mathbb{I}_{n\times n}},
\]
one obtains
\[
d_2 = e(G_1, G_2)^{\alpha \beta \cdot \det(\boldsymbol{B}) \cdot \langle \boldsymbol{x}, \boldsymbol{y} \rangle}
    = d_1^{\langle \boldsymbol{x}, \boldsymbol{y} \rangle}.
\]
Decryption therefore reduces to finding $z \in S$ such that
\[
d_2 = d_1^z.
\]
If such $z$ exists, it is the inner product; otherwise the output is $\perp$ [2504.02068].

The correctness condition is correspondingly bounded: correctness holds iff
\[
\langle \boldsymbol{x}, \boldsymbol{y} \rangle \in S.
\]
If entries satisfy
\[
x_i \le B_x,\qquad y_i \le B_y,
\]
then
\[
\langle \boldsymbol{x}, \boldsymbol{y} \rangle \le nB_xB_y.
\]
The paper therefore requires
\[
nB_xB_y < q,
\]
and emphasizes the stronger practical condition
\[
nB_xB_y \ll q,
\]
because decryption uses a bounded discrete logarithm over a manageable interval.

This bounded-range requirement is not incidental. It is a defining practical property of this style of FHIPE: the hidden-function evaluation is efficient only when the revealed inner product is known in advance to lie in a suitably small set.

## 4. Leakage model, bounded discrete logarithms, and operational constraints

The intended privacy guarantee is that the ciphertext hides $\boldsymbol{y}$ except for what is implied by the inner product, and the functional key hides $\boldsymbol{x}$ except for what is implied by that same output. The pairing computation, together with the randomizers $\alpha$ and $\beta$ and the hidden basis matrices $\boldsymbol{B}$ and $\boldsymbol{B}^*$, collapses the encoded structures into a relation in $G_T$ that depends only on $\langle \boldsymbol{x}, \boldsymbol{y} \rangle$.

At the same time, the paper is clear about residual exposure. The decryptor learns the value of the inner product and therefore any information inferable from repeated observations of such outputs. Operational leakage also includes the vector dimension $n$, ciphertext length $n+1$, the selected discrete-log search bound $s = |S|$ or equivalently
\[
\alpha = \lceil \sqrt{s} \rceil,
\]
and application-level metadata [2504.02068].

The bounded discrete logarithm is recovered with Baby-Step Giant-Step (BSGS). For
\[
S = \{0,1,\dots,s-1\},
\qquad
\alpha = \lceil \sqrt{s}\rceil,
\]
the implementation precomputes
\[
T = \{(j,d_1^j)\}_{j=0}^{\alpha-1},
\]
sets
\[
t_0 \leftarrow d_1^{-\alpha},
\qquad
t_1 \leftarrow d_2,
\]
and iterates through giant steps until a match with a baby-step entry is found, yielding
\[
z=i\alpha + j.
\]

The paper also addresses signed values through modular encoding. If $x<0$, it is encoded as
\[
q+x.
\]
After discrete-log recovery, if
\[
z > \left\lceil \frac{q}{2}\right\rceil,
\]
the output is decoded as
\[
z-q.
\]
This requires choosing $s \ll q$ so that positive and negative representatives remain disjoint.

A common misconception is that function hiding eliminates all leakage apart from the stated output. The implementation study does not claim such a theorem. Instead, it highlights the bounded-output and repeated-query realities of deployment. This suggests that in practical systems, function hiding should be interpreted as protecting the vectors against direct recovery while still leaving application-level inference risks attached to the observable sequence of inner-product outputs.

## 5. Implementation techniques on BLS12-381

The software framework is built in MIRACL and is described as constant-time, with execution time independent of secrets and including “state-of-the-art side-channel countermeasures.” The implementation uses MIRACL’s 64-bit limb representation for 381-bit field elements, with extra “word excess” and “field excess” bits to accelerate modular arithmetic.

Encryption requires $n+1$ scalar multiplications in the ciphertext group. To accelerate this step, the implementation uses the GLS method on BLS12-381, exploiting an efficient endomorphism. For a point $P$ and scalar $m$,
\[
mP = m_0P + m_1\psi(P) + m_2\psi^2(P) + m_3\psi^3(P),
\]
where $\psi = \Psi \pi_p \Psi^{-1}$, $\psi(P)=\lambda P$, and
\[
m \equiv m_0 + m_1\lambda + m_2\lambda^2 + m_3\lambda^3 \pmod q.
\]
The decomposition is four-dimensional and converts one long scalar multiplication into a multi-scalar multiplication using precomputed points
\[
P,\ \psi(P),\ \psi^2(P),\ \psi^3(P),
\]
together with lookup tables of combinations
\[
P + \sum_{i=1}^3 b_i \psi^i(P), \qquad b_i\in\{0,1\}.
\]
The reported timing for traditional 4-bit-window scalar multiplication in $G$ is 4.16 ms, while the optimized GLS-based scalar multiplication is 1.62 ms, yielding approximately $2.6\times$ speedup [2504.02068].

Decryption is accelerated through multi-pairing. The generic form is
\[
\prod_{j=1}^{n} e(P_j,Q_j) = e(P_1,Q_1)\cdots e(P_n,Q_n),
\]
with the two main pairing phases identified as Miller Loop (ML) and Final Exponentiation (FE). The optimization strategy studies three cases: no sharing, shared FE only, and shared ML and FE. Compared to no sharing, sharing FE gives up to $2.35\times$ speedup, and sharing both ML and FE gives another $\approx 30\%$ speedup, for a total pairing-stage decryption improvement of about $\approx 3.4\times$.

The bounded discrete-log stage is also optimized. Instead of generating the BSGS table solely through repeated multiplications, the implementation uses Knuth’s power tree and replaces many multiplications with Granger-Scott cyclotomic squarings in the target group. The measured target-group costs are 20.4 $\mu$s for multiplication and 10.1 $\mu$s for cyclotomic squaring, and the power-tree method yields about 25% faster table generation than repeated multiplication alone. The lookup strategy remains a constant-time brute-force search; the paper notes that hash-table lookup can be faster, but it was not used because of prohibitive memory overhead for large $\alpha$.

These design choices expose the technique’s practical logic. The cryptographic construction is fixed, but performance is determined by a combination of curve choice, endomorphism exploitation, shared pairing work, constant-time engineering, and memory-sensitive discrete-log recovery.

## 6. Complexity, empirical performance, and application profiles

The asymptotic costs reported in the paper are explicit. Encryption has time
\[
O(n),
\]
dominated by $n+1$ scalar multiplications, and memory
\[
O(n^2),
\]
due to storage of $\boldsymbol{B}^* \in GL(Z)$. Decryption has time
\[
O(n)+O(\alpha),
\]
where $O(n)$ arises from the $n$-fold multi-pairing and $O(\alpha)$ from bounded discrete-log recovery, with memory
\[
O(n)+O(\alpha),
\]
typically dominated by the BSGS lookup table for large $\alpha$ [2504.02068].

The concrete benchmarking platform is a Raspberry Pi 4 Model B with a 1.8 GHz quad-core ARM Cortex-A72, 8 GB LPDDR4-3200 RAM, 128 GB microSDXC storage, 64-bit Raspberry Pi OS kernel 5.15, GCC 10.2.1 with `-O3`, and the MIRACL Core library. All reported aggregate results were averaged over 10,000 runs.

For the comparison point used against the earlier practical implementation of Kim et al., with
\[
n=100,\qquad \alpha=1024,
\]
the reported values are as follows.

| Metric | Kim et al. | This work |
|---|---:|---:|
| Encrypt | 71.4 ms | 165 ms |
| Decrypt | 366.4 ms | 266 ms |
| Ciphertext | 17.7 KB | 18.9 KB |

The comparison is notable because the BLS12-381 implementation runs on a 1.8 GHz Raspberry Pi 4B, whereas the earlier baseline used MNT6-224 on a 4.0 GHz Intel Core i7. The paper emphasizes that the newer implementation operates at approximately 126-bit security rather than approximately 80-bit security, yet still achieves comparable ciphertext size and faster decryption.

The application case studies further illustrate how practicality depends jointly on vector dimension and output range. For encrypted biomedical sensor data classification, two linear classifiers are implemented. The ECG case uses dimension $n=188$ and $\alpha=16384$, with Encrypt at 307 ms and Decrypt at 1004 ms. The EEG case uses dimension $n=178$ and $\alpha=16384$, with Encrypt at 291 ms and Decrypt at 1567 ms. The larger decryption times reflect the cost of bounded discrete-log recovery over a substantial range.

For secure wireless fingerprint-based indoor localization, the toy setting uses $N=4$ access points and $M=9$ locations, with transformed vector dimension
\[
n=N+2=6
\]
and discrete-log parameter
\[
\alpha=64.
\]
The reported per-distance computation costs are Encrypt at 12 ms and Decrypt at 29 ms. This lower-dimensional, small-range regime is much more favorable.

A plausible implication is that the dominant practical variable is not merely the dimension $n$, but the joint regime of $n$ and the admissible output range. The paper’s own summary supports this reading: encryption grows linearly with $n$, whereas decryption grows with both $n$ and $\alpha$, ciphertext size grows linearly with $n$, encryption memory scales as $O(n^2)$, and decryption memory scales as $O(n)+O(\alpha)$.

## 7. Significance, limitations, and place in the broader research landscape

The work establishes that pairing-based FHIPE can be implemented efficiently enough for privacy-preserving edge computing on resource-constrained hardware, provided that the application admits moderate vector dimensions and tightly bounded inner products [2504.02068]. The primary technical message is not the invention of a new function-hiding mechanism, but the demonstration that an existing one can remain practical when moved to a modern and widely adopted curve with substantially higher security than older deployments.

Several limitations are equally central. First, the bounded discrete logarithm is a fundamental bottleneck rather than a secondary implementation detail. Even with optimized scalar multiplication and shared multi-pairing, decryption becomes expensive when the possible inner-product range is large. Second, memory pressure is structurally important: encryption stores the $n\times n$ matrix $\boldsymbol{B}^*$, while decryption may require large BSGS tables. Third, function hiding does not eliminate application-level inference from repeated outputs or metadata.

The paper therefore locates function-hiding inner-product techniques in a specific practical niche. They are well suited to quantized signals, low-to-moderate dimensions, and tasks in which the output range can be tightly constrained. They are less attractive when the output must span a large interval or when very high-dimensional computations are required at high frequency.

Within the broader FE literature, this work suggests that the maturity of some pairing-based FHIPE constructions has shifted part of the research frontier from purely cryptographic design toward realization questions: curve selection, multi-pairing strategy, endomorphism-based acceleration, constant-time table lookup, serialization, and memory-aware deployment. In that sense, the paper serves as a detailed case study of how function-hiding inner-product techniques move from bilinear-group abstractions to operational edge systems.

Source: https://www.emergentmind.com/topics/function-hiding-inner-product-techniques