Instruction processing method, device and system, electronic equipment, chip and medium

By obtaining and configuring hash operation instructions and field sets, and combining loop configuration, hash operation processing is solved, and the inefficiency problem caused by the hash operation instructions is achieved, and more efficient hash operation processing is achieved.

CN119045889APending Publication Date: 2024-11-29BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411171318.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

In the prior art, when hash operation instructions involve multiple hash operations, the upper-layer software needs to frequently interact with the hash operation components, resulting in too long interaction time, poor operation efficiency and low instruction processing efficiency.

Method used

By obtaining the hash operation instructions and corresponding field sets in the data memory, the upper-level software configures and combines this information to determine the contents of each operation-related fields in the hash operation instructions, perform hash operation processing, and there is a loop in the field set. During configuration, the content update process is performed, and the hashing operation is performed again to reduce the number of interactions between the upper-level software and the hashing operation component.

Benefits of technology

The total interaction time of hash operation instructions is shortened, the instruction processing efficiency is improved, and the computing efficiency of hash operation is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119045889A_ABST
    Figure CN119045889A_ABST
Patent Text Reader

Abstract

The invention relates to an instruction processing method, device and system, electronic equipment, a chip and a medium, and the method comprises the steps: obtaining a Hash operation instruction stored in a data memory and a field set corresponding to the Hash operation instruction; the Hash operation instruction and the field set are obtained through upper software configuration; in combination with the Hash operation instruction and the field set, determining the content of each operation related field in the Hash operation instruction so as to perform Hash operation processing to obtain output data; under the condition that the first operation related field with the loop configuration exists in the field set, content updating processing and Hash operation processing are carried out on the first operation related field again according to the loop configuration, and new output data are obtained; for the Hash operation instruction involving multiple Hash operations, only one-time interaction between the upper software and the algorithm controller for controlling the Hash operation component is needed, so that the total interaction time is shortened, and the instruction processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, and in particular to an instruction processing method, device, system, electronic device, chip and medium. Background Art

[0002] The current instruction processing technology mainly focuses on hash operation instructions. When the hash operation instruction involves multiple hash operations, the upper-level software sends the data to be operated to the hash operation component for each hash operation to obtain the result obtained by the hash operation component.

[0003] In the above scheme, for hash operation instructions involving multiple hash operations, the upper-level software needs to interact with the hash operation component multiple times. The upper-level software needs to call the hash operation component frequently, and the amount of data each time the hash operation component is called is small, resulting in a total interaction time that is too long, poor computing efficiency, and poor instruction processing efficiency. Summary of the invention

[0004] The present disclosure provides an instruction processing method, device, system, electronic device, chip and medium.

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided an instruction processing method, the method comprising: obtaining a hash operation instruction stored in a data storage device and a field set corresponding to the hash operation instruction; the hash operation instruction and the field set are obtained by upper-level software configuration; combining the hash operation instruction and the field set, determining the content of each operation-related field in the hash operation instruction to perform hash operation processing to obtain output data; in a case where a first operation-related field with a loop configuration is present in the field set, performing content update processing on the first operation-related field according to the loop configuration and re-performing hash operation processing to obtain new output data.

[0006] In one embodiment of the present disclosure, the field set includes the content of each operation-related field in the hash operation instruction or the physical storage address of the content; the content of each operation-related field in the hash operation instruction is determined in combination with the hash operation instruction and the field set to perform hash operation processing to obtain output data, including: for each operation-related field in the hash operation instruction, when the field set includes the content of the operation-related field, obtaining the content of the operation-related field in the field set; or, when the field set includes the physical storage address of the content of the operation-related field, reading the content of the operation-related field from the data storage according to the physical storage address; combining the content of each operation-related field in the hash operation instruction, performing hash operation processing to obtain output data.

[0007] In one embodiment of the present disclosure, the field set includes an output data physical address and an output data address offset; the method further includes: storing and processing the output data in combination with the output data physical address; and storing and processing the new output data in combination with the output data physical address and the output data address offset.

[0008] In one embodiment of the present disclosure, the field set includes the content of the first operation-related field or the physical storage address of the content, and the loop configuration of the first operation-related field is the number of loops; the content update processing and re-hashing processing of the first operation-related field according to the loop configuration to obtain new output data include: when the number of loops of the first operation-related field is not met, adding a preset value to the content of the first operation-related field to obtain the updated content of the first operation-related field; combining the updated content of the first operation-related field and the content of the non-first operation-related field in the hash operation instruction to perform hash operation processing to obtain the new output data.

[0009] In one embodiment of the present disclosure, the field set includes the physical storage address of the content of the first operation-related field, and the loop configuration of the first operation-related field is an address offset; the content update processing and re-hashing the first operation-related field according to the loop configuration to obtain new output data include: determining a new physical storage address in combination with the physical storage address of the content of the first operation-related field and the address offset; when the updated content of the first operation-related field is read from the new physical storage address, hashing the updated content of the first operation-related field and the content of the non-first operation-related field in the hash operation instruction to obtain the new output data.

[0010] In one embodiment of the present disclosure, obtaining the hash operation instruction stored in the data storage device and the field set corresponding to the hash operation instruction includes: reading the instruction storage address from the instruction address memory; reading the hash operation instruction from the data storage device in combination with the instruction storage address; reading the field set corresponding to the hash operation instruction from the data storage device in combination with a preset field set storage address.

[0011] In one embodiment of the present disclosure, the number of instruction storage addresses in the instruction address memory is multiple; the number of field sets is multiple; the multiple field sets correspond one-to-one to the hash operation instructions in the multiple instruction storage addresses.

[0012] In one embodiment of the present disclosure, the hash operation instruction is a hash operation instruction in a hash-based signature algorithm LMS; the hash operation instruction in the LMS algorithm includes at least one of the following: a private key generation instruction, a public key generation instruction, and a signature generation instruction.

[0013] According to the second aspect of an embodiment of the present disclosure, an instruction processing method is also provided, the method comprising: configuring a hash operation instruction and a field set corresponding to the hash operation instruction; a first operation-related field with a loop configuration is present in the field set; storing the hash operation instruction in a data memory, and storing the instruction storage address of the hash operation instruction in the data memory in an instruction address memory; storing the field set in the data memory in combination with a preset field set storage address, to instruct the algorithm controller to perform a loop hash operation processing.

[0014] According to the third aspect of the embodiment of the present disclosure, an instruction processing device is also provided, which includes: an acquisition module, used to acquire a hash operation instruction stored in a data storage device and a field set corresponding to the hash operation instruction; the hash operation instruction and the field set are obtained by upper-level software configuration; a determination module, used to determine the content of each operation-related field in the hash operation instruction in combination with the hash operation instruction and the field set, so as to perform hash operation processing to obtain output data; a processing module, used to update the content of the first operation-related field with a loop configuration in the field set and re-perform hash operation processing according to the loop configuration to obtain new output data.

[0015] In one embodiment of the present disclosure, the field set includes the content of each operation-related field in the hash operation instruction or the physical storage address of the content; the determination module is specifically used to, for each operation-related field in the hash operation instruction, obtain the content of the operation-related field in the field set when the field set includes the content of the operation-related field; or, when the field set includes the physical storage address of the content of the operation-related field, read the content of the operation-related field from the data storage device according to the physical storage address; and perform hash operation processing in combination with the content of each operation-related field in the hash operation instruction to obtain output data.

[0016] In one embodiment of the present disclosure, the field set includes an output data physical address and an output data address offset; the device also includes: a storage module, used to store and process the output data in combination with the output data physical address; and to store and process the new output data in combination with the output data physical address and the output data address offset.

[0017] In one embodiment of the present disclosure, the field set includes the content of the first operation-related field or the physical storage address of the content, and the loop configuration of the first operation-related field is the number of loops; the processing module is specifically used to, when the number of loops of the first operation-related field is not met, perform content processing on the first operation-related field plus a preset value to obtain updated content of the first operation-related field; and perform hash operation processing in combination with the updated content of the first operation-related field and the content of the non-first operation-related field in the hash operation instruction to obtain the new output data.

[0018] In one embodiment of the present disclosure, the field set includes the physical storage address of the content of the first operation-related field, and the loop configuration of the first operation-related field is an address offset; the processing module is specifically used to determine a new physical storage address in combination with the physical storage address of the content of the first operation-related field and the address offset; when the updated content of the first operation-related field is read from the new physical storage address, the hash operation is performed in combination with the updated content of the first operation-related field and the content of the non-first operation-related field in the hash operation instruction to obtain the new output data.

[0019] In one embodiment of the present disclosure, the acquisition module is specifically used to read the instruction storage address from the instruction address memory; in combination with the instruction storage address, read the hash operation instruction from the data memory; in combination with a preset field set storage address, read the field set corresponding to the hash operation instruction from the data memory.

[0020] In one embodiment of the present disclosure, the number of instruction storage addresses in the instruction address memory is multiple; the number of field sets is multiple; the multiple field sets correspond one-to-one to the hash operation instructions in the multiple instruction storage addresses.

[0021] In one embodiment of the present disclosure, the hash operation instruction is a hash operation instruction in a hash-based signature algorithm LMS; the hash operation instruction in the LMS algorithm includes at least one of the following: a private key generation instruction, a public key generation instruction, and a signature generation instruction.

[0022] According to the fourth aspect of the embodiment of the present disclosure, an instruction processing device is also provided, which includes: a configuration module, used to configure a hash operation instruction and a field set corresponding to the hash operation instruction; a first operation-related field with a loop configuration is present in the field set; a storage module, used to store the hash operation instruction in a data memory, and store the instruction storage address of the hash operation instruction in the data memory in an instruction address memory; the storage module is also used to store the field set in the data memory in combination with a preset field set storage address, so as to instruct the algorithm controller to perform a loop hash operation processing.

[0023] According to the fifth aspect of the embodiments of the present disclosure, there is also provided an instruction processing system, comprising: upper-layer software, and an algorithm controller communicatively connected to the upper-layer software; the upper-layer software is used to execute the instruction processing method as described in the above-mentioned second aspect embodiment; the algorithm controller is used to execute the instruction processing method as described in the above-mentioned first aspect embodiment.

[0024] According to a sixth aspect of an embodiment of the present disclosure, there is also provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to: implement the steps of the instruction processing method as described above.

[0025] According to the seventh aspect of the embodiment of the present disclosure, a non-temporary computer-readable storage medium is also provided. When the instructions in the storage medium are executed by a processor, the processor is enabled to execute the instruction processing method as described above.

[0026] According to the eighth aspect of the embodiments of the present disclosure, a chip is also provided, comprising one or more interface circuits and one or more processors; the interface circuit is used to receive a signal, the signal comprising a computer instruction, and when the processor executes the computer instruction, the chip executes the instruction processing method as described above.

[0027] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0028] By acquiring hash operation instructions and field sets corresponding to the hash operation instructions stored in a data storage device; the hash operation instructions and the field sets are obtained by upper-level software configuration; combining the hash operation instructions and the field sets, determining the contents of each operation-related field in the hash operation instruction to perform hash operation processing to obtain output data; in the case where there is a first operation-related field with a loop configuration in the field set, updating the content of the first operation-related field according to the loop configuration and re-performing the hash operation processing to obtain new output data; wherein, for hash operation instructions involving multiple hash operations, only the upper-level software needs to interact with the algorithm controller that controls the hash operation component once, thereby shortening the total interaction time and improving the instruction processing efficiency.

[0029] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0031] Figure 1 A flowchart of an instruction processing method according to an embodiment of the present disclosure;

[0032] Figure 2 A flowchart of an instruction processing method according to another embodiment of the present disclosure;

[0033] Figure 3 A flowchart of an instruction processing method according to another embodiment of the present disclosure;

[0034] Figure 4 A flowchart of an instruction processing method according to another embodiment of the present disclosure;

[0035] Figure 5 A schematic diagram of the structure of an instruction processing device according to an embodiment of the present disclosure;

[0036] Figure 6 It is a structural schematic diagram of an instruction processing device according to another embodiment of the present disclosure;

[0037] Figure 7 is a structural block diagram of an electronic device according to an exemplary embodiment of the present disclosure;

[0038] Figure 8 The figure is a schematic diagram of the structure of a chip according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0039] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0040] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0041] The current instruction processing technology mainly focuses on hash operation instructions. When the hash operation instruction involves multiple hash operations, the upper-level software sends the data to be operated to the hash operation component for each hash operation to obtain the result obtained by the hash operation component.

[0042] In the above scheme, for hash operation instructions involving multiple hash operations, the upper-level software needs to interact with the hash operation component multiple times. The upper-level software needs to call the hash operation component frequently, and the amount of data each time the hash operation component is called is small, resulting in a total interaction time that is too long, poor computing efficiency, and poor instruction processing efficiency.

[0043] Figure 1 The flowchart of the instruction processing method of one embodiment of the present disclosure is as follows. It should be noted that the instruction processing method of the present embodiment can be applied to an instruction processing device, which can be configured in an electronic device or chip so that the electronic device or chip can perform an instruction processing function.

[0044] Among them, the electronic device can be any device with computing capabilities, such as a personal computer (PC), a mobile terminal, a terminal device, a server, a controller in a vehicle, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.

[0045] In addition, the instruction processing device may also be a hardware component in an electronic device, such as a CPU device, an algorithm controller, etc.

[0046] In addition, the instruction processing device may also be software in an electronic device, etc. The software may be, for example, instruction processing software, etc. In the following embodiments, the execution subject is an algorithm controller as an example for explanation.

[0047] like Figure 1 As shown, the method comprises the following steps:

[0048] Step 101, obtain the hash operation instruction and the field set corresponding to the hash operation instruction stored in the data storage device; the hash operation instruction and the field set are obtained by upper-level software configuration.

[0049] In the embodiment of the present disclosure, the process of the algorithm controller executing step 101 may, for example, be to read the instruction storage address from the instruction address memory; in combination with the instruction storage address, read the hash operation instruction from the data memory; in combination with the preset field set storage address, read the field set corresponding to the hash operation instruction from the data memory.

[0050] The algorithm controller may be respectively connected to the instruction address memory, the data memory, and the hash operation component. The instruction address memory may store at least one instruction storage address configured by the upper-layer software. The data memory may store hash operation instructions, field sets corresponding to hash operation instructions, and the like. In the case where the field set includes the physical storage address of the content of a certain operation-related field in the hash operation instruction, the content of the operation-related field may also be stored at the physical storage address in the data memory. The hash operation component may be used to perform hash operation processing.

[0051] Among them, the storage of the instruction storage address in the instruction address memory and the storage of the field set in the field set storage address make it convenient for the algorithm controller to obtain the hash operation instructions and the corresponding field sets in time through monitoring the instruction address memory and the data memory, thereby improving the efficiency of obtaining the hash operation instructions and the corresponding field sets. In addition, it is also convenient for the algorithm controller and the upper-level software to realize data interaction through the two memories, thereby improving the data interaction efficiency.

[0052] In the embodiment of the present disclosure, the number of instruction storage addresses in the instruction address memory is multiple; the number of field sets is multiple; the multiple field sets correspond one-to-one to the hash operation instructions in the multiple instruction storage addresses.

[0053] Wherein, when there are multiple instruction storage addresses in the instruction address memory, the multiple instruction storage addresses can be stored and processed in order. Correspondingly, the multiple field sets can also be stored and processed in order. Wherein, the storage address of the first field set in the multiple field sets can be a preset field set storage address; the offset value between the storage addresses of two adjacent field sets can be a preset offset value. The preset offset value can be determined based on the maximum storage space occupied by each field set.

[0054] Among them, the storage of multiple instruction storage addresses and the storage processing of multiple field sets facilitate the hash operation processing of multiple hash operation instructions through a single interaction between the upper-level software and the algorithm controller; thus, for multiple hash operation instructions involving multiple hash operations, only one interaction is required between the upper-level software and the algorithm controller, thereby further shortening the interaction time and further improving the instruction processing efficiency.

[0055] In the embodiment of the present disclosure, the hash operation instruction is a hash operation instruction in a hash-based signature algorithm LMS. The hash operation instruction in the LMS algorithm may include at least one of the following: a private key generation instruction, a public key generation instruction, and a signature generation instruction.

[0056] Among them, the hash-based signature algorithm (Leighton-Micali Signature, LMS) is a post-quantum signature scheme, which mainly involves the private key generation process, the public key generation process, the signature generation process and the signature verification process. Among them, the signature generation process mainly includes obtaining the message to be signed; using the hash function to hash the message to generate a hash value of a fixed length; using the private key and the hash value to generate a signature through specific mathematical operations.

[0057] The private key generation instruction may involve at least one of the following: the generation instruction of the ith private key element in the qth private key. The public key generation instruction may involve at least one of the following: the generation instruction of each intermediate value in the public key generation process, and the generation instruction of the final public key.

[0058] Among them, for the hash operation instruction in the LMS algorithm, the following is used Figure 1 The instruction processing method shown is used to perform hash operation processing, which can reduce the number of interactions between the upper-level software and the algorithm controller, thereby improving the calculation efficiency of the LMS algorithm.

[0059] Step 102, combining the hash operation instruction and the field set, determining the content of each operation-related field in the hash operation instruction, so as to perform hash operation processing to obtain output data.

[0060] In an embodiment of the present disclosure, the field set may include at least one of the following fields: instruction number, address of data I in a data memory, initial value of q or r, initial value of i, number of i loops, initial value of j, number of j loops, output data address, output data offset, input data address, input data length, input data offset, etc.

[0061] Wherein, data I is the data required to determine the data to be hashed in each hash operation instruction. q is the number of the leaf node in the Merkle tree. r is the intermediate value.

[0062] In the embodiments of the present disclosure, different hash operation instructions may correspond to different field sets, wherein different field sets may refer to different fields in the field set; and / or may refer to different contents of the fields in the field set.

[0063] Step 103 , when there is a first operation related field with a loop configuration in the field set, the first operation related field is updated according to the loop configuration and the hash operation is re-performed to obtain new output data.

[0064] In the embodiment of the present disclosure, the field set may include a data physical address. Correspondingly, after step 102, the algorithm controller may also perform the following process: combining the output data physical address, and performing storage processing on the output data.

[0065] In the embodiment of the present disclosure, the field set may include the data physical address and the output data address offset. Correspondingly, after step 103, the algorithm controller may also perform the following process: combining the output data physical address and the output data address offset, perform storage processing on the new output data.

[0066] Specifically, the algorithm controller may determine a new output data physical address in combination with the output data physical address and the output data address offset; and perform storage processing on the new output data in combination with the new output data physical address.

[0067] It should be noted that, in the case where there are multiple new output data, for each new output data, the output data address offset can be added to the new output data physical address corresponding to the previous new output data to obtain the new output data physical address corresponding to the new output data.

[0068] Among them, the storage processing of the output data and the new output data makes it convenient to combine the output data and / or the new output data for calculation processing of other data in subsequent calculations, and to call the output data and / or the new output data in subsequent calculations, thereby further improving the calculation efficiency of the LMS algorithm to which the hash operation instruction belongs.

