Data processing method and data processing chip

By determining the signature node from the leaf node and determining the verification node during the Merkel tree signature process, the problem of large storage space and high resource consumption when signing the Merkel tree is solved, and efficient signature output order and resource utilization are achieved.

CN119557260AActive Publication Date: 2025-03-04OPEN SECURITY RES INC
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510121563.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-26
Publication Date
2025-03-04
Estimated Expiration
2045-01-26

AI Technical Summary

Technical Problem

When using the Merkel tree for signature, a separate storage space is needed to store the verification node, resulting in large storage space, high resource consumption and low signature efficiency.

Method used

By determining the signature node from at least two leaf nodes of the current Merkel tree and determining the verification node based on the signature node, if the node is a verification node in the process of determining the parent node, the output first and then the parent node is determined, thereby ensuring that the output order of the verification node is upwards in sequence.

Benefits of technology

Reduces the need for storage space, and outputs verification nodes in order upwards in the process of determining the parent node upwards, reducing resource consumption and improving signature efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557260A_ABST
    Figure CN119557260A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and a data processing chip. The data processing method comprises the following steps: determining a signature node from at least two leaf nodes of a current Merkel tree; determining at least one verification node from a plurality of nodes of the current Merkel tree based on the signature node; and in the process of determining the father node of the first node, if the first node is one verification node in the at least one verification node, outputting the first node, and determining the father node of the first node based on the first node. Therefore, in the process of upwards determining the father node of a certain node, if the node is the verification node, the node is output firstly, and then the father node of the node is determined, so that the output sequence of each verification node is ensured to be an upward sequence, and no additional storage space is needed for independently storing each verification node; therefore, not only is the storage space reduced, but also the resource consumption is reduced and the signature efficiency is improved while the signature security is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to but is not limited to the field of information security technology, and in particular to a data processing method and a data processing chip. Background Art

[0002] In the related art, in the process of signing using a Merkle tree, a separate storage space is required to store each verification node in the Merkle tree, which increases the storage space, and subsequently it is necessary to read and output each verification node from the storage space in an upward order, which not only increases resource consumption but also reduces signature efficiency. Summary of the invention

[0003] The embodiments of the present application provide a data processing method and a data processing chip to solve the problems in the related art such as large storage space, high resource consumption, low signature efficiency, etc. due to the need for a separate storage space to store each verification node in the Merkle tree.

[0004] The technical solution of the embodiment of the present application is implemented as follows: The present application provides a data processing method, including: Determine a signature node from at least two leaf nodes of the current Merkle tree; Based on the signature node, determine at least one verification node from multiple nodes of the current Merkle tree; In the process of determining the parent node of the first node, if the first node is a verification node among at least one verification node, the first node is output, and based on the first node, the parent node of the first node is determined, and the first node is a node among multiple nodes.

[0005] The present application embodiment provides a data processing chip, in which a processing unit is deployed, wherein: A processing unit is used to: determine a signature node from at least two leaf nodes of a current Merkle tree; determine at least one verification node from multiple nodes of the current Merkle tree based on the signature node; in the process of determining the parent node of a first node, if the first node is a verification node among at least one verification node, output the first node, and determine the parent node of the first node based on the first node, where the first node is one of the multiple nodes.

[0006] In the embodiment of the present application, the signature node is determined from at least two leaf nodes of the current Merkle tree; based on the signature node, at least one verification node is determined from multiple nodes of the current Merkle tree; in the process of determining the parent node of the first node, if the first node is a verification node in at least one verification node, the first node is output, and based on the first node, the parent node of the first node is determined. In this way, on the one hand, at least one verification node is determined in real time according to the signature node, which improves the security of the verification node; on the other hand, in the process of upwardly determining the parent node of a certain node, if the node is a verification node, the node is first output and then the parent node of the node is determined to ensure that the output order of each verification node is in an upward order. The present application does not require additional storage space to store each verification node separately. Compared with the related art that requires additional storage space to store each verification node in the Merkle tree, the storage space is reduced. At the same time, the present application has output each verification node in an upward order in the process of upwardly determining the parent node. Compared with the related art that requires reading and outputting each verification node in an upward order from another storage space, the resource consumption is reduced and the signature efficiency is improved while ensuring the security of the signature.

[0007] 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 application. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0009] Figure 1 A schematic diagram of an implementation process of a data processing method provided in an embodiment of the present application Figure 1 ; Figure 2 A schematic diagram of a Merkle tree provided in an embodiment of the present application; Figure 3 A schematic diagram of an implementation process of a data processing method provided in an embodiment of the present application Figure 2 ; Figure 4 A storage diagram of a Merkle tree in the related art; Figure 5 A schematic diagram of a Merkle tree storage provided in an embodiment of the present application; Figure 6 A schematic diagram of the structure of a data processing chip provided in an embodiment of the present application; Figure 7 A schematic diagram of a signature generation process provided in an embodiment of the present application; Figure 8 A schematic diagram of an implementation process of a data processing method provided in an embodiment of the present application Figure 3 ; Fig. 9 A schematic diagram of a process for generating a public key provided in an embodiment of the present application; Fig.10 A schematic diagram of the structure of a data processing system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0010] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0011] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0012] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0013] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0014] With the application and development of quantum computers, post-quantum signature algorithms have received widespread attention. Post-quantum signature algorithms are a type of digital signature algorithm designed to resist attacks from quantum computers. They are implemented by using hash functions to improve the efficiency and security of signatures. Post-quantum signature algorithms can provide stronger security guarantees in the face of threats from quantum computing technology. Post-quantum signature algorithms may include but are not limited to LMS (Leighton-Micali Signature), Falcon, SPHINCS+, etc.

[0015] The SPHINCS+ algorithm is a hash-based digital signature algorithm with high security and quantum resistance. It has been selected by NIST as one of the standard algorithms for its post-quantum cryptography standardization program. The SPHINCS+ algorithm inherits the advantages of traditional hash signatures and improves the security and efficiency of the algorithm by introducing new technologies and methods.

[0016] SPHINCS+ uses a hypertree structure to manage one-time signatures. It improves signature efficiency by combining multiple one-time signatures (WOTS, Winternitz One-Time Signature) into a hypertree structure. The outer structure of the SPHINCS+ hypertree can be a k-ary tree with a total of d layers. Each node of the k-ary tree is a Merkle tree, where k and d are both positive integers not less than 2.

[0017] In the related art, in the process of signing using a Merkle tree, a separate storage space is required to store each verification node in the Merkle tree, which increases the storage space, and subsequently it is necessary to read and output each verification node from the storage space in an upward order, which not only increases resource consumption but also reduces signature efficiency.

[0018] An embodiment of the present application provides a data processing method. In the process of upwardly determining the parent node of a certain node, if the node is a verification node, the node is output first and then the parent node of the node is determined, so as to ensure that the output order of each verification node is in an upward order. The present application does not require additional storage space to store each verification node separately. Compared with the related art that requires additional storage space to store each verification node in a Merkle tree, the storage space is reduced. At the same time, in the process of upwardly determining the parent node, the present application has output each verification node in an upward order. Compared with the related art that requires reading and outputting each verification node in sequence from another storage space in an upward order, the resource consumption is reduced and the signature efficiency is improved while ensuring the security of the signature.

[0019] The method provided in the embodiment of the present application can be executed by a data processing chip. Below, the technical solution in the embodiment of the present application will be clearly and completely described in conjunction with the drawings in the embodiment of the present application.

[0020] Figure 1 A schematic diagram of an implementation process of a data processing method provided in an embodiment of the present application Figure 1 ,like Figure 1 As shown, the method includes steps S11 to S13, wherein: Step S11: Determine a signature node from at least two leaf nodes of the current Merkle tree.

[0021] Here, the current Merkle tree is a Merkle tree in the supertree. Merkle tree is a tree-like data structure, which is usually used to verify the integrity and consistency of large-scale data sets. Merkle tree is a hash binary tree with a height of h. In computer science, binary tree is an important data structure, which consists of multiple nodes, each of which has at most two child nodes, called left child node and right child node. Child node refers to the node connected below a node. Parent node refers to the node connected above a node.

[0022] The Merkle tree includes multiple nodes, including at least two leaf nodes and at least one non-leaf node. A leaf node refers to the bottom node of a binary tree and has no child nodes, and the height of a leaf node is 0. The height of a node refers to the number of the longest simple path edges from the node to the leaf node. The at least one non-leaf node includes a root node, a non-root node, etc. The root node is the top node of a binary tree and has no parent node, and the height of the root node is the height of the tree.

[0023] The signature node can be any leaf node. Each leaf node of the Merkle tree is a one-time key, which is used to generate a public key for the child node of the outer structure. In implementation, the signature node can be a leaf node in an unused one-time key.

[0024] The signature node may be determined in any suitable manner.

[0025] In some implementations, a leaf node may be used as the signature node according to custom configuration information.

[0026] In some implementations, a leaf node may be randomly selected from leaf nodes in a plurality of unused one-time keys as the signature node.

[0027] In some implementations, the adjacent leaf node of the last signature node may be used as the signature node according to the order in which each leaf node is used. The order of use may include but is not limited to from left to right, from right to left, etc. For example, the Merkle tree includes 8 leaf nodes, and the third leaf node was used as the signature node last time, so the fourth leaf node may be used as the signature node this time.

[0028] In some implementations, the signing node may be determined based on a message to be processed, where the message to be processed may be a message sent by a client.

[0029] During implementation, those skilled in the art may independently select a method for determining the signature node according to actual needs, and the embodiments of the present application are not limited thereto.

[0030] Step S12: Based on the signature node, determine at least one verification node from multiple nodes of the current Merkle tree.

[0031] Here, the number of verification nodes is adapted to the height of the current Merkle tree. For example, if the height of the current Merkle tree is 3, then the number of verification nodes can be 3.

[0032] In some embodiments, one of the multiple nodes at the same height is a verification node. For example, if the height of the Merkle tree is 2, then the Merkle tree includes 7 nodes, namely: 4 leaf nodes, 2 intermediate nodes (referring to nodes other than leaf nodes and root nodes) and 1 root node, then the number of the verification nodes can be 2, one verification node can be one of the 4 leaf nodes, and the other verification node can be one of the 2 intermediate nodes.

[0033] In some implementations, a correspondence between a signature node and a verification node may be pre-established, and based on the correspondence, at least one verification node adapted to the signature node may be obtained.

[0034] For example, the corresponding relationship includes: signature node A1 corresponds to verification node B1 and verification node B2, signature node A2 corresponds to verification node C1 and verification node C2... Then, if the signature node is A2, at this time, verification node C1 and verification node C2 can both be used as one verification node.

[0035] During implementation, those skilled in the art can independently set the corresponding relationship according to actual needs, and the embodiments of the present application are not limited thereto.

[0036] In some embodiments, based on the signature node, a verification node is determined from at least two leaf nodes; when the parent node of the signature node is a non-root node, based on the parent node of the signature node, at least one verification node is determined from at least one non-leaf node.

[0037] Here, when the parent node of the signature node is a root node, the number of the verification node is one. When the parent node of the signature node is a non-root node, the number of the verification node may be at least two.

[0038] In some implementations, a leaf node may be randomly selected from at least two leaf nodes as the verification node, wherein the verification node is different from the signature node.

[0039] In some implementations, the sibling node of the signing node may be used as a verification node.

[0040] In some implementations, a verification node may be determined from at least two leaf nodes according to the position index of the signature node, wherein the position index of a node refers to the position of the node in a binary tree, and generally the position index of the leftmost node is 0, and the position index increases from left to right.

[0041] For example, the position index of the signature node is XORed with a preset value to obtain an XOR value, and the verification node is determined based on the XOR value. The preset value can be any suitable value, for example, 1.

[0042] For example, the position index of the signature node is 3 and the preset value is 1. Then, 011 (3) and 001 (1) are XORed to get 010 (2). Then, the leaf node with the position index of 2 can be used as the verification node.

[0043] In some embodiments, the parent node of the signature node is used as the third node, and based on the third node, a verification node is determined from at least two intermediate nodes with the same height as the third node; if the parent node of the third node is the root node, the traversal is stopped; conversely, if the parent node of the third node is a non-root node, the parent node of the third node is used as the new third node, and in the same manner, the upward traversal is continued to determine the verification node until the parent node of the third node is the root node.

[0044] Figure 2 A schematic diagram of a Merkle tree provided in an embodiment of the present application, such as Figure 2 As shown, the height of the Merkle tree is 3, so the Merkle tree includes: The eight leaf nodes with a height of 0 are: node (0,0), node (0,1), node (0,2), node (0,3), node (0,4), node (0,5), node (0,6), and node (0,7); The four intermediate nodes with a height of 1 are: node (1,0), node (1,1), node (1,2), and node (1,3); Two intermediate nodes with a height of 2, namely: node (2, 0) and node (2, 1); 1 root node, namely: node (3, 0), At this time, the number of verification nodes can be 3. If the signature node is node (0, 2), 0 is the height of the node, and 2 is the position index of the node, then the process of determining the verification node is as follows: For the 8 leaf nodes with a height of 0, a verification node (0, 3) is determined based on the signature node (0, 2). Since the parent node (1, 1) of the signature node (0, 2) is not the root node, continue to traverse upwards; For the four intermediate nodes with a height of 1, a verification node is determined to be (1, 0) based on the node (1, 1). Since the parent node (2, 0) of the node (1, 1) is not the root node, continue to traverse upwards; For the two intermediate nodes with a height of 2, a verification node is determined to be (2, 1) based on the node (2, 0). Since the parent node of the node (2, 0) is the root node (3, 0), the upward traversal is stopped.

[0045] Step S13: In the process of determining the parent node of the first node, if the first node is a verification node among at least one verification node, the first node is output, and the parent node of the first node is determined based on the first node.

