Technology Field
The present invention relates to a command executing method, and a memory controller using the method, and a memory storage apparatus using the method.
Description of Related Art
The rapid growth in the popularity of digital cameras, cellular phones, and MP3 players in recent years has brought about the escalated demand for storage media by consumers. Since a rewritable non-volatile memory (e.g., a flash memory) has several characteristics such as non-volatility of data, low power consumption, small size and non-mechanical structure, the rewritable non-volatile memory is the most suitable memory to be adopted in a portable multimedia device mentioned above.
Conventionally, a rewritable non-volatile memory module is controlled by a memory controller and connected to a host system through a connector. The host system gives a command to the memory controller to access data in the rewritable non-volatile module. In order to protect data stored in the rewritable non-volatile memory module, a technique has been developed for encrypting the data before the data is written into the rewritable non-volatile memory module. However, when a plurality of data from the host system by a write command belongs to a plurality of different groups and it is requested to encrypt the data with different keys respectively according to the different groups, in the current technique, the data first is temporarily stored into a buffer memory. Then, each portion of the data is read from then buffer memory and encrypted, and the encrypted portion of the data is restored into the buffer memory. Finally, the encrypted data is transmitted and programmed from the buffer memory to the rewritable non-volatile memory in a unit of each physical programming unit. Because several direct memory accesses for the buffer memory are needed for encrypting all data corresponding to one write command, the performance of the memory storage apparatus is influenced seriously.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.