[0069] In the instruction processing method of the embodiment of the present disclosure, a hash operation instruction and a field set corresponding to the hash operation instruction stored in a data storage device are obtained; the hash operation instruction and the field set are obtained by upper-level software configuration; in combination with the hash operation instruction and the field set, the content of each operation-related field in the hash operation instruction is determined to perform hash operation processing to obtain output data; in the case where there is a first operation-related field with a loop configuration in the field set, the first operation-related field is updated according to the loop configuration and the hash operation processing is re-performed to obtain new output data; wherein, for hash operation instructions involving multiple hash operations, only one interaction is required between the upper-level software and the algorithm controller that controls the hash operation component, thereby shortening the total interaction time and improving the instruction processing efficiency.

[0070] Figure 2 The flowchart of the instruction processing method of another embodiment of the present disclosure is as follows. It should be noted that the instruction processing method of the present embodiment can be applied to an instruction processing device, which can be configured in an electronic device or chip so that the electronic device or chip can perform an instruction processing function.

[0071] Among them, the electronic device can be any device with computing capabilities, such as a personal computer (PC), a mobile terminal, a terminal device, a server, a controller in a vehicle, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.

[0072] In addition, the instruction processing device may also be a hardware component in an electronic device, such as a CPU device, an algorithm controller, etc.

[0073] In addition, the instruction processing device may also be software in an electronic device, etc. The software may be, for example, instruction processing software, etc. In the following embodiments, the execution subject is an algorithm controller as an example for explanation.

[0074] like Figure 2 As shown, the method comprises the following steps:

[0075] Step 201, obtain the hash operation instructions and the field set corresponding to the hash operation instructions stored in the data storage device; the hash operation instructions and the field set are obtained by upper-level software configuration; the field set includes the content of each operation-related field in the hash operation instruction or the physical storage address of the content.

[0076] The physical storage address of the content of the operation-related field may refer to the storage address of the content of the operation-related field in the data storage device.

[0077] In the embodiments of the present disclosure, it should be noted that a field set may involve multiple operation-related fields in a hash operation instruction. In one example, the field set may include the contents of the multiple operation-related fields. In another example, the field set may include the physical storage addresses of the contents of the multiple operation-related fields. In another example, the field set may include the contents of the first part of the multiple operation-related fields, and the physical storage addresses of the contents of the second part of the operation-related fields.

[0078] It should be noted that, for each operation-related field in the hash operation instruction, if the field set includes the content of the operation-related field, step 202 is executed; if the field set includes the physical storage address of the content of the operation-related field, step 203 is executed.

[0079] Step 202: for each operation-related field in the hash operation instruction, if the field set includes the content of the operation-related field, obtain the content of the operation-related field in the field set.

[0080] Among them, the field set is provided with content-related fields, such as instruction number, initial value of q or r, initial value of i, number of i loops, initial value of j, number of j loops, output data offset, input data length, input data offset, etc.

[0081] Step 203 : for each operation-related field in the hash operation instruction, when the field set includes the physical storage address of the content of the operation-related field, read the content of the operation-related field from the data memory according to the physical storage address.

[0082] Among them, the field set is provided with operation-related fields of the physical storage address of the content, for example, the address of data I in the data storage device, the input data address, etc.

[0083] Step 204, combining the contents of each operation-related field in the hash operation instruction, and performing hash operation processing to obtain output data.

[0084] In the embodiment of the present disclosure, the algorithm controller can determine the data to be hashed based on the contents of each operation-related field in the hash operation instruction; and then perform hash operation on the data to obtain output data.

[0085] The following examples are used for illustration. In the disclosed embodiment, the LMS algorithm may include 6 types of hash operation instructions, namely, the generation instruction of the i-th private key element in the q-th private key, the generation instruction of the first intermediate value in the public key generation process, the generation instruction of the second intermediate value in the public key generation process, the generation instruction of the third intermediate value in the public key generation process, the generation instruction of the final public key, and the signature generation instruction.

[0086] In this example, the generation instruction of the i-th private key element in the q-th private key may be as shown in the following formula (1).

[0087] x_q[i] = H(I || u32str(q) || u16str(i) || u8str(0xff) || SEED) (1)

[0088] Among them, x_q[i] represents the i-th private key element in the q-th private key. H represents a hash function. I represents the LMS key pair identifier. || represents concatenation. q represents the number of leaf nodes in the Merkle tree. u32str(q) represents converting q into a 4-byte format. i represents the number of the private key. u16str(i) represents converting i into a 2-byte format. 0xff represents a constant. u8str(0xff) represents converting 0xff into a 1-byte format. SEED represents a value derived from a random seed.

[0089] In this example, the instruction for generating the first intermediate value in the public key generation process may be as shown in the following formula (2).

[0090] tmp = H(I || u32str(q) || u16str(i) || u8str(j) || tmp) (2)

[0091] Wherein, tmp represents the first intermediate value. j represents the number of the node in the chain when determining the qth private key.

[0092] In this example, the instruction for generating the second intermediate value in the public key generation process may be as shown in the following formula (3).

[0093] K = H(I || u32str(q) || u16str(D_PBLC) || y[0] || ... || y[p-1]) (3)

[0094] Wherein, K represents the second intermediate value. D_PBLC represents a constant. y[0]||...||y[p-1]) represents the concatenation result of q private keys. Wherein, the physical storage address of y[0]||...||y[p-1] can be filled in the input data address.

[0095] In this example, the instruction for generating the third intermediate value in the public key generation process may be as shown in the following formula (4).

[0096] H(I||u32str(r)||u16str(D_LEAF)||OTS_PUB_HASH[r-2^h])(4)

[0097] Where D_LEAF is a constant, h is the height of the Merkle tree, and r is the middle value.

[0098] In this example, the final public key generation instruction can be shown as the following formula (5).

[0099] H(I||u32str(r)||u16str(D_INTR)||T[2*r]||T[2*r+1])(5)

[0100] Where D_INTR represents a constant. The content of D_INTR can be filled in the initial value of i.

[0101] In this example, the signature generation instruction may be as shown in the following formula (6).

[0102] Q=H(I||u32str(q)||u16str(D_MESG)||C||message)

[0103] Where Q represents the generated signature. C represents a constant. Message represents the message to be signed. The content of D_MESG can be filled in the initial value of i. The physical storage address of message can be filled in the input data address.

[0104] Step 205 , when there is a first operation related field with a loop configuration in the field set, the first operation related field is updated and hashed again according to the loop configuration to obtain new output data.