[0046] Here, we can first determine whether the first node is a verification node. If it is a verification node, the first node (that is, the value of the first node) is used as the signature output; if it is not a verification node, the parent node of the first node is determined based on the first node (that is, the value of the parent node of the first node is determined).

[0047] The method for determining the parent node of the first node may be any suitable method. For example, a hash operation is performed between the first node and the sibling node of the first node to obtain a first hash value, and the parent node of the first node is determined according to the first hash value. For example, the first hash value is used as the parent node of the first node. For another example, the weighted value of the first hash value is used as the parent node of the first node.

[0048] For example, Figure 2 In the Merkle tree shown, if the signature node is node (0, 4), then the number of verification nodes is three, namely: node (0, 5), node (1, 3) and node (2, 0). The process of determining each non-leaf node upward is as follows: Determine node (1,0) based on node (0,0) and node (0,1); Determine node (1, 1) based on node (0, 2) and node (0, 3); Node (2,0) is determined based on nodes (1,0) and (1,1). Although node (2,0) is a verification node, it is not output at this time. Instead, it is determined whether it is a verification node after its parent node is determined based on node (2,0). Determine node (1, 2) based on node (0, 4) and node (0, 5). Since node (0, 5) is a verification node, output node (0, 5) first, and then determine node (1, 2). Determine node (1,3) based on node (0,6) and node (0,7); Determine node (2,1) based on node (1,2) and node (1,3). Since node (1,3) is a verification node, output node (1,3) first, then determine node (2,1). Determine node (3,0) based on node (2,0) and node (2,1). Since node (2,0) is a verification node, output node (2,0) first, and then determine node (3,0). It can be seen that the output order of each verification node is node (0, 5), node (1, 3) and node (2, 0), that is, each verification node is output in order from small to large in terms of node height. In implementation, the signature of the current Merkle tree at least includes each verification node output in order from small to large in terms of node height.

[0049] In some embodiments, when the parent node of the first node is a non-root node, the parent node of the first node can be used as the new first node, and step S13 is continued to output the next verification node until all verification nodes of the current Merkle tree are output to ensure the correctness and integrity of the signature of the current Merkle tree.

[0050] In the embodiments of the present application, on the one hand, at least one verification node is determined in real time according to the signature node, thereby improving the security of the verification node; on the other hand, in the process of upwardly determining the parent node of a certain node, if the node is a verification node, the node is first output and then the parent node of the node is determined, so as to ensure that the output order of each verification node is in an upward order. The present application does not require additional storage space to store each verification node separately. Compared with the related art that requires additional storage space to store each verification node in the Merkle tree, not only the storage space is reduced, but also, in the process of upwardly determining the parent node, the present application has output each verification node in an upward order. Compared with the related art that requires reading and outputting each verification node in sequence from another storage space in an upward order, the security of the signature is ensured while reducing resource consumption and improving signature efficiency.

[0051] In some implementations, the step S11 includes step S111 and step S112, wherein: Step S111: Determine a second hash value of the message to be processed.

[0052] Here, the message to be processed may be a message sent by the client. The message to be processed may include any suitable content. During implementation, a hash operation may be performed on the message to be processed to obtain the second hash value.

[0053] Step S112: Based on the second hash value, determine a signature node from at least two leaf nodes of the current Merkle tree.

[0054] Here, the signature node is any leaf node. In implementation, the signature node is a leaf node in an unused one-time key.

[0055] In some implementations, a number of bits may be selected from the second hash value to determine the signature node. For example, a leaf node that matches the number of bits may be used as the signature node.

[0056] In the implementation manner of the present application, by determining the signature node according to the second hash value of the message to be processed, the accuracy and security of the signature node are improved.

[0057] In some implementations, step S12 includes step S121 and step S122, wherein: Step S121: Based on the signature node, determine a second node from at least two leaf nodes, and use the second node as a verification node.

[0058] Here, one of the multiple nodes at the same height can be a verification node. During implementation, the signing node and the verification node can be different nodes.

[0059] The second node may be any leaf node other than the signature node. The method for determining the second node may be any suitable method. In some embodiments, a leaf node may be randomly selected as the second node. In some embodiments, the brother node of the signature node may be selected as the second node. In some embodiments, the second node may be determined based on the position index of the signature node. During implementation, those skilled in the art may independently select the method for determining the second node based on actual needs, and the embodiments of the present application are not limited thereto.

[0060] Step S122: When the parent node of the signature node is a non-root node, determine at least one verification node from at least one non-leaf node based on the parent node of the signature node.

[0061] Here, when the parent node of the signature node is the root node, there is no need to continue traversing; conversely, when the parent node of the signature node is a non-root node, it is necessary to continue traversing upward to determine the remaining verification nodes.

[0062] The number of verification nodes is adapted to the height of the Merkle tree. For example, if the height of the Merkle tree is 3, then the number of verification nodes can be 3, that is, there is one verification node in the 8 leaf nodes with a height of 0, one verification node in the 4 intermediate nodes with a height of 1, and one verification node in the two intermediate nodes with a height of 2.

[0063] In some implementations, each verification node may be determined by traversing upward in a loop. The end condition of the loop may include, but is not limited to, the height of the node, whether the parent node of a node is a root node, and the like.

[0064] For example, the parent node of the signature node is taken as a target node; according to the target node, a verification node is determined from at least two intermediate nodes with the same height as the target node; if the parent node of the target node is a root node, the traversal is stopped; conversely, if the parent node of the target node is a non-root node, the parent node of the target node is taken as a new target node, and in the same way, the upward traversal is continued to determine the verification node until the parent node of the target node is a root node.

[0065] For another example, the height of the parent node of the signature node is used as the target height; a verification node is determined from multiple intermediate nodes with the target height. If the target height is the height of the Merkle tree, the traversal is stopped; conversely, if the target height is less than the height of the Merkle tree, the next height (target height + 1) is used as the new target height, and the traversal continues upwards in the same way to determine the verification node until the target height is the height of the Merkle tree.

[0066] During implementation, the method of determining the verification node among at least two non-leaf nodes at the same height is similar to the method of determining the verification node according to the signature node. During implementation, the specific implementation of the aforementioned step S121 may be referred to.

[0067] In the implementation manner of the present application, each verification node is determined in sequence from leaf nodes to non-leaf nodes, thereby improving the accuracy of the verification nodes.

[0068] In some implementations, the “determining a second node from at least two leaf nodes based on the signature node” in step S121 includes step S1211 or step S1212, wherein: Step S1211: Use the sibling node of the signature node as the second node.

[0069] Here, the second node is located on the left or right of the signature node, and the signature node and the second node are two child nodes of the same parent node. In implementation, when the signature node is a left node, the node located on the right of the signature node can be used as the second node. When the signature node is a right node, the node located on the left of the signature node can be used as the second node.

[0070] Step S1212: Determine a second node from at least two leaf nodes based on the position index of the signature node.

[0071] Here, the position index refers to the position of the node in the binary tree. Usually, the position index of the leftmost node is 0, and the position index increases from left to right.

