[go: up one dir, main page]

TW201901407A - Method for updating firmware of data storage device - Google Patents

Method for updating firmware of data storage device Download PDF

Info

Publication number
TW201901407A
TW201901407A TW107120355A TW107120355A TW201901407A TW 201901407 A TW201901407 A TW 201901407A TW 107120355 A TW107120355 A TW 107120355A TW 107120355 A TW107120355 A TW 107120355A TW 201901407 A TW201901407 A TW 201901407A
Authority
TW
Taiwan
Prior art keywords
data
firmware
hash
storage device
sorting
Prior art date
Application number
TW107120355A
Other languages
Chinese (zh)
Other versions
TWI678658B (en
Inventor
江耀邦
Original Assignee
慧榮科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 慧榮科技股份有限公司 filed Critical 慧榮科技股份有限公司
Priority to TW107120355A priority Critical patent/TWI678658B/en
Publication of TW201901407A publication Critical patent/TW201901407A/en
Application granted granted Critical
Publication of TWI678658B publication Critical patent/TWI678658B/en

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

A firmware updating method of a data storage device includes: obtaining a predetermined sorting mechanism from a efuse wherein the efuse is arranged within a controller of the data storage device; obtaining a firmware package; obtaining a first sorting hash data from the firmware package; performing a hash calculation on a firmware data of the firmware package to obtain a second hash data; performing the predetermined hash mechanism on the second hash data to generate a second sorting hash data; and if the first sorting hash data is identical to the second sorting hash data, updating the firmware of the data storage device by the firmware data.

Description

資料儲存裝置之韌體更新之方法  Method for firmware update of data storage device  

本發明係關於一種資料儲存裝置與資料儲存方法,特別係關於一種能夠有效認證韌體資料之資料儲存裝置與資料儲存方法。 The invention relates to a data storage device and a data storage method, in particular to a data storage device and a data storage method capable of effectively authenticating firmware data.

快閃記憶體為一種普遍的非揮發性資料儲存裝置,係以電性方式抹除與程式化。以非及閘型的快閃記憶體(NAND FLASH)為例,常用作記憶卡(memory card)、通用序列匯流排閃存裝置(USB flash device)、固態硬碟(SSD)、嵌入式快閃記憶體模組(eMMC)、通用快閃記憶體(UFS)…等使用。 Flash memory is a popular non-volatile data storage device that is electrically erased and programmed. For example, non-NAND flash memory (NAND FLASH) is often used as a memory card, a universal flash memory device, a solid-state hard disk (SSD), embedded flash memory. Body module (eMMC), universal flash memory (UFS), etc.

一般而言,資料儲存裝置可以透過對韌體的升級提升其效能及可靠性。韌體的更新可以確保資料儲存裝置保持在最新的狀態以及確保其相容性。然而,如果資料儲存裝置更新了錯誤或不合法的韌體,可能會導致資料儲存裝置無法正常的進行讀取或寫入等操作,甚至造成資料儲存裝置的損毀。因此,需要一種能夠有效並且方便認證韌體資料之資料儲存裝置與資料儲存方法,以確保將更新的韌體資料是合法以及正確的。 In general, data storage devices can improve their performance and reliability by upgrading firmware. The firmware update ensures that the data storage device remains up-to-date and ensures compatibility. However, if the data storage device is updated with an error or an illegal firmware, the data storage device may not be able to perform operations such as reading or writing normally, or even cause damage to the data storage device. Therefore, there is a need for a data storage device and data storage method that can efficiently and conveniently authenticate firmware data to ensure that the updated firmware data is legal and correct.

為了解決上述問題,本發明提出一種能夠有效並 且方便認證韌體資料之資料儲存裝置與資料儲存方法,以確保所更新的是正確的韌體資料。 In order to solve the above problems, the present invention provides a data storage device and a data storage method capable of efficiently and conveniently authenticating firmware data to ensure that the updated firmware information is updated.

詳細而言,本發明提供了安全雜湊機制以及預定排序機制,用以準確的偵測所欲安裝之韌體資料是否為合法與正確。首先,安全雜湊機制將韌體資料進行加密與壓縮以產生雜湊資料。然後,預定排序機制將上述雜湊資料重新排序,並且儲存於資料儲存裝置之特定位置。上述預定排序機制係由資料儲存裝置之製造商所設定。藉由判斷所欲安裝之韌體資料及其相關之雜湊資料是否相同於排序雜湊資料,就能夠偵測出所欲安裝之韌體資料,是否為資料儲存裝置之製造商所認證之正確合法的韌體資料。依據本發明之資料儲存裝置以及資料儲存方法,能夠判斷上述韌體資料是否正確與合法,以防止資料儲存裝置受到惡意的破壞。 In detail, the present invention provides a secure hashing mechanism and a predetermined sorting mechanism for accurately detecting whether the firmware information to be installed is legal and correct. First, the secure hash mechanism encrypts and compresses the firmware data to produce hash data. The predetermined sorting mechanism then reorders the hashed data and stores it at a particular location in the data storage device. The predetermined ordering mechanism described above is set by the manufacturer of the data storage device. By judging whether the firmware information to be installed and the related hash data are the same as the sorting hash data, it is possible to detect whether the firmware information to be installed is correct and legally certified by the manufacturer of the data storage device. Body data. According to the data storage device and the data storage method of the present invention, it is possible to determine whether the firmware data is correct and legal, so as to prevent the data storage device from being maliciously damaged.

本發明之一實施例提供了一種資料儲存裝置之韌體更新之方法,包括:從一電子熔絲中取得一預定排序機制,其中,該電子熔絲置於該資料儲存裝置的一控制器內部;取得一韌體封包;從該韌體封包取得一第一排序雜湊資料;對該韌體封包中的一韌體資料進行一雜湊計算以取得一第二雜湊資料;對該第二雜湊資料執行該預定排序機制以產生一第二排序雜湊資料;以及如果該第一排序雜湊資料相同於該第二排序雜湊資料,以該韌體資料進行該資料儲存裝置的韌體更新。 An embodiment of the present invention provides a method for updating a firmware of a data storage device, comprising: obtaining a predetermined sorting mechanism from an electronic fuse, wherein the electronic fuse is disposed inside a controller of the data storage device Obtaining a firmware packet; obtaining a first sorting hash data from the firmware packet; performing a hash calculation on the firmware information in the firmware packet to obtain a second hash data; and executing the second hash data The predetermined sorting mechanism generates a second sorted hash data; and if the first sorted hash data is identical to the second sorted hash data, the firmware update of the data storage device is performed with the firmware data.

本發明之一實施例提供了一種資料儲存裝置之韌體更新之方法,包括:從一電子熔絲中取得一預定排序機制,其中,該電子熔絲置於該資料儲存裝置的一控制器內部;取得 一韌體封包;從該韌體封包取得複數個第一排序子雜湊資料;依據一預定分割機制將該韌體封包中的一韌體資料分割為複數個子韌體資料;對每一該些子韌體資料執行一雜湊計算以取得複數個子雜湊資料;對每一該些子雜湊資料執行該預定排序機制以產生複數個第二排序子雜湊資料;以及如果該些第一排序子雜湊資料相同於該些第二排序子雜湊資料,以該韌體資料進行該資料儲存裝置的韌體更新。 An embodiment of the present invention provides a method for updating a firmware of a data storage device, comprising: obtaining a predetermined sorting mechanism from an electronic fuse, wherein the electronic fuse is disposed inside a controller of the data storage device Obtaining a firmware packet; obtaining a plurality of first sorter hash data from the firmware packet; and dividing a firmware data in the firmware packet into a plurality of firmware information according to a predetermined segmentation mechanism; Performing a hash calculation on the plurality of sub-mesh data to obtain a plurality of sub-heap data; performing a predetermined sorting mechanism on each of the sub-heap data to generate a plurality of second sorted hash data; and if the first sorting hash data Similar to the second sorter hash data, the firmware update of the data storage device is performed using the firmware data.

本發明之一實施例提供了一種資料儲存裝置之韌體更新之方法,包括:從一電子熔絲中取得一預定排序機制,其中,該電子熔絲置於該資料儲存裝置的一控制器內部;取得一韌體封包;從該韌體封包取得複數個第一排序子雜湊資料;依據一預定分割機制將該韌體封包中的一韌體資料分割為複數個子韌體資料;對每一該些子韌體資料執行一資料壓縮計算以及一雜湊計算以取得複數個子雜湊資料;對每一該些子雜湊資料執行該預定排序機制以產生複數個第二排序子雜湊資料;以及如果該些第一排序子雜湊資料相同於該些第二排序子雜湊資料,以該韌體資料進行該資料儲存裝置的韌體更新。 An embodiment of the present invention provides a method for updating a firmware of a data storage device, comprising: obtaining a predetermined sorting mechanism from an electronic fuse, wherein the electronic fuse is disposed inside a controller of the data storage device Obtaining a firmware packet; obtaining a plurality of first sorter hash data from the firmware packet; and dividing a firmware data in the firmware packet into a plurality of firmware information according to a predetermined segmentation mechanism; Performing a data compression calculation and a hash calculation to obtain a plurality of sub-heap data; performing a predetermined ordering mechanism on each of the sub-heap data to generate a plurality of second sort sub-heap data; and if the A sorted hashed data is identical to the second sorted hashed data, and the firmware of the data storage device is updated with the firmware data.

關於本發明其他附加的特徵與優點,此領域之熟習技術人士,在不脫離本發明之精神和範圍內,當可根據本案實施方法中所揭露之資料儲存裝置與資料儲存方法。 Other data and storage methods disclosed in the method of the present invention can be made by those skilled in the art without departing from the spirit and scope of the present invention.

10A、10A-1、10A-2、10A-3、10A-4、20A‧‧‧韌體資料 10A, 10A-1, 10A-2, 10A-3, 10A-4, 20A‧‧‧ firmware data

10B、10B-1、10B-2、10B-3、10B-4、10B-5、10B-6、10B-7、20B‧‧‧雜湊資料 10B, 10B-1, 10B-2, 10B-3, 10B-4, 10B-5, 10B-6, 10B-7, 20B‧‧‧ hash information

10C、10C-1、10C-2、10C-3、10C-4、10C-5、20C‧‧‧排序雜湊資料 10C, 10C-1, 10C-2, 10C-3, 10C-4, 10C-5, 20C‧‧‧ Sorting hash data

10D‧‧‧其他資料 10D‧‧‧Other Information

10X‧‧‧韌體封包 10X‧‧‧ firmware package

100‧‧‧資料儲存裝置 100‧‧‧ data storage device

120‧‧‧控制器 120‧‧‧ Controller

122‧‧‧電子熔絲區 122‧‧‧Electronic fuse area

122-1至122-8‧‧‧特定區域 122-1 to 122-8‧‧‧Specific areas

140‧‧‧快閃記憶體 140‧‧‧Flash memory

160-16N‧‧‧區塊 160-16N‧‧‧ Block

160A、160Z...16NA、16NZ‧‧‧頁面 160A, 160Z...16NA, 16NZ‧‧‧ pages

180‧‧‧隨機存取記憶體 180‧‧‧ Random access memory

200‧‧‧主機 200‧‧‧Host

300‧‧‧安全雜湊機制 300‧‧‧Safety hash mechanism

320‧‧‧預定排序機制 320‧‧‧Predetermined sorting mechanism

340‧‧‧預定分割機制 340‧‧‧Scheduled segmentation mechanism

360‧‧‧預定再壓縮機制 360‧‧‧Pre-recompression mechanism

根據以下的詳細說明並配合所附圖式做完整揭露。應注意的是,根據本產業的一般作業,圖示並未必按照比例繪製。事 實上,可能任意的放大或縮小元件的尺寸,以做清楚的說明。 The full disclosure is based on the following detailed description and in conjunction with the drawings. It should be noted that the illustrations are not necessarily drawn to scale in accordance with the general operation of the industry. In fact, the size of the components may be arbitrarily enlarged or reduced for a clear explanation.

第1圖係顯示根據本發明一實施例所述之資料儲存裝置與主機之示意圖;第2A圖係顯示根據本發明一實施例所述之用於認證韌體資料之資料儲存方法之示意圖;第2B圖係顯示根據本發明另一實施例所述之用於認證韌體資料之資料儲存方法之示意圖;第2C圖係顯示根據本發明一實施例所述之韌體資料之示意圖;第3圖係顯示根據本發明一實施例所述之用於認證韌體資料之資料儲存方法之示意圖;第4圖係顯示根據本發明另一實施例所述之用於認證韌體資料之資料儲存方法之示意圖;第5A圖係顯示根據本發明一實施例所述之用於認證韌體資料之電子熔絲區之示意圖。 1 is a schematic diagram showing a data storage device and a host according to an embodiment of the invention; FIG. 2A is a schematic diagram showing a data storage method for authenticating firmware data according to an embodiment of the invention; 2B is a schematic diagram showing a data storage method for authenticating firmware data according to another embodiment of the present invention; FIG. 2C is a schematic diagram showing firmware data according to an embodiment of the present invention; A schematic diagram of a data storage method for authenticating firmware data according to an embodiment of the invention; and FIG. 4 is a diagram showing a data storage method for authenticating firmware data according to another embodiment of the present invention. FIG. 5A is a schematic diagram showing an electronic fuse region for authenticating firmware data according to an embodiment of the invention.

第5B圖係顯示根據本發明另一實施例所述之用於認證韌體資料之電子熔絲區之示意圖。 FIG. 5B is a schematic diagram showing an electronic fuse region for authenticating firmware data according to another embodiment of the present invention.

第6圖係顯示根據本發明一實施例所述之用於認證韌體資料之資料儲存方法之流程圖。 Figure 6 is a flow chart showing a method of storing data for authenticating firmware data according to an embodiment of the invention.

第7圖係顯示根據本發明另一實施例所述之用於認證韌體資料之資料儲存方法之流程圖。 Figure 7 is a flow chart showing a method of storing data for authenticating firmware data according to another embodiment of the present invention.

第8圖係顯示根據本發明另一實施例所述之用於認證韌體 資料之資料儲存方法之流程圖。 Figure 8 is a flow chart showing a method of storing data for authenticating firmware data according to another embodiment of the present invention.

第9圖係顯示根據本發明另一實施例所述之用於認證韌體資料之資料儲存方法之示意圖。 Figure 9 is a diagram showing a data storage method for authenticating firmware data according to another embodiment of the present invention.

為讓本發明之目的、特徵和優點能更明顯易懂,下文特舉出本發明之具體實施例,並配合所附圖式,作詳細說明如下。目的在於說明本發明之精神而非用以限定本發明之保護範圍,應理解下列實施例可經由軟體、硬體、韌體、或上述任意組合來實現。 In order to make the objects, features and advantages of the present invention more comprehensible, the specific embodiments of the invention are set forth in the accompanying drawings. The intention is to illustrate the spirit of the invention and not to limit the scope of the invention, it being understood that the following embodiments can be implemented by software, hardware, firmware, or any combination of the above.

第1圖係顯示根據本發明一實施例所述之資料儲存裝置100與主機200之示意圖。在一實施例中,資料儲存裝置100包括控制器120、非揮發式記憶體以及隨機存取記憶體(RAM)180。控制器120包括電子熔絲(efuse)區122。資料儲存裝置100耦接主機200以傳送資料與指令、或是接收資料與指令。非揮發式記憶體可以為反集閘快閃記憶體(NAND Flash)、磁阻式隨機存取記憶體(Magnetoresistive RAM)、鐵電隨機存取記憶體(Ferroelectric RAM)、電阻式記憶體(Resistive RAM,RRAM)、自旋轉移力矩隨機存取記憶體(Spin Transfer Torque-RAM,STT-RAM)…等,使資料可於長時間保存。在下述說明中將以快閃記憶體140為例進行說明,但不以此為限。資料儲存裝置100係符合嵌入式快閃記憶體模組(eMMC)規範、通用快閃記憶體(UFS)、串行ATA(SATA)或非揮發性快速記憶體(NVMe)等通信標準的規範。主機200可以為手機、平板電腦、筆記型電腦、導航機或車載系統等各種電子產品。 1 is a schematic diagram showing a data storage device 100 and a host 200 according to an embodiment of the invention. In one embodiment, the data storage device 100 includes a controller 120, a non-volatile memory, and a random access memory (RAM) 180. Controller 120 includes an electronic efuse region 122. The data storage device 100 is coupled to the host 200 for transmitting data and instructions, or for receiving data and instructions. The non-volatile memory can be a NAND Flash, a Magnetoresistive RAM, a Ferroelectric RAM, or a Resistive memory. RAM, RRAM), Spin Transfer Torque-RAM (STT-RAM), etc., so that data can be saved for a long time. In the following description, the flash memory 140 will be described as an example, but not limited thereto. The data storage device 100 conforms to specifications of communication standards such as embedded flash memory module (eMMC) specifications, general flash memory (UFS), serial ATA (SATA), or non-volatile fast memory (NVMe). The host computer 200 can be various electronic products such as a mobile phone, a tablet computer, a notebook computer, a navigation machine, or an in-vehicle system.

如第1圖所示,控制器120耦接快閃記憶體140以及隨機存取記憶體180。隨機存取記憶體180用以暫存以及預取控制器120所需之資料,或是用以暫存主機200要寫入快閃記憶體140之資料,以加快資料儲存裝置100之存取時間。控制器120藉由控制快閃記憶體140以叢集(cluster)為單位執行讀取運作的方式來對快閃記憶體140執行讀取運作。此外,控制器120耦接快閃記憶體140,以相互傳送資料與指令或接收資料與指令。 As shown in FIG. 1 , the controller 120 is coupled to the flash memory 140 and the random access memory 180 . The random access memory 180 is used for temporarily storing and prefetching the data required by the controller 120, or for temporarily storing the data that the host 200 is to write to the flash memory 140 to speed up the access time of the data storage device 100. . The controller 120 performs a read operation on the flash memory 140 by controlling the flash memory 140 to perform a read operation in units of clusters. In addition, the controller 120 is coupled to the flash memory 140 to transmit data and instructions or receive data and instructions to each other.

電子熔絲區122主要係儲存關於資料儲存裝置100之安全性與存取操作的重要資料,例如,用以解碼第一金鑰的第二金鑰。在一般運作模式下,只有控制器120才能讀取電子熔絲區122所儲存之資料。在除錯模式下,電子熔絲區122會被關閉/屏閉以防止讀取。要注意的是,韌體資料係一次性寫入電子熔絲區122。 The electronic fuse area 122 primarily stores important information about the security and access operations of the data storage device 100, such as a second key used to decode the first key. In the normal mode of operation, only the controller 120 can read the data stored in the electronic fuse area 122. In the debug mode, the electronic fuse area 122 is turned off/screened to prevent reading. It is to be noted that the firmware data is written to the electronic fuse area 122 at one time.