[0105] It should be noted that the detailed description of step 201 and step 205 can be found in Figure 1 Step 101 and step 103 in the illustrated embodiment will not be described in detail herein.

[0106] In the instruction processing method of the embodiment of the present disclosure, a hash operation instruction and a field set corresponding to the hash operation instruction stored in a data memory are obtained; the hash operation instruction and the field set are obtained by upper-level software configuration; the field set includes the content of each operation-related field in the hash operation instruction or the physical storage address of the content; for each operation-related field in the hash operation instruction, when the field set includes the content of the operation-related field, the content of the operation-related field in the field set is obtained; for each operation-related field in the hash operation instruction, when the field set includes the physical storage address of the content of the operation-related field, the content of the operation-related field is read from the data memory according to the physical storage address; The contents of each operation-related field in the hash operation instruction are combined, and hash operation processing is performed to obtain output data; when there is a first operation-related field with a loop configuration in the field set, the first operation-related field is updated and the hash operation processing is performed again according to the loop configuration to obtain new output data; wherein, in the field set, the content or the physical storage address of the content can be flexibly set for the operation-related field to meet the different requirements of the hash operation instruction for different fields, and the content can be looped with preset values, or different content can be used in different numbers of loops, thereby improving the flexibility of the content of multiple hash operations in the hash operation instruction and expanding the applicable scenarios of the instruction processing method.

[0107] Figure 3 The flowchart of the instruction processing method of another embodiment of the present disclosure is as follows. It should be noted that the instruction processing method of the present embodiment can be applied to an instruction processing device, which can be configured in an electronic device or chip so that the electronic device or chip can perform an instruction processing function.

[0108] Among them, the electronic device can be any device with computing capabilities, such as a personal computer (PC), a mobile terminal, a terminal device, a server, a controller in a vehicle, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.

[0109] In addition, the instruction processing device may also be a hardware component in an electronic device, such as a CPU device, an algorithm controller, etc.

[0110] In addition, the instruction processing device may also be software in an electronic device, etc. The software may be, for example, instruction processing software, etc. In the following embodiments, the execution subject is an algorithm controller as an example for explanation.

[0111] like Figure 3 As shown, the method comprises the following steps:

[0112] Step 301, obtain the hash operation instruction and the field set corresponding to the hash operation instruction stored in the data storage device; the hash operation instruction and the field set are obtained by upper-level software configuration.

[0113] Step 302, combining the hash operation instruction and the field set, determining the content of each operation-related field in the hash operation instruction, so as to perform hash operation processing to obtain output data.

[0114] Step 303, if there is content of a first operation-related field with a loop configuration or a physical storage address of the content in the field set, and the loop configuration is a loop count, and if the loop count is not met, the first operation-related field is processed with a preset value added to the content to obtain updated content of the first operation-related field.

[0115] In the embodiment of the present disclosure, before executing step 303 or step 304, the algorithm controller may further perform the following process: obtaining a first operation-related field with a loop configuration in the field set, and obtaining a specific loop configuration of the first operation-related field. It should be noted that, in the case where the field set is provided with the content of the first operation-related field, the loop configuration may be, for example, the number of loops. In the case where the physical storage address of the content of the first operation-related field is provided in the field set, the loop configuration may be, for example, an address offset.

[0116] Among them, the number of first operation related fields in the field set can be one or more. For example, the first operation related fields in the field set may include at least one of the following: the initial value of i, the initial value of j, the input data address, etc. Among them, the initial value of i may include the specific value of i, then for i, i loop counts may be set. The initial value of j may include the specific value of j, then for j, j loop counts may be set. Among them, the input data address may include the physical storage address of the input data, then for the input data address, an input data offset may be set, or an input data length for determining the input data offset may be set.

[0117] In the embodiment of the present disclosure, the number of cycles not being satisfied may mean that the number of times the first operation-related field is added with a preset value is less than the set number of cycles. In addition, the algorithm controller may also perform the following process: when there is content of the first operation-related field with a cycle configuration or a physical storage address of the content in the field set, and the cycle configuration is the number of cycles, and the number of cycles is satisfied, stop determining the update content of the first operation-related field.

[0118] Step 304, when there is content of a first operation-related field or a physical address of the content set with a loop configuration in the field set, and the loop configuration is an address offset, a new physical storage address is determined in combination with the physical storage address of the content of the first operation-related field and the address offset, so as to read the updated content of the first operation-related field from the new physical storage address.

[0119] In the embodiment of the present disclosure, the algorithm controller may also perform the following process: when there is content of a first operation-related field or a physical address of the content set with a loop configuration in the field set, and the loop configuration is an address offset, if the updated content of the first operation-related field is not read in combination with the new physical storage address, step 305 is stopped.

[0120] Step 305 , combining the updated content of the first operation related field in the hash operation instruction and the content of the non-first operation related field, performs hash operation processing to obtain new output data.

[0121] It should be noted that the detailed description of step 301 to step 302 can be found in Figure 1 Steps 101 to 102 in the illustrated embodiment will not be described in detail herein.

[0122] In the instruction processing method of the embodiment of the present disclosure, a hash operation instruction and a field set corresponding to the hash operation instruction stored in a data memory are obtained; the hash operation instruction and the field set are obtained by upper-level software configuration; in combination with the hash operation instruction and the field set, the content of each operation-related field in the hash operation instruction is determined to perform hash operation processing to obtain output data; if the content of a first operation-related field with a loop configuration or a physical storage address of the content exists in the field set, and the loop configuration is a loop number, and if the loop number is not satisfied, the content of the first operation-related field is processed by adding a preset value to obtain updated content of the first operation-related field; if the content of the first operation-related field with a loop configuration or a physical address of the content exists in the field set, and When the loop configuration is an address offset, a new physical storage address is determined in combination with the physical storage address of the content of the first operation-related field and the address offset, so as to read the updated content of the first operation-related field from the new physical storage address; a hash operation is performed in combination with the updated content of the first operation-related field and the content of the non-first operation-related field in the hash operation instruction to obtain new output data; wherein, the updated content of the first operation-related field is determined according to different loop configurations of the first operation-related field and whether the loop configuration is satisfied, so as to realize the content plus preset value loop, or realize the use of different content in different numbers of loops, thereby improving the flexibility of the content of multiple hash operations in the hash operation instruction and expanding the applicable scenarios of the instruction processing method.

[0123] Figure 4 The flowchart of the instruction processing method of another embodiment of the present disclosure is as follows. It should be noted that the instruction processing method of the present embodiment can be applied to an instruction processing device, which can be configured in an electronic device or chip so that the electronic device or chip can perform an instruction processing function.

[0124] Among them, the electronic device can be any device with computing capabilities, such as a personal computer (PC), a mobile terminal, a terminal device, a server, a controller in a vehicle, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.

[0125] In addition, the instruction processing device may also be upper-layer software that communicates with hardware components in the electronic device, etc. Among them, the hardware components in the electronic device are, for example, CPU devices, algorithm controllers, etc. Among them, the following embodiments are described by taking the execution subject as the upper-layer software as an example.

[0126] like Figure 4 As shown, the method comprises the following steps:

[0127] Step 401, configure a hash operation instruction and a field set corresponding to the hash operation instruction; the field set contains a first operation-related field with a loop configuration.

[0128] In the disclosed embodiment, the upper layer software may be in communication with the instruction address memory and the data memory. The upper layer software may store the configured hash operation instruction in the data memory, and store the instruction storage address of the hash operation instruction in the data memory in the instruction address memory. The upper layer software may also store the configured field set in the data memory.

[0129] It should be noted that the upper-layer software stores the configured hash operation instructions and field sets, that is, an interaction process between the upper-layer software and the algorithm controller through two memories.

[0130] In an embodiment of the present disclosure, the field set may include at least one of the following fields: instruction number, address of data I in a data memory, initial value of q or r, initial value of i, number of i loops, initial value of j, number of j loops, output data address, output data offset, input data address, input data length, input data offset, etc.

[0131] Wherein, data I is the data required to determine the data to be hashed in each hash operation instruction. q is the number of the leaf node in the Merkle tree. r is the intermediate value.

[0132] In the embodiments of the present disclosure, different hash operation instructions may correspond to different field sets, wherein different field sets may refer to different fields in the field set; and / or may refer to different contents of the fields in the field set.

[0133] In the embodiment of the present disclosure, the number of instruction storage addresses in the instruction address memory is multiple; the number of field sets is multiple; the multiple field sets correspond one-to-one to the hash operation instructions in the multiple instruction storage addresses.

[0134] Wherein, when there are multiple instruction storage addresses in the instruction address memory, the multiple instruction storage addresses can be stored and processed in order. Correspondingly, the multiple field sets can also be stored and processed in order. Wherein, the storage address of the first field set in the multiple field sets can be a preset field set storage address; the offset value between the storage addresses of two adjacent field sets can be a preset offset value. The preset offset value can be determined based on the maximum storage space occupied by each field set.

[0135] Among them, the storage of multiple instruction storage addresses and the storage processing of multiple field sets facilitate the hash operation processing of multiple hash operation instructions through a single interaction between the upper-level software and the algorithm controller; thus, for multiple hash operation instructions involving multiple hash operations, only one interaction is required between the upper-level software and the algorithm controller, thereby further shortening the interaction time and further improving the instruction processing efficiency.

[0136] In the embodiment of the present disclosure, the hash operation instruction is a hash operation instruction in a hash-based signature algorithm LMS. The hash operation instruction in the LMS algorithm may include at least one of the following: a private key generation instruction, a public key generation instruction, and a signature generation instruction.

[0137] Among them, the hash-based signature algorithm (Leighton-Micali Signature, LMS) is a post-quantum signature scheme, which mainly involves the private key generation process, the public key generation process, the signature generation process and the signature verification process. Among them, the signature generation process mainly includes obtaining the message to be signed; using the hash function to hash the message to generate a hash value of a fixed length; using the private key and the hash value to generate a signature through specific mathematical operations.

[0138] The private key generation instruction may involve at least one of the following: the generation instruction of the ith private key element in the qth private key. The public key generation instruction may involve at least one of the following: the generation instruction of each intermediate value in the public key generation process, and the generation instruction of the final public key.

[0139] Step 402: store the hash operation instruction in the data memory, and store the instruction storage address of the hash operation instruction in the data memory in the instruction address memory.

[0140] Step 403, in combination with the preset field set storage address, the field set is stored in the data storage device to instruct the algorithm controller to perform cyclic hash operation processing.

[0141] In the instruction processing method of the embodiment of the present disclosure, a hash operation instruction and a field set corresponding to the hash operation instruction are configured; a first operation-related field with a loop configuration is present in the field set; the hash operation instruction is stored in a data memory, and the instruction storage address of the hash operation instruction in the data memory is stored in an instruction address memory; the field set is stored in the data memory in combination with a preset field set storage address to instruct the algorithm controller to perform a loop hash operation processing; wherein, for hash operation instructions involving multiple hash operations, only the upper-level software needs to interact with the algorithm controller that controls the hash operation component once, thereby shortening the total interaction time and improving the instruction processing efficiency.

[0142] Figure 5 The figure is a schematic diagram of the structure of an instruction processing device according to an embodiment of the present disclosure.

[0143] like Figure 5 As shown, the instruction processing device may include: an acquisition module 501 , a determination module 502 and a processing module 503 .

[0144] Among them, the acquisition module 501 is used to obtain the hash operation instructions stored in the data storage device and the field set corresponding to the hash operation instructions; the hash operation instructions and the field set are obtained by the upper-level software configuration; the determination module 502 is used to determine the content of each operation-related field in the hash operation instruction in combination with the hash operation instruction and the field set, so as to perform hash operation processing to obtain output data; the processing module 503 is used to, when there is a first operation-related field with a loop configuration in the field set, update the content of the first operation-related field according to the loop configuration and re-perform hash operation processing to obtain new output data.

[0145] In one embodiment of the present disclosure, the field set includes the content of each operation-related field in the hash operation instruction or the physical storage address of the content; the determination module 502 is specifically used to, for each operation-related field in the hash operation instruction, obtain the content of the operation-related field in the field set when the field set includes the content of the operation-related field; or, when the field set includes the physical storage address of the content of the operation-related field, read the content of the operation-related field from the data storage device according to the physical storage address; and perform hash operation processing in combination with the content of each operation-related field in the hash operation instruction to obtain output data.

[0146] In one embodiment of the present disclosure, the field set includes an output data physical address and an output data address offset; the device also includes: a storage module, used to store and process the output data in combination with the output data physical address; and to store and process the new output data in combination with the output data physical address and the output data address offset.

[0147] In one embodiment of the present disclosure, the field set includes the content of the first operation-related field or the physical storage address of the content, and the loop configuration of the first operation-related field is the number of loops; the processing module 503 is specifically used to, when the number of loops of the first operation-related field is not met, perform content addition and preset value processing on the first operation-related field to obtain updated content of the first operation-related field; combine the updated content of the first operation-related field and the content of the non-first operation-related field in the hash operation instruction, and perform hash operation processing to obtain the new output data.

[0148] In one embodiment of the present disclosure, the field set includes the physical storage address of the content of the first operation-related field, and the loop configuration of the first operation-related field is an address offset; the processing module 503 is specifically used to determine a new physical storage address in combination with the physical storage address of the content of the first operation-related field and the address offset; when the updated content of the first operation-related field is read from the new physical storage address, the hash operation is performed in combination with the updated content of the first operation-related field and the content of the non-first operation-related field in the hash operation instruction to obtain the new output data.

[0149] In one embodiment of the present disclosure, the acquisition module 501 is specifically used to read the instruction storage address from the instruction address memory; in combination with the instruction storage address, read the hash operation instruction from the data memory; in combination with a preset field set storage address, read the field set corresponding to the hash operation instruction from the data memory.

[0150] In one embodiment of the present disclosure, the number of instruction storage addresses in the instruction address memory is multiple; the number of field sets is multiple; the multiple field sets correspond one-to-one to the hash operation instructions in the multiple instruction storage addresses.

[0151] In one embodiment of the present disclosure, the hash operation instruction is a hash operation instruction in a hash-based signature algorithm LMS; the hash operation instruction in the LMS algorithm includes at least one of the following: a private key generation instruction, a public key generation instruction, and a signature generation instruction.

[0152] In the instruction processing device of the embodiment of the present disclosure, a hash operation instruction and a field set corresponding to the hash operation instruction stored in a data storage device are obtained; the hash operation instruction and the field set are obtained by upper-level software configuration; in combination with the hash operation instruction and the field set, the content of each operation-related field in the hash operation instruction is determined to perform hash operation processing to obtain output data; in the case where there is a first operation-related field with a loop configuration in the field set, the first operation-related field is updated according to the loop configuration and the hash operation processing is re-performed to obtain new output data; wherein, for hash operation instructions involving multiple hash operations, only one interaction is required between the upper-level software and the algorithm controller that controls the hash operation component, thereby shortening the total interaction time and improving the instruction processing efficiency.

[0153] Figure 6 It is a schematic diagram of the structure of an instruction processing device according to another embodiment of the present disclosure.

[0154] like Figure 6 As shown, the instruction processing device may include: a configuration module 601 and a storage module 602 .

[0155] Among them, the configuration module 601 is used to configure the hash operation instruction and the field set corresponding to the hash operation instruction; the field set contains a first operation-related field with a loop configuration; the storage module 602 is used to store the hash operation instruction in a data memory, and store the instruction storage address of the hash operation instruction in the data memory in an instruction address memory; the storage module 602 is also used to store the field set in the data memory in combination with a preset field set storage address, so as to instruct the algorithm controller to perform a loop hash operation processing.

[0156] In the instruction processing device of the embodiment of the present disclosure, a hash operation instruction and a field set corresponding to the hash operation instruction are configured; a first operation-related field with a loop configuration is present in the field set; the hash operation instruction is stored in a data memory, and the instruction storage address of the hash operation instruction in the data memory is stored in an instruction address memory; the field set is stored in the data memory in combination with a preset field set storage address, so as to instruct the algorithm controller to perform a loop hash operation processing; wherein, for hash operation instructions involving multiple hash operations, only the upper-level software needs to interact with the algorithm controller that controls the hash operation component once, thereby shortening the total interaction time and improving the instruction processing efficiency.

[0157] According to the fifth aspect of the embodiment of the present disclosure, there is also provided an instruction processing system, comprising: upper layer software, and an algorithm controller connected to the upper layer software in communication; the upper layer software is used to execute Figure 4The instruction processing method in the embodiment shown; the algorithm controller is used to execute Figures 1 to 3 The instruction processing method in any embodiment.

[0158] According to a sixth aspect of an embodiment of the present disclosure, there is also provided an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor, wherein the processor is configured to: implement the steps of the instruction processing method as described above.

[0159] In order to implement the above embodiments, the present disclosure also proposes a non-transitory computer-readable storage medium.

[0160] When the instructions in the storage medium are executed by the processor, the processor is enabled to execute the instruction processing method as described above.

[0161] In order to implement the above embodiments, the present disclosure also provides a computer program product.

[0162] When the computer program product is executed by a processor of an electronic device, the electronic device is enabled to execute the above method.

[0163] Figure 7 The figure is a structural block diagram of an electronic device according to an exemplary embodiment. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0164] like Figure 7 As shown, the electronic device 1000 includes a processor 111, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 112 or a program loaded from a memory 116 to a random access memory (RAM) 113. In the RAM 113, various programs and data required for the operation of the electronic device 1000 are also stored. The processor 111, the ROM 112, and the RAM 113 are connected to each other via a bus 114. An input / output (I / O) interface 115 is also connected to the bus 114.

[0165] The following components are connected to the I / O interface 115: a memory 116 including a hard disk, etc.; and a communication part 117 including a network interface card such as a local area network (LAN) card, a modem, etc., and the communication part 117 performs communication processing via a network such as the Internet; a drive 118 is also connected to the I / O interface 115 as needed.

[0166] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 117. When the computer program is executed by the processor 111, the above-mentioned functions defined in the method of the present disclosure are executed.

[0167] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by the processor 111 of the electronic device 1000 to complete the above method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0168] In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0169] Figure 8 FIG. 1 is a schematic diagram of the structure of a chip according to an embodiment of the present disclosure. Figure 8 As shown, the chip includes a processor 801 and an interface circuit 802. The number of the processor 801 can be one or more, and the number of the interface circuit 802 can be one or more.

[0170] Optionally, the interface circuit 802 is used to receive a signal, where the signal includes a computer instruction. When the processor 801 executes the computer instruction, the chip executes the instruction processing method described in the above embodiment of the present disclosure.

[0171] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.

[0172] In addition, the word "exemplary" is used herein to indicate serving as an example, instance, or diagram. Any aspect or design described as "exemplary" in this article is not necessarily understood to be advantageous compared to other aspects or designs. On the contrary, the use of the word exemplary is intended to present concepts in a specific way. As used herein, the term "or" is intended to represent an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X applies A or B" is intended to represent any one of the natural inclusive arrangements. That is, if X applies A; X applies B; or X applies both A and B, "X applies A or B" is satisfied under any of the aforementioned examples. In addition, unless otherwise specified or clearly pointed to a singular form from the context, the articles "one" and "an" as used in this application and the appended claims are generally understood to mean "one or more".