[0072] In some implementations, the position index of the signature node may be increased by 1 or decreased by 1 to obtain a first position index, and if the position index of a certain node matches the first position index, the node is used as the second node. For example, if the signature node is a left node, the position index of the signature node is increased by 1 to obtain the first position index; if the signature node is a right node, the position index of the signature node is decreased by 1 to obtain the first position index.

[0073] In some implementations, the position index of the signature node may be XORed with a preset value to obtain an XOR value, and the second node may be determined based on the XOR value. The preset value may be any suitable value. For example, if the position index of a node matches the XOR value, the node is used as the second node.

[0074] For example, the position index of the signature node is 4 and the preset value is 1. Then, XOR 100 (4) and 001 (1) to get 110 (5). Then, the leaf node with position index 5 can be used as the verification node.

[0075] In the implementation manner of the present application, the second node is determined by different methods, thereby improving the efficiency and flexibility of determining the second node.

[0076] In some implementations, step S1212 includes step S141 and step S142, wherein: Step S141: Determine the target location index based on the location index of the signature node.

[0077] Here, the target position index is different from the position index of the signature node. The method for determining the target position index may include, but is not limited to, the position index of the signature node plus 1, the position index of the signature node minus 1, the XOR value of the position index of the signature node and a preset value, the weighting of the XOR value, etc. During implementation, those skilled in the art can independently select the method for determining the target position index according to actual needs, and the embodiments of the present application are not limited. For example, the position index of the signature node plus 1 is used as the target position index.

[0078] In some implementations, the step S141 includes step S1411, wherein: Step S1411, determine the XOR value between the position index of the signature node and the preset value, and use the XOR value as the target position index.

[0079] Here, the preset value may be any suitable value, for example, 1. In implementation, the position index of the signature node and the preset value may be converted into corresponding binary and XORed to obtain the XOR value.

[0080] In the implementation manner of the present application, the target location index is determined according to the location index of the signature node and a preset value, thereby improving the accuracy of the target location index and thus improving the accuracy of the second node.

[0081] Step S142: Determine a second node from at least two leaf nodes based on the target position index.

[0082] Here, the position index of each leaf node is compared with the target position index. If the position index of a leaf node is the same as the target position index, the leaf node is used as the second node.

[0083] In the implementation manner of the present application, the second node is determined in real time according to the position index of the signature node, thereby improving the accuracy of the second node.

[0084] In some implementations, step S122 includes steps S1221 to S1223, wherein: Step S1221: Use the parent node of the signature node as the third node.

[0085] Here, the third node is an intermediate node, and the height of the third node is smaller than the height of the Merkle tree.

[0086] Step S1222: Based on the third node, determine a fourth node from at least one non-leaf node with the same height as the third node, and use the fourth node as a verification node.

[0087] Here, the fourth node may be an intermediate node, and the height of the fourth node is the same as the height of the third node. In implementation, the fourth node and the third node may be different nodes.

[0088] The method for determining the fourth node may be any suitable method. In some embodiments, a certain node may be randomly selected as the fourth node. In some embodiments, the brother node of the third node may be selected as the fourth node. In some embodiments, the fourth node may be determined based on the position index of the third node. During implementation, those skilled in the art may independently select the method for determining the fourth node according to actual needs, and the embodiments of the present application are not limited thereto.

[0089] Step S1223: When the parent node of the third node is a non-root node, the parent node of the third node is used as a new third node.

[0090] Here, if the parent node of the third node is the root node, the traversal is stopped; otherwise, if the parent node of the third node is not the root node, the parent node of the third node is used as the new third node, and the traversal is continued upward to determine the verification node in the same manner until the parent node of the third node is the root node. In implementation, the method of determining the verification node in at least two non-leaf nodes at the same height is similar to the method of determining the fourth node based on the third node. In implementation, the specific implementation of the aforementioned step S1222 can be referred to.

[0091] In the implementation manner of the present application, each verification node is determined by traversing in sequence in an upward manner, thereby improving the accuracy and completeness of the verification node.

[0092] In some implementations, the step S1222 of “determining, based on the third node, a fourth node from at least one non-leaf node having the same height as the third node” includes steps S151 and S152, wherein: Step S151: Use the sibling node of the third node as the fourth node.

[0093] Here, the fourth node is located on the left or right side of the third node, and the third node and the fourth node are two child nodes of the same parent node. In implementation, when the third node is a left node, the node located on the right side of the third node can be used as the fourth node. When the third node is a right node, the node located on the left side of the third node can be used as the fourth node.

[0094] Step S152: Based on the position index of the third node, determine a fourth node from at least one non-leaf node having the same height as the third node.

[0095] Here, the position index refers to the position of the node in the binary tree. Usually, the position index of the leftmost node is 0, and the position index increases from left to right.

[0096] In some implementations, the position index of the third node may be increased by 1 or decreased by 1 to obtain the second position index, and if the position index of a certain node matches the second position index, the node is used as the fourth node. For example, if the third node is a left node, the position index of the third node is increased by 1 to obtain the second position index; if the third node is a right node, the position index of the third node is decreased by 1 to obtain the second position index.

[0097] In some implementations, the position index of the third node may be XORed with a preset value to obtain an XOR value, and the fourth node may be determined based on the XOR value. The preset value may be any suitable value. For example, if the position index of a certain node matches the XOR value, the node is used as the fourth node.

[0098] In the implementation manner of the present application, the fourth node is determined by different methods, thereby improving the efficiency and flexibility of determining the fourth node.

[0099] In some embodiments, the method further comprises step S14 and / or step S15, wherein: Step S14: If the first node is a non-root node and a non-verification node, determine the parent node of the first node based on the first node.

[0100] Here, in the process of determining the parent node of the first node, it is possible to first determine whether the first node is a root node. If it is not a root node, it is further determined whether it is a verification node. If it is not a verification node, the parent node of the first node is directly determined. If the first node is a root node, it is not necessary to determine whether it is a verification node, nor is it necessary to determine its parent node. In implementation, the method for determining the parent node of the first node can refer to the specific implementation method in the aforementioned step S13.

[0101] Step S15: If the first node is a root node and the current Merkle tree is a supertree, the first node is used as a public key.

[0102] Here, if the first node is the root node of the supertree, then the first node is used as the public key. If the first node is not the root node of the supertree, then the first node can be used to sign the leaf node of the Merkle tree on the previous layer.

[0103] In some implementations, the order in which the root nodes of the Merkle tree are determined is consistent with the order in which the signatures of the Merkle tree are generated.

[0104] For example, Figure 2 The Merkle tree shown in the figure has a root node (3, 0) that is determined as follows: Determine node (1,0) based on node (0,0) and node (0,1); Determine node (1, 1) based on node (0, 2) and node (0, 3); Determine node (2,0) based on node (1,0) and node (1,1); Determine node (1, 2) based on node (0, 4) and node (0, 5); Determine node (1,3) based on node (0,6) and node (0,7); Determine node (2,1) based on node (1,2) and node (1,3); Determine the node (3,0) based on the nodes (2,0) and (2,1).

