Skip to main content

A New Secure Matrix Multiplication from Ring-LWE

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNSC,volume 11261))

Abstract

Matrix multiplication is one of the most basic and useful operations in statistical calculations and machine learning. When the matrices contain sensitive information and the computation has to be carried out in an insecure environment, such as a cloud server, secure matrix multiplication computation (MMC) is required, so that the computation can be outsourced without information leakage. Dung et al. apply the Ring-LWE-based somewhat public key homomorphic encryption scheme to secure MMC [TMMP2016], whose packing method is an extension of Yasuda et al.’s methods [SCN2015 and ACISP2015] for secure inner product. In this study, we propose a new packing method for secure MMC from Ring-LWE-based secure inner product and show that ours is efficient and flexible.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    When encode a rectangular matrix, add zero terms to last rows (or/and columns) if the row (or/and column) number is smaller than \( \beta \), e.g., \(m<k=\beta \),

    $$ \begin{array}{l} \widetilde{A}[rows](x) =A_1^{(r)} X\,+\,...\,+\,x^{(i-1)\beta }A_i^{(r)} X\,+\,...\,+\,x^{(m-1)\beta }A_{m}^{(r)} X\\ \widetilde{A}[columns](x) =A_1^{(c)} X'\,+\,...\,+\,x^{(j-1)\beta ^2}A_j^{(c)} X'\,+\,...\,+\,x^{(\beta -1)\beta ^2}A_\beta ^{(c)} X', \end{array} $$

    where \(X' = (1, x,..., x^{m-1})^T\).

  2. 2.

    We show the MMC AB of \(A\in \mathbb {Z}_p^{m \times k}\) and \(B \in \mathbb {Z}_p^{k \times l}\) for flexible mkl under Corollary 1 here, for example. The MMC AB and BA under the cases of \(m=k=l\) (Theorem 2) and \(m=l \ne k\) (Corollary 2) can be similarly done.

  3. 3.

    The notation “−” in Table 1 means that no concrete packing method for rectangular matrix multiplication was explicitly considered in [2]. However, the approach similar to ours considering rectangular matrices may work for [2].

References

  1. Brakerski, Z., Vaikuntanathan, V.: Fully homomorphic encryption from ring-LWE and security for key dependent messages. In: Rogaway, P. (ed.) CRYPTO 2011. LNCS, vol. 6841, pp. 505–524. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-22792-9_29

    Chapter  Google Scholar 

  2. Dung, D.H., Mishra, P.K., Yasuda, M.: Efficient secure matrix multiplication over LWE-based homomorphic encryption. Tatra Mt. Math. Publ. 67, 69–83 (2016)

    MathSciNet  MATH  Google Scholar 

  3. Fu, S., Yu, Y., Xu, M.: A secure algorithm for outsourcing matrix multiplication computation in the cloud. In: SCC 2017, pp. 27–33. ACM (2017)

    Google Scholar 

  4. Lei, X., Liao, X., Huang, T., Heriniaina, F.: Achieving security, robust cheating resistance, and high-efficiency for outsourcing large matrix multiplication computation to a malicious cloud. Inf. Sci. 280, 205–217 (2014)

    Article  Google Scholar 

  5. Lauter, K.E., Naehrig, M., Vaikuntanathan, V.: Can homomorphic encryption be practical? In: CCSW 2011, pp. 113–124. ACM (2011)

    Google Scholar 

  6. Wang, L., Hayashi, T., Aono, Y., Phong, L.T.: A generic yet efficient method for secure inner product. In: Yan, Z., Molva, R., Mazurczyk, W., Kantola, R. (eds.) NSS 2017. LNCS, vol. 10394, pp. 217–232. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-64701-2_16

    Chapter  Google Scholar 

  7. Yasuda, M., Shimoyama, T., Kogure, J., Yokoyama, K., Koshiba, T.: New packing method in somewhat homomorphic encryption and its applications. Secur. Commun. Netw. 8(13), 2194–2213 (2015)

    Article  Google Scholar 

  8. Yasuda, M., Shimoyama, T., Kogure, J., Yokoyama, K., Koshiba, T.: Practical packing method in somewhat homomorphic encryption. In: Garcia-Alfaro, J., Lioudakis, G., Cuppens-Boulahia, N., Foley, S., Fitzgerald, W.M. (eds.) DPM/SETOP -2013. LNCS, vol. 8247, pp. 34–50. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-642-54568-9_3

    Chapter  MATH  Google Scholar 

  9. Yasuda, M., Shimoyama, T., Kogure, J., Yokoyama, K., Koshiba, T.: Secure pattern matching using somewhat homomorphic encryption. In: CCSW 2013, pp. 65–76. ACM (2013)

    Google Scholar 

  10. Yasuda, M., Shimoyama, T., Kogure, J., Yokoyama, K., Koshiba, T.: Secure statistical analysis using RLWE-based homomorphic encryption. In: Foo, E., Stebila, D. (eds.) ACISP 2015. LNCS, vol. 9144, pp. 471–487. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-19962-7_27

    Chapter  MATH  Google Scholar 

Download references

Acknowledgement

This work was partially supported by JSPS KAKENHI Grant Number JP15K00028 and JST CREST Number JPMJCR168A. We thank Takuya Hayashi and Mishra Pradeep Kumar for the useful discussion. We also greatly appreciate the anonymous reviewers for their thoughtful comments that helped improving the manuscript.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lihua Wang .

Editor information

Editors and Affiliations

A Correctness of Theorem 2

A Correctness of Theorem 2

Apart from Notation list-1.\(\sim \)3., the following list of notation should be useful:

Notation List-4. For a vector \(V=(v_1, ... , v_{\gamma })\), \({\mathsf { pol}}(V)= v_1x^{\delta _1}+ ... + v_{\gamma }x^{\delta _{\gamma }}\), let

When V is a row or column vector of a matrix of size \(\beta \times \beta \), \(\gamma = \beta \).

Proof

According to Eqs. (6) and (5), we have

$$ \begin{array}{l} x^{2j {\beta }^2-\beta }\widehat{A}(x)= x^{2j {\beta }^2-\beta } \widetilde{A}(x)[rows] + x^{2j {\beta }^2-\beta } \widetilde{A}(x)[columns] \end{array} $$
$$ \begin{array}{l} x^{2j {\beta }^2-\beta } \widetilde{A}(x)[rows] \\ \qquad =( a_{11}x^{2j\beta ^2-\beta } \,+\, ...\,+\,a_{1\beta }x^{2j\beta ^2-1} )\,+\,...\,+\,( a_{i-1,1}x^{2j\beta ^2-(i-3)\beta } \\ \qquad \quad +...+\,a_{i-1,\beta }x^{2j\beta ^2+(i-2)\beta -1} ) + ( a_{i,1}x^{2j\beta ^2-(i-2)\beta } + ... + a_{i,\beta }x^{2j\beta ^2+(i-1)\beta -1} ) \\ \qquad \quad + ( a_{i+1,1}x^{2j\beta ^2-(i-1)\beta } + ... + a_{i+1,\beta }x^{2j\beta ^2+i \beta -1} )+ ... + ( a_{\beta ,1}x^{2j\beta ^2-(\beta -2)\beta } \\ \qquad \quad + ... + a_{\beta ,\beta }x^{2j\beta ^2+ \beta ^2 -\beta -1} ) \\ \qquad = {\mathsf { pol}}(A_1^{(r)}) + ... + {\mathsf { pol}}(A_{i-1}^{(r)}) + {\mathsf { pol}}(A_i^{(r)}) + {\mathsf { pol}}(A_{i+1}^{(r)}) + ... + {\mathsf { pol}}(A_{\beta }^{(r)}), \\ x^{2j {\beta }^2-\beta } \widetilde{A}(x)[columns] \\ \qquad =x^{2j {\beta }^2-\beta }(x^{2\times {\beta }^2-\beta }A_1^{(c)}+ ...+ x^{2i\times {\beta }^2-\beta }A_i^{(c)}\,+\,...\,+\,x^{2\beta \times {\beta }^2-\beta }A_{\beta }^{(c)}) X \\ \qquad = x^{2 {\beta }^2-\beta } (a_{11}x^{2j {\beta }^2-\beta } \,+\,...\,+\, a_{\beta ,1}x^{2j {\beta }^2-1} ) \,+\,...\,+\, x^{2i {\beta }^2-\beta } (a_{1,i}x^{2j {\beta }^2-\beta } \\ \qquad \quad +... + a_{\beta ,i}x^{2j {\beta }^2-1} ) \,+\,...\,+\, x^{2\beta {\beta }^2-\beta } (a_{1,\beta }x^{2j {\beta }^2-\beta } \,+\,...\,+\, a_{\beta ,\beta }x^{2j {\beta }^2-1} ) \\ \qquad = {\mathsf { pol}}(A_1^{(c)}) + ... + {\mathsf { pol}}(A_i^{(c)}) + ... + {\mathsf { pol}}(A_{\beta }^{(c)}); \end{array} $$

and

$$ \begin{array}{l} x^{(i-1)\beta }\widehat{B}(x) = x^{(i-1)\beta } \widetilde{B}(x)[rows] + x^{(i-1)\beta } \widetilde{B}(x)[columns] \end{array} $$
$$ \begin{array}{l} x^{(i-1)\beta } \widetilde{B}(x)[rows] \\ \qquad =( b_{11}x^{(i-1)\beta } + ... + b_{1\beta }x^{i \beta -1} ) + ( b_{21}x^{i \beta } + ... + b_{2 \beta }x^{(i+1) \beta -1} ) \\ \qquad \quad + ... + ( b_{\beta ,1}x^{(i-1)\beta + (\beta -1)\beta } + ... + b_{\beta ,\beta }x^{(i-1)\beta + \beta ^2 -1} ) \\ \qquad = {\mathsf { pol}}(B_1^{(r)}) + {\mathsf { pol}}(B_2^{(r)}) + ... + {\mathsf { pol}}(B_{\beta }^{(r)}), \\ x^{(i-1)\beta } \widetilde{B}(x)[columns] \\ \qquad = x^{(i-1)\beta } (x^{2\times {\beta }^2-\beta }B_1^{(c)}+ ...+ x^{2j \times {\beta }^2-\beta }B_i^{(c)}\,+\,...\,+\,x^{2\beta \times {\beta }^2-\beta }B_{\beta }^{(c)}) X \\ \qquad =x^{2{\beta }^2-\beta } ( b_{11}x^{(i-1)\beta } + ... + b_{\beta 1}x^{i \beta -1} ) + x^{4 {\beta }^2-\beta } ( b_{12}x^{(i-1) \beta } + ... + b_{ \beta 2}x^{i \beta -1} ) \\ \qquad \quad + ... + x^{2j {\beta }^2-\beta } ( b_{1j}x^{(i-1)\beta } + ... + b_{\beta j}x^{i \beta -1} ) + x^{2(j+1) {\beta }^2-\beta } ( b_{1,j+1}x^{(i-1)\beta } \end{array} $$
$$ \begin{array}{l} \quad \quad + ... + b_{\beta , j+1}x^{i \beta -1} ) + ... + x^{2\beta {\beta }^2-\beta } ( b_{1\beta }x^{(i-1)\beta } + ... + b_{\beta \beta }x^{i \beta -1} ) \\ \quad = {\mathsf { pol}}(B_1^{(c)}) + {\mathsf { pol}}(B_2^{(c)}) + ... + {\mathsf { pol}}(B_j^{(c)}) + {\mathsf { pol}}(B_{j+1}^{(c)}) + ... + {\mathsf { pol}}(B_{\beta }^{(c)}). \end{array} $$

We should prove for any \(i,j=1,...,\beta \), \({\mathsf { pol}}(A_i^{(r)})\) in \(x^{2j {\beta }^2-\beta }\widehat{A}(x)\) and \({\mathsf { pol}}(B_j^{(c)})\) in \(x^{(i-1) \beta }\widehat{B}(x)\) satisfy exactly

$$ {\mathsf { deg}}({\mathsf { pol}}(A_i^{(r)}[k]))= {\mathsf { deg}}({\mathsf { pol}}(B_j^{(c)}[k])) \quad (k=1,..., \beta ). $$

Case 1: when \(j=1\), i.e., \(\langle {\mathsf { Vec}}(x^{2 {\beta }^2-\beta }\widehat{A}(x), {\mathsf { Vec}}(x^{(i-1) \beta }\widehat{B}(x)) \rangle = \langle {A}_i, {B}_1 \rangle \). It can be easily check that

$$ \begin{array}{l} \mathsf {left-deg}({\mathsf { pol}}(A_1^{(r)}))< \cdots< {\mathsf {right-deg}}({\mathsf { pol}}(A_{i-1}^{(r)})) = 2\beta ^2 + (i-2)\beta -1< \\ < 2\beta ^2 + (i-2)\beta \le \end{array} $$

\({\mathsf { deg}}({\mathsf { pol}}(A_i^{(r)}[k]))= {\mathsf { deg}}({\mathsf { pol}}(B_1^{(c)}[k])) = 2\beta ^2+(i-2)\beta + (k -1)\) for \(k=1,..., \beta \)

$$ \begin{array}{l} \le 2\beta ^2+(i-1)\beta -1< 2\beta ^2+(i-1)\beta = {\mathsf {left-deg}}({\mathsf { pol}}(A_{i+1}^{(r)})) \\< \cdots< {\mathsf {left-deg}}({\mathsf { pol}}(A_1^{(c)}))< {\mathsf {right-deg}}({\mathsf { pol}}(A_1^{(c)}))< {\mathsf {left-deg}}({\mathsf { pol}}(B_2^{(c)})) \\< \cdots<{\mathsf { deg}}({\mathsf { pol}}(B_l^{(c)}))<{\mathsf { deg}}({\mathsf { pol}}(A_l^{(c)}))< \cdots<{\mathsf { deg}}({\mathsf { pol}}(B_{\beta }^{(c)})) <{\mathsf { deg}}({\mathsf { pol}}(A_{\beta }^{(c)})). \end{array} $$

Case 2: when \(j \ge 2\), i.e., \(\langle {\mathsf { Vec}}(x^{2j {\beta }^2-\beta }\widehat{A}(x)), {\mathsf { Vec}}(x^{(i-1) \beta }\widehat{B}(x)) \rangle = \langle {A}_i, {B}_j \rangle \). It can be easily check that

$$ \begin{array}{l} {\mathsf {right-deg}}({\mathsf { pol}}(B_{j-1}^{(c)}))< {\mathsf {left-deg}}({\mathsf { pol}}(A_1^{(r)}))< \cdots< \mathsf{right-}{\mathsf { deg}}({\mathsf { pol}}(A_{i-1}^{(r)})) \\ = 2j\beta ^2 + (i-2)\beta -1 < 2j\beta ^2 + (i-2)\beta \le \end{array} $$

\({\mathsf { deg}}({\mathsf { pol}}(A_i^{(r)}[k]))= {\mathsf { deg}}({\mathsf { pol}}(B_j^{(c)}[k])) = 2j\beta ^2+(i-2)\beta + (k -1)\), for \(k=1,..., \beta \)

$$ \begin{array}{l} \le 2j\beta ^2+(i-1)\beta -1< 2j\beta ^2+(i-1)\beta = \mathsf{left-}{\mathsf { deg}}({\mathsf { pol}}(A_{i+1}^{(r)})) \\< \cdots< \mathsf{left-}{\mathsf { deg}}({\mathsf { pol}}(A_1^{(c)}))< \mathsf{right-}{\mathsf { deg}}({\mathsf { pol}}(A_1^{(c)}))< \mathsf{left-}{\mathsf { deg}}({\mathsf { pol}}(B_{j+1}^{(c)})) \\< \cdots<{\mathsf { deg}}({\mathsf { pol}}(B_{j+l-1}^{(c)}))<{\mathsf { deg}}({\mathsf { pol}}(A_l^{(c)}))<\cdots<{\mathsf { deg}}({\mathsf { pol}}(B_{\beta }^{(c)})) \\<{\mathsf { deg}}({\mathsf { pol}}(A_{\beta -j+1}^{(c)}))< ... < {\mathsf { deg}}({\mathsf { pol}}(A_{\beta }^{(c)})). \end{array} $$

Note. Since

$$ \begin{array}{l} \mathsf{right-}{\mathsf { deg}}(x^{2j {\beta }^2-\beta }\widehat{A}(x)) = 4\beta ^3-\beta -1,\\ \mathsf{right-}{\mathsf { deg}}(x^{(i-1) \beta }\widehat{B}(x)) \, \, = 2\beta ^3 + \beta ^2 -\beta -1, \end{array} $$

we have

$$\displaystyle \max _{i, j}\{ {\mathsf { deg}}(x^{2j {\beta }^2-\beta }\widehat{A}(x)) , {\mathsf { deg}}(x^{(i-1) \beta }\widehat{B}(x)) \} < 4\beta ^3.$$

Therefore, our packing method works if

$$4\beta ^3 \le n.$$

The proof for correctness of the MMC AB is complete. Correctness of the MMC BA can be proved similarly.    \(\square \)

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Wang, L., Aono, Y., Phong, L.T. (2018). A New Secure Matrix Multiplication from Ring-LWE. In: Capkun, S., Chow, S. (eds) Cryptology and Network Security. CANS 2017. Lecture Notes in Computer Science(), vol 11261. Springer, Cham. https://doi.org/10.1007/978-3-030-02641-7_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-02641-7_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-02640-0

  • Online ISBN: 978-3-030-02641-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics