**Appendix C**

The pseudo code for fast algorithm of inner embedding is given as follows: Input: n LSBs of secret segment *s<sup>L</sup> j* , basic structure for embedding

*A* = *M* - *G* - *pX*(0)*i*, *<sup>d</sup><sup>j</sup> n* , *G* - *pX*(1)*i*, *<sup>d</sup><sup>j</sup> n*+1 , ... , *G* - *pX*(*n*−1)*i*, *<sup>d</sup><sup>j</sup>* 2*n*−1 Output: stego pixel values *p X*(0)*i* , *p X*(1)*i* , ... , *p X*(*n*−1)*i* (a) Construct an n-dimensional basic structure *B* with all elements valued with *sL j* ;

*B* = *s<sup>L</sup> <sup>j</sup>* <sup>×</sup> *ones*- 2, 2, ... , 2(*n*) ;


for *k* = 0 : *n* − 1,

$$\mathbb{E}\left[v\_{\prime}p\_{\mathcal{X}(k)i}^{\prime}\right] = \max \Sigma\_{q \neq k} \mathbf{C}(:,:, \dots,:\_{(q)\_{\prime}}, \dots,:\_{\prime});$$

end

The algorithm utilizes an array of unique value *s<sup>L</sup> <sup>j</sup>* to compare with the basic structure for embedding *A* using the function *ismember*(). As a result, the unique '1' in the array *C* indicates the location of *s<sup>L</sup> <sup>j</sup>* in *A*. By projecting the summations to each axis can obtain the index of the corresponding axis. Thus, the values of stego pixels are determined.