[0105] In some implementations, for any Merkle tree in the supertree, the root node of the Merkle tree may be synchronously calculated during the process of determining the signature, so as to achieve efficient unification of tree root calculation and signature generation.

[0106] In the implementation manner of the present application, the first node is processed according to whether the first node is the root node of the supertree, whether it is a verification node, etc., thereby improving the accuracy and reliability of the processing of the first node.

[0107] Figure 3 A schematic diagram of an implementation process of a data processing method provided in an embodiment of the present application Figure 2 ,like Figure 3 As shown, the method includes steps S31 to S33, wherein: Step S31: Determine a signature node from at least two leaf nodes of the current Merkle tree.

[0108] Step S32: Based on the signature node, determine at least one verification node from multiple nodes of the current Merkle tree.

[0109] Here, the above steps S31 to S32 correspond to the above steps S11 to S12 respectively. When implementing, reference may be made to the specific implementation of the above steps S11 to S12.

[0110] Step S33. In the process of determining the parent node of the first node, if the first node is a verification node in at least one verification node, the first node is output, and when the position index of the first node satisfies a first preset condition, the brother node of the first node is obtained from the target storage position of the target storage block, and the parent node of the first node is determined based on the first node and the brother node of the first node; wherein the target storage block includes multiple storage locations, the number of the multiple storage locations is adapted to the height of the current Merkle tree, all nodes at the same height in the current Merkle tree correspond to one storage location, and the target storage location is a storage location adapted to the height of the first node.

[0111] Here, the process of outputting the first node may refer to the specific implementation of the aforementioned step S13.

[0112] The position index of a node refers to the position of the node in the binary tree. Usually, the position index of the leftmost node is 0, and the position index increases from left to right.

[0113] The first preset condition may be any appropriate condition, for example, an odd number, or a number that is not divisible by 2.

[0114] The target storage block may be a storage space in a storage unit. The storage unit may be any suitable unit capable of implementing a storage function. For example, a random access memory. In some embodiments, different Merkle trees may correspond to different storage blocks or reuse the same storage block. In implementation, the storage block may be reused to further reduce the storage space requirement; or the storage block may not be reused to improve the independence of the values ​​of each node, thereby reducing the possibility of data anomalies.

[0115] In some embodiments, the number of storage locations included in the target storage block is adapted to the height of the current Merkle tree. For example, if the height of the current Merkle tree is 3, then the number of storage locations may be 3, that is, 8 leaf nodes with a height of 0 share a storage location P0, 4 intermediate nodes with a height of 1 share a storage location P1, and 2 intermediate nodes with a height of 2 share a storage location P2.

[0116] During implementation, when the position index of the first node does not satisfy the first preset condition, the first node can be stored in the target storage position first; when the position index of the first node satisfies the first preset condition, it is not necessary to store the first node in the target storage position, but the sibling node of the first node is directly obtained from the target storage position, so as to achieve multiple nodes at the same height sharing one storage position.

[0117] Figure 4 A schematic diagram of a Merkle tree storage in the related art is shown in FIG. Figure 4 As shown, the height of the Merkle tree is 3, so the target storage block needs to include 2 3 Storage locations, namely: P0~P7, in implementation, P0~P7 are first used to store each leaf node. As the height increases, fewer and fewer storage locations are needed. When reaching the top layer, the target storage block only needs to store one root node. It can be seen that the storage space of the target storage block is large and the utilization rate is low.

[0118] Figure 5 A storage diagram of a Merkle tree provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the height of the Merkle tree is 3, so the target storage block only needs 3 storage locations, namely: P0~P2, and the storage process of each node is as follows: Since the node (0, 0) does not meet the first preset condition, the node (0, 0) is stored in P0; Since the node (0, 1) satisfies the first preset condition, the node (1, 0) is determined according to the node (0, 0) and the node (0, 1). Since the node (1, 0) does not satisfy the first preset condition, the node (1, 0) is stored in P1. Since the node (0, 2) does not meet the first preset condition, the node (0, 2) is stored in P0 to replace the original node (0, 0); Since node (0, 3) satisfies the first preset condition, node (1, 1) is determined based on node (0, 2) and node (0, 3); since node (1, 1) satisfies the first preset condition, node (2, 0) is determined based on node (1, 0) and node (1, 1); since node (2, 0) does not satisfy the first preset condition, node (2, 0) is stored in P2; Since the node (0, 4) does not meet the first preset condition, the node (0, 4) is stored in P0 to replace the original node (0, 2); Since the node (0, 5) meets the first preset condition, the node (1, 2) is determined based on the nodes (0, 4) and (0, 5). Since the node (1, 2) does not meet the first preset condition, the node (1, 2) is stored in P1 to replace the original node (1, 0). Since the node (0, 6) does not meet the first preset condition, the node (0, 6) is stored in P0 to replace the original node (0, 4); Since node (0, 7) satisfies the first preset condition, node (1, 3) is determined based on node (0, 6) and node (0, 7); since node (1, 3) satisfies the first preset condition, node (2, 1) is determined based on node (1, 2) and node (1, 3); since node (2, 1) satisfies the first preset condition, node (3, 0) is determined based on node (2, 0) and node (2, 1).

[0119] It can be seen that for any node (i, j), the node (i, j) needs to be stored in the storage location p = i only when j is an even number. Once its right node (i, j+1) is generated, their parent node (i+1, j / 2) can be calculated by hashing the node (i, j) and its right node (i, j+1). If j / 2 is an even number, the node (i+1, j / 2) will be stored in the storage location p = i+1. Otherwise, if j / 2 is an odd number, its sibling node (i+1, j / 2−1) can be obtained from the storage location p = i+1 to calculate the parent node (i+2, (j / 2−1) / 2) of the node (i+1, j / 2)... According to the above logic, continue upward until the root node is calculated. Among them, i and j are both integers not less than 0, i is the height of the node, and j is the position index of the node.

[0120] Therefore, once the parent node is calculated, its child nodes are no longer needed. Then, the storage location occupied by the child node can store the values ​​of other child nodes of the same height. The same node height only needs to occupy one storage location in the storage block.

[0121] The method for determining the parent node of the first node may be any suitable method. For example, a hash operation is performed between the first node and the sibling node of the first node to obtain a first hash value, and the parent node of the first node is determined according to the first hash value. For example, the first hash value is used as the parent node of the first node. For another example, the weighted value of the first hash value is used as the parent node of the first node.

[0122] In an embodiment of the present application, by setting the number of storage locations to the tree height, the number of storage locations is greatly reduced compared to the case where the number of storage locations is the total number of leaf nodes, and the size of the storage space is reduced, thereby improving the utilization of the storage space while reducing resource consumption.

[0123] In some implementations, the step S33 of “determining the parent node of the first node based on the first node and the sibling nodes of the first node” includes steps S331 and S332, wherein: Step S331: Determine a first hash value between a first node and a sibling node of the first node.

[0124] Here, a hash operation may be performed on the first node and the sibling nodes of the first node to obtain the first hash value.

[0125] Step S332: Determine the parent node of the first node based on the first hash value.