快閃記憶體140包括複數個區塊160~16N,N為正整數,例如2048。詳細而言,區塊160~16N中的每一者更包括複數個實體頁面160A~16NZ,A與Z為正整數,例如A=0而Z=256。區塊160包括實體頁面160A~160Z,區塊16N包括實體頁面16NA~16NZ。控制器120在對快閃記憶體140執行資料寫入或儲存動作時,是藉由控制快閃記憶體140以實體頁面為單位來執行資料寫入或程式化的運作。 Flash memory 140 includes a plurality of blocks 160-16N, N being a positive integer, such as 2048. In detail, each of the blocks 160-16N further includes a plurality of physical pages 160A-16NZ, and A and Z are positive integers, for example, A=0 and Z=256. Block 160 includes physical pages 160A-160Z, and block 16N includes physical pages 16NA~16NZ. When the controller 120 performs a data writing or storing operation on the flash memory 140, the controller 120 performs a data writing or stylization operation by controlling the flash memory 140 in units of physical pages.

對於快閃記憶體140而言,其實體頁面160A~16NZ的每一者皆具有不同的實體位址。換言之,實體頁面160A~16NZ的每一者都具有一個實體位址,而實體頁面 160A~16NZ的每一者的實體位址都是不同的。當資料儲存裝置100執行一寫入運作時,控制器120決定快閃記憶體140的一實體位址以寫入或儲存資料。此外,控制器120更會記錄資料的實體位址與邏輯位址的映射關係,此記錄乃儲存於映射表H2F中。因此,對於主機200而言,主機200係藉由邏輯位址,來讀取或寫入資料儲存裝置100所儲存於某個邏輯位址的資料。 For flash memory 140, each of its physical pages 160A-16NZ has a different physical address. In other words, each of the physical pages 160A~16NZ has one physical address, and the physical addresses of each of the physical pages 160A~16NZ are different. When the data storage device 100 performs a write operation, the controller 120 determines a physical address of the flash memory 140 to write or store data. In addition, the controller 120 records the mapping relationship between the physical address and the logical address of the data, and the record is stored in the mapping table H2F. Therefore, for the host 200, the host 200 reads or writes the data stored in the logical storage address of the data storage device 100 by using the logical address.

第2A圖係顯示根據本發明一實施例所述之用於認證韌體資料之資料儲存方法之示意圖。韌體資料10A係由一編譯器(compiler)所產生。接著,如第2A圖所示,韌體資料10A藉由安全雜湊機制(Secure Hash Algorithm,SHA)300以產生一雜湊資料10B。舉例而言,韌體資料10A係藉由SHA-256之運算以產生256bits長度的雜湊資料10B。要注意的是上述SHA僅是用於例示,而非用以限制本發明。 FIG. 2A is a schematic diagram showing a data storage method for authenticating firmware data according to an embodiment of the invention. The firmware data 10A is generated by a compiler. Next, as shown in FIG. 2A, the firmware data 10A generates a hash data 10B by a Secure Hash Algorithm (SHA) 300. For example, the firmware data 10A is operated by SHA-256 to generate a 256-bit length hash data 10B. It is to be noted that the above SHA is for illustrative purposes only and is not intended to limit the invention.

在一實施例中,控制器120接收韌體資料10A,並且對韌體資料10A進行安全雜湊機制300,而產生並接收雜湊資料10B。在另一實施例中,係由其他裝置(例如主機200)對韌體資料10A進行安全雜湊機制300以產生雜湊資料10B,並且控制器120接收該雜湊資料10B。 In one embodiment, the controller 120 receives the firmware data 10A and performs a secure hashing mechanism 300 on the firmware data 10A to generate and receive the hash data 10B. In another embodiment, the firmware data 10A is subjected to a secure hash mechanism 300 by other devices (e.g., host 200) to generate hash material 10B, and controller 120 receives the hash data 10B.

在一實施例中,控制器120將雜湊資料10B區分為複數個資料群組,以一預定排序機制320對上述資料群組進行排序而產生排序雜湊資料10C。上述預定排序機制320係儲存於控制器120之電子熔絲區122。舉例而言,雜湊資料10B之大小為8個位元組(bytes),其內容如下所示: In an embodiment, the controller 120 divides the hash data 10B into a plurality of data groups, and sorts the data groups by a predetermined sorting mechanism 320 to generate sorting hash data 10C. The predetermined ordering mechanism 320 is stored in the electronic fuse area 122 of the controller 120. For example, the size of the hash data 10B is 8 bytes, and its contents are as follows:

表格1顯示了雜湊資料10B之每一位元組的資料。在一實施例中,控制器120將上述8個位元組資料進行分組,而產生複數個資料群組。舉例而言,每個資料群組的大小為1byte,亦即每1byte的資料皆各自成為一個資料群組。在另一實施例中,每個資料群組的大小為2byte,亦即將2個1byte的資料是為一個資料群組。例如表格1中的0x54和0x47為一資料群組,表格1中的0x28和0x00為一另資料群組。要注意的是上述資料群組之大小僅是用於例示,而非用以限制本發明。本技術領域中具有通常知識者依據本發明之內容而設定其他大小之資料群組,仍不脫離本發明之精神與範疇。 Table 1 shows the data for each tuple of the hash data 10B. In an embodiment, the controller 120 groups the above 8 byte data to generate a plurality of data groups. For example, the size of each data group is 1 byte, that is, each 1 byte of data becomes a data group. In another embodiment, each data group has a size of 2 bytes, that is, two 1 byte data is a data group. For example, 0x54 and 0x47 in Table 1 are a data group, and 0x28 and 0x00 in Table 1 are another data group. It is to be noted that the size of the above data group is for illustration only and is not intended to limit the invention. Those skilled in the art will be able to set other sizes of data groups in accordance with the teachings of the present invention without departing from the spirit and scope of the present invention.

在此實施例中,雜湊資料10B的大小為8bytes,在另一實施例中,雜湊資料10B的大小為32bytes。如果使用較複雜的安全雜湊機制300與預定排序機制320,或是另外使用其他機制(例如預定分割機制或預定再壓縮機制),則電子熔絲區122需要較大儲存容量來儲存上述機制。上述預定分割機制以及預定再壓縮機制將分別在第3圖以及第4圖中詳細說明。 In this embodiment, the size of the hash material 10B is 8 bytes, and in another embodiment, the size of the hash material 10B is 32 bytes. If a more complex secure hash mechanism 300 is used with the predetermined sorting mechanism 320, or otherwise using other mechanisms (e.g., a predetermined splitting mechanism or a predetermined recompression mechanism), the e-fuse zone 122 requires a larger storage capacity to store the above mechanism. The predetermined division mechanism and the predetermined recompression mechanism described above will be described in detail in FIGS. 3 and 4, respectively.

在此實施例中,每1byte的資料皆各自成為一個資料群組。換言之,表格1中的0x54為一資料群組,0x28為另一資料群組。然後,上述雜湊資料10B藉由預定排序機制 320以資料群組為單位進行排序,而產生排序雜湊資料10C。要注意的是,預定排序機制300係以表格化方式儲存於電子熔絲區122。舉例而言,預定排序機制300如表格2所示: In this embodiment, each 1 byte of data becomes a data group. In other words, 0x54 in Table 1 is a data group, and 0x28 is another data group. Then, the hash data 10B is sorted by the predetermined sorting mechanism 320 in units of data groups, and the sorting hash data 10C is generated. It is to be noted that the predetermined ordering mechanism 300 is stored in the electronic fuse area 122 in a tabular manner. For example, the predetermined ordering mechanism 300 is as shown in Table 2:

預定排序機制320改變了雜湊資料10B的內容的位址,如第9圖所示,0x54由Byte 6的位置變更到Byte 5的位置,0x28由Byte 4的位置變更到Byte 1的位置,0x47由Byte 2的位置變更到Byte 0的位置,最後產生了排序雜湊資料10C。 The predetermined sorting mechanism 320 changes the address of the content of the hash material 10B. As shown in FIG. 9, 0x54 is changed from the position of Byte 6 to the position of Byte 5, and 0x28 is changed from the position of Byte 4 to the position of Byte 1, 0x47 The position of Byte 2 is changed to the position of Byte 0, and finally the sorting hash data 10C is generated.

詳細而言,本發明之資料儲存方法提供了雙重的保護機制,分別是安全雜湊機制300以及預定排序機制320。安全雜湊機制300所產生之雜湊資料10B(如表格1所示),會藉由預定排序機制320而重新排列成排序雜湊資料10C(如表格3所示)。如果有第三人要將不合法的韌體資料更新至資料儲存裝置100,上述不合法的韌體資料透過其他安全雜湊機制後所產生的雜湊資料將不同於本案之排序雜湊資料10C。因此,控制器120可據以判斷上述雜湊資料是不合法的,並且拒絕將該不合法的韌體資料安裝或更新至資料儲存裝置100。 In detail, the data storage method of the present invention provides a dual protection mechanism, namely a security hash mechanism 300 and a predetermined ordering mechanism 320. The hash data 10B generated by the secure hash mechanism 300 (as shown in Table 1) is rearranged into sorted hash data 10C (as shown in Table 3) by a predetermined sorting mechanism 320. If a third person wants to update the illegal firmware information to the data storage device 100, the hash data generated by the above illegal firmware data through other security hash mechanisms will be different from the sorted hash data 10C of the present case. Therefore, the controller 120 can determine that the hash data is illegal and refuse to install or update the illegal firmware data to the data storage device 100.

第2B圖係顯示根據本發明另一實施例所述之用於認證韌體資料之資料儲存方法之示意圖。在此實施例中,排序雜湊資料10C與韌體資料10A形成韌體封包10X。然後,預定排序機制320對上述排序雜湊資料10C進行反向排序以產生雜 湊資料10B。 2B is a schematic diagram showing a data storage method for authenticating firmware data according to another embodiment of the present invention. In this embodiment, the sorting hash data 10C forms a firmware packet 10X with the firmware data 10A. The predetermined sorting mechanism 320 then reverse sorts the sorted hash data 10C to produce the hash material 10B.

在一實施例中,上述雜湊資料10B的產生方式或儲存位置係由資料儲存裝置100之製造商所設定。由於第三人並未知悉上述雜湊資料10B的產生方式或儲存位置,因此控制器120能夠檢測另一韌體資料是否合法與正確。因此,本發明之資料儲存方法能夠避免安裝或更新不合法的韌體資料,以確保資料儲存裝置100不會受到惡意的破壞。 In one embodiment, the manner in which the hash data 10B is generated or the storage location is set by the manufacturer of the data storage device 100. Since the third person is not aware of the manner in which the hash data 10B is generated or the storage location, the controller 120 can detect whether the other firmware data is legal and correct. Therefore, the data storage method of the present invention can avoid installing or updating illegal firmware data to ensure that the data storage device 100 is not maliciously damaged.

在一實施例中,預定排序機制320係由資料儲存裝置100之製造商所設定。舉例而言,第三人從不合法的手段而得知安全雜湊機制300,且知雜湊資料10B的儲存位置,並將另一韌體資料與雜湊資料10B形成韌體封包,意圖將不合法的另一韌體資料更新至資料儲存裝置100。由於第三人並未得知預定排序機制320,所以韌體封包包含的是雜湊資料10B,而非透過預定排序機制320而產生的排序雜湊資料10C。因此,控制器120可輕易地判斷排序雜湊資料10C與雜湊資料10B的不同,進而判斷上述韌體資料是不合法的,並且拒絕將該不合法的韌體資料安裝或更新至資料儲存裝置100,以防止資料儲存裝置100受到惡意的破壞。 In one embodiment, the predetermined ordering mechanism 320 is set by the manufacturer of the data storage device 100. For example, the third person learns the security hash mechanism 300 from the illegal means, and knows the storage location of the hash data 10B, and forms another firmware file and the hash data 10B into a firmware package, and the intention is that it is illegal. The other firmware data is updated to the data storage device 100. Since the third person does not know the predetermined sorting mechanism 320, the firmware packet contains the hashed material 10B instead of the sorted hash data 10C generated by the predetermined sorting mechanism 320. Therefore, the controller 120 can easily determine the difference between the sorted hash data 10C and the hash data 10B, thereby determining that the firmware information is illegal, and refuses to install or update the illegal firmware data to the data storage device 100. In order to prevent the data storage device 100 from being maliciously damaged.

第2C圖係顯示根據本發明一實施例所述之韌體資料之示意圖。如第2C圖所示,在一實施例中,排序雜湊資料10C係儲存於韌體資料10A之上。另外,韌體資料10A之下則儲存了與韌體相關之其他資料10D。換言之,韌體封包10X係包括韌體資料10A、排序雜湊資料10C以及其他資料10D。舉例而言,其他資料10D係包括韌體版本、安全雜湊機制300 的版本、以及其他客戶所欲儲存的安全資訊。可想而知地,排序雜湊資料10C亦可儲存於韌體資料10A之下。 2C is a schematic diagram showing firmware data according to an embodiment of the present invention. As shown in FIG. 2C, in an embodiment, the sorting hash data 10C is stored on the firmware data 10A. In addition, under the firmware data 10A, other materials related to the firmware 10D are stored. In other words, the firmware package 10X includes the firmware data 10A, the sorted hash data 10C, and other materials 10D. For example, other data 10D includes the firmware version, the version of the security hash mechanism 300, and other security information that the customer wants to store. It is conceivable that the sorting hash data 10C can also be stored under the firmware data 10A.

當資料儲存裝置100收到韌體封包10X時,控制器120會對韌體封包10X的韌體資料10A執行安全雜湊機制300以得到雜湊資料20B,然後再執行預定排序機制320以得到排序雜湊資料20C。在一實施例中,控制器120會比對排序雜湊資料20C以及韌體封包10X所儲存的排序雜湊資料10C。如果比對結果為兩者相同,則表示韌體資料10A為合法正確的。如果比對結果為兩者不同,則表示韌體資料10A是非法的。 When the data storage device 100 receives the firmware package 10X, the controller 120 executes a secure hash mechanism 300 on the firmware data 10A of the firmware package 10X to obtain the hash data 20B, and then executes the predetermined sorting mechanism 320 to obtain the sorted hash data. 20C. In one embodiment, the controller 120 compares the sorted hash data 20C and the sorted hash data 10C stored by the firmware package 10X. If the comparison result is the same, it means that the firmware data 10A is legally correct. If the comparison result is different, it means that the firmware data 10A is illegal.

在另一實施例中,儲存裝置100收到韌體封包10X時,控制器120會對韌體封包10X的韌體資料10A執行安全雜湊機制300以得到雜湊資料20B。然後,控制器120會對韌體封包10X所儲存的排序雜湊資料10C執行反向預定排序機制320以得到雜湊資料10B。然後,控制器120比對雜湊資料20B以及韌體封包10X所儲存的雜湊資料10B。如果比對結果為兩者相同,則表示韌體資料10A為合法正確的。如果比對結果為兩者不同,則表示韌體資料10A是非法的。 In another embodiment, when the storage device 100 receives the firmware package 10X, the controller 120 performs a secure hash mechanism 300 on the firmware data 10A of the firmware package 10X to obtain the hash data 20B. Then, the controller 120 performs a reverse predetermined sorting mechanism 320 on the sorted hash data 10C stored by the firmware packet 10X to obtain the hash data 10B. Then, the controller 120 compares the hash data 20B and the hash data 10B stored in the firmware package 10X. If the comparison result is the same, it means that the firmware data 10A is legally correct. If the comparison result is different, it means that the firmware data 10A is illegal.

第3圖係顯示根據本發明一實施例所述之用於認證韌體資料之資料儲存方法之示意圖。在此實施例中,資料儲存方法更包括一預定分割機制340,以促進韌體資料的認證並且提升安全性。如第3圖所示,預定分割機制340將韌體資料10A分割為4個韌體資料10A-1、10A-2、10A-3以及10A-4(亦即子韌體資料)。換言之,4個韌體資料10A-1、10A-2、10A-3以及10A-4之總和就是原本的韌體資料10A。 3 is a schematic diagram showing a data storage method for authenticating firmware data according to an embodiment of the invention. In this embodiment, the data storage method further includes a predetermined segmentation mechanism 340 to facilitate authentication of the firmware data and improve security. As shown in FIG. 3, the predetermined segmentation mechanism 340 divides the firmware data 10A into four firmware data 10A-1, 10A-2, 10A-3, and 10A-4 (ie, child firmware data). In other words, the sum of the four firmware data 10A-1, 10A-2, 10A-3, and 10A-4 is the original firmware data 10A.

要注意的是,上述4個韌體資料10A-1~10A-4之分割僅是用於例示,而非用以限制本發明。本技術領域中具有通常知識者依據本發明之內容而分割為其他數量之韌體資料,仍不脫離本發明之範疇。 It is to be noted that the above four firmware data 10A-1~10A-4 are divided for illustration only and are not intended to limit the present invention. Those skilled in the art having the knowledge of the present invention are divided into other quantities of firmware data in accordance with the teachings of the present invention without departing from the scope of the present invention.

然後,安全雜湊機制300分別將4個韌體資料10A-1、10A-2、10A-3以及10A-4進行雜湊運算,並且分別產生4個雜湊資料10B-1、10B-2、10B-3以及10B-4(亦即子雜湊資料)。4個雜湊資料10B-1、10B-2、10B-3以及10B-4之總和就是雜湊資料10B。 Then, the secure hash mechanism 300 performs a hash operation on the four firmware files 10A-1, 10A-2, 10A-3, and 10A-4, respectively, and generates four hash data 10B-1, 10B-2, and 10B-3, respectively. And 10B-4 (that is, sub-blind information). The sum of the four hash materials 10B-1, 10B-2, 10B-3, and 10B-4 is the hash data 10B.

在一實施例中,預定排序機制320分別將4個雜湊資料10B-1、10B-2、10B-3以及10B-4進行排序,並且分別產生4個排序雜湊資料10C-1、10C-2、10C-3以及10C-4。4個排序雜湊資料10C-1、10C-2、10C-3以及10C-4之總和即為排序雜湊資料10C。在另一實施例中,預定排序機制320係同時對全部的4個雜湊資料10B-1、10B-2、10B-3以及10B-4進行排序,而產生1個排序雜湊資料10C。 In an embodiment, the predetermined ordering mechanism 320 sorts the four hash data 10B-1, 10B-2, 10B-3, and 10B-4, respectively, and generates four sorting hash data 10C-1, 10C-2, respectively. 10C-3 and 10C-4. The sum of the four sorting hash data 10C-1, 10C-2, 10C-3, and 10C-4 is the sorting hash data 10C. In another embodiment, the predetermined ranking mechanism 320 sorts all of the four hash materials 10B-1, 10B-2, 10B-3, and 10B-4 simultaneously, resulting in one sorted hash data 10C.

第4圖係顯示根據本發明另一實施例所述之用於認證韌體資料之資料儲存方法之示意圖。在此實施例中,資料儲存方法更包括一預定再壓縮機制360,對韌體資料10A進行兩次以上的加密與壓縮,以促進韌體資料10A的認證並且提升安全性。如第4圖所示,預定分割機制340將韌體資料10A分割為4個韌體資料10A-1、10A-2、10A-3以及10A-4。 4 is a schematic diagram showing a data storage method for authenticating firmware data according to another embodiment of the present invention. In this embodiment, the data storage method further includes a predetermined recompression mechanism 360 for performing two or more encryptions and compressions on the firmware data 10A to facilitate the authentication of the firmware data 10A and improve security. As shown in FIG. 4, the predetermined segmentation mechanism 340 divides the firmware data 10A into four firmware files 10A-1, 10A-2, 10A-3, and 10A-4.

然後,預定再壓縮機制360對4個韌體資料10A-1、10A-2、10A-3以及10A-4進行多重壓縮(亦即兩次以上的加密 與壓縮)的安排。如第4圖所示,預定再壓縮機制360將韌體資料10A-1與10A-2安排為一組,將韌體資料10A-3與10A-4安排為另一組。然後,兩組韌體資料分別藉由安全雜湊機制300進行加密與壓縮,並且分別產生2個雜湊資料10B-5以及10B-6(第一子雜湊資料)。換言之,雜湊資料10B-5係由韌體資料10A-1與10A-2所產生,雜湊資料10B-6係由韌體資料10A-3與10A-4所產生。 Then, the predetermined recompression mechanism 360 performs an arrangement of multiple compression (i.e., more than two encryption and compression) on the four firmware files 10A-1, 10A-2, 10A-3, and 10A-4. As shown in FIG. 4, the predetermined recompression mechanism 360 arranges the firmware data 10A-1 and 10A-2 into one group, and arranges the firmware data 10A-3 and 10A-4 as another group. Then, the two sets of firmware data are encrypted and compressed by the secure hash mechanism 300, respectively, and two hash data 10B-5 and 10B-6 (first sub-heap data) are generated respectively. In other words, the hash data 10B-5 is generated by the firmware data 10A-1 and 10A-2, and the hash data 10B-6 is produced by the firmware data 10A-3 and 10A-4.

然後,如第4圖所示,2個雜湊資料10B-5以及10B-6再藉由安全雜湊機制300進行第2次的壓縮,而產生雜湊資料10B-7(第二子雜湊資料)。然後,在此實施例中,預定排序機制320對雜湊資料10B-7進行排序,而產生1個排序雜湊資料10C-5。由於此實施例使用了2次以上的安全壓縮機制300,因此能進一步提升辨識韌體資料是否正確的可靠度與準確度。 Then, as shown in Fig. 4, the two hash data 10B-5 and 10B-6 are compressed by the secure hash mechanism 300 for the second time, and the hash data 10B-7 (second sub-mesh data) is generated. Then, in this embodiment, the predetermined ordering mechanism 320 sorts the hashed material 10B-7 to produce 1 sorted hash material 10C-5. Since this embodiment uses more than two security compression mechanisms 300, the reliability and accuracy of identifying the firmware data can be further improved.

要注意的是上述4個韌體資料10A-1~10A-4之分割以及2次壓縮僅是用於例示,而非用以限制本發明。本技術領域中具有通常知識者依據本發明之內容而分割為其他數量之韌體資料或是進行其他次數之加密與壓縮,仍不脫離本發明之範疇。 It is to be noted that the division of the above four firmware data 10A-1~10A-4 and the second compression are for illustration only, and are not intended to limit the present invention. Those skilled in the art will be able to divide into other quantities of firmware data or perform other times of encryption and compression according to the content of the present invention without departing from the scope of the present invention.

第5A圖係顯示根據本發明一實施例所述之用於認證韌體資料之電子熔絲區122之示意圖。在一實施例中,電子熔絲區122係包括複數個特定區域122-1~122-8,用以分別儲存特定資料。如第5A圖所示,預定排序機制320係儲存於特定區域122-1。換言之,特定區域122-1只能用於儲存預定排 序機制320,不能儲存其他機制或其他資料。此外,上述預定排序機制320係一次性寫入電子熔絲區122,並且只有控制器120才能加以讀取。 Figure 5A is a schematic diagram showing an electronic fuse region 122 for authenticating firmware data in accordance with an embodiment of the present invention. In one embodiment, the e-fuse region 122 includes a plurality of specific regions 122-1 through 122-8 for storing specific data, respectively. As shown in FIG. 5A, the predetermined ordering mechanism 320 is stored in the specific area 122-1. In other words, the specific area 122-1 can only be used to store the predetermined ordering mechanism 320, and cannot store other mechanisms or other materials. Moreover, the predetermined ordering mechanism 320 described above is written to the electronic fuse area 122 at one time and can only be read by the controller 120.

第5B圖係顯示根據本發明另一實施例所述之用於認證韌體資料之電子熔絲區之示意圖。在一些實施例中,資料儲存方法除了預定排序機制320之外,更包括預定分割機制340以及預定再壓縮機制360。要注意的是,如果上述機制的一者或是多者較為複雜,則可使用2個以上的特定區域來儲存1個機制。如第5B圖所示,預定排序機制320儲存於特定區域122-1,預定分割機制340儲存於特定區域122-2,以及預定再壓縮機制360儲存於特定區域122-3。 FIG. 5B is a schematic diagram showing an electronic fuse region for authenticating firmware data according to another embodiment of the present invention. In some embodiments, the data storage method includes a predetermined segmentation mechanism 340 and a predetermined recompression mechanism 360 in addition to the predetermined ordering mechanism 320. It should be noted that if one or more of the above mechanisms are more complicated, more than two specific areas may be used to store one mechanism. As shown in FIG. 5B, the predetermined ordering mechanism 320 is stored in the specific area 122-1, the predetermined segmentation mechanism 340 is stored in the specific area 122-2, and the predetermined recompression mechanism 360 is stored in the specific area 122-3.

第6圖係顯示根據本發明一實施例所述之用於認證韌體資料之資料儲存方法之流程圖。在步驟S602中,控制器120自電子熔絲區122中讀取預定排序機制320。然後,在步驟S604中,控制器120取得韌體資料及其相關之第一排序雜湊資料,其中,韌體資料及第一排序雜湊資料係取自於韌體封包。在步驟S606中,控制器120對韌體資料執行安全雜湊機制300以產生第二雜湊資料。在步驟S608中,控制器120對第二雜湊資料執行預定排序機制320以產生第二排序雜湊資料。在步驟S610中,控制器120判斷第二排序雜湊資料是否相同於第一排序雜湊資料。如果比對結果為否,則執行步驟S614,中止本發明用於認證韌體資料之資料儲存方法的執行。如果比對結果為是,則執行步驟S612,控制器120以韌體資料對資料儲存裝置100進行韌體的更新。由此可知,在步驟 S610中,藉由判斷第二排序雜湊資料是否相同於步驟S604所取得第一排序雜湊資料,就能夠偵測出所欲安裝之韌體資料,是否為資料儲存裝置100之製造商所認證之正確合法的韌體資料。依據本發明之資料儲存裝置以及資料儲存方法,能夠判斷上述韌體資料是否正確與合法,以保護資料儲存裝置100。 Figure 6 is a flow chart showing a method of storing data for authenticating firmware data according to an embodiment of the invention. In step S602, the controller 120 reads the predetermined ordering mechanism 320 from the electronic fuse area 122. Then, in step S604, the controller 120 obtains the firmware data and the related first sorting hash data, wherein the firmware data and the first sorting hash data are taken from the firmware packet. In step S606, the controller 120 executes a secure hash mechanism 300 on the firmware data to generate second hash data. In step S608, the controller 120 performs a predetermined sorting mechanism 320 on the second hash data to generate second sorting hash data. In step S610, the controller 120 determines whether the second sorting hash data is identical to the first sorting hash data. If the comparison result is no, step S614 is executed to suspend execution of the data storage method for authenticating the firmware data of the present invention. If the comparison result is yes, step S612 is executed, and the controller 120 performs firmware update on the data storage device 100 with the firmware data. Therefore, in step S610, by determining whether the second sorting hash data is identical to the first sorting hash data obtained in step S604, it is possible to detect whether the firmware information to be installed is the manufacturing of the data storage device 100. The correct legal firmware information certified by the firm. According to the data storage device and the data storage method of the present invention, it is possible to determine whether the firmware data is correct and legal to protect the data storage device 100.

在另一實施例中,步驟S608可變更為控制器120對第一排序雜湊資料執行反向預定排序機制320以產生第一雜湊資料;步驟S610可變更為控制器120判斷第二雜湊資料是否相同於第一雜湊資料。此實施例與上述實施例的主要差異乃在於執行預定排序機制320的標的為何以及執行方式。如果標的是第二雜湊資料,則對第二雜湊資料執行預定排序機制320。如果標的是第一排序雜湊資料,則對第一排序雜湊資料執行反向預定排序機制320。其餘步驟相同。 In another embodiment, step S608 is further variable. The controller 120 performs a reverse predetermined ordering mechanism 320 on the first sorted hash data to generate the first hash data. The step S610 is further variable to determine whether the second hash data is the same. In the first hash information. The main difference between this embodiment and the above embodiment is the reason why the target of the predetermined sorting mechanism 320 is executed and the manner of execution. If the target is the second hashed material, a predetermined sorting mechanism 320 is performed on the second hashed material. If the target is the first sorted hash material, a reverse predetermined sorting mechanism 320 is performed on the first sorted hash material. The remaining steps are the same.

