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

Method for updating firmware of data storage device Download PDF

Info

Publication number
TWI678658B
TWI678658B TW107120355A TW107120355A TWI678658B TW I678658 B TWI678658 B TW I678658B TW 107120355 A TW107120355 A TW 107120355A TW 107120355 A TW107120355 A TW 107120355A TW I678658 B TWI678658 B TW I678658B
Authority
TW
Taiwan
Prior art keywords
data
firmware
hash
storage device
sub
Prior art date
Application number
TW107120355A
Other languages
Chinese (zh)
Other versions
TW201901407A (en
Inventor
江耀邦
Yao Pang Chiang
Original Assignee
慧榮科技股份有限公司
Silicon Motion, Inc.
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 慧榮科技股份有限公司, Silicon Motion, Inc. 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

Abstract

一種資料儲存裝置之韌體更新之方法,包括:從一電子熔絲中取得一預定排序機制,其中,該電子熔絲置於該資料儲存裝置的一控制器內部;取得一韌體封包;從該韌體封包取得一第一排序雜湊資料;對該韌體封包中的一韌體資料進行一雜湊計算以取得一第二雜湊資料;對該第二雜湊資料執行該預定排序機制以產生一第二排序雜湊資料;以及如果該第一排序雜湊資料相同於該第二排序雜湊資料,以該韌體資料進行該資料儲存裝置的韌體更新。 A method for updating firmware of a data storage device, comprising: obtaining a predetermined sequencing 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 sorted hash data; performs a hash calculation on the firmware data in the firmware packet to obtain a second hash data; executes the predetermined sorting mechanism on the second hash data to generate a first Two sorted hash data; and if the first sorted hash data is the same as the second sorted hash data, performing firmware update of the data storage device with the firmware data.

Description

資料儲存裝置之韌體更新之方法    Method for updating firmware 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 universal non-volatile data storage device that is electrically erased and programmed. Take NAND flash as an example, it is often used as a memory card, a universal serial bus flash device (USB flash device), a solid state drive (SSD), and an embedded flash memory. Body module (eMMC), universal flash memory (UFS), etc.

一般而言,資料儲存裝置可以透過對韌體的升級提升其效能及可靠性。韌體的更新可以確保資料儲存裝置保持在最新的狀態以及確保其相容性。然而,如果資料儲存裝置更新了錯誤或不合法的韌體,可能會導致資料儲存裝置無法正常的進行讀取或寫入等操作,甚至造成資料儲存裝置的損毀。因此,需要一種能夠有效並且方便認證韌體資料之資料儲存裝置與資料儲存方法,以確保將更新的韌體資料是合法以及正確的。 Generally speaking, data storage devices can improve their performance and reliability through firmware upgrades. Firmware updates ensure that data storage devices are kept up-to-date and compatible. However, if the data storage device is updated with incorrect or illegal firmware, it may cause the data storage device to fail to read or write normally, or even cause damage to the data storage device. Therefore, there is a need for a data storage device and a data storage method that can effectively and conveniently authenticate the firmware data to ensure that the firmware data to be updated is legal and correct.

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

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

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

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

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

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

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

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 data

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

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

10X‧‧‧韌體封包 10X‧‧‧Firmware packet

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

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

122‧‧‧電子熔絲區 122‧‧‧ E-fuse area

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

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‧‧‧ Security hashing mechanism

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

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

360‧‧‧預定再壓縮機制 360‧‧‧ scheduled recompression mechanism

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

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

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

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

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

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

第9圖係顯示根據本發明另一實施例所述之用於認證韌體資料之資料儲存方法之示意圖。 FIG. 9 is a schematic 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, specific embodiments of the present invention are specifically listed below, and described in detail with the accompanying drawings. The purpose is to explain the spirit of the present invention and not to limit the protection scope of the present invention. It should be understood that the following embodiments can be implemented by software, hardware, firmware, or any combination thereof.

第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可以為手機、平板電腦、筆記型電腦、導航機或車載系統等各種電子產品。 FIG. 1 is a schematic diagram showing a data storage device 100 and a host 200 according to an embodiment of the present invention. In one embodiment, the data storage device 100 includes a controller 120, a non-volatile memory, and a random access memory (RAM) 180. The controller 120 includes an e-fuse region 122. The data storage device 100 is coupled to the host 200 to transmit data and instructions or receive data and instructions. Non-volatile memory can be anti-gate flash memory (NAND Flash), magnetoresistive random access memory (Magnetoresistive RAM), ferroelectric random access memory (Ferroelectric RAM), resistive memory (Resistive RAM, RRAM), Spin Transfer Torque-RAM (STT-RAM), etc., so that data can be stored for a long time. In the following description, the flash memory 140 is taken as an example for description, but is not limited thereto. The data storage device 100 conforms to communication standards such as the embedded flash memory module (eMMC) specification, universal flash memory (UFS), serial ATA (SATA), or non-volatile fast memory (NVMe). The host 200 may be various electronic products such as a mobile phone, a tablet computer, a notebook computer, a navigation system, or a vehicle-mounted 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 to temporarily store and prefetch the data required by the controller 120, or used to temporarily store the data to be written into the flash memory 140 by the host 200 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 to each other or receive data and instructions.

電子熔絲區122主要係儲存關於資料儲存裝置100之安全性與存取操作的重要資料,例如,用以解碼第一金鑰的第二金鑰。在一般運作模式下,只有控制器120才能讀取電子熔絲區122所儲存之資料。在除錯模式下,電子熔絲區122會被關閉/屏閉以防止讀取。要注意的是,韌體資料係一次性寫入電子熔絲區122。 The electronic fuse area 122 is mainly used to store important data about the security and access operations of the data storage device 100, such as a second key used to decode a first key. In the normal operation mode, only the controller 120 can read the data stored in the electronic fuse area 122. In the debug mode, the e-fuse area 122 is closed / screened to prevent reading. It should be noted that the firmware data is written into the e-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以實體頁面為單位來執行資料寫入或程式化的運作。 The flash memory 140 includes a plurality of blocks 160 to 16N, where N is a positive integer, such as 2048. In detail, each of the blocks 160 to 16N further includes a plurality of physical pages 160A to 16NZ, where A and Z are positive integers, such as 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 storage operation on the flash memory 140, the controller 120 controls the flash memory 140 to perform data writing or programming operations in units of physical pages.

對於快閃記憶體140而言,其實體頁面160A~16NZ的每一者皆具有不同的實體位址。換言之,實體頁面160A~16NZ的每一者都具有一個實體位址,而實體頁面 160A~16NZ的每一者的實體位址都是不同的。當資料儲存裝置100執行一寫入運作時,控制器120決定快閃記憶體140的一實體位址以寫入或儲存資料。此外,控制器120更會記錄資料的實體位址與邏輯位址的映射關係,此記錄乃儲存於映射表H2F中。因此,對於主機200而言,主機200係藉由邏輯位址,來讀取或寫入資料儲存裝置100所儲存於某個邏輯位址的資料。 For the 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 a physical address, and each of the physical pages 160A-16NZ has a different physical address. 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 further records the mapping relationship between the physical address and the logical address of the data. This record is stored in the mapping table H2F. Therefore, for the host 200, the host 200 reads or writes data stored in a certain logical address by the data storage device 100 by using a 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 present invention. The firmware data 10A is generated by a compiler. Then, as shown in FIG. 2A, the firmware data 10A generates a hash data 10B by using a secure hash algorithm (SHA) 300. For example, the firmware data 10A is a hash data 10B with a length of 256 bits by the operation of SHA-256. It should be noted that the above-mentioned SHA is only for illustration and is not intended to limit the present 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 hash mechanism 300 on the firmware data 10A to generate and receive the hash data 10B. In another embodiment, other devices (such as the host 200) perform a secure hashing mechanism 300 on the firmware data 10A to generate a hash data 10B, and the controller 120 receives the hash data 10B.

在一實施例中,控制器120將雜湊資料10B區分為複數個資料群組,以一預定排序機制320對上述資料群組進行排序而產生排序雜湊資料10C。上述預定排序機制320係儲存於控制器120之電子熔絲區122。舉例而言,雜湊資料10B之大小為8個位元組(bytes),其內容如下所示: In one 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 a sorted hash data 10C. The predetermined sequencing 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 content is as follows:

表格1顯示了雜湊資料10B之每一位元組的資料。在一實施例中,控制器120將上述8個位元組資料進行分組,而產生複數個資料群組。舉例而言,每個資料群組的大小為1byte,亦即每1byte的資料皆各自成為一個資料群組。在另一實施例中,每個資料群組的大小為2byte,亦即將2個1byte的資料是為一個資料群組。例如表格1中的0x54和0x47為一資料群組,表格1中的0x28和0x00為一另資料群組。要注意的是上述資料群組之大小僅是用於例示,而非用以限制本發明。本技術領域中具有通常知識者依據本發明之內容而設定其他大小之資料群組,仍不脫離本發明之精神與範疇。 Table 1 shows the data for each byte 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, the size of each data group is 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 should be noted that the size of the above data group is only for illustration, and is not intended to limit the present invention. Those skilled in the art can set data groups of other sizes according to the content 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 data 10B is 8 bytes. In another embodiment, the size of the hash data 10B is 32 bytes. If a more complex security hashing mechanism 300 and a predetermined sequencing mechanism 320 are used, or other mechanisms (such as a predetermined partitioning mechanism or a predetermined recompression mechanism) are used, the e-fuse area 122 needs a larger storage capacity to store the above mechanism. The predetermined partitioning mechanism and the predetermined recompression mechanism will be described in detail in FIG. 3 and FIG. 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 above-mentioned hash data 10B is sorted in units of data groups by a predetermined sorting mechanism 320 to generate sorted hash data 10C. It should be noted that the predetermined sorting mechanism 300 is stored in a tabular manner in the e-fuse area 122. For example, the predetermined sorting mechanism 300 is 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 data 10B. As shown in FIG. 9, 0x54 is changed from the position of Byte 6 to Byte 5, 0x28 is changed from the position of Byte 4 to Byte 1, and 0x47 is changed from The position of Byte 2 was changed to the position of Byte 0, and finally the sorted hash data 10C was generated.

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

在一實施例中,上述雜湊資料10B的產生方式或儲存位置係由資料儲存裝置100之製造商所設定。由於第三人並未知悉上述雜湊資料10B的產生方式或儲存位置,因此控制器120能夠檢測另一韌體資料是否合法與正確。因此,本發明之資料儲存方法能夠避免安裝或更新不合法的韌體資料,以確保資料儲存裝置100不會受到惡意的破壞。 In one embodiment, the generation method or storage location of the hash data 10B is set by the manufacturer of the data storage device 100. Since the third person does not know the generation method or storage location of the hash data 10B, 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, so as to ensure that the data storage device 100 will not be maliciously damaged.

在一實施例中,預定排序機制320係由資料儲存裝置100之製造商所設定。舉例而言,第三人從不合法的手段而得知安全雜湊機制300,且知雜湊資料10B的儲存位置,並將另一韌體資料與雜湊資料10B形成韌體封包,意圖將不合法的另一韌體資料更新至資料儲存裝置100。由於第三人並未得知預定排序機制320,所以韌體封包包含的是雜湊資料10B,而非透過預定排序機制320而產生的排序雜湊資料10C。因此,控制器120可輕易地判斷排序雜湊資料10C與雜湊資料10B的不同,進而判斷上述韌體資料是不合法的,並且拒絕將該不合法的韌體資料安裝或更新至資料儲存裝置100,以防止資料儲存裝置100受到惡意的破壞。 In one embodiment, the predetermined sorting mechanism 320 is set by a manufacturer of the data storage device 100. For example, a third person learns the secure hash mechanism 300 from illegal means, and knows the storage location of the hash data 10B, and forms another firmware data with the hash data 10B to form a firmware package. 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 hash data 10B, rather than the sorted hash data 10C generated through the predetermined sorting mechanism 320. Therefore, the controller 120 can easily determine that the sorted hash data 10C is different from the hash data 10B, and further determine that the firmware data is illegal, and refuse 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之下。 FIG. 2C is a schematic diagram showing firmware data according to an embodiment of the present invention. As shown in FIG. 2C, in one embodiment, the sorted hash data 10C is stored on the firmware data 10A. In addition, the firmware data 10A stores other firmware-related data 10D. In other words, the firmware packet 10X includes firmware data 10A, sorted hash data 10C, and other data 10D. For example, the 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 sorted 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 packet 10X, the controller 120 performs a secure hash mechanism 300 on the firmware data 10A of the firmware packet 10X to obtain the hash data 20B, and then executes a predetermined sorting mechanism 320 to obtain the sorted hash data. 20C. In one embodiment, the controller 120 compares the sorted hash data 20C with the sorted hash data 10C stored in the firmware packet 10X. If the comparison result is the same, it means that the firmware data 10A is legal and 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 packet 10X, the controller 120 performs a secure hash mechanism 300 on the firmware data 10A of the firmware packet 10X to obtain the hash data 20B. Then, the controller 120 performs a reverse ordering sorting mechanism 320 on the sorted hash data 10C stored in the firmware packet 10X to obtain the hashed data 10B. Then, the controller 120 compares the hash data 20B and the hash data 10B stored in the firmware packet 10X. If the comparison result is the same, it means that the firmware data 10A is legal and 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。 FIG. 3 is a schematic diagram showing a data storage method for authenticating firmware data according to an embodiment of the present invention. In this embodiment, the data storage method further includes a predetermined segmentation mechanism 340 to promote 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 (that is, sub-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 should be noted that the segmentation of the above 4 pieces of firmware data 10A-1 to 10A-4 is only for illustration, and is not intended to limit the present invention. Those skilled in the art can divide the firmware data into other quantities based on the content 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 hashing mechanism 300 performs a hash operation on the four firmware data 10A-1, 10A-2, 10A-3, and 10A-4, and generates four hash data 10B-1, 10B-2, and 10B-3, respectively. And 10B-4 (that is, the child hash). The sum of the four hash data 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 one embodiment, the predetermined sorting mechanism 320 sorts the four hash data 10B-1, 10B-2, 10B-3, and 10B-4, and generates four sorted hash data 10C-1, 10C-2, 10C-3 and 10C-4. The sum of the 4 sorted hash data 10C-1, 10C-2, 10C-3, and 10C-4 is the sorted hash data 10C. In another embodiment, the predetermined sorting mechanism 320 sorts all four hash data 10B-1, 10B-2, 10B-3, and 10B-4 at the same time, and generates a sorted hash data 10C.

第4圖係顯示根據本發明另一實施例所述之用於認證韌體資料之資料儲存方法之示意圖。在此實施例中,資料儲存方法更包括一預定再壓縮機制360,對韌體資料10A進行兩次以上的加密與壓縮,以促進韌體資料10A的認證並且提升安全性。如第4圖所示,預定分割機制340將韌體資料10A分割為4個韌體資料10A-1、10A-2、10A-3以及10A-4。 FIG. 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 encrypting and compressing the firmware data 10A more than twice to promote 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 data 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, a predetermined recompression mechanism 360 is arranged to perform multiple compressions (i.e., more than two encryptions and compressions) on the four firmware materials 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 into another group. Then, the two sets of firmware data are encrypted and compressed by the secure hash mechanism 300, and two hash data 10B-5 and 10B-6 (the first sub-hash data) are generated respectively. In other words, the hash data 10B-5 is generated from the firmware data 10A-1 and 10A-2, and the hash data 10B-6 is generated from 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 a second time by the secure hash mechanism 300 to generate a hash data 10B-7 (second sub-hash data). Then, in this embodiment, the predetermined sorting mechanism 320 sorts the hash data 10B-7, and generates a sorted hash data 10C-5. Since this embodiment uses the security compression mechanism 300 more than twice, the reliability and accuracy of identifying whether the firmware data is correct can be further improved.

要注意的是上述4個韌體資料10A-1~10A-4之分割以及2次壓縮僅是用於例示,而非用以限制本發明。本技術領域中具有通常知識者依據本發明之內容而分割為其他數量之韌體資料或是進行其他次數之加密與壓縮,仍不脫離本發明之範疇。 It should be noted that the segmentation and secondary compression of the above 4 pieces of firmware data 10A-1 to 10A-4 are for illustration only, and are not intended to limit the present invention. Those with ordinary knowledge in the technical field may 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才能加以讀取。 FIG. 5A is a schematic diagram showing an electronic fuse area 122 for authenticating firmware data according to an embodiment of the present invention. In one embodiment, the e-fuse region 122 includes a plurality of specific regions 122-1 to 122-8 for storing specific data, respectively. As shown in FIG. 5A, the predetermined sorting 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 sorting mechanism 320, and cannot store other mechanisms or other data. In addition, the above-mentioned predetermined sorting mechanism 320 is written into the e-fuse area 122 at a time, and only the controller 120 can read it.

第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 area for authenticating firmware data according to another embodiment of the present invention. In some embodiments, the data storage method includes a predetermined partitioning mechanism 340 and a predetermined recompression mechanism 360 in addition to the predetermined sorting mechanism 320. It should be noted that if one or more of the above mechanisms are more complicated, two or more specific areas may be used to store one mechanism. As shown in FIG. 5B, the predetermined sorting mechanism 320 is stored in the specific region 122-1, the predetermined partitioning mechanism 340 is stored in the specific region 122-2, and the predetermined recompression mechanism 360 is stored in the specific region 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。 FIG. 6 is a flowchart illustrating a data storage method for authenticating firmware data according to an embodiment of the present invention. In step S602, the controller 120 reads the predetermined sequencing mechanism 320 from the e-fuse area 122. Then, in step S604, the controller 120 obtains the firmware data and the related first sorted hash data, wherein the firmware data and the first sorted hash data are obtained from the firmware packet. In step S606, the controller 120 executes the secure hashing mechanism 300 on the firmware data to generate the second hash data. In step S608, the controller 120 executes a predetermined sorting mechanism 320 on the second hash data to generate a second sort hash data. In step S610, the controller 120 determines whether the second sorted hash data is the same as the first sorted hash data. If the comparison result is negative, step S614 is executed to terminate the execution of the data storage method of the present invention for authenticating firmware data. If the comparison result is yes, step S612 is performed, and the controller 120 updates the firmware of the data storage device 100 with the firmware data. It can be seen that in step S610, by determining whether the second sorted hash data is the same as the first sorted hash data obtained in step S604, it is possible to detect whether the firmware data to be installed is the manufacture of the data storage device 100. The correct and legal firmware information certified by the company. According to the data storage device and the data storage method of the present invention, whether the firmware data is correct and legal can be determined to protect the data storage device 100.

在另一實施例中,步驟S608可變更為控制器120對第一排序雜湊資料執行反向預定排序機制320以產生第一雜湊資料;步驟S610可變更為控制器120判斷第二雜湊資料是否相同於第一雜湊資料。此實施例與上述實施例的主要差異乃在於執行預定排序機制320的標的為何以及執行方式。如果標的是第二雜湊資料,則對第二雜湊資料執行預定排序機制320。如果標的是第一排序雜湊資料,則對第一排序雜湊資料執行反向預定排序機制320。其餘步驟相同。 In another embodiment, step S608 can be changed to the controller 120 to perform a reverse ordering mechanism 320 on the first sorted hash data to generate the first hash data; step S610 can be changed to the controller 120 to determine whether the second hash data is the same For the first hash information. The main difference between this embodiment and the above-mentioned embodiment lies in the reasons for executing the predetermined sorting mechanism 320 and the execution method. If the target is the second hash data, a predetermined sorting mechanism 320 is performed on the second hash data. If the target is the first sorted hash data, a reverse predetermined sorting mechanism 320 is performed on the first sorted hash data. 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進行韌體的更新。 FIG. 7 is a flowchart illustrating a data storage method for authenticating firmware data according to another embodiment of the present invention. In step S702, the controller 120 obtains a predetermined sequencing mechanism 320 from the e-fuse area 122. In step S704, the controller 120 receives the firmware data and the first sorted hash data, wherein the firmware data and the first sorted hash data are obtained from the firmware packet, and the first sorted hash data includes a plurality of first sub-sorts. Hash information. In step S706, the controller 120 divides the firmware data into a plurality of second sub-firmware data by using a predetermined division mechanism. In step S708, the controller 120 executes the security hashing mechanism 300 on each of the plurality of second sub-firmware data to generate a plurality of second sub-hash data. In step S710, the controller 120 performs a predetermined sorting mechanism 320 on each of the second sub-hash data to generate a plurality of second-order sub-hash data. In step S712, the controller 120 determines whether the second sorting sub-hash data is the same as the first sorting sub-hash data. If the comparison result is negative, the execution of the data storage method for authenticating firmware data of the present invention is suspended. If the comparison result is yes, step S714 is executed, and the controller 120 updates the firmware of the data storage device 100 with the firmware data.

第8圖係顯示根據本發明另一實施例所述之用於認證韌體資料之資料儲存方法之流程圖。在此實施例中,步驟S802至S806相同於第7圖之步驟S702至S706,故此處不再贅述。在步驟S808中,控制器120對每一複數個第二子韌體資料執行預定再壓縮機制360與安全雜湊機制300以產生複數個第二子雜湊資料。上述預定再壓縮機制360係儲存於電子熔絲區122的一第三特定區域。 FIG. 8 is a flowchart illustrating a data storage method 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 in FIG. 7, so they are not repeated here. In step S808, the controller 120 performs a predetermined recompression mechanism 360 and a security hash mechanism 300 on each of the plurality of second sub-firmware data to generate a plurality of second sub-hash data. The predetermined recompression mechanism 360 is stored in a third specific area of the e-fuse area 122.

然後,在步驟S810中,控制器120對每一個第二子雜湊資料執行安全雜湊機制300以產生第三子雜湊資料。在步驟S812中,控制器120對第三子雜湊資料執行預定排序機制320以產生第二排序子雜湊資料。在步驟S814中,控制器120判斷判斷第二排序子雜湊資料是否相同於第一排序子雜湊資料。如果比對結果為否,則執行步驟S818,中止本發明用於認證韌體資料之資料儲存方法的執行。如果比對結果為是,則執行步驟S816,控制器120以韌體資料對資料儲存裝置100進行韌體的更新。 Then, in step S810, the controller 120 performs a secure hashing mechanism 300 on each second sub-hash data to generate a third sub-hash data. In step S812, the controller 120 executes a predetermined sorting mechanism 320 on the third sub-hash data to generate a second order sub-hash data. In step S814, the controller 120 determines whether the second sorting sub-hash data is the same as the first sorting sub-hash data. If the comparison result is no, step S818 is executed to terminate the execution of the data storage method of the present invention for authenticating firmware data. If the comparison result is yes, step S816 is performed, and the controller 120 updates the firmware of 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 be encrypted 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 present invention, or a specific form or part thereof, may exist in the form of a code. The code can be stored in physical media, such as floppy disks, CD-ROMs, hard disks, or any other machine-readable (such as computer-readable) storage media, or it is not limited to external computer program products. When the code is loaded and executed by a machine, such as a computer, the machine becomes a device for participating in the invention. The code can also be transmitted through some transmission media, such as wire or cable, optical fiber, or any transmission type. Where the code is received, loaded, and executed by a machine, such as a computer, the machine becomes used to participate Invented device. When implemented in a general-purpose processing unit, the code in combination with the processing unit provides a unique device that operates similar to an application-specific logic circuit.

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

Claims (9)

一種資料儲存裝置之韌體更新之方法,包括:從一電子熔絲中取得一預定排序機制,其中,該電子熔絲置於該資料儲存裝置的一控制器內部;取得一韌體封包;從該韌體封包取得一第一排序雜湊資料;對該韌體封包中的一韌體資料進行一雜湊計算以取得一第二雜湊資料;對該第二雜湊資料執行該預定排序機制以產生一第二排序雜湊資料;以及如果該第一排序雜湊資料相同於該第二排序雜湊資料,以該韌體資料進行該資料儲存裝置的韌體更新;其中,該預定排序機制調整該第二雜湊資料中複數資料群組的先後順序。A method for updating firmware of a data storage device, comprising: obtaining a predetermined sequencing 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 sorted hash data; performs a hash calculation on the firmware data in the firmware packet to obtain a second hash data; executes the predetermined sorting mechanism on the second hash data to generate a first Two sorted hash data; and if the first sorted hash data is the same as the second sorted hash data, performing firmware update of the data storage device with the firmware data; wherein the predetermined sorting mechanism adjusts the second hash data Sequence of plural data groups. 如申請專利範圍第1項所述之韌體更新方法,其中該韌體封包從一記憶體裝置中取得。The firmware updating method according to item 1 of the patent application scope, wherein the firmware packet is obtained from a memory device. 如申請專利範圍第1項所述之韌體更新方法,其中該第一排序雜湊資料與該第二排序雜湊資料具有相同的資料長度。The firmware updating method according to item 1 of the scope of the patent application, wherein the first sorted hash data and the second sorted hash data have the same data length. 如申請專利範圍第1項所述之韌體更新方法,其中,將該韌體資料儲存至該資料儲存裝置的一記憶體裝置以完成該資料儲存裝置的韌體更新。The firmware update method according to item 1 of the scope of the patent application, wherein the firmware data is stored in a memory device of the data storage device to complete the firmware update of the data storage device. 一種資料儲存裝置之韌體更新之方法,包括:從一電子熔絲中取得一預定排序機制,其中,該電子熔絲置於該資料儲存裝置的一控制器內部;取得一韌體封包;從該韌體封包取得複數個第一排序子雜湊資料;依據一預定分割機制將該韌體封包中的一韌體資料分割為複數個子韌體資料;對每一該些子韌體資料執行一雜湊計算以取得複數個子雜湊資料;對每一該些子雜湊資料執行該預定排序機制以產生複數個第二排序子雜湊資料;以及如果該些第一排序子雜湊資料相同於該些第二排序子雜湊資料,以該韌體資料進行該資料儲存裝置的韌體更新;其中,該預定排序機制調整每一該些子雜湊資料中複數資料群組的先後順序。A method for updating firmware of a data storage device, comprising: obtaining a predetermined sequencing 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-order sub-hash data; divides a piece of firmware data in the firmware packet into a plurality of sub-firmware data according to a predetermined segmentation mechanism; and performs a hash on each of the sub-firmware data Calculating to obtain a plurality of sub-hash data; performing the predetermined sorting mechanism on each of the sub-hash data to generate a plurality of second-order sub-hash data; and if the first-order sub-hash data is the same as the second sort-hash data The hash data is used to update the firmware of the data storage device using the firmware data; wherein the predetermined ordering mechanism adjusts the sequence of the plural data groups in each of the sub-hash data. 如申請專利範圍第5項所述之韌體更新方法,其中該韌體封包從一記憶體裝置中取得。The firmware updating method according to item 5 of the patent application scope, wherein the firmware packet is obtained from a memory device. 如申請專利範圍第5項所述之韌體更新方法,其中每一該第一排序子雜湊資料與每一該第二排序子雜湊資料具有相同的資料長度。The firmware updating method as described in item 5 of the scope of the patent application, wherein each of the first sorter hash data and each of the second sorter hash data have the same data length. 如申請專利範圍第5項所述之韌體更新方法,其中,將該韌體資料儲存至該資料儲存裝置的一記憶體裝置以完成該資料儲存裝置的韌體更新。The firmware updating method according to item 5 of the scope of the patent application, wherein the firmware data is stored in a memory device of the data storage device to complete the firmware update of the data storage device. 一種資料儲存裝置之韌體更新之方法,包括:從一電子熔絲中取得一預定排序機制,其中,該電子熔絲置於該資料儲存裝置的一控制器內部;取得一韌體封包;從該韌體封包取得複數個第一排序子雜湊資料;依據一預定分割機制將該韌體封包中的一韌體資料分割為複數個子韌體資料;對每一該些子韌體資料執行一資料壓縮計算以及一雜湊計算以取得複數個子雜湊資料;對每一該些子雜湊資料執行該預定排序機制以產生複數個第二排序子雜湊資料;以及如果該些第一排序子雜湊資料相同於該些第二排序子雜湊資料,以該韌體資料進行該資料儲存裝置的韌體更新;其中,該預定排序機制調整每一該些子雜湊資料中複數資料群組的先後順序。A method for updating firmware of a data storage device, comprising: obtaining a predetermined sequencing 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-order sub-hash data; divides a piece of firmware data in the firmware packet into a plurality of sub-firmware data according to a predetermined segmentation mechanism; and executes a data for each of the sub-firmware data Compression calculation and a hash calculation to obtain a plurality of sub-hash data; performing the predetermined sorting mechanism on each of the sub-hash data to generate a plurality of second-order sub-hash data; and if the first-order sub-hash data is the same as the The second sorted sub-hash data is used to update the firmware of the data storage device using the firmware data; wherein the predetermined sorting mechanism adjusts the order of the plural data groups in each of the sub-hash data.
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 TW201901407A (en) 2019-01-01
TWI678658B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020149236A (en) * 2019-03-12 2020-09-17 キオクシア株式会社 Electronic apparatus and control method for electronic apparatus
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

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750478A (en) * 2012-06-12 2012-10-24 福建睿矽微电子科技有限公司 Security chip provided with security authorization transferring and locking technology
TW201519096A (en) * 2013-11-06 2015-05-16 Mitsubishi Electric Corp Software update device, and software update program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750478A (en) * 2012-06-12 2012-10-24 福建睿矽微电子科技有限公司 Security chip provided with security authorization transferring and locking technology
TW201519096A (en) * 2013-11-06 2015-05-16 Mitsubishi Electric Corp Software update device, and software update program

Also Published As

Publication number Publication date
TW201901407A (en) 2019-01-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
US10176328B2 (en) Self-measuring nonvolatile memory device systems and methods
US20190050297A1 (en) Memory devices and systems with security capabilities
TWI678658B (en) Method for updating firmware of data storage device
TWI436372B (en) Flash memory storage system, and controller and method for anti-falsifying data thereof
TWI667590B (en) Data storage devices and methods for encrypting and updating firmware thereof
US11100011B2 (en) Flash translation layer with hierarchical security
US20150199145A1 (en) Method and system for hijacking writes to a non-volatile memory
CN113015975B (en) Secure logical to physical cache
US20220058293A1 (en) Data attestation in memory
EP3948630A1 (en) Validating data stored in memory using cryptographic hashes
US11829464B2 (en) Apparatus and method for authentication of software
US20180129809A1 (en) Semiconductor memory system and operating method thereof
US8452900B2 (en) Dynamic compression of an I/O data block
CN113796045A (en) Electronic control unit for confirming vehicle
US20080244217A1 (en) Safety module for a franking machine
KR20210132741A (en) Secure communication between the intermediary device and the network
US20200313899A1 (en) Using memory as a block in a block chain
US20060053269A1 (en) System, microcontroller and methods thereof
US20230384951A1 (en) Cryptographic block locking in a non-volatile memory device
US20230214144A1 (en) Electric device and method for emulating a non-volatile memory
US20230335199A1 (en) Identifying a most recently programmed page during memory device initialization
US20230359466A1 (en) Boot processes for storage systems
US20220138114A1 (en) Using memory as a block in a block chain