[0126] Here, the method for determining the parent node of the first node may include but is not limited to the first hash value, the weighted value of the first hash value, etc. During implementation, those skilled in the art may independently select the method for determining the parent node of the first node according to actual needs, and the embodiment of the present application is not limited thereto. For example, the first hash value is used as the parent node of the first node.

[0127] In the implementation manner of the present application, the parent node of the first node is determined by the first hash value between the first node and the sibling node of the first node, thereby improving the accuracy and security of the parent node of the first node.

[0128] In some embodiments, the method further comprises step S34 and / or step S35, wherein: Step S34: When the position index of the first node does not satisfy the first preset condition, the first node is stored in the target storage location.

[0129] Here, the target storage location can be used to store at least one node. For example, if the height of the Merkle tree is 3, the target storage location is P0, and the first preset condition is an odd number, P0 is used to store node (0, 0), node (0, 2), node (0, 4), and node (0, 6).

[0130] Step S35: When the first node satisfies the second preset condition, stop refreshing the target storage block.

[0131] Here, the second preset condition may be any suitable condition, for example, the penultimate leaf node, a preset index value, etc. During implementation, those skilled in the art may independently set the second preset condition according to actual needs, and the embodiment of the present application is not limited thereto.

[0132] During implementation, if the first node does not satisfy the second preset condition, the target storage block needs to continue to be refreshed; if the first node satisfies the second preset condition, the target storage block is no longer refreshed.

[0133] In an implementation manner of the present application, on the one hand, whether to store the first node is determined based on the location index of the first node and the first preset condition, thereby improving the accuracy of storage of the first node; on the other hand, whether to refresh the corresponding storage block is determined based on the first node and the second preset condition, thereby improving the accuracy of refreshing the storage block.

[0134] Based on the above embodiments, the present application also provides a data processing chip. Figure 6 A schematic diagram of the structure of a data processing chip provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the data processing chip 60 is provided with a processing unit 61, wherein: The processing unit 61 is used to: determine a signature node from at least two leaf nodes of the current Merkle tree; based on the signature node, determine at least one verification node from multiple nodes of the current Merkle tree; in the process of determining the parent node of the first node, if the first node is a verification node in at least one verification node, output the first node, and based on the first node, determine the parent node of the first node, the first node is a node in multiple nodes.

[0135] Here, the processing unit may be any suitable hardware unit capable of realizing the function, such as a digital circuit, an analog circuit, etc.

[0136] The signature node may be any leaf node, and the signature node may be a leaf node in an unused one-time key. In implementation, the process of the processing unit determining the signature node may refer to the specific implementation of the aforementioned step S11.

[0137] In some embodiments, the processing unit 61 is further used to: in response to receiving a signature request transmitted by the server through the processor, determine a signature node from at least two leaf nodes of the current Merkle tree based on a pending message transmitted by the server through direct memory access.

[0138] Here, the server may be any suitable unit capable of implementing the function, for example, an electronic device.

[0139] The processor may be any suitable processor capable of implementing the function, for example, a CPU (Central Processing Unit), a DSP (Digital Signal Processing), etc. The processor may be communicatively connected to the processing unit via a bus, a hard line, an interface, etc.

[0140] The message to be processed may be any suitable message.

[0141] Direct Memory Access (DMA) is a function provided by some computer bus architectures. It enables data to be sent directly from an attached device (such as a disk drive) to the computer motherboard's memory to reduce data latency and improve data real-time performance and effectiveness.

[0142] The signature request may be any suitable request that can implement the signature. After receiving the signature request, the processing unit determines the signature node according to the pending processing message, and finally returns the output verification nodes to the server. In implementation, the process of the processing unit determining the signature node according to the pending processing message can refer to the specific implementation of the aforementioned steps S111 to S112.

[0143] In some implementations, the processing unit may have a built-in processing module, which is specifically used to perform signing operations, key generation operations, etc.

[0144] In the implementation manner of the present application, on the one hand, DMA is used to transmit messages to be processed, thereby reducing the delay of messages to be processed and improving the real-time and effectiveness of messages to be processed; on the other hand, the server controls the processing unit through the processor to perform the signature operation to fully utilize the high-speed processing capability and low latency of the processor, which not only improves the overall signature efficiency, but also improves the performance and stability of the signature operation.

[0145] The number of verification nodes is adapted to the height of the current Merkle tree, and the verification nodes are different from the signature nodes. In implementation, the process of the processing unit determining the verification nodes can refer to the specific implementation of the aforementioned step S12.

[0146] In some embodiments, the processing unit 61 is also used to: when the position index of the first node satisfies a first preset condition, obtain the sibling node of the first node from the target storage position of the target storage block of the storage unit, and send the first node and the sibling node of the first node to the computing unit, so that the computing unit determines the parent node of the first node based on the first node and the sibling node of the first node; wherein the target storage block includes multiple storage locations, the number of the multiple storage locations is adapted to the height of the current Merkle tree, all nodes of the same height in the current Merkle tree correspond to one storage location, and the target storage location is a storage location adapted to the height of the first node.

[0147] Here, the computing unit may be any suitable unit capable of implementing the function, such as a hardware circuit, a hash core, etc. The computing unit is mainly used to determine the parent node of the first node. The computing unit may be connected to the processing unit in a communication manner via a bus, a hard line, an interface, etc. In implementation, the process of the computing unit determining the parent node of the first node may refer to the specific implementation of the aforementioned step S33.

[0148] The first preset condition may be any appropriate condition, for example, an odd number, or a number that is not divisible by 2.

[0149] The storage unit may be any suitable unit capable of implementing a storage function. For example, a random access memory. The storage unit includes at least the target storage block. In some embodiments, different Merkle trees may correspond to different storage blocks or reuse the same storage block. During implementation, the number of storage locations included in the target storage block is adapted to the height of the current Merkle tree. For example, the number of storage locations included in the target storage block is the same as the height of the current Merkle tree. For another example, the number of storage locations included in the target storage block is 1 more than the height of the current Merkle tree.

[0150] In some embodiments, the computing unit needs to return the parent node of the first node to the processing unit. The processing unit can first determine whether the parent node of the first node is a root node. If it is not a root node, the parent node of the first node can be used as the new first node, and the next verification node can be output until all verification nodes of the current Merkle tree are output, so as to ensure the correctness and integrity of the signature of the current Merkle tree.

[0151] In an implementation manner of the present application, by setting the number of storage locations to the tree height, the number of storage locations is greatly reduced compared to the case where the number of storage locations is the total number of leaf nodes, thereby reducing the size of the storage space, thereby improving the utilization of the storage space and reducing resource consumption.

[0152] In some implementations, the processing unit 61 is further configured to: store the first node in a target storage location when the location index of the first node does not satisfy a first preset condition.

[0153] Here, the target storage location can be used to store at least one node. For example, if the height of the Merkle tree is 3, the target storage location is P0, and the first preset condition is an odd number, P0 is used to store node (0, 0), node (0, 2), node (0, 4), and node (0, 6).