[0173] Likewise, although the present disclosure has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art after reading and understanding the specification and drawings. The present disclosure includes all such modifications and variations and is limited only by the scope of the claims. In particular, with respect to the various functions performed by the components (e.g., elements, resources, etc.) described above, unless otherwise noted, the terms used to describe such components are intended to correspond to any component (functionally equivalent) that performs the specific functions of the described components, even if the structure is not equivalent to the disclosed structure. In addition, although the specific features of the present disclosure may have been disclosed with respect to only one of several implementations, such features may be combined with one or more other features of other implementations as may be desired and conducive to any given or specific application. In addition, with respect to "including", "having", "having", "having", or variations thereof used in the specific embodiments or claims, such terms are intended to be inclusive in a manner similar to the term "comprising".

[0174] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0175] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A command processing method, characterized in that: The method comprises: Acquire a hash operation instruction and a field set corresponding to the hash operation instruction stored in a data memory; the hash operation instruction and the field set are obtained by upper-layer software configuration; Determine the content of each operation-related field in the hash operation instruction in combination with the hash operation instruction and the field set, so as to perform hash operation processing to obtain output data; In the case that a first operation-related field having a loop configuration is present in the field set, content update processing is performed on the first operation-related field according to the loop configuration and hash operation processing is performed again to obtain new output data.

2. The method according to claim 1, characterized in that The field set includes the content of each operation-related field in the hash operation instruction or the physical storage address of the content; the combining the hash operation instruction and the field set to determine the content of each operation-related field in the hash operation instruction to perform hash operation processing to obtain output data includes: For each operation-related field in the hash operation instruction, if the field set includes the content of the operation-related field, obtaining the content of the operation-related field in the field set; or, In a case where the field set includes a physical storage address of the content of the operation-related field, reading the content of the operation-related field from the data memory according to the physical storage address; Combined with the contents of each operation-related field in the hash operation instruction, a hash operation is performed to obtain output data.

3. The method according to claim 1 or 2, characterized in that: The field set includes an output data physical address and an output data address offset; the method further includes: In combination with the physical address of the output data, storing the output data; The new output data is stored in combination with the output data physical address and the output data address offset.

4. The method according to claim 1, characterized in that The field set includes the content of the first operation-related field or the physical storage address of the content, and the loop configuration of the first operation-related field is the number of loops; the content update processing and re-performing the hash operation processing on the first operation-related field according to the loop configuration to obtain new output data includes: When the number of cycles of the first operation-related field is not satisfied, performing content addition processing on the first operation-related field and a preset value is added to obtain updated content of the first operation-related field; Combined with the updated content of the first operation related field and the content of the non-first operation related field in the hash operation instruction, a hash operation is performed to obtain the new output data.

5. The method according to claim 1, characterized in that The field set includes a physical storage address of the content of the first operation-related field, and the loop configuration of the first operation-related field is an address offset; the content update processing and re-performing hash operation processing on the first operation-related field according to the loop configuration to obtain new output data includes: Determine a new physical storage address by combining the physical storage address of the content of the first operation-related field and the address offset; When the updated content of the first operation-related field is read from the new physical storage address, the updated content of the first operation-related field and the content of the non-first operation-related field in the hash operation instruction are combined to perform hash operation processing to obtain the new output data.

6. The method according to claim 1, characterized in that The obtaining of the hash operation instruction stored in the data memory and the field set corresponding to the hash operation instruction includes: reading an instruction storage address from an instruction address memory; In combination with the instruction storage address, reading the hash operation instruction from the data memory; In combination with a preset field set storage address, the field set corresponding to the hash operation instruction is read from the data storage.

7. The method according to claim 6, characterized in that The number of instruction storage addresses in the instruction address memory is multiple; the number of the field sets is multiple; The multiple field sets correspond one-to-one to the hash operation instructions in the multiple instruction storage addresses.

8. The method according to claim 1, characterized in that The hash operation instruction is a hash operation instruction in a hash-based signature algorithm LMS; The hash operation instructions in the LMS algorithm include at least one of the following: a private key generation instruction, a public key generation instruction, and a signature generation instruction.

9. A command processing method, characterized in that: The method comprises: A hash operation instruction and a field set corresponding to the hash operation instruction are configured; the field set includes a first operation-related field with a loop configuration; Storing the hash operation instruction in a data memory, and storing the instruction storage address of the hash operation instruction in the data memory in an instruction address memory; In combination with a preset field set storage address, the field set is stored in the data storage device to instruct the algorithm controller to perform cyclic hash operation processing.

10. An instruction processing device, characterized in that: The device comprises: An acquisition module, used to acquire a hash operation instruction and a field set corresponding to the hash operation instruction stored in a data storage device; the hash operation instruction and the field set are obtained by upper-layer software configuration; A determination module, configured to determine the content of each operation-related field in the hash operation instruction in combination with the hash operation instruction and the field set, so as to perform hash operation processing to obtain output data; The processing module is used to update the content of the first operation-related field with a loop configuration and re-perform hash operation processing on the first operation-related field according to the loop configuration to obtain new output data when there is a first operation-related field with a loop configuration in the field set.

11. An instruction processing device, characterized in that: The device comprises: A configuration module, used to configure a hash operation instruction and a field set corresponding to the hash operation instruction; the field set includes a first operation-related field with a loop configuration; A storage module, used for storing the hash operation instruction in a data memory, and storing the instruction storage address of the hash operation instruction in the data memory in an instruction address memory; The storage module is also used to store the field set in the data storage device in combination with a preset field set storage address, so as to instruct the algorithm controller to perform cyclic hash operation processing.

12. An instruction processing system, characterized in that: include: Upper-layer software, and an algorithm controller in communication with the upper-layer software; The upper layer software is used to execute the instruction processing method as described in claim 9; The algorithm controller is used to execute the instruction processing method according to any one of claims 1 to 8.

13. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to: Implement the steps of the instruction processing method according to any one of claims 1 to 8; or implement the steps of the instruction processing method according to claim 9.

14. A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor, enables the processor to execute the instruction processing method according to any one of claims 1 to 8; or, execute the instruction processing method according to claim 9.

15. A chip, characterized in that: The chip comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal, the signal comprises a computer instruction, and when the processor executes the computer instruction, the chip executes the instruction processing method according to any one of claims 1 to 8; or, executes the instruction processing method according to claim 9.