第7圖係顯示根據本發明另一實施例所述之用於認證韌體資料之資料儲存方法之流程圖。在步驟S702中,控制器120自電子熔絲區122取得預定排序機制320。在步驟S704中,控制器120接收韌體資料及第一排序雜湊資料,其中,韌體資料及第一排序雜湊資料係取自於韌體封包,且第一排序雜湊資料包括複數第一子排序雜湊資料。在步驟S706中,控制器120以一預定分割機制將韌體資料分割為複數個第二子韌體資料。在步驟S708中,控制器120對每一複數個第二子韌體資料執行安全雜湊機制300以產生複數個第二子雜湊資料。在步驟S710中,控制器120對每一個第二子雜湊資料執行預定排序機制320以產生複數個第二排序子雜湊資料。在步驟 S712中,控制器120判斷第二排序子雜湊資料是否相同於第一排序子雜湊資料。如果比對結果為否,則中止本發明用於認證韌體資料之資料儲存方法的執行。如果比對結果為是,則執行步驟S714,控制器120以韌體資料對資料儲存裝置100進行韌體的更新。 Figure 7 is a flow chart showing a method of storing data for authenticating firmware data according to another embodiment of the present invention. In step S702, the controller 120 obtains a predetermined ordering mechanism 320 from the electronic fuse area 122. In step S704, the controller 120 receives the firmware data and the first sorting hash data, wherein the firmware data and the first sorting hash data are taken from the firmware packet, and the first sorting hash data includes the first first sub-sorting. Hash data. In step S706, the controller 120 divides the firmware data into a plurality of second child firmware data by a predetermined segmentation mechanism. In step S708, the controller 120 performs a secure hashing mechanism 300 on each of the plurality of second child firmware data to generate a plurality of second sub-heap data. In step S710, the controller 120 performs a predetermined ordering mechanism 320 on each of the second sub-heap data to generate a plurality of second sorter hash data. In step S712, the controller 120 determines whether the second sorter hash data is identical to the first sorter hash data. If the result of the comparison is no, the execution of the data storage method for authenticating the firmware data of the present invention is suspended. If the comparison result is yes, step S714 is executed, and the controller 120 performs firmware update on the data storage device 100 with the firmware data.

第8圖係顯示根據本發明另一實施例所述之用於認證韌體資料之資料儲存方法之流程圖。在此實施例中,步驟S802至S806相同於第7圖之步驟S702至S706,故此處不再贅述。在步驟S808中,控制器120對每一複數個第二子韌體資料執行預定再壓縮機制360與安全雜湊機制300以產生複數個第二子雜湊資料。上述預定再壓縮機制360係儲存於電子熔絲區122的一第三特定區域。 Figure 8 is a flow chart showing a method of storing data for authenticating firmware data according to another embodiment of the present invention. In this embodiment, steps S802 to S806 are the same as steps S702 to S706 of FIG. 7, and therefore are not described herein again. In step S808, the controller 120 performs a predetermined recompression mechanism 360 and a secure hash mechanism 300 for each of the plurality of second child firmware data to generate a plurality of second sub-heap data. The predetermined recompression mechanism 360 is stored in a third specific area of the electronic fuse area 122.

然後,在步驟S810中,控制器120對每一個第二子雜湊資料執行安全雜湊機制300以產生第三子雜湊資料。在步驟S812中,控制器120對第三子雜湊資料執行預定排序機制320以產生第二排序子雜湊資料。在步驟S814中,控制器120判斷判斷第二排序子雜湊資料是否相同於第一排序子雜湊資料。如果比對結果為否,則執行步驟S818,中止本發明用於認證韌體資料之資料儲存方法的執行。如果比對結果為是,則執行步驟S816,控制器120以韌體資料對資料儲存裝置100進行韌體的更新。 Then, in step S810, the controller 120 executes a secure hashing mechanism 300 for each of the second sub-heap data to generate a third sub-heap material. In step S812, the controller 120 performs a predetermined ordering mechanism 320 on the third sub-heap material to generate a second sorted sub-heap material. In step S814, the controller 120 determines whether the second sorter hash data is the same as the first sorter hash data. If the comparison result is no, step S818 is performed to suspend execution of the data storage method for authenticating the firmware data of the present invention. If the comparison result is yes, then step S816 is performed, and the controller 120 performs firmware update on the data storage device 100 with the firmware data.

在另一實施例中,韌體資料10A亦可藉由加密機制,例如進階加密標準(Advanced Encryption Standard,AES)、或是RSA加密演算法,對韌體資料10A進行加密而產生加密 資料10B。 In another embodiment, the firmware data 10A may also encrypt the firmware data 10A by using an encryption mechanism, such as an Advanced Encryption Standard (AES) or an RSA encryption algorithm to generate the encrypted data 10B. .

本發明之方法,或特定型態或其部份,可以以程式碼的型態存在。程式碼可儲存於實體媒體,如軟碟、光碟片、硬碟、或是任何其他機器可讀取(如電腦可讀取)儲存媒體,亦或不限於外在形式之電腦程式產品,其中,當程式碼被機器,如電腦載入且執行時,此機器變成用以參與本發明之裝置。程式碼也可透過一些傳送媒體,如電線或電纜、光纖、或是任何傳輸型態進行傳送,其中,當程式碼被機器,如電腦接收、載入且執行時,此機器變成用以參與本發明之裝置。當在一般用途處理單元實作時,程式碼結合處理單元提供一操作類似於應用特定邏輯電路之獨特裝置。 The method of the invention, or a particular type or portion thereof, may exist in the form of a code. The code can be stored in a physical medium such as a floppy disk, a CD, a hard disk, or any other machine readable (such as computer readable) storage medium, or is not limited to an external form of computer program product, wherein When the code is loaded and executed by a machine, such as a computer, the machine becomes a device for participating in the present invention. The code can also be transmitted via some transmission medium, such as a wire or cable, fiber optics, or any transmission type, where the machine becomes part of the program when it is received, loaded, and executed by a machine, such as a computer. Invented device. When implemented in a general purpose processing unit, the code combination processing unit provides a unique means of operation similar to application specific logic.

在本說明書以及申請專利範圍中的序數,例如「第一」、「第二」、「第三」等等,彼此之間並沒有順序上的先後關係,其僅用於標示區分兩個具有相同名字之不同元件。本發明說明書中「耦接」一詞係泛指各種直接或間接之電性連接方式。本發明雖以較佳實施例揭露如上,然其並非用以限定本發明的範圍,任何熟習此項技藝者,在不脫離本發明之精神和範圍內,當可做些許的更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。 The ordinal numbers in this specification and the scope of the patent application, such as "first", "second", "third", etc., have no sequential relationship with each other, and are only used to indicate that two are identical. Different components of the name. The term "coupled" in this specification refers to a variety of direct or indirect electrical connections. The present invention has been described above with reference to the preferred embodiments thereof, and is not intended to limit the scope of the present invention, and the invention may be modified and modified without departing from the spirit and scope of the invention. The scope of the invention is defined by the scope of the appended claims.

Claims (11)