[0154] In the implementation manner of the present application, whether to store the first node is determined according to the position index of the first node and the first preset condition, thereby improving the accuracy of storing the first node.

[0155] Figure 7 A flow chart of a signature generation process provided in an embodiment of the present application is as follows: Figure 7 As shown, user 71 sends a message to server 72 and initiates a signature request. Server 72 sends the message to processing unit 61 via DMA and controls processing unit 61 to perform the signature operation through the processor. Processing unit 61 will repeatedly call processing module 611 to respectively determine and output each verification node of each Merkle tree in the supertree, and finally return all verification nodes to user 71.

[0156] Figure 8 A schematic diagram of an implementation process of a data processing method provided in an embodiment of the present application Figure 3 ,like Figure 8 As shown, the method includes steps S800 to S811, wherein: Step S800: Determine the signature node according to the message to be processed; Step S801: Determine at least one verification node according to the signature node; Step S802: Get a node; Here, the node may be sent by other units to the processing unit, or may be actively obtained by the processing unit from other units. The other units may be any suitable units capable of generating nodes.

[0157] Step S803, determine whether the position index of the node is an odd number (corresponding to the first preset condition mentioned above), if not, proceed to step S804, otherwise, proceed to step S805; Step S804, storing the node to a storage location corresponding to the height of the node, and proceeding to step S802; Step S805: Obtain the sibling node of the node from the storage location corresponding to the height of the node; Step S806: Determine whether the node is a verification node. If so, proceed to step S807; otherwise, proceed to step S808; Step S807: output the node and proceed to step S808; Step S808: Determine the parent node of the node according to the node and its sibling nodes; Step S809, determine whether the parent node of the node is a root node, if not, proceed to step S810, otherwise, if yes, proceed to step S811; Step S810, taking the parent node of the node as a new node, and proceeding to step S803; Step S811, end.

[0158] Below Figure 2 The Merkle tree shown is used as an example to illustrate the process of the generation module of the present application performing the signature operation.

[0159] 1) According to the message to be processed, node (0, 4) is determined as the signature node; 2) Based on the signature node (0, 4), the verification nodes are determined to be node (0, 5), node (1, 3) and node (2, 0); 3) When node (0, 0) is received, the node (0, 0) is stored in the storage address P0; When node (0, 1) is received, node (1, 0) is obtained by hashing node (0, 0) and node (0, 1), and node (1, 0) is stored in storage address P1; When node (0, 2) is received, node (0, 2) replaces node (0, 0) in storage address P0; When node (0, 3) is received, node (1, 1) is obtained by hashing node (0, 2) and node (0, 3), node (2, 0) is obtained by hashing node (1, 0) and node (1, 1), and node (2, 0) is stored in storage address P2; When node (0, 4) is received, node (0, 4) replaces node (0, 2) in storage address P0; When node (0, 5) is received, node (0, 5) is output, and node (1, 2) is obtained by hashing node (0, 4) and node (0, 5), and node (1, 2) replaces node (1, 0) in storage address P1; When the node (0, 6) is received, the node (0, 6) replaces the node (0, 4) in the storage address P0, and the nodes stored in the RAM will stop refreshing; When node (0, 7) is received, node (1, 3) is obtained by hashing node (0, 6) and node (0, 7), and node (1, 3) is output. Node (2, 1) is obtained by hashing node (1, 2) and node (1, 3), and node (2, 0) is output. Root node (3, 0) is obtained by hashing node (2, 0) and node (2, 1).

[0160] In some implementations, the processing unit 61 is further used to: in response to receiving a key request transmitted by the server through the processor, determine the root node of the supertree corresponding to the current Merkle tree, and use the root node of the supertree as the public key corresponding to the key request.

[0161] Here, the key request can be any suitable request for obtaining a public key. During implementation, the server controls the processing unit through a processor to perform a public key generation operation. When the processing unit generates the public key, it returns it to the server. In some embodiments, if the current Merkle tree is a supertree, then the parent node is determined according to the first node until the root node, and the root node of the current Merkle tree is used as the public key; if the current Merkle tree is not a supertree, the root node of the current Merkle tree can be used to sign the leaf node of the Merkle tree on the previous layer.

[0162] Fig. 9 A schematic diagram of a process for generating a public key provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, user 91 initiates a key request to server 72. Server 72 controls processing unit 61 through a processor to perform a key generation operation. Processing unit 61 calls processing module 611 once to calculate the root node of the supertree, and finally returns the root node to user 91 as a public key.

[0163] In the implementation manner of the present application, the corresponding public key is generated in real time according to the key request, thereby improving the security and reliability of the public key.

[0164] Fig.10 A schematic diagram of the structure of a data processing system provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the data processing system includes a processing unit 61, a server 72, a CPU 73 (corresponding to the aforementioned processor), a hash core 74 (corresponding to the aforementioned computing unit) and a memory 75 (corresponding to the aforementioned storage unit) in the algorithm core of the post-quantum SPHINCS+. The algorithm core supports DMA and CPU to transfer data to the algorithm core through the bus, and at the same time, an external standard hash core 74 and memory 75 are connected to perform data calculation and access. The processing unit 61 is an important component of the algorithm core and is used for key generation and signature of the post-quantum SPHINCS+ algorithm. When generating a key, only the root node of the supertree needs to be calculated, while when signing, both the signature and the root node are generated, realizing the efficient unification of tree root calculation and signature generation.

[0165] In the embodiments of the present application, on the one hand, at least one verification node is determined in real time according to the signature node, thereby improving the security of the verification node; on the other hand, in the process of upwardly determining the parent node of a certain node, if the node is a verification node, the node is first output and then the parent node of the node is determined, so as to ensure that the output order of each verification node is in an upward order. The present application does not require additional storage space to store each verification node separately. Compared with the related art that requires additional storage space to store each verification node in the Merkle tree, not only the storage space is reduced, but also, in the process of upwardly determining the parent node, the present application has output each verification node in an upward order. Compared with the related art that requires reading and outputting each verification node in sequence from another storage space in an upward order, the security of the signature is ensured while reducing resource consumption and improving signature efficiency.

[0166] In some embodiments, the multiple nodes of the current Merkle tree include at least two leaf nodes and at least one non-leaf node; the processing unit 61 is also used to: determine a second node from at least two leaf nodes based on the signature node, and use the second node as a verification node; when the parent node of the signature node is a non-root node, determine at least one verification node from at least one non-leaf node based on the parent node of the signature node.

[0167] In some embodiments, the processing unit 61 is further used to: use the parent node of the signature node as the third node; based on the third node, determine the fourth node from at least one non-leaf node with the same height as the third node, and use the fourth node as a verification node; when the parent node of the third node is a non-root node, use the parent node of the third node as a new third node.

[0168] In some implementations, the processing unit 61 is further configured to: use a sibling node of the signature node as the second node; or determine the second node from at least two leaf nodes based on a position index of the signature node.

[0169] In some implementations, the processing unit 61 is further configured to: determine a target location index based on the location index of the signature node; and determine a second node from at least two leaf nodes based on the target location index.

[0170] In some implementations, the processing unit 61 is further configured to: determine an XOR value between the location index of the signature node and a preset value, and use the XOR value as the target location index.

[0171] In some embodiments, the processing unit 61 is further used for one of the following: taking the sibling node of the third node as the fourth node; and determining the fourth node from at least one non-leaf node having the same height as the third node based on the position index of the third node.

[0172] In some implementations, the processing unit 61 is further configured to: determine a first hash value between the first node and a sibling node of the first node; and determine a parent node of the first node based on the first hash value.

[0173] In some implementations, the processing unit 61 is further configured to: stop refreshing the target storage block when the first node satisfies a second preset condition.

[0174] In some implementations, the processing unit 61 is further configured to: determine a second hash value of the message to be processed; and determine a signature node from at least two leaf nodes of the current Merkle tree based on the second hash value.

[0175] In some embodiments, the processing unit 61 is further used to: if the first node is a non-root node and a non-verification node, determine the parent node of the first node based on the first node; if the first node is a root node and the current Merkle tree is a supertree, use the first node as a public key.

[0176] The description of the above chip embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the chip embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0177] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0178] It should be noted that, in this article, the term "comprises", "includes" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0179] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0180] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0181] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately configured as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0182] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, read-only memories (ROM), magnetic disks or optical disks.

[0183] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for an electronic device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0184] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A data processing method, characterized in that: include: Determine a signature node from at least two leaf nodes of the current Merkle tree; Based on the signature node, determining at least one verification node from multiple nodes of the current Merkle tree; In the process of determining the parent node of a first node, if the first node is one of the at least one verification node, the first node is output, and based on the first node, the parent node of the first node is determined, and the first node is one of the multiple nodes.

2. The data processing method according to claim 1, characterized in that: The multiple nodes of the current Merkle tree include the at least two leaf nodes and at least one non-leaf node; The determining, based on the signature node, at least one verification node from a plurality of nodes of the current Merkle tree comprises: Based on the signature node, determine a second node from the at least two leaf nodes, and use the second node as a verification node; In the case that the parent node of the signature node is a non-root node, at least one verification node is determined from the at least one non-leaf node based on the parent node of the signature node.

3. The data processing method according to claim 2, characterized in that: The determining, based on the parent node of the signature node, at least one verification node from the at least one non-leaf node comprises: Taking the parent node of the signature node as the third node; Based on the third node, determine a fourth node from at least one non-leaf node with the same height as the third node, and use the fourth node as a verification node; In the case that the parent node of the third node is a non-root node, the parent node of the third node is used as the new third node.

4. The data processing method according to claim 2, characterized in that: The determining, based on the signature node, a second node from the at least two leaf nodes comprises one of the following: Using the brother node of the signature node as the second node; Based on the position index of the signature node, the second node is determined from the at least two leaf nodes.

5. The data processing method according to claim 4, characterized in that: The determining the second node from the at least two leaf nodes based on the position index of the signature node includes: Determine a target location index based on the location index of the signature node; Based on the target position index, the second node is determined from the at least two leaf nodes.

6. The data processing method according to claim 5, characterized in that: The determining the target location index based on the location index of the signature node includes: Determine an XOR value between the position index of the signature node and a preset value, and use the XOR value as the target position index.

7. The data processing method according to claim 3, characterized in that: The step of determining the fourth node from at least one non-leaf node having the same height as the third node based on the third node comprises one of the following: Using the sibling node of the third node as the fourth node; The fourth node is determined from at least one non-leaf node having the same height as the third node based on the position index of the third node.

8. The data processing method according to any one of claims 1 to 7, characterized in that: The determining, based on the first node, a parent node of the first node includes: When the position index of the first node satisfies a first preset condition, obtaining a sibling node of the first node from a target storage position of a target storage block, and determining a parent node of the first node based on the first node and the sibling node of the first node; The target storage block includes multiple storage locations, the number of the multiple storage locations is adapted to the height of the current Merkle tree, all nodes of the same height in the current Merkle tree correspond to one storage location, and the target storage location is a storage location adapted to the height of the first node.

9. The data processing method according to claim 8, characterized in that: The determining the parent node of the first node based on the first node and the sibling nodes of the first node includes: Determine a first hash value between the first node and a sibling node of the first node; Based on the first hash value, a parent node of the first node is determined.

10. The data processing method according to claim 8, characterized in that: The data processing method further includes at least one of the following: If the position index of the first node does not satisfy the first preset condition, storing the first node in the target storage location; When the first node meets a second preset condition, refreshing the target storage block is stopped.

11. The data processing method according to any one of claims 1 to 7, characterized in that: The step of determining a signature node from at least two leaf nodes of the current Merkle tree includes: Determining a second hash value of the message to be processed; Based on the second hash value, the signature node is determined from at least two leaf nodes of the current Merkle tree.

12. The data processing method according to any one of claims 1 to 7, characterized in that: The data processing method further includes: If the first node is a non-root node and a non-verification node, determining a parent node of the first node based on the first node; If the first node is a root node and the current Merkle tree is a supertree, the first node is used as a public key.

13. A data processing chip, characterized in that: The data processing chip is provided with a processing unit, wherein: The processing unit is used to: determine a signature node from at least two leaf nodes of the current Merkle tree; determine at least one verification node from multiple nodes of the current Merkle tree based on the signature node; in the process of determining the parent node of a first node, if the first node is a verification node among the at least one verification node, output the first node, and determine the parent node of the first node based on the first node, the first node being one of the multiple nodes.

14. The data processing chip according to claim 13, characterized in that: The processing unit is further configured to: In response to receiving a signature request transmitted by a server through a processor, determining the signature node from at least two leaf nodes of the current Merkle tree based on a pending message transmitted by the server through direct memory access; In the case where the position index of the first node satisfies a first preset condition, a brother node of the first node is obtained from a target storage position of a target storage block of a storage unit, and the first node and the brother node of the first node are sent to a computing unit, so that the computing unit determines the parent node of the first node based on the first node and the brother node of the first node; wherein the target storage block includes a plurality of storage locations, the number of the plurality of storage locations is adapted to the height of the current Merkle tree, all nodes of the same height in the current Merkle tree correspond to one storage location, and the target storage location is a storage location adapted to the height of the first node; When the location index of the first node does not satisfy the first preset condition, the first node is stored in the target storage location.

15. The data processing chip according to claim 13 or 14, characterized in that: The processing unit is further used for: In response to receiving a key request transmitted by the server through the processor, a root node of a supertree corresponding to the current Merkle tree is determined, and the root node of the supertree is used as a public key corresponding to the key request.

Citation Information

Patent Citations

  • System and method for implementing Tag-Tree encoding

    CN108513130A

  • Storage verification method, device and system for efficient provable block chain data

    CN116962053A

  • Data verification method and device, computer equipment and storage medium

    CN117910048A

  • Predictable and adaptive quality of service for storage

    US20230168934A1

  • Resource allocation method and apparatus, and storage medium

    US20230239159A1