一種資料儲存裝置之韌體更新之方法,包括:從一電子熔絲中取得一預定排序機制,其中,該電子熔絲置於該資料儲存裝置的一控制器內部;取得一韌體封包;從該韌體封包取得一第一排序雜湊資料;對該韌體封包中的一韌體資料進行一雜湊計算以取得一第二雜湊資料;對該第二雜湊資料執行該預定排序機制以產生一第二排序雜湊資料;以及如果該第一排序雜湊資料相同於該第二排序雜湊資料,以該韌體資料進行該資料儲存裝置的韌體更新。  A method for updating a firmware of a data storage device, comprising: obtaining a predetermined sorting mechanism from an electronic fuse, wherein the electronic fuse is placed inside a controller of the data storage device; obtaining a firmware package; The firmware packet obtains a first sorting hash data; performing a hash calculation on a firmware data in the firmware packet to obtain a second hash data; and performing the predetermined sorting mechanism on the second hash data to generate a first And sorting the hash data; and if the first sorting hash data is identical to the second sorting hash data, performing firmware update of the data storage device with the firmware data.   如申請專利範圍第1項所述之韌體更新方法,其中該韌體封包從一記憶體裝置中取得。  The firmware update method of claim 1, wherein the firmware package is obtained from a memory device.   如申請專利範圍第1項所述之韌體更新方法,其中該預定排序機制調整該第二雜湊資料中複數資料群組的先後順序。  The firmware updating method according to claim 1, wherein the predetermined sorting mechanism adjusts a sequence of the plurality of data groups in the second hash data.   如申請專利範圍第1項所述之韌體更新方法,其中該第一排序雜湊資料與該第二排序雜湊資料具有相同的資料長度。  The firmware update method of claim 1, wherein the first sorted hash data has the same data length as the second sorted hash data.   如申請專利範圍第1項所述之韌體更新方法,其中,將該韌體資料儲存至該資料儲存裝置的一記憶體裝置以完成該資料儲存裝置的韌體更新。  The firmware update method of claim 1, wherein the firmware data is stored in a memory device of the data storage device to complete firmware update of the data storage device.   一種資料儲存裝置之韌體更新之方法,包括: 從一電子熔絲中取得一預定排序機制,其中,該電子熔絲置於該資料儲存裝置的一控制器內部;取得一韌體封包;從該韌體封包取得複數個第一排序子雜湊資料;依據一預定分割機制將該韌體封包中的一韌體資料分割為複數個子韌體資料;對每一該些子韌體資料執行一雜湊計算以取得複數個子雜湊資料;對每一該些子雜湊資料執行該預定排序機制以產生複數個第二排序子雜湊資料;以及如果該些第一排序子雜湊資料相同於該些第二排序子雜湊資料,以該韌體資料進行該資料儲存裝置的韌體更新。  A method for updating a firmware of a data storage device, comprising: obtaining a predetermined sorting mechanism from an electronic fuse, wherein the electronic fuse is placed inside a controller of the data storage device; obtaining a firmware package; The firmware packet obtains a plurality of first sorter hash data; the firmware data in the firmware packet is segmented into a plurality of firmware data according to a predetermined segmentation mechanism; and a hash is performed on each of the child firmware data Calculating to obtain a plurality of sub-heap data; performing the predetermined sorting mechanism on each of the sub-heap data to generate a plurality of second sorting sub-heap data; and if the first sorting hash data is identical to the second sorting The hash data is used to update the firmware of the data storage device with the firmware data.   如申請專利範圍第6項所述之韌體更新方法,其中該韌體封包從一記憶體裝置中取得。  The firmware update method of claim 6, wherein the firmware package is obtained from a memory device.   如申請專利範圍第6項所述之韌體更新方法,其中該預定排序機制調整每一該些子雜湊資料中複數資料群組的先後順序。  The firmware updating method according to claim 6, wherein the predetermined sorting mechanism adjusts a sequence of the plurality of data groups in each of the sub-heap data.   如申請專利範圍第6項所述之韌體更新方法,其中每一該第一排序子雜湊資料與每一該第二排序子雜湊資料具有相同的資料長度。  The firmware update method of claim 6, wherein each of the first sorted hash data has the same data length as each of the second sorted hash data.   如申請專利範圍第6項所述之韌體更新方法,其中,將該韌體資料儲存至該資料儲存裝置的一記憶體裝置以完成該資料儲存裝置的韌體更新。  The firmware update method of claim 6, wherein the firmware data is stored in a memory device of the data storage device to complete firmware update of the data storage device.   一種資料儲存裝置之韌體更新之方法,包括: 從一電子熔絲中取得一預定排序機制,其中,該電子熔絲置於該資料儲存裝置的一控制器內部;取得一韌體封包;從該韌體封包取得複數個第一排序子雜湊資料;依據一預定分割機制將該韌體封包中的一韌體資料分割為複數個子韌體資料;對每一該些子韌體資料執行一資料壓縮計算以及一雜湊計算以取得複數個子雜湊資料;對每一該些子雜湊資料執行該預定排序機制以產生複數個第二排序子雜湊資料;以及如果該些第一排序子雜湊資料相同於該些第二排序子雜湊資料,以該韌體資料進行該資料儲存裝置的韌體更新。  A method for updating a firmware of a data storage device, comprising: obtaining a predetermined sorting mechanism from an electronic fuse, wherein the electronic fuse is placed inside a controller of the data storage device; obtaining a firmware package; The firmware packet obtains a plurality of first sorter hash data; the firmware data in the firmware packet is segmented into a plurality of firmware data according to a predetermined segmentation mechanism; and a data is performed on each of the child firmware data Compressing a calculation and a hashing calculation to obtain a plurality of sub-heap data; performing the predetermined sorting mechanism on each of the sub-heap data to generate a plurality of second sorting hash data; and if the first sorting hash data is the same The second sorting sub-mesh data is used to perform firmware update of the data storage device.  
TW107120355A 2017-05-23 2017-05-23 Method for updating firmware of data storage device TWI678658B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107120355A TWI678658B (en) 2017-05-23 2017-05-23 Method for updating firmware of data storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107120355A TWI678658B (en) 2017-05-23 2017-05-23 Method for updating firmware of data storage device

Publications (2)

Publication Number Publication Date
TW201901407A true TW201901407A (en) 2019-01-01
TWI678658B TWI678658B (en) 2019-12-01

Family

ID=65803153

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107120355A TWI678658B (en) 2017-05-23 2017-05-23 Method for updating firmware of data storage device

Country Status (1)

Country Link
TW (1) TWI678658B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111695164A (en) * 2019-03-12 2020-09-22 东芝存储器株式会社 Electronic device and control method thereof
CN113051544A (en) * 2019-12-26 2021-06-29 瑞昱半导体股份有限公司 External device and verification updating method thereof
TWI736074B (en) * 2019-12-20 2021-08-11 瑞昱半導體股份有限公司 Peripheral devices and upgrade-verifying method thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750478B (en) * 2012-06-12 2016-03-30 福建睿矽微电子科技有限公司 A kind of safety chip possessing security certificate transfer and lock-in techniques
CN105706099B (en) * 2013-11-06 2018-11-30 三菱电机株式会社 software update device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111695164A (en) * 2019-03-12 2020-09-22 东芝存储器株式会社 Electronic device and control method thereof
TWI738020B (en) * 2019-03-12 2021-09-01 日商東芝記憶體股份有限公司 Electronic machine and its control method
US11113399B2 (en) 2019-03-12 2021-09-07 Toshiba Memory Corporation Electronic apparatus and control method of electronic apparatus
CN111695164B (en) * 2019-03-12 2023-11-24 铠侠股份有限公司 Electronic equipment and control methods
TWI736074B (en) * 2019-12-20 2021-08-11 瑞昱半導體股份有限公司 Peripheral devices and upgrade-verifying method thereof
CN113051544A (en) * 2019-12-26 2021-06-29 瑞昱半导体股份有限公司 External device and verification updating method thereof
CN113051544B (en) * 2019-12-26 2024-07-26 瑞昱半导体股份有限公司 External device and verification updating method thereof

Also Published As

Publication number Publication date
TWI678658B (en) 2019-12-01

Similar Documents

Publication Publication Date Title
TWI647610B (en) Data storage device and data storage method for confirming firmware data
TWI700627B (en) Data storage device and data storage method for confirming firmware data
US9760299B2 (en) Method and system for hijacking writes to a non-volatile memory
CN108985111A (en) Data storage device and firmware encryption and decryption method
US20200334028A1 (en) System and Method for Dynamic Data Deduplication for Firmware Updates
US8898351B2 (en) Dynamic compression of an I/O data block
US10339318B2 (en) Semiconductor memory system and operating method thereof
US11829464B2 (en) Apparatus and method for authentication of software
CN113767387A (en) Verifying data stored in memory using cryptographic hashes
TWI678658B (en) Method for updating firmware of data storage device
CN113841129A (en) Data attestation in memory
WO2019168878A1 (en) Method and apparatus for data encryption using standardized data storage and retrieval protocol
CN113632066A (en) Error identification in executed code
US12120100B2 (en) Secure communication between an intermediary device and a network
CN113796045A (en) Electronic control unit for confirming vehicle
CN113826071A (en) Over-the-air update acknowledgement
CN113632413B (en) Using storage as blocks in blockchain
TWI546667B (en) Method for managing memory card, memory storage device and memory control circuit unit
US12141286B2 (en) Establishing a chain of ownership of a device
CN112380171B (en) A YAFFS file system OOB identification method, terminal device and storage medium
CN111950675B (en) System and method for evaluating memory media
US12143519B2 (en) Using memory as a block in a block chain
US20250211448A1 (en) Storage device, operating method of controller, and system
US20240184454A1 (en) Storage device and operating method of the same
CN105988935A (en) Smart card management method, memory storage device and memory control circuit unit