US20220376893A1 - Circuit for performing hash algorithm, computing chip, data processing device and method - Google Patents

Circuit for performing hash algorithm, computing chip, data processing device and method Download PDF

Info

Publication number
US20220376893A1
US20220376893A1 US17/630,881 US202117630881A US2022376893A1 US 20220376893 A1 US20220376893 A1 US 20220376893A1 US 202117630881 A US202117630881 A US 202117630881A US 2022376893 A1 US2022376893 A1 US 2022376893A1
Authority
US
United States
Prior art keywords
expansion
register
operation stage
data
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
US17/630,881
Other versions
US11658807B2 (en
Inventor
Zhijun Fan
Ke Xue
Chao Xu
Zuoxing YANG
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen MicroBT Electronics Technology Co Ltd
Original Assignee
Shenzhen MicroBT Electronics Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen MicroBT Electronics Technology Co Ltd filed Critical Shenzhen MicroBT Electronics Technology Co Ltd
Assigned to SHENZHEN MICROBT ELECTRONICS TECHNOLOGY CO., LTD. reassignment SHENZHEN MICROBT ELECTRONICS TECHNOLOGY CO., LTD. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: FAN, ZHIJUN, XU, CHAO, XUE, KE, YANG, Zuoxing
Publication of US20220376893A1 publication Critical patent/US20220376893A1/en
Application granted granted Critical
Publication of US11658807B2 publication Critical patent/US11658807B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/137Hash-based
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • G06Q20/4014Identity check for transactions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • the present disclosure generally relates to a circuit for performing a hash algorithm, computing chip, data processing device (e.g., a crypto currency mining machine), and related method.
  • Bitcoin is a virtual crypto digital currency in a form of P2P (Peer-to-Peer), the concept of which was originally proposed by Satoshi Nakamoto on Nov. 1, 2008 and formally came into being on Jan. 3, 2009. Bitcoin is unique in that it is not issued by a specific monetary institution, but is generated through a large amount of operations according to a specific algorithm.
  • P2P Peer-to-Peer
  • a distributed database composed of numerous nodes throughout a P2P network is used to validate and record all transactions, and the design of cryptography is used to ensure their security.
  • Bitcoin is a proof of work (POW) based on a hash algorithm SHA-256, and its transaction integrity depends on collision and pre-image resistance of the SHA-256.
  • the hash algorithm is an algorithm that takes variable-length data as input and generates a fixed-length hash value as output, the essence of which is a distillation of information. Since 1993, the US National Institute of Standards and Technology has successively designed and issued several versions of secure hash algorithms (SHAs), and the SHA-256 is one of the secure Hash algorithms with a hash length of 256 bits.
  • SHAs secure hash algorithms
  • the core of Bitcoin mining using a mining machine is that a reward is obtained according to the operation capability of computing the SHA-256 by the mining machine.
  • chip's size, chip's running speed and chip's power consumption are three factors crucial to the performance of the mining machine, wherein the chip's size decides chip's cost, the chip's running speed decides mining machine's running speed, i.e., hash rate, and the chip's power consumption decides a degree of consumed electricity, i.e., mining cost.
  • a most important performance index for measuring the mining machine is power consumption consumed by unit hash rate, i.e., a ratio of power consumption to hash rate.
  • the SHA-256 is performed twice in a Bitcoin protocol. Therefore, it is most important for the Bitcoin mining machine to implement the hash algorithm SHA-256 with lower ratio of power consumption to hash rate.
  • a circuit for performing a hash algorithm comprising: an input module configured to receive data; and an operation module configured to compute a hash value based on the received data, the operation module comprising: a plurality of operation stages arranged in a pipeline structure, each operation stage of the plurality of operation stages comprising 0th to 15th expansion registers, each expansion register being configured to store expansion data of the current operation stage; and a plurality of expansion data operation logic modules, each expansion data operation logic module being disposed between two respective adjacent operation stages of the plurality of operation stages, the two adjacent operation stages comprising a first operation stage and a second operation stage after the first operation stage, each expansion data operation logic module comprising: a first sub-module configured to compute expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register of the first operation stage; and a second sub-module configured to compute expansion data for storage into a 15th expansion register of the second operation stage
  • a circuit for performing a hash algorithm comprising: an input module configured to receive data; and an operation module configured to compute a hash value based on the received data, the operation module comprising: a plurality of operation stages arranged in a pipeline structure, each operation stage of the plurality of operation stages comprising 0th to 15th expansion registers and an additional register, each expansion register being configured to store expansion data of the current operation stage, the additional register being configured to store intermediate data for computing expansion data; and a plurality of expansion data operation logic modules, each expansion data operation logic module being disposed between two respective adjacent operation stages of the plurality of operation stages, the two adjacent operation stages comprising a first operation stage and a second operation stage after the first operation stage, each expansion data operation logic module comprising: a first sub-module configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in an expansion register of the first operation stage; and a second sub-module configured to compute expansion data for storage into
  • a computing chip comprising the circuit as described in the above aspects.
  • a data processing device comprising one or more computing chips as described in the above aspect.
  • a method of computing expansion data in a circuit for performing a hash algorithm comprising an input module configured to receive data and an operation module configured to compute a hash value based on the received data, the operation module comprising a plurality of operation stages arranged in a pipeline structure, each operation stage of the plurality of operation stages comprising 0th to 15th expansion registers, each expansion register being configured to store expansion data of the current operation stage, the method comprising: for two adjacent operation stages of the plurality of operation stages which comprise a first operation stage and a second operation stage after the first operation stage: computing expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register of the first operation stage; computing expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register of the first operation stage; and taking expansion data stored in an ith expansion register of the first operation stage as expansion data for storage into an (
  • a method of computing expansion data in a circuit for performing a hash algorithm comprising an input module configured to receive data and an operation module configured to compute a hash value based on the received data, the operation module comprising a plurality of operation stages arranged in a pipeline structure, each operation stage of the plurality of operation stages comprising 0th to 15th expansion registers and an additional register, each expansion register being configured to store expansion data of the current operation stage, the additional register being configured to store intermediate data for computing expansion data, the method comprising: for two adjacent operation stages of the plurality of operation stages which comprise a first operation stage and a second operation stage after the first operation stage: computing intermediate data for storage into an additional register of the second operation stage based on expansion data stored in an expansion register of the first operation stage; computing expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage; and taking expansion data stored in an ith expansion register of the first operation stage as expansion
  • FIG. 1 shows a schematic diagram of an exemplary pipeline structure for performing a SHA-256 algorithm
  • FIG. 2 schematically shows conventional operation logic between expansion data in expansion registers of two adjacent operation stages in the pipeline structure of FIG. 1 ;
  • FIG. 3 shows a schematic block diagram of a circuit for performing a hash algorithm according to some embodiments of the present disclosure
  • FIGS. 4 to 7 schematically show exemplary configurations of a portion, comprising an expansion data operation logic module, in the circuit as shown in FIG. 3 according to embodiments of the present disclosure
  • FIG. 8 shows a schematic block diagram of a circuit for performing a hash algorithm according to some embodiments of the present disclosure
  • FIGS. 9 to 14 schematically show exemplary configurations of a portion, comprising an expansion data operation logic module, in the circuit as shown in FIG. 8 according to embodiments of the present disclosure.
  • FIGS. 15 and 16 show exemplary flow diagrams of a method for computing expansion data according to embodiments of the present disclosure.
  • a SHA-256 algorithm will be briefly described hereinafter and taken as a representative example of a hash algorithm to describe a circuit for performing a hash algorithm and related method according to the embodiments of the present disclosure.
  • the circuit for performing the hash algorithm and related method according to the embodiments of the present disclosure are applicable to any hash algorithm and can even further be applied in any other suitable circuit and method, and not limited to the implementation of the SHA-256 algorithm.
  • FIG. 1 shows a schematic diagram of an exemplary pipeline structure for performing a SHA-256 algorithm.
  • Input to the SHA-256 is data w 1 th a maximum length less than 2 64 bits, and output therefrom is a 256-bit data digest, i.e., hash value.
  • the input data is processed in a 512-bit data block as a unit.
  • To implement the SHA-256 algorithm 64 rounds of repetitive operations are required to be performed for each 512-bit data block, and thus a parallel operation on 64 groups of data can be performed using a pipeline structure comprising 64 operation stages. As shown in FIG.
  • the pipeline structure comprises 0th to 63th operation stages, each operation stage comprising 8 32-bit compression registers A to H for storing intermediate values and 16 32-bit expansion registers R 0 to R 15 for storing expansion data.
  • the 0th operation stage can receive an input data block, divide it into 8 blocks of 32-bit data and store them into the compression registers A to H respectively, and then perform operation processing on them and provide their results to the 1st operation stage. Then, each operation stage performs an operation on its received operation result from a preceding operation stage and provides its own operation result to a subsequent operation stage.
  • an operation core can output a hash operation result of performing the SHA-256 algorithm once on the input data.
  • a (t)th round of operations performed on a (t)th operation stage is defined by(t is an integer and satisfies 0 ⁇ t ⁇ 63):
  • T 1 H+ ⁇ 1 (E)+Ch(E, F, G)+K t +W t ;
  • T 2 ⁇ 0 (A)+Maj(A, B, C);
  • Ch(x, y, z) (x AND y) ⁇ ((NOT x) AND z)
  • Maj(x, y, z) (x AND y) ⁇ (x AND z) ⁇ (y AND z)
  • ⁇ 0 (x) ROTR 2 (x) ⁇ ROTR 13 (x) ⁇ ROTR 22 (x)
  • ⁇ 1 (x) ROTR 6 (x) ⁇ ROTR 11 (x) ⁇ ROTR 25 (x)
  • ROTR n (x) denotes that a 32-bit variable x is rotated n bits to the right;
  • W t is a 32-bit word derived from the current 256-bit input data block;
  • K t is a 32-bit additional constant;
  • + is modulo 2 32 addition;
  • AND is a 32-bit bitwise AND operation; NOT is an operation of negation; and
  • is an exclusive OR operation.
  • W t can be obtained according to the following operation expression:
  • W t is taken directly from the input data block
  • ROTR n (x) denotes that a 32-bit variable x is rotated n bits to the right
  • SHR n (x) denotes that a 32-bit variable x is shifted n bits to the right with the left thereof padded by 0
  • is an exclusive OR operation
  • + is modulo 2 32 addition.
  • formulas of the above functions ⁇ 0 (x), ⁇ 1 (x), ⁇ 0 (x), ⁇ 1 (x) are specific forms for processing 32-bit data given by taking the SHA-256 as an example, and those skilled in the art know that in other SHA algorithms (e.g., SHA-512, etc.) and even other hash algorithms, these functions can adaptively take other corresponding forms for processing other sizes of data (e.g., 64-bit data, etc.).
  • FIG. 2 shows conventional operation logic between expansion data in expansion registers of two adjacent operation stages in the pipeline structure in FIG. 1 .
  • Expansion data to be stored in an expansion register R 15 of a subsequent operation stage needs to be computed using expansion data in expansion registers R 0 , R 1 , R 9 , and R 14 of each operation stage, and in addition, expansion data in expansion registers R 1 to R 15 can be directly shifted into corresponding expansion registers R 0 to R 14 of the subsequent operation stage.
  • a portion involving the expansion data in the expansion register R 0 of the (t+1)th operation stage i.e., the expansion data in the expansion register R 10 f the (t)th operation stage
  • a process for computing expansion data to be stored in an expansion register R 15 of a (t+2)th operation stage is advanced to be performed simultaneously with a process for computing the expansion data to be stored in the expansion register R 15 of the (t+1)th operation stage, and is stored in the expansion register R 0 of the (t+1)th operation stage.
  • a disassembled portion can be processed in parallel with the process for computing the expansion data to be stored in the expansion register R 15 of the (t+1)th operation stage.
  • the present disclosure provides a circuit for performing a hash algorithm with an improved expansion data operation logic module and an improved method of computing expansion data in the circuit for performing the hash algorithm, which can reduce the number of operation logic stages that is required to be experienced for computing, between adjacent operation stages, expansion data of a subsequent operation stage based on expansion data of a preceding operation stage, and significantly improves the operation speed of the circuit and thus of a computing chip including the circuit, thereby helping to achieve a lower ratio of power consumption to hash rate.
  • FIG. 3 shows a schematic block diagram of a circuit 100 for performing a hash algorithm according to some embodiments of the present disclosure, wherein arrows indicate a data transfer direction.
  • the circuit 100 can comprise an input module 110 and an operation module 120 .
  • the input module 110 can be configured to receive data.
  • the operation module 120 can be configured to compute a hash value based on the received data.
  • the operation module 120 can comprise a plurality of operation stages 120 - 0 , . . . , 120 - 63 arranged in a pipeline structure, each operation stage can comprise 0th to 15th expansion registers R 0 to R 15 , and each expansion register can be configured to store expansion data of the current operation stage.
  • the operation module 120 is depicted in the drawings as comprising 64 operation stages, as mentioned earlier, the circuit for performing the SHA-256 algorithm is taken herein merely as a non-limiting example, the circuit according to the present disclosure can actually be suitable for performing any hash algorithm (not limited to the SHA series of algorithms) now known or later developed for use in a mining machine and can comprise any suitable number of operation stages. It should also be understood that an actual circuit can also have additional other components (such as compression registers, etc.), but these other components are not shown in the drawings and are not discussed herein to avoid obscuring the main points of the present disclosure.
  • expansion data stored in 0th to 15th expansion registers R 0 to R 15 of a most preceding operation stage 120 - 0 of the operation module 120 can be directly taken from data received by the input module 110 , for example, while expansion data to be stored in 0th to 15th expansion registers R 0 to R 15 of each operation stage starting from the operation stage 120 - 1 can be determined based on expansion data stored in 0th to 15th expansion registers R 0 to R 15 of a preceding operation stage, for example.
  • the operation module 120 can further comprise a plurality of expansion data operation logic modules 130 , each expansion data operation logic module 130 being disposed between two respective adjacent operation stages of the plurality of operation stages 120 - 0 , . . . , 120 - 63 of the operation module 120 .
  • a preceding operation stage of the two adjacent operation stages can be referred to as a first operation stage and a subsequent operation stage of the two adjacent operation stages can be referred to as a second operation stage, and it is noted that “first” and “second” are merely for distinction rather than limitation.
  • an expansion data operation logic module 130 is disposed between two adjacent operation stages 120 - a, 120 - b.
  • Each expansion data operation logic module 130 can comprise a first sub-module 131 and a second sub-module 132 .
  • the expansion data operation logic module 130 can be configured to compute expansion data for storage into an expansion register of the second operation stage (e.g., 120 - b ) based on expansion data stored in an expansion register of the first operation stage (e.g., 120 - a ).
  • the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R 0 of the second operation stage based on expansion data stored in a 1st expansion register R 10 f the first operation stage.
  • the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on expansion data stored in a 0th expansion register R 0 of the first operation stage.
  • expansion data for storage into an (i ⁇ 1)th expansion register of the second operation stage can be expansion data stored in an ith expansion register of the first operation stage, where 2 ⁇ i ⁇ 15 and i is an integer. That is, in the circuit 100 , expansion data to be stored in the 0th expansion register R 0 and the 15th expansion register R 15 of the second operation stage is obtained by performing operations on expansion data stored in expansion registers of the first operation stage, and expansion data to be stored in 1st to 14th expansion registers R 1 to R 14 of the second operation stage is obtained by directly shifting expansion data stored in each expansion register of 2nd to 15th expansion registers R 2 to R 15 of the first operation stage into corresponding expansion registers of the 1st to 14th expansion registers R 1 to R 14 of the second operation stage.
  • expansion data stored in a 15th expansion register R 15 of a subsequent operation stage of the second operation stage can be determined based on expansion data stored in a 1st expansion register R 1 , a 2nd expansion register R 2 , a 10th expansion register R 10 , and a 15th expansion register R 15 of the first operation stage.
  • the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R 0 of the second operation stage based on expansion data stored in one or two of a 2nd expansion register R 2 , a 10th expansion register R 10 , a 15th expansion register R 15 of the first operation stage and expansion data stored in a 1st expansion register R 10 f the first operation stage.
  • the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on expansion data stored in one or two of a 1st expansion register R 1 , a 9th expansion register R 9 , a 14th expansion register R 14 of the first operation stage and expansion data stored in a 0th expansion register R 0 of the first operation stage.
  • FIGS. 4 to 7 Several non-limiting exemplary configurations of a portion, comprising the expansion data operation logic module, in the circuit shown in FIG. 3 according to embodiments of the present disclosure will be described below in conjunction with FIGS. 4 to 7 .
  • the two adjacent operation stages 120 - a and 120 - b are taken as examples for explanation, and it can be understood that any two adjacent operation stages in the operation module 120 can be the operation stages 120 - a and 120 - b discussed below.
  • first sub-module 131 and the second sub-module 132 are indicated by dashed boxes, moving directions of expansion data that is directly shifted with no operation are indicated by dotted arrows, moving directions of expansion data processed via the first sub-module 131 are indicated by chain-dotted arrows, and moving directions of expansion data processed via the second sub-module 132 are indicated by solid arrows.
  • the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R 0 of the second operation stage based on expansion data stored in a 1st expansion register R 1 and a 2nd expansion register R 2 of the first operation stage
  • the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on expansion data stored in a 0th expansion register R 0 , a 9th expansion register R 9 , and a 14th expansion register R 14 of the first operation stage.
  • expansion data w 0 ′ in a 0th expansion register R 0 of the operation stage 120 - b is obtained by processing, by the first sub-module 131 , expansion data w 1 stored in a 1st expansion register R 1 and expansion data w 2 stored in a 2nd expansion register R 2 of the operation stage 120 - a.
  • expansion data w 15 ′ in a 15th expansion register R 15 of the operation stage 120 - b is obtained by processing, by the second sub-module 132 , expansion data w 0 stored in a 0th expansion register R 0 , expansion data w 9 stored in a 9th expansion register R 9 , and expansion data w 14 stored in a 14th expansion register R 14 of the operation stage 120 - a .
  • expansion data stored in an ith expansion register of the operation stage 120 - a is directly shifted into an (i ⁇ 1)th expansion register of the operation stage 120 - b, where 2 ⁇ i ⁇ 15 and i is an integer.
  • the number of operation logic stages experienced by the first sub-module 131 is 2, and the number of operation logic stages experienced by the second sub-module 132 is 3.
  • the first sub-module 131 and the second sub-module 132 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 120 - b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R 0 of the second operation stage based on expansion data stored in a 1st expansion register R 1 and a 10th expansion register R 10 of the first operation stage
  • the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on e 0 xpansion data stored in a 0th expansion register R 0 , a 1st expansion register R 1 , and a 14th expansion register R 14 of the first operation stage.
  • expansion data w 0 ′ in a 0th expansion register R 0 of the operation stage 120 - b is obtained by processing, by the first sub-module 131 , expansion data w 1 stored in a 1st expansion register R 1 and expansion data w 10 stored in a 10th expansion register R 10 of the operation stage 120 - a.
  • expansion data w 15 ′ in a 15th expansion register R 15 of the operation stage 120 - b is obtained by processing, by the second sub-module 132 , expansion data w 0 stored in a 0th expansion register R 0 , expansion data w 1 stored in a 1st expansion register R 1 , and expansion data w 14 stored in a 14th expansion register R 14 of the operation stage 120 - a .
  • the second sub-module 132 comprises a ⁇ 0 operator for performing a ⁇ 0 operation, a ⁇ 1 operator for performing a ⁇ 1 operation, and a full-adder FAA and an adder ADD 2 for performing an addition operation, wherein the expansion data w 1 is input to the ⁇ 0 operator, the expansion data w 14 is input to the ⁇ 1 operator, and the ⁇ 0 operation and the ⁇ 1 operation can be performed simultaneously, for example.
  • expansion data stored in an ith expansion register of the operation stage 120 - a is directly shifted into an (i ⁇ 1)th expansion register of the operation stage 120 - b, where 2 ⁇ i ⁇ 15 and i is an integer.
  • the number of operation logic stages experienced by the first sub-module 131 is 1, and the number of operation logic stages experienced by the second sub-module 132 is 3.
  • the first sub-module 131 and the second sub-module 132 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 120 - b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R 0 of the second operation stage based on expansion data stored in a 1st expansion register R 1 , a 2nd expansion register R 2 , and a 10th expansion register R 10 of the first operation stage
  • the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on expansion data stored in a 0th expansion register R 0 and a 14th expansion register R 14 of the first operation stage.
  • expansion data w 0 ′ in a 0th expansion register R 0 of the operation stage 120 - b is obtained by processing, by the first sub-module 131 , expansion data w 1 stored in a 1st expansion register R 1 , expansion data w 2 stored in a 2nd expansion register R 2 , and expansion data w 10 stored in a 10th expansion register R 10 of the operation stage 120 - a.
  • expansion data w 15 ′ in a 15th expansion register R 15 of the operation stage 120 - b is obtained by processing, by the second sub-module 132 , expansion data w 0 stored in a 0th expansion register R 0 and expansion data w 14 stored in a 14th expansion register R 14 of the operation stage 120 - a.
  • expansion data stored in an ith expansion register of the operation stage 120 - a is directly shifted into an (i ⁇ 1)th expansion register of the operation stage 120 - b, where 2 ⁇ i ⁇ 15 and i is an integer.
  • the number of operation logic stages experienced by the first sub-module 131 is 3, and the number of operation logic stages experienced by the second sub-module 132 is 2.
  • the first sub-module 131 and the second sub-module 132 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 120 - b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R 0 of the second operation stage based on expansion data stored in a 1st expansion register R 1 and a 15th expansion register R 15 of the first operation stage
  • the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on expansion data stored in a 0th expansion register R 0 , a 1st expansion register R 1 , and a 9th expansion register R 9 of the first operation stage.
  • expansion data w 0 ′ in a 0th expansion register R 0 of the operation stage 120 - b is obtained by processing, by the first sub-module 131 , expansion data w 1 stored in a 1st expansion register R 1 and expansion data w 15 stored in a 15th expansion register R 15 of the operation stage 120 - a.
  • expansion data w 15 ′ in a 15th expansion register R 15 of the operation stage 120 - b is obtained by processing, by the second sub-module 132 , expansion data w 0 stored in a 0th expansion register R 0 , expansion data w 1 stored in a 1st expansion register R 1 , and expansion data w 9 stored in a 9th expansion register R 9 of the operation stage 120 - a .
  • expansion data stored in an ith expansion register of the operation stage 120 - a is directly shifted into an (i ⁇ 1)th expansion register of the operation stage 120 - b, where 2 ⁇ i ⁇ 15 and i is an integer.
  • the number of operation logic stages experienced by the first sub-module 131 is 2, and the number of operation logic stages experienced by the second sub-module 132 is 3.
  • the first sub-module 131 and the second sub-module 132 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 120 - b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R 0 of the second operation stage based on expansion data stored in a 1st expansion register R 1 , a 2nd expansion register R 2 , and a 15th expansion register R 15 of the first operation stage
  • the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on expansion data stored in a 0th expansion register R 0 and a 9th expansion register R 9 of the first operation stage.
  • the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R 0 of the second operation stage based on expansion data stored in a 1st expansion register R 1 , a 10th expansion register R 10 , and a 15th expansion register R 15 of the first operation stage
  • the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register R 0 and a 1st expansion register R 1 of the first operation stage.
  • FIG. 13 shows an exemplary flow diagram of a method 300 of computing expansion data in a circuit for performing a hash algorithm according to embodiments of the present disclosure.
  • a circuit can comprise an input module configured to receive data and an operation module configured to compute a hash value based on the received data, wherein the operation module can comprise a plurality of operation stages arranged in a pipeline structure, each operation stages can comprise 0th to 15th expansion registers, each expansion register can be configured to store expansion data of the current operation stage.
  • the method 300 can comprise: at S 301 , computing expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register of the first operation stage; at S 302 , computing expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register of the first operation stage; and at S 303 , taking expansion data stored in an ith expansion register of the first operation stage as expansion data for storage into an (i ⁇ 1)th expansion register of the second operation stage, where 2 ⁇ i ⁇ 15 and i is an integer.
  • S 301 to S 303 do not need to be performed in sequential order, but can be performed in any order, or can be performed at least partially in parallel.
  • the computation of the expansion data for storage into the 0th expansion register of the second operation stage and the computation of the expansion data for storage into the 15th expansion register of the second operation stage can be performed simultaneously.
  • expansion data stored in a 15th expansion register of a subsequent operation stage of the second operation stage can be determined based on expansion data stored in a 1st expansion register, a 2nd expansion register, a 10th expansion register, and a 15th expansion register of the first operation stage.
  • the method 300 can also compute expansion data in various ways as described above with respect to the first sub-module 131 and the second sub-module 132 , which are not repeated herein.
  • the method 300 can reduce the computation latency caused by computing expansion data in the circuit for performing the hash algorithm, thereby significantly improving the operation speed of the circuit and thus of a computing chip containing the circuit, thereby achieving a lower ratio of power consumption to hash rate.
  • an expansion register R 0 is used to store a portion involving expansion data in an expansion register R 1 of a preceding operation stage which was in a process originally for computing expansion data to be stored in an expansion register R 15 of a subsequent operation stage but is performed in advance.
  • an additional register can also be used instead to implement the role of the expansion register R 0 in the above embodiments.
  • the additional register when used, it can not only be used to perform the portion involving the expansion data in the expansion register R 1 of the preceding operation stage which was in the process originally for computing the expansion data to be stored in the expansion register R 15 of the subsequent operation stage in advance, but also can be used to perform any suitable portion which was in the process originally for computing the expansion data to be stored in the expansion register R 15 of the subsequent operation stage in advance.
  • FIG. 8 shows a schematic block diagram of a circuit 200 for performing a hash algorithm according to some other embodiments of the present disclosure.
  • the circuit 200 can comprise an input module 210 and an operation module 220 .
  • the input module 210 can be configured to receive data.
  • the operation module 220 can be configured to compute a hash value based on the received data.
  • the operation module 220 can comprise a plurality of operation stages 220 - 0 , . . .
  • each operation stage can comprise 0th to 15th expansion registers R 0 to R 15 and an additional register X
  • each expansion register can be configured to store expansion data of the current operation stage
  • the additional register can be configured to store intermediate data for computing expansion data.
  • intermediate data stored in an additional register X of a most preceding operation stage 220 - 0 can be the same as expansion data stored in a 0th expansion register R 0 of the most preceding operation stage 220 - 0 .
  • the operation module 220 can further comprise a plurality of expansion data operation logic modules 230 , each expansion data operation logic module 230 being disposed between two respective adjacent operation stages of the plurality of operation stages 220 - 0 , . . . , 220 - 63 of the operation module 220 .
  • a preceding operation stage in the two adjacent operation stages can be referred to as a first operation stage and a subsequent operation stage in the two adjacent operation stages can be referred to as a second operation stage, and it is noted that “first” and “second” are merely for distinction rather than limitation.
  • an expansion data operation logic module 230 is disposed between two adjacent operation stages 220 - a, 220 - b.
  • Each expansion data operation logic module 230 can comprise a first sub-module 231 and a second sub-module 232 .
  • the expansion data operation logic module 230 can be configured to compute expansion data for storage into an expansion register of the second operation stage (e.g., 220 - b ) and intermediate data for storage into an additional register of the second operation stage based on expansion data stored in an expansion register of the first operation stage (e.g., 220 - a ) and intermediate data stored in an additional register of the first operation stage (e.g., 220 - a ).
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in an expansion register of the first operation stage.
  • the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage.
  • expansion data for storage into an (i ⁇ 1)th expansion register of the second operation stage can be expansion data stored in an ith expansion register of the first operation stage, where 1 ⁇ i ⁇ 15 and i is an integer.
  • expansion data to be stored in a 15th expansion register R 15 of the second operation stage is obtained by performing operations on intermediate data stored in an additional register of the first operation stage, and expansion data to be stored in 0th to 14th expansion registers R 0 to R 14 of the second operation stage is obtained by directly shifting expansion data stored in each expansion register of 1st to 15th expansion registers R 1 to R 15 of the first operation stage into corresponding expansion registers of the 0th to 14th expansion registers R 0 to R 14 of the second operation stage.
  • expansion data stored in a 15th expansion register R 15 of a subsequent operation stage of the second operation stage can be determined based on expansion data stored in a 1st expansion register R 1 , a 2nd expansion register R 2 , a 10th expansion register R 10 , and a 15th expansion register R 15 of the first operation stage.
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in two or three of a 1st expansion register R 1 , a 2nd expansion register R 2 , a 10th expansion register R 10 , and a 15th expansion register R 15 of the first operation stage.
  • the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on expansion data stored in one or two of a 0th expansion register R 0 , a 1st expansion register R 1 , a 9th expansion register R 9 , a 14th expansion register R 14 of the first operation stage and intermediate data stored in an additional register X of the first operation stage.
  • FIGS. 9 to 14 Several non-limiting exemplary configurations of a portion, comprising an expansion data operation logic module, in the circuit as shown in FIG. 8 according to embodiments of the present disclosure will be described below in conjunction with FIGS. 9 to 14 .
  • two adjacent operation stages 220 - a and 220 - b are taken as examples for explanation, and it can be understood that any two adjacent operation stages in the operation module 220 can be the operation stages 220 - a and 220 - b discussed below.
  • first sub-module 231 and the second sub-module 232 are indicated by dashed boxes, moving directions of expansion data that is directly shifted with no operation are indicated by dotted arrows, moving directions of expansion data processed via the first sub-module 231 are indicated by chain-dotted arrows, and moving directions of expansion data processed via the second sub-module 232 are indicated by solid arrows.
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R 1 and a 2nd expansion register R 2 of the first operation stage
  • the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 9th expansion register R 9 and a 14th expansion register R 14 of the first operation stage.
  • intermediate data w x ′ in an additional register X of the operation stage 220 - b is obtained by processing, by the first sub-module 231 , expansion data w 1 stored in a 1st expansion register R 1 and expansion data w 2 stored in a 2nd expansion register R 2 of the operation stage 220 - a.
  • expansion data w 15 ′ in a 15th expansion register R 15 of the operation stage 220 - b is obtained by processing, by the second sub-module 232 , intermediate data w x stored in an additional register X, expansion data w 9 stored in a 9th expansion register R 9 , and expansion data w 14 stored in a 14th expansion register R 14 of the operation stage 220 - a.
  • expansion data stored in an ith expansion register of the operation stage 220 - a is directly shifted into an (i ⁇ 1)th expansion register of the operation stage 220 - b, where 1 ⁇ i ⁇ 15 and i is an integer.
  • the number of operation logic stages experienced by the first sub-module 231 is 2, and the number of operation logic stages experienced by the second sub-module 232 is 3.
  • the first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220 - b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R 1 and a 10th expansion register R 10 of the first operation stage
  • the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 1st expansion register R 1 and a 14th expansion register R 14 of the first operation stage.
  • intermediate data w x ′ in an additional register X of the operation stage 220 - b is obtained by processing, by the first sub-module 231 , expansion data w 1 stored in a 1st expansion register R 1 and expansion data w 10 stored in a 10th expansion register R 10 of the operation stage 220 - a.
  • expansion data w 15 ′ in a 15th expansion register R 15 of the operation stage 220 - b is obtained by processing, by the second sub-module 232 , intermediate data w x stored in an additional register X, expansion data w 1 stored in a 1st expansion register R 1 , and expansion data w 14 stored in a 14th expansion register R 14 of the operation stage 220 - a.
  • the second sub-module 232 comprises a ⁇ 0 operator for performing a ⁇ 0 operation, a ⁇ 1 operator for performing a ⁇ 1 operation, and a full-adder FAA and an adder ADD 2 for performing an addition operation, wherein the expansion data w 1 is input to the ⁇ 0 operator, the expansion data w 14 is input to the ⁇ 1 operator, and the ⁇ 0 operation and the ⁇ 1 operation can be performed simultaneously, for example.
  • expansion data stored in an ith expansion register of the operation stage 220 - a is directly shifted into an (i ⁇ 1)th expansion register of the operation stage 220 - b, where 1 ⁇ i ⁇ 15 and i is an integer.
  • the number of operation logic stages experienced by the first sub-module 231 is 1, and the number of operation logic stages experienced by the second sub-module 232 is 3.
  • the first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220 - b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R 1 , a 2nd expansion register R 2 , and a 10th expansion register R 10 of the first operation stage
  • the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 14th expansion register R 14 of the first operation stage.
  • intermediate data w x ′ in an additional register X of the operation stage 220 - b is obtained by processing, by the first sub-module 231 , expansion data w 1 stored in a 1st expansion register R 1 , expansion data w 2 stored in a 2nd expansion register R 2 , and expansion data w 10 stored in a 10th expansion register R 10 of the operation stage 220 - a.
  • expansion data w 15 ′ in a 15th expansion register R 15 of the operation stage 220 - b is obtained by processing, by the second sub-module 232 , intermediate data w x stored in an additional register X and expansion data w 14 stored in the 14th expansion register R 14 of the operation stage 220 - a.
  • expansion data stored in an ith expansion register of the operation stage 220 - a is directly shifted into an (i ⁇ 1)th expansion register of the operation stage 220 - b, where 1 ⁇ i ⁇ 15 and i is an integer.
  • the number of operation logic stages experienced by the first sub-module 231 is 3, and the number of operation logic stages experienced by the second sub-module 232 is 2.
  • the first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220 - b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R 1 and a 15th expansion register R 15 of the first operation stage
  • the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 1st expansion register R 1 and a 9th expansion register R 9 of the first operation stage.
  • intermediate data w x ′ in an additional register X of the operation stage 220 - b is obtained by processing, by the first sub-module 231 , expansion data w 1 stored in a 1st expansion register R 1 and expansion data w 15 stored in a 15th expansion register R 15 of the operation stage 220 - a.
  • expansion data w 15 ′ in a 15th expansion register R 15 of the operation stage 220 - b is obtained by processing, by the second sub-module 232 , intermediate data w x stored in an additional register X, expansion data w 1 stored in a 1st expansion register R 1 , and expansion data w 9 stored in a 9th expansion register R 9 of the operation stage 220 - a.
  • expansion data stored in an ith expansion register of the operation stage 220 - a is directly shifted into an (i ⁇ 1)th expansion register of the operation stage 220 - b, where 1 ⁇ i ⁇ 15 and i is an integer.
  • the number of operation logic stages experienced by the first sub-module 231 is 2, and the number of operation logic stages experienced by the second sub-module 232 is 3.
  • the first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220 - b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R 1 , a 2nd expansion register R 2 , and a 15th expansion register R 15 of the first operation stage
  • the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 9th expansion register R 9 of the first operation stage.
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R 1 , a 10th expansion register R 10 , and a 15th expansion register R 15 of the first operation stage
  • the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 1st expansion register R 1 of the first operation stage.
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 2nd expansion register R 2 and a 10th expansion register R 10 of the first operation stage
  • the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 0th expansion register R 0 and a 14th expansion register R 14 of the first operation stage.
  • intermediate data w x ′ in an additional register X of the operation stage 220 - b is obtained by processing, by the first sub-module 231 , expansion data w 2 stored in a 2nd expansion register R 2 and expansion data w 10 stored in a 1 0th expansion register R 10 of the operation stage 220 - a.
  • expansion data w 15 ′ in a 15th expansion register R 15 of the operation stage 220 - b is obtained by processing, by the second sub-module 232 , intermediate data w x stored in an additional register X, expansion data w 0 stored in a 0th expansion register R 0 , and expansion data w 14 stored in a 14th expansion register R 14 of the operation stage 220 - a.
  • expansion data stored in an ith expansion register of the operation stage 220 - a is directly shifted into an (i ⁇ 1)th expansion register of the operation stage 220 - b, where 1 ⁇ i ⁇ 15 and i is an integer.
  • the number of operation logic stages experienced by the first sub-module 231 is 2, and the number of operation logic stages experienced by the second sub-module 232 is 3.
  • the first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220 - b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 2nd expansion register R 2 , a 10th expansion register R 10 , and a 15th expansion register R 15 of the first operation stage
  • the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 0th expansion register R 0 of the first operation stage.
  • intermediate data w x ′ in an additional register X of the operation stage 220 - b is obtained by processing, by the first sub-module 231 , expansion data w 2 stored in a 2nd expansion register R 2 , expansion data w 10 stored in a 10th expansion register R 10 , and expansion data w 15 stored in a 15th expansion register R 15 of the operation stage 220 - a.
  • the first sub-module 231 comprises a ⁇ 0 operator for performing a ⁇ 0 operation, a ⁇ 1 operator for performing a ⁇ 1 operation, and a full-adder FAA and an adder ADD 1 for performing an addition operation, wherein the expansion data w 2 is input to the ⁇ 0 operator, the expansion data w 15 is input to the ⁇ 1 operator, and the ⁇ 0 operation and the ⁇ 1 operation can be performed simultaneously.
  • expansion data w 15 ′ in a 15th expansion register R 15 of the operation stage 220 - b is obtained by processing, by the second sub-module 232 , intermediate data w x stored in an additional register X and expansion data w 0 stored in a 0th expansion register R 0 of the operation stage 220 - a.
  • expansion data stored in an ith expansion register of the operation stage 220 - a is directly shifted into an (i ⁇ 1)th expansion register of the operation stage 220 - b, where 1 ⁇ i ⁇ 15 and i is an integer.
  • the number of operation logic stages experienced by the first sub-module 231 is 3, and the number of operation logic stages experienced by the second sub-module 232 is 1.
  • the first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220 - b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 2nd expansion register R 2 and a 15th expansion register R 15 of the first operation stage
  • the second sub-module can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 0th expansion register R 0 and a 9th expansion register R 9 of the first operation stage.
  • intermediate data w x ′ in an additional register X of the operation stage 220 - b can be obtained by processing, by the first sub-module 231 , expansion data w 2 stored in a 2nd expansion register R 2 and expansion data w 15 stored in a 15th expansion register R 15 of the operation stage 220 - a
  • the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 10th expansion register R 10 and a 15th expansion register R 15 of the first operation stage
  • the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R 15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 0th expansion register R 0 and a 1st expansion register R 1 of the first operation stage.
  • intermediate data w x ′ in an additional register X of the operation stage 220 - b can be obtained by processing, by the first sub-module 231 , expansion data w 10 stored in a 10th expansion register R 10 and expansion data w 15 stored in a 15th expansion register R 15 of the operation stage 220 - a
  • FIG. 14 shows an exemplary flow diagram of a method 400 of computing expansion data in a circuit for performing a hash algorithm according to embodiments of the present disclosure.
  • a circuit can comprise an input module configured to receive data and an operation module configured to compute a hash value based on the received data, wherein the operation module can comprise a plurality of operation stages arranged in a pipeline structure, each operation stage can comprise 0th to 15th expansion registers and an additional register, each expansion register can be configured to store expansion data of the current operation stage, and the additional register can be configured to store intermediate data for computing expansion data.
  • intermediate data stored in an additional register of a most preceding operation stage and expansion data stored in a 0th expansion register of the most preceding operation stage can be the same.
  • the method 400 can comprise: at S 401 , computing intermediate data for storage into an additional register of the second operation stage based on expansion data stored in an expansion register of the first operation stage; at S 402 , computing expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage; and at S 403 , taking expansion data stored in an ith expansion register of the first operation stage as expansion data for storage into an (i ⁇ 1)th expansion register of the second operation stage, where 1 ⁇ i ⁇ 15 and i is an integer.
  • S 401 to S 403 do not need to be performed in sequential order, but can be performed in any order, or can be performed at least partially in parallel.
  • the computation of the intermediate data for storage into the additional register of the second operation stage and the computation of the expansion data for storage into the 15th expansion register of the second operation stage can be performed simultaneously.
  • expansion data stored in a 15th expansion register of a subsequent operation stage of the second operation stage can be determined based on expansion data stored in a 1st expansion register, a 2nd expansion register, a 10th expansion register, and a 15th expansion register of the first operation stage.
  • the method 400 can further compute expansion data in various ways described above with respect to the first sub-module 231 and the second sub-module 232 , which are not repeated herein.
  • the method 400 can reduce the computation latency caused by computing the expansion data in the circuit for performing the hash algorithm, thereby significantly improving the operation speed of the circuit and thus of a computing chip containing the circuit, thereby achieving a lower ratio of power consumption to hash rate.
  • the present disclosure can further provide a computing chip comprising the circuit as described in any of the above embodiments.
  • the present disclosure can further provide a data processing device comprising one or more computing chips as described above.
  • a data processing device according to the present disclosure for example, as a crypto currency mining machine, can achieve a lower ratio of power consumption to hash rate, thereby performing a mining process with lower cost and greater efficiency.
  • one element when it is described that one element is “on”, “attached to”, “connected to”, “coupled to”, or “in contact with” another element, and so on, the element can be directly on, directly attached to, directly connected to, directly coupled to, or in direct contact with the other element, or one or more intermediate elements can be present. In contrast, when it is described that one element is “directly on”, “directly attached to”, “directly connected to”, “directly coupled to”, or “in direct contact with” another element, no intermediate elements will be present.
  • one feature is arranged “adjacent” to another feature, which can refer to the one feature having a portion overlapping with the adjacent feature or a portion above or below the adjacent feature.
  • a term “exemplary” means “serving as an example, instance, or illustration”, and not as a “model” that is to be reproduced exactly. Any implementation exemplarily described herein is not necessarily to be construed as preferred or advantageous over other implementations. Furthermore, the present disclosure is not limited by any expressed or implied theory presented in the technical field, background, summary or detailed description. As used herein, a term “substantially” means to encompass any minor variations caused by design or manufacturing imperfections, tolerances of devices or components, environmental effects and/or other factors. The term “substantially” also allows for differences from a perfect or ideal situation caused by parasitics, noise, and other practical considerations that may exist in a practical implementation.
  • a term “providing” is used broadly to encompass all ways of obtaining an object, and thus “providing an object” includes, but is not limited to, “purchasing”, “preparing/manufacturing”, “arranging/setting”, “installing/assembling”, and/or “ordering” the object, and so on.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Finance (AREA)
  • Mathematical Physics (AREA)
  • Power Engineering (AREA)
  • Software Systems (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Algebra (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Advance Control (AREA)

Abstract

The present disclosure relates to a circuit for performing a hash algorithm, computing chip, data processing device and method. A circuit includes: operation stages in a pipeline structure each including 0th to 15th expansion registers; expansion data operation logic modules each disposed between two adjacent operation stages including a first operation stage and its subsequent second operation stage, and including a first sub-module configured to compute data in a 0th expansion register of the second operation stage based on data in a 1st expansion register of the first operation stage and a second sub-module configured to compute data in a 15th expansion register of the second operation stage based on data in a 0th expansion register of the first operation stage: data in an (i−1)th expansion register of the second operation stage is data in an ith expansion register of the first operation stage.

Description

    CROSS-REFERENCE TO RELATED APPLICATIONS
  • This application is based on and claims the priority to the Chinese patent application No. 202011509432.7 filed on Dec. 18, 2020, the disclosure of which is hereby incorporated by reference in its entirety into the present application.
  • TECHNICAL FIELD
  • The present disclosure generally relates to a circuit for performing a hash algorithm, computing chip, data processing device (e.g., a crypto currency mining machine), and related method.
  • BACKGROUND
  • Bitcoin is a virtual crypto digital currency in a form of P2P (Peer-to-Peer), the concept of which was originally proposed by Satoshi Nakamoto on Nov. 1, 2008 and formally came into being on Jan. 3, 2009. Bitcoin is unique in that it is not issued by a specific monetary institution, but is generated through a large amount of operations according to a specific algorithm. For a Bitcoin transaction, a distributed database composed of numerous nodes throughout a P2P network is used to validate and record all transactions, and the design of cryptography is used to ensure their security. From the perspective of cryptography, Bitcoin is a proof of work (POW) based on a hash algorithm SHA-256, and its transaction integrity depends on collision and pre-image resistance of the SHA-256. The hash algorithm is an algorithm that takes variable-length data as input and generates a fixed-length hash value as output, the essence of which is a distillation of information. Since 1993, the US National Institute of Standards and Technology has successively designed and issued several versions of secure hash algorithms (SHAs), and the SHA-256 is one of the secure Hash algorithms with a hash length of 256 bits.
  • The core of Bitcoin mining using a mining machine is that a reward is obtained according to the operation capability of computing the SHA-256 by the mining machine. For the mining machine, chip's size, chip's running speed and chip's power consumption are three factors crucial to the performance of the mining machine, wherein the chip's size decides chip's cost, the chip's running speed decides mining machine's running speed, i.e., hash rate, and the chip's power consumption decides a degree of consumed electricity, i.e., mining cost. In a practical application, a most important performance index for measuring the mining machine is power consumption consumed by unit hash rate, i.e., a ratio of power consumption to hash rate. To improve security, the SHA-256 is performed twice in a Bitcoin protocol. Therefore, it is most important for the Bitcoin mining machine to implement the hash algorithm SHA-256 with lower ratio of power consumption to hash rate.
  • SUMMARY
  • According to a first aspect of the present disclosure, there is provided a circuit for performing a hash algorithm, comprising: an input module configured to receive data; and an operation module configured to compute a hash value based on the received data, the operation module comprising: a plurality of operation stages arranged in a pipeline structure, each operation stage of the plurality of operation stages comprising 0th to 15th expansion registers, each expansion register being configured to store expansion data of the current operation stage; and a plurality of expansion data operation logic modules, each expansion data operation logic module being disposed between two respective adjacent operation stages of the plurality of operation stages, the two adjacent operation stages comprising a first operation stage and a second operation stage after the first operation stage, each expansion data operation logic module comprising: a first sub-module configured to compute expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register of the first operation stage; and a second sub-module configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register of the first operation stage, wherein expansion data for storage into an (i−1)th expansion register of the second operation stage is expansion data stored in an ith expansion register of the first operation stage, where 2≤i≤15 and i is an integer.
  • According to a second aspect of the present disclosure, there is provided a circuit for performing a hash algorithm, comprising: an input module configured to receive data; and an operation module configured to compute a hash value based on the received data, the operation module comprising: a plurality of operation stages arranged in a pipeline structure, each operation stage of the plurality of operation stages comprising 0th to 15th expansion registers and an additional register, each expansion register being configured to store expansion data of the current operation stage, the additional register being configured to store intermediate data for computing expansion data; and a plurality of expansion data operation logic modules, each expansion data operation logic module being disposed between two respective adjacent operation stages of the plurality of operation stages, the two adjacent operation stages comprising a first operation stage and a second operation stage after the first operation stage, each expansion data operation logic module comprising: a first sub-module configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in an expansion register of the first operation stage; and a second sub-module configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage, wherein expansion data for storage into an (i−1)th expansion register of the second operation stage is expansion data stored in an ith expansion register of the first operation stage, where 1≤i≤15 and i is an integer.
  • According to a third aspect of the present disclosure, there is provided a computing chip comprising the circuit as described in the above aspects.
  • According to a fourth aspect of the present disclosure, there is provided a data processing device comprising one or more computing chips as described in the above aspect.
  • According to a fifth aspect of the present disclosure, there is provided a method of computing expansion data in a circuit for performing a hash algorithm, the circuit comprising an input module configured to receive data and an operation module configured to compute a hash value based on the received data, the operation module comprising a plurality of operation stages arranged in a pipeline structure, each operation stage of the plurality of operation stages comprising 0th to 15th expansion registers, each expansion register being configured to store expansion data of the current operation stage, the method comprising: for two adjacent operation stages of the plurality of operation stages which comprise a first operation stage and a second operation stage after the first operation stage: computing expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register of the first operation stage; computing expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register of the first operation stage; and taking expansion data stored in an ith expansion register of the first operation stage as expansion data for storage into an (i−1)th expansion register of the second operation stage, where 2≤i≤15 and i is an integer.
  • According to a sixth aspect of the present disclosure, there is provided a method of computing expansion data in a circuit for performing a hash algorithm, the circuit comprising an input module configured to receive data and an operation module configured to compute a hash value based on the received data, the operation module comprising a plurality of operation stages arranged in a pipeline structure, each operation stage of the plurality of operation stages comprising 0th to 15th expansion registers and an additional register, each expansion register being configured to store expansion data of the current operation stage, the additional register being configured to store intermediate data for computing expansion data, the method comprising: for two adjacent operation stages of the plurality of operation stages which comprise a first operation stage and a second operation stage after the first operation stage: computing intermediate data for storage into an additional register of the second operation stage based on expansion data stored in an expansion register of the first operation stage; computing expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage; and taking expansion data stored in an ith expansion register of the first operation stage as expansion data for storage into an (i−1)th expansion register of the second operation stage, where 1≤i≤15 and i is an integer.
  • Other features of the present disclosure and advantages thereof will become more apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings.
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • The accompanying drawings constituting a part of this specification, describe embodiments of the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.
  • The present disclosure can be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
  • FIG. 1 shows a schematic diagram of an exemplary pipeline structure for performing a SHA-256 algorithm;
  • FIG. 2 schematically shows conventional operation logic between expansion data in expansion registers of two adjacent operation stages in the pipeline structure of FIG. 1;
  • FIG. 3 shows a schematic block diagram of a circuit for performing a hash algorithm according to some embodiments of the present disclosure;
  • FIGS. 4 to 7 schematically show exemplary configurations of a portion, comprising an expansion data operation logic module, in the circuit as shown in FIG. 3 according to embodiments of the present disclosure;
  • FIG. 8 shows a schematic block diagram of a circuit for performing a hash algorithm according to some embodiments of the present disclosure;
  • FIGS. 9 to 14 schematically show exemplary configurations of a portion, comprising an expansion data operation logic module, in the circuit as shown in FIG. 8 according to embodiments of the present disclosure; and
  • FIGS. 15 and 16 show exemplary flow diagrams of a method for computing expansion data according to embodiments of the present disclosure.
  • Note that in the embodiments described below, a same reference numeral is sometimes shared among different drawings to denote a same portion or portions having a same function, and a repetitive description thereof will be omitted. In this specification, similar reference numerals and letters are used to designate similar items, and therefore, once a certain item is defined in one drawing, further discussion thereof is not required in subsequent drawings.
  • For ease of understanding, positions, dimensions, ranges, etc. of structures shown in the drawings, etc., do not necessarily indicate actual positions, dimensions, ranges, etc. Therefore, the disclosed invention is not limited to the positions, dimensions, ranges, etc. disclosed in the drawings, etc. Further, the drawings are not necessarily drawn to scale, and some features may be enlarged to show details of specific components.
  • DETAILED DESCRIPTION
  • Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that relative arrangements, numerical expressions, and numerical values of components and steps set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specified.
  • The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit this disclosure and its application or uses. Those skilled in the art will appreciate that they are merely illustrative of exemplary ways in which the present disclosure can be implemented, rather than exhaustive ways.
  • Techniques, methods, and devices known to one of ordinary skill in the related art may not be discussed in detail but should be regarded as part of the granted specification where appropriate.
  • To more clearly and intuitively present inventive concepts of the present disclosure, a SHA-256 algorithm will be briefly described hereinafter and taken as a representative example of a hash algorithm to describe a circuit for performing a hash algorithm and related method according to the embodiments of the present disclosure. Those skilled in the art will appreciate that the circuit for performing the hash algorithm and related method according to the embodiments of the present disclosure are applicable to any hash algorithm and can even further be applied in any other suitable circuit and method, and not limited to the implementation of the SHA-256 algorithm.
  • FIG. 1 shows a schematic diagram of an exemplary pipeline structure for performing a SHA-256 algorithm. Input to the SHA-256 is data w1 th a maximum length less than 264 bits, and output therefrom is a 256-bit data digest, i.e., hash value. The input data is processed in a 512-bit data block as a unit. To implement the SHA-256 algorithm, 64 rounds of repetitive operations are required to be performed for each 512-bit data block, and thus a parallel operation on 64 groups of data can be performed using a pipeline structure comprising 64 operation stages. As shown in FIG. 1, the pipeline structure comprises 0th to 63th operation stages, each operation stage comprising 8 32-bit compression registers A to H for storing intermediate values and 16 32-bit expansion registers R0 to R15 for storing expansion data. The 0th operation stage can receive an input data block, divide it into 8 blocks of 32-bit data and store them into the compression registers A to H respectively, and then perform operation processing on them and provide their results to the 1st operation stage. Then, each operation stage performs an operation on its received operation result from a preceding operation stage and provides its own operation result to a subsequent operation stage. Finally, after operations of the 64 operation stages, an operation core can output a hash operation result of performing the SHA-256 algorithm once on the input data.
  • Internal logic of a round of operations performed by the SHA-256 on each operation stage will be discussed in detail below. A (t)th round of operations performed on a (t)th operation stage is defined by(t is an integer and satisfies 0≤t≤63):
  • T1=H+Σ1(E)+Ch(E, F, G)+Kt+Wt;
  • T20(A)+Maj(A, B, C);
  • H=G;
  • G=F;
  • F=E;
  • E=D+T1;
  • D=C;
  • C=B;
  • B=A;

  • A=T1+T2;   (operation expression 1)
  • wherein:
  • Ch(x, y, z)=(x AND y) ⊕ ((NOT x) AND z)
  • Maj(x, y, z)=(x AND y) ⊕ (x AND z) ⊕ (y AND z)
  • Σ0(x)=ROTR2(x) ⊕ ROTR13(x) ⊕ ROTR22(x)
  • Σ1(x)=ROTR6(x) ⊕ ROTR11(x) ⊕ ROTR25(x)
  • wherein ROTRn(x) denotes that a 32-bit variable x is rotated n bits to the right; Wt is a 32-bit word derived from the current 256-bit input data block; Kt is a 32-bit additional constant; + is modulo 232 addition; AND is a 32-bit bitwise AND operation; NOT is an operation of negation; and ⊕ is an exclusive OR operation.
  • Next, how the 32-bit word Wt is derived from the 512-bit data block will be described. Wt can be obtained according to the following operation expression:
  • for 0≤t≤15: Wt is taken directly from the input data block;
  • for 16≤t≤63:

  • W tσ1(W t−2)+W t−70(W t−15)+W t−16   (operation expression 2)
  • wherein:
  • σ0(x)=ROTR7(x) ⊕ ROTR18(x) ⊕ SHR3(x)
  • σ1(x)=ROTR17(x) ⊕ ROTR19(x) ⊕ SHR10(x)
  • wherein ROTRn(x) denotes that a 32-bit variable x is rotated n bits to the right; SHRn(x) denotes that a 32-bit variable x is shifted n bits to the right with the left thereof padded by 0; ⊕ is an exclusive OR operation; + is modulo 232 addition.
  • Note that, formulas of the above functions Σ0(x), Σ1(x), σ0(x), σ1(x) are specific forms for processing 32-bit data given by taking the SHA-256 as an example, and those skilled in the art know that in other SHA algorithms (e.g., SHA-512, etc.) and even other hash algorithms, these functions can adaptively take other corresponding forms for processing other sizes of data (e.g., 64-bit data, etc.).
  • Specifically, FIG. 2 shows conventional operation logic between expansion data in expansion registers of two adjacent operation stages in the pipeline structure in FIG. 1. Expansion data to be stored in an expansion register R15 of a subsequent operation stage needs to be computed using expansion data in expansion registers R0, R1, R9, and R14 of each operation stage, and in addition, expansion data in expansion registers R1 to R15 can be directly shifted into corresponding expansion registers R0 to R14 of the subsequent operation stage. Specifically, expansion data w15′ in an expansion register R15 of a (t+1)th operation stage is obtained by sequentially adding, through three adders ADD1, ADD2 and ADD3, expansion data w0 in an expansion register R0 of the (t)th operation stage, σ0(w1) obtained from performing a σ0 operation on expansion data in an expansion register R10 f the (t)th operation stage by a σ0 operator, expansion data w9 in an expansion register R9 of the (t)th operation stage, and σ1(w14) obtained from performing a σ1 operation on expansion data in an expansion register R14 of the (t)th operation stage by a σ1 operator, that is, w15′=w00(w1)+w91(w14). It can be seen that the computation of the expansion data w15′ to be stored in the expansion register R15 of the subsequent operation stage from the expansion data w0, w1, w9, w14 in the expansion registers R0, R1, R9, R14 of the (t)th operation stage needs to experience up to 4 operation logic stages, which brings significant computation latency, limits operation speed of the pipeline structure, and further makes it difficult to achieve a lower ratio of power consumption to hash rate.
  • In this regard, inventors of the present application have noted that there is a direct connection between an expansion register R0 of the (t+1)th operation stage and an expansion register R10 f the (t)th operation stage, that is, expansion data stored in the expansion register R1 of the (t)th operation stage is directly shifted into the expansion register R0 of the (t+1)th operation stage. Therefore, the inventors of the present application conceived that, by using this direct connection of the expansion registers R0, R1, a portion involving the expansion data in the expansion register R0 of the (t+1)th operation stage (i.e., the expansion data in the expansion register R10 f the (t)th operation stage) in a process for computing expansion data to be stored in an expansion register R15 of a (t+2)th operation stage is advanced to be performed simultaneously with a process for computing the expansion data to be stored in the expansion register R15 of the (t+1)th operation stage, and is stored in the expansion register R0 of the (t+1)th operation stage. In this way, after the process for computing the expansion data to be stored in the expansion register R15 of the (t+2)th operation stage is disassembled, a disassembled portion can be processed in parallel with the process for computing the expansion data to be stored in the expansion register R15 of the (t+1)th operation stage. By means of the parallel processing, the number of operation logic stages that is required to be experienced for computing expansion data in each round of operations can be reduced.
  • Accordingly, the present disclosure provides a circuit for performing a hash algorithm with an improved expansion data operation logic module and an improved method of computing expansion data in the circuit for performing the hash algorithm, which can reduce the number of operation logic stages that is required to be experienced for computing, between adjacent operation stages, expansion data of a subsequent operation stage based on expansion data of a preceding operation stage, and significantly improves the operation speed of the circuit and thus of a computing chip including the circuit, thereby helping to achieve a lower ratio of power consumption to hash rate.
  • FIG. 3 shows a schematic block diagram of a circuit 100 for performing a hash algorithm according to some embodiments of the present disclosure, wherein arrows indicate a data transfer direction. The circuit 100 can comprise an input module 110 and an operation module 120. The input module 110 can be configured to receive data. The operation module 120 can be configured to compute a hash value based on the received data. The operation module 120 can comprise a plurality of operation stages 120-0, . . . , 120-63 arranged in a pipeline structure, each operation stage can comprise 0th to 15th expansion registers R0 to R15, and each expansion register can be configured to store expansion data of the current operation stage.
  • It should be understood that although the operation module 120 is depicted in the drawings as comprising 64 operation stages, as mentioned earlier, the circuit for performing the SHA-256 algorithm is taken herein merely as a non-limiting example, the circuit according to the present disclosure can actually be suitable for performing any hash algorithm (not limited to the SHA series of algorithms) now known or later developed for use in a mining machine and can comprise any suitable number of operation stages. It should also be understood that an actual circuit can also have additional other components (such as compression registers, etc.), but these other components are not shown in the drawings and are not discussed herein to avoid obscuring the main points of the present disclosure.
  • In general, expansion data stored in 0th to 15th expansion registers R0 to R15 of a most preceding operation stage 120-0 of the operation module 120 can be directly taken from data received by the input module 110, for example, while expansion data to be stored in 0th to 15th expansion registers R0 to R15 of each operation stage starting from the operation stage 120-1 can be determined based on expansion data stored in 0th to 15th expansion registers R0 to R15 of a preceding operation stage, for example. What is mainly discussed in the present disclosure is how to determine expansion data to be stored in 0th to 15th expansion registers R0 to R15 of a subsequent operation stage based on expansion data stored in 0th to 15th expansion registers R0 to R15 of a preceding operation stage.
  • The operation module 120 can further comprise a plurality of expansion data operation logic modules 130, each expansion data operation logic module 130 being disposed between two respective adjacent operation stages of the plurality of operation stages 120-0, . . . , 120-63 of the operation module 120. Herein, a preceding operation stage of the two adjacent operation stages can be referred to as a first operation stage and a subsequent operation stage of the two adjacent operation stages can be referred to as a second operation stage, and it is noted that “first” and “second” are merely for distinction rather than limitation. For example, as shown in FIG. 3, an expansion data operation logic module 130 is disposed between two adjacent operation stages 120-a, 120-b. Each expansion data operation logic module 130 can comprise a first sub-module 131 and a second sub-module 132.
  • The expansion data operation logic module 130 can be configured to compute expansion data for storage into an expansion register of the second operation stage (e.g., 120-b) based on expansion data stored in an expansion register of the first operation stage (e.g., 120-a). The first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R0 of the second operation stage based on expansion data stored in a 1st expansion register R10 f the first operation stage. The second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on expansion data stored in a 0th expansion register R0 of the first operation stage. In addition, expansion data for storage into an (i−1)th expansion register of the second operation stage can be expansion data stored in an ith expansion register of the first operation stage, where 2≤i≤15 and i is an integer. That is, in the circuit 100, expansion data to be stored in the 0th expansion register R0 and the 15th expansion register R15 of the second operation stage is obtained by performing operations on expansion data stored in expansion registers of the first operation stage, and expansion data to be stored in 1st to 14th expansion registers R1 to R14 of the second operation stage is obtained by directly shifting expansion data stored in each expansion register of 2nd to 15th expansion registers R2 to R15 of the first operation stage into corresponding expansion registers of the 1st to 14th expansion registers R1 to R14 of the second operation stage.
  • In some embodiments, expansion data stored in a 15th expansion register R15 of a subsequent operation stage of the second operation stage can be determined based on expansion data stored in a 1st expansion register R1, a 2nd expansion register R2, a 10th expansion register R10, and a 15th expansion register R15 of the first operation stage. In some embodiments, expansion data w15″ stored in the 15th expansion register R15 of the subsequent operation stage of the second operation stage, expansion data w1 stored in the 1st expansion register R10 f the first operation stage, expansion data w2 stored in the 2nd expansion register R2 of the first operation stage, expansion data w10 stored in the 10th expansion register R10 of the first operation stage, and expansion data w15 stored in the 15th expansion register R15 of the first operation stage can satisfy the following relation: w15″=w10(w2)+w101(w15), where σ0, σ1 and + are defined as the above.
  • In some embodiments, the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R0 of the second operation stage based on expansion data stored in one or two of a 2nd expansion register R2, a 10th expansion register R10, a 15th expansion register R15 of the first operation stage and expansion data stored in a 1st expansion register R10 f the first operation stage.
  • In some embodiments, the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on expansion data stored in one or two of a 1st expansion register R1, a 9th expansion register R9, a 14th expansion register R14 of the first operation stage and expansion data stored in a 0th expansion register R0 of the first operation stage.
  • Several non-limiting exemplary configurations of a portion, comprising the expansion data operation logic module, in the circuit shown in FIG. 3 according to embodiments of the present disclosure will be described below in conjunction with FIGS. 4 to 7. In these figures, the two adjacent operation stages 120-a and 120-b are taken as examples for explanation, and it can be understood that any two adjacent operation stages in the operation module 120 can be the operation stages 120-a and 120-b discussed below. In addition, in these figures, for the sake of clarity, the first sub-module 131 and the second sub-module 132 are indicated by dashed boxes, moving directions of expansion data that is directly shifted with no operation are indicated by dotted arrows, moving directions of expansion data processed via the first sub-module 131 are indicated by chain-dotted arrows, and moving directions of expansion data processed via the second sub-module 132 are indicated by solid arrows.
  • In some embodiments, the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R0 of the second operation stage based on expansion data stored in a 1st expansion register R1 and a 2nd expansion register R2 of the first operation stage, and the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on expansion data stored in a 0th expansion register R0, a 9th expansion register R9, and a 14th expansion register R14 of the first operation stage.
  • For example, in some examples, as shown in FIG. 4, expansion data w0′ in a 0th expansion register R0 of the operation stage 120-b is obtained by processing, by the first sub-module 131, expansion data w1 stored in a 1st expansion register R1 and expansion data w2 stored in a 2nd expansion register R2 of the operation stage 120-a. Specifically, in this example, the first sub-module 131 comprises a σ0 operator for performing a σ0 operation and an adder ADD1 for performing an addition operation, wherein the expansion data w2 is input to the σ0 operator, output of the σ0 operator and the expansion data w1 are input to the adder ADD1, and output of the adder ADD1 is provided to the 0th expansion register R0 of the operation stage 120-b, so that w0′=w10(w2).
  • As further shown in FIG. 4, expansion data w15′ in a 15th expansion register R15 of the operation stage 120-b is obtained by processing, by the second sub-module 132, expansion data w0 stored in a 0th expansion register R0, expansion data w9 stored in a 9th expansion register R9, and expansion data w14 stored in a 14th expansion register R14 of the operation stage 120-a. Specifically, in this example, the second sub-module 132 comprises a σ1 operator for performing a σ1 operation, and a full-adder FAA and an adder ADD2 for performing an addition operation, wherein the expansion data w14 is input to the σ1 operator, output of the σ1 operator, the expansion data w0, and the expansion data w9 are input to the full-adder FAA, outputs of the full-adder FAA are input to the adder ADD2, and output of the adder ADD2 is provided to the 15th expansion register R15 of the operation stage 120-b, so that w15′=w0+w91(w14).
  • As further shown in FIG. 4, expansion data stored in an ith expansion register of the operation stage 120-a is directly shifted into an (i−1)th expansion register of the operation stage 120-b, where 2≤i≤15 and i is an integer.
  • In the example shown in FIG. 4, the number of operation logic stages experienced by the first sub-module 131 is 2, and the number of operation logic stages experienced by the second sub-module 132 is 3. The first sub-module 131 and the second sub-module 132 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 120-b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • In some embodiments, the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R0 of the second operation stage based on expansion data stored in a 1st expansion register R1 and a 10th expansion register R10 of the first operation stage, and the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on e0xpansion data stored in a 0th expansion register R0, a 1st expansion register R1, and a 14th expansion register R14 of the first operation stage.
  • For example, in some examples, as shown in FIG. 5, expansion data w0′ in a 0th expansion register R0 of the operation stage 120-b is obtained by processing, by the first sub-module 131, expansion data w1 stored in a 1st expansion register R1 and expansion data w10 stored in a 10th expansion register R10 of the operation stage 120-a. Specifically, in this example, the first sub-module 131 comprises an adder ADD1 for performing an addition operation, wherein the expansion data w1 and the expansion data w1 o are input to the adder ADD1, and output of the adder ADD1 is provided to the 0th expansion register R0 of the operation stage 120-b, so that w0′=w1+w10.
  • As further shown in FIG. 5, expansion data w15′ in a 15th expansion register R15 of the operation stage 120-b is obtained by processing, by the second sub-module 132, expansion data w0 stored in a 0th expansion register R0, expansion data w1 stored in a 1st expansion register R1, and expansion data w14 stored in a 14th expansion register R14 of the operation stage 120-a. Specifically, in this example, the second sub-module 132 comprises a σ0 operator for performing a σ0 operation, a σ1 operator for performing a σ1 operation, and a full-adder FAA and an adder ADD2 for performing an addition operation, wherein the expansion data w1 is input to the σ0 operator, the expansion data w14 is input to the σ1 operator, and the σ0 operation and the σ1 operation can be performed simultaneously, for example. Then, output of the σ0 operator, output of the σ1 operator, and the expansion data w0 are input to the full-adder FAA, outputs of the full-adder FAA are input to the adder ADD2, and output of the adder ADD2 is provided to the 15th expansion register R15 of the operation stage 120-b, so that w15′=w00(w1)+σ1(w14).
  • As further shown in FIG. 5, expansion data stored in an ith expansion register of the operation stage 120-a is directly shifted into an (i−1)th expansion register of the operation stage 120-b, where 2≤i≤15 and i is an integer.
  • In the example shown in FIG. 5, the number of operation logic stages experienced by the first sub-module 131 is 1, and the number of operation logic stages experienced by the second sub-module 132 is 3. The first sub-module 131 and the second sub-module 132 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 120-b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • In some embodiments, the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R0 of the second operation stage based on expansion data stored in a 1st expansion register R1, a 2nd expansion register R2, and a 10th expansion register R10 of the first operation stage, and the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on expansion data stored in a 0th expansion register R0 and a 14th expansion register R14 of the first operation stage.
  • For example, in some examples, as shown in FIG. 6, expansion data w0′ in a 0th expansion register R0 of the operation stage 120-b is obtained by processing, by the first sub-module 131, expansion data w1 stored in a 1st expansion register R1, expansion data w2 stored in a 2nd expansion register R2, and expansion data w10 stored in a 10th expansion register R10 of the operation stage 120-a. Specifically, in this example, the first sub-module 131 comprises a σ0 operator for performing a σ0 operation, and a full-adder FAA and an adder ADD1 for performing an addition operation, wherein the expansion data w2 is input to the σ0 operator, output of the σ0 operator, the expansion data w1, and the expansion data w10 are input to the full-adder FAA, outputs of the full-adder FAA are input to the adder ADD1, and output of the adder ADD1 is provided to the 0th expansion register R0 of the operation stage 120-b, so that w0′=w10(w2)+w10.
  • As further shown in FIG. 6, expansion data w15′ in a 15th expansion register R15 of the operation stage 120-b is obtained by processing, by the second sub-module 132, expansion data w0 stored in a 0th expansion register R0 and expansion data w14 stored in a 14th expansion register R14 of the operation stage 120-a. Specifically, in this example, the second sub-module 132 comprises a σ1 operator for performing a σ1 operation and an adder ADD2 for performing an addition operation, wherein the expansion data w14 is input to the σ1 operator, output of the σ1 operator and the expansion data w0 are input to the adder ADD2, and output of the adder ADD2 is provided to the 15th expansion register R15 of the operation stage 120-b, so that w15′=w01(w14).
  • As further shown in FIG. 6, expansion data stored in an ith expansion register of the operation stage 120-a is directly shifted into an (i−1)th expansion register of the operation stage 120-b, where 2≤i≤15 and i is an integer.
  • In the example shown in FIG. 6, the number of operation logic stages experienced by the first sub-module 131 is 3, and the number of operation logic stages experienced by the second sub-module 132 is 2. The first sub-module 131 and the second sub-module 132 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 120-b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • In some embodiments, the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R0 of the second operation stage based on expansion data stored in a 1st expansion register R1 and a 15th expansion register R15 of the first operation stage, and the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on expansion data stored in a 0th expansion register R0, a 1st expansion register R1, and a 9th expansion register R9 of the first operation stage.
  • For example, in some examples, as shown in FIG. 7, expansion data w0′ in a 0th expansion register R0 of the operation stage 120-b is obtained by processing, by the first sub-module 131, expansion data w1 stored in a 1st expansion register R1 and expansion data w15 stored in a 15th expansion register R15 of the operation stage 120-a. Specifically, in this example, the first sub-module 131 comprises a σ1 operator for performing a σ1 operation and an adder ADD1 for performing an addition operation, wherein the expansion data w15 is input to the σ1 operator, output of the σ1 operator and the expansion data w1 are input to the adder ADD1, and output of the adder ADD1 is provided to the 0th expansion register R0 of the operation stage 120-b, so that w0′=w11(w15).
  • As further shown in FIG. 7, expansion data w15′ in a 15th expansion register R15 of the operation stage 120-b is obtained by processing, by the second sub-module 132, expansion data w0 stored in a 0th expansion register R0, expansion data w1 stored in a 1st expansion register R1, and expansion data w9 stored in a 9th expansion register R9 of the operation stage 120-a. Specifically, in this example, the second sub-module 132 comprises a σ0 operator for performing a σ0 operation, and a full-adder FAA and an adder ADD2 for performing an addition operation, wherein the expansion data w1 is input to the σ0 operator, output of the σ0 operator, the expansion data w0, and the expansion data w9 are input to the full-adder FAA, outputs of the full-adder FAA are input to the adder ADD2, and output of the adder ADD2 is provided to the 15th expansion register R15 of the operation stage 120-b, so that w15′=w00(w1)+w9.
  • As further shown in FIG. 7, expansion data stored in an ith expansion register of the operation stage 120-a is directly shifted into an (i−1)th expansion register of the operation stage 120-b, where 2≤i≤15 and i is an integer.
  • In the example shown in FIG. 7, the number of operation logic stages experienced by the first sub-module 131 is 2, and the number of operation logic stages experienced by the second sub-module 132 is 3. The first sub-module 131 and the second sub-module 132 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 120-b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • In some embodiments, the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R0 of the second operation stage based on expansion data stored in a 1st expansion register R1, a 2nd expansion register R2, and a 15th expansion register R15 of the first operation stage, and the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on expansion data stored in a 0th expansion register R0 and a 9th expansion register R9 of the first operation stage. Specifically, in some examples, expansion data w0′ in a 0th expansion register R0 of the operation stage 120-b can be obtained by processing, by the first sub-module 131, expansion data w1 stored in a 1st expansion register R1, expansion data w2 stored in a 2nd expansion register R2, and expansion data w15 stored in a 15th expansion register R15 of the operation stage 120-a, and expansion data w15′ in a 15th expansion register R15 of the operation stage 120-b can be obtained by processing, by the second sub-module 132, expansion data w0 stored in a 0th expansion register R0 and expansion data w9 stored in a 9th expansion register R9 of the operation stage 120-a, so that w0′=w10(w2)+σ1(w15), w15′=w0+w9.
  • In some embodiments, the first sub-module 131 can be configured to compute expansion data for storage into a 0th expansion register R0 of the second operation stage based on expansion data stored in a 1st expansion register R1, a 10th expansion register R10, and a 15th expansion register R15 of the first operation stage, and the second sub-module 132 can be configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register R0 and a 1st expansion register R1 of the first operation stage. Specifically, in some examples, expansion data w0′ in a 0th expansion register R0 of the operation stage 120-b can be obtained by processing, by the first sub-module 131, expansion data w1 stored in a 1st expansion register R1, expansion data w10 stored in a 10th expansion register R10, and expansion data w15 stored in a 15th expansion register R15 of the operation stage 120-a, and expansion data w15′ in a 15th expansion register R15 of the operation stage 120-b can be obtained by processing, by the second sub-module 132, expansion data w0 stored in a 0th expansion register R0 and expansion data w1 stored in a 1st expansion register R1 of the operation stage 120-a, so that w0′=w1+w101(w15), w15′=w00(w1).
  • Accordingly, the present disclosure also provides a method of computing expansion data in a circuit for performing a hash algorithm. FIG. 13 shows an exemplary flow diagram of a method 300 of computing expansion data in a circuit for performing a hash algorithm according to embodiments of the present disclosure. Such a circuit can comprise an input module configured to receive data and an operation module configured to compute a hash value based on the received data, wherein the operation module can comprise a plurality of operation stages arranged in a pipeline structure, each operation stages can comprise 0th to 15th expansion registers, each expansion register can be configured to store expansion data of the current operation stage. For two adjacent operation stages of the plurality of operation stages of the operation module which comprise a first operation stage and a second operation stage after the first operation stage, the method 300 can comprise: at S301, computing expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register of the first operation stage; at S302, computing expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register of the first operation stage; and at S303, taking expansion data stored in an ith expansion register of the first operation stage as expansion data for storage into an (i−1)th expansion register of the second operation stage, where 2≤i≤15 and i is an integer. Note that S301 to S303 do not need to be performed in sequential order, but can be performed in any order, or can be performed at least partially in parallel.
  • In some embodiments, the computation of the expansion data for storage into the 0th expansion register of the second operation stage and the computation of the expansion data for storage into the 15th expansion register of the second operation stage can be performed simultaneously.
  • In some embodiments, expansion data stored in a 15th expansion register of a subsequent operation stage of the second operation stage can be determined based on expansion data stored in a 1st expansion register, a 2nd expansion register, a 10th expansion register, and a 15th expansion register of the first operation stage.
  • The method 300 can also compute expansion data in various ways as described above with respect to the first sub-module 131 and the second sub-module 132, which are not repeated herein. The method 300 can reduce the computation latency caused by computing expansion data in the circuit for performing the hash algorithm, thereby significantly improving the operation speed of the circuit and thus of a computing chip containing the circuit, thereby achieving a lower ratio of power consumption to hash rate.
  • Further, in the circuit and method according to the above embodiments of the present disclosure, an expansion register R0 is used to store a portion involving expansion data in an expansion register R1 of a preceding operation stage which was in a process originally for computing expansion data to be stored in an expansion register R15 of a subsequent operation stage but is performed in advance. In some alternative embodiments, an additional register can also be used instead to implement the role of the expansion register R0 in the above embodiments. Moreover, when the additional register is used, it can not only be used to perform the portion involving the expansion data in the expansion register R1 of the preceding operation stage which was in the process originally for computing the expansion data to be stored in the expansion register R15 of the subsequent operation stage in advance, but also can be used to perform any suitable portion which was in the process originally for computing the expansion data to be stored in the expansion register R15 of the subsequent operation stage in advance.
  • FIG. 8 shows a schematic block diagram of a circuit 200 for performing a hash algorithm according to some other embodiments of the present disclosure. Therein, arrows indicate a data transfer direction. The circuit 200 can comprise an input module 210 and an operation module 220. The input module 210 can be configured to receive data. The operation module 220 can be configured to compute a hash value based on the received data. The operation module 220 can comprise a plurality of operation stages 220-0, . . . , 220-63 arranged in a pipeline structure, each operation stage can comprise 0th to 15th expansion registers R0 to R15 and an additional register X, each expansion register can be configured to store expansion data of the current operation stage, and the additional register can be configured to store intermediate data for computing expansion data. In some embodiments, intermediate data stored in an additional register X of a most preceding operation stage 220-0 can be the same as expansion data stored in a 0th expansion register R0 of the most preceding operation stage 220-0.
  • The operation module 220 can further comprise a plurality of expansion data operation logic modules 230, each expansion data operation logic module 230 being disposed between two respective adjacent operation stages of the plurality of operation stages 220-0, . . . , 220-63 of the operation module 220. Herein, a preceding operation stage in the two adjacent operation stages can be referred to as a first operation stage and a subsequent operation stage in the two adjacent operation stages can be referred to as a second operation stage, and it is noted that “first” and “second” are merely for distinction rather than limitation. For example, as shown in FIG. 8, an expansion data operation logic module 230 is disposed between two adjacent operation stages 220-a, 220-b. Each expansion data operation logic module 230 can comprise a first sub-module 231 and a second sub-module 232.
  • The expansion data operation logic module 230 can be configured to compute expansion data for storage into an expansion register of the second operation stage (e.g., 220-b) and intermediate data for storage into an additional register of the second operation stage based on expansion data stored in an expansion register of the first operation stage (e.g., 220-a) and intermediate data stored in an additional register of the first operation stage (e.g., 220-a). The first sub-module 231 can be configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in an expansion register of the first operation stage. The second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage. In addition, expansion data for storage into an (i−1)th expansion register of the second operation stage can be expansion data stored in an ith expansion register of the first operation stage, where 1≤i≤15 and i is an integer. That is, in the circuit 200, expansion data to be stored in a 15th expansion register R15 of the second operation stage is obtained by performing operations on intermediate data stored in an additional register of the first operation stage, and expansion data to be stored in 0th to 14th expansion registers R0 to R14 of the second operation stage is obtained by directly shifting expansion data stored in each expansion register of 1st to 15th expansion registers R1 to R15 of the first operation stage into corresponding expansion registers of the 0th to 14th expansion registers R0 to R14 of the second operation stage.
  • In some embodiments, expansion data stored in a 15th expansion register R15 of a subsequent operation stage of the second operation stage can be determined based on expansion data stored in a 1st expansion register R1, a 2nd expansion register R2, a 10th expansion register R10, and a 15th expansion register R15 of the first operation stage. In some embodiments, expansion data w15″ stored in the 15th expansion register R15 of the subsequent operation stage of the second operation stage, expansion data w1 stored in the 1st expansion register R1 of the first operation stage, expansion data w2 stored in the 2nd expansion register R2 of the first operation stage, expansion data w10 stored in the 10th expansion register R10 of the first operation stage, and expansion data w15 stored in the 15th expansion register R15 of the first operation stage can satisfy the following relation: w15″=w10(w2)+w101(w15), where σ0, σ1 and + are defined as the above.
  • In some embodiments, the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in two or three of a 1st expansion register R1, a 2nd expansion register R2, a 10th expansion register R10, and a 15th expansion register R15 of the first operation stage.
  • In some embodiments, the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on expansion data stored in one or two of a 0th expansion register R0, a 1st expansion register R1, a 9th expansion register R9, a 14th expansion register R14 of the first operation stage and intermediate data stored in an additional register X of the first operation stage.
  • Several non-limiting exemplary configurations of a portion, comprising an expansion data operation logic module, in the circuit as shown in FIG. 8 according to embodiments of the present disclosure will be described below in conjunction with FIGS. 9 to 14. In these figures, two adjacent operation stages 220-a and 220-b are taken as examples for explanation, and it can be understood that any two adjacent operation stages in the operation module 220 can be the operation stages 220-a and 220-b discussed below. In addition, in these figures, for the sake of clarity, the first sub-module 231 and the second sub-module 232 are indicated by dashed boxes, moving directions of expansion data that is directly shifted with no operation are indicated by dotted arrows, moving directions of expansion data processed via the first sub-module 231 are indicated by chain-dotted arrows, and moving directions of expansion data processed via the second sub-module 232 are indicated by solid arrows.
  • In some embodiments, the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R1 and a 2nd expansion register R2 of the first operation stage, and the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 9th expansion register R9 and a 14th expansion register R14 of the first operation stage.
  • For example, in some examples, as shown in FIG. 9, intermediate data wx′ in an additional register X of the operation stage 220-b is obtained by processing, by the first sub-module 231, expansion data w1 stored in a 1st expansion register R1 and expansion data w2 stored in a 2nd expansion register R2 of the operation stage 220-a. Specifically, in this example, the first sub-module 231 comprises a σ0 operator for performing a σ0 operation and an adder ADD1 for performing an addition operation, wherein the expansion data w2 is input to the σ0 operator, output of the σ0 operator and the expansion data w1 are input to the adder ADD1, and output of the adder ADD1 is provided to the additional register X of the operation stage 220-b, so that wx′=w10(w2).
  • As further shown in FIG. 9, expansion data w15′ in a 15th expansion register R15 of the operation stage 220-b is obtained by processing, by the second sub-module 232, intermediate data wx stored in an additional register X, expansion data w9 stored in a 9th expansion register R9, and expansion data w14 stored in a 14th expansion register R14 of the operation stage 220-a. Specifically, in this example, the second sub-module 232 comprises a σ1 operator for performing a σ1 operation, and a full-adder FAA and an adder ADD2 for performing an addition operation, wherein the expansion data w14 is input to the σ1 operator, output of the σ1 operator, the intermediate data wx, and the expansion data w9 are input to the full-adder FAA, outputs of the full-adder FAA are input to the adder ADD2, and output of the adder ADD2 is provided to the 15th expansion register R15 of the operation stage 220-b, so that w15′=wx+w91(w14).
  • As further shown in FIG. 9, expansion data stored in an ith expansion register of the operation stage 220-a is directly shifted into an (i−1)th expansion register of the operation stage 220-b, where 1≤i≤15 and i is an integer.
  • In the example shown in FIG. 9, the number of operation logic stages experienced by the first sub-module 231 is 2, and the number of operation logic stages experienced by the second sub-module 232 is 3. The first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220-b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • In some embodiments, the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R1 and a 10th expansion register R10 of the first operation stage, and the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 1st expansion register R1 and a 14th expansion register R14 of the first operation stage.
  • For example, in some examples, as shown in FIG. 10, intermediate data wx′ in an additional register X of the operation stage 220-b is obtained by processing, by the first sub-module 231, expansion data w1 stored in a 1st expansion register R1 and expansion data w10 stored in a 10th expansion register R10 of the operation stage 220-a. Specifically, in this example, the first sub-module 231 comprises an adder ADD1 for performing an addition operation, wherein the expansion data w1 and the expansion data w10 are input to the adder ADD1, output of the adder ADD1 is provided to the additional register X of the operation stage 220-b, so that wx′=w1+w10.
  • As further shown in FIG. 10, expansion data w15′ in a 15th expansion register R15 of the operation stage 220-b is obtained by processing, by the second sub-module 232, intermediate data wx stored in an additional register X, expansion data w1 stored in a 1st expansion register R1, and expansion data w14 stored in a 14th expansion register R14 of the operation stage 220-a. Specifically, in this example, the second sub-module 232 comprises a σ0 operator for performing a σ0 operation, a σ1 operator for performing a σ1 operation, and a full-adder FAA and an adder ADD2 for performing an addition operation, wherein the expansion data w1 is input to the σ0 operator, the expansion data w14 is input to the σ1 operator, and the σ0 operation and the σ1 operation can be performed simultaneously, for example. Then, output of the σ0 operator, output of the σ1 operator, and the intermediate data wx are input to the full-adder FAA, outputs of the full-adder FAA are input to the adder ADD2, and output of the adder ADD2 is provided to the 15th expansion register R15 of the operation stage 220-b, so that w15′=wx0(w1)+σ1(w14).
  • As further shown in FIG. 10, expansion data stored in an ith expansion register of the operation stage 220-a is directly shifted into an (i−1)th expansion register of the operation stage 220-b, where 1≤i≤15 and i is an integer.
  • In the example shown in FIG. 10, the number of operation logic stages experienced by the first sub-module 231 is 1, and the number of operation logic stages experienced by the second sub-module 232 is 3. The first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220-b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • In some embodiments, the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R1, a 2nd expansion register R2, and a 10th expansion register R10 of the first operation stage, and the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 14th expansion register R14 of the first operation stage.
  • For example, in some examples, as shown in FIG. 11, intermediate data wx′ in an additional register X of the operation stage 220-b is obtained by processing, by the first sub-module 231, expansion data w1 stored in a 1st expansion register R1, expansion data w2 stored in a 2nd expansion register R2, and expansion data w10 stored in a 10th expansion register R10 of the operation stage 220-a. Specifically, in this example, the first sub-module 231 comprises a σ0 operator for performing a σ0 operation, and a full-adder FAA and an adder ADD1 for performing an addition operation, wherein the expansion data w2 is input to the σ0 operator, output of the σ0 operator, the expansion data w1, and the expansion data w10 are input to the full-adder FAA, outputs of the full-adder FAA are input to the adder ADD1, and output of the adder ADD1 is provided to the additional register X of the operation stage 220-b, so that wx′=w10(w2)+w10.
  • As further shown in FIG. 11, expansion data w15′ in a 15th expansion register R15 of the operation stage 220-b is obtained by processing, by the second sub-module 232, intermediate data wx stored in an additional register X and expansion data w14 stored in the 14th expansion register R14 of the operation stage 220-a. Specifically, in this example, the second sub-module 232 comprises a σ1 operator for performing a σ1 operation and an adder ADD2 for performing an addition operation, wherein the expansion data w14 is input to the σ1 operator, output of the σ1 operator and the intermediate data wx are input to the adder ADD2, and output of the adder ADD2 is provided to the 15th expansion register R15 of the operation stage 220-b, so that w15′=wx1(w14).
  • As further shown in FIG. 11, expansion data stored in an ith expansion register of the operation stage 220-a is directly shifted into an (i−1)th expansion register of the operation stage 220-b, where 1≤i≤15 and i is an integer.
  • In the example shown in FIG. 11, the number of operation logic stages experienced by the first sub-module 231 is 3, and the number of operation logic stages experienced by the second sub-module 232 is 2. The first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220-b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • In some embodiments, the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R1 and a 15th expansion register R15 of the first operation stage, and the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 1st expansion register R1 and a 9th expansion register R9 of the first operation stage.
  • For example, in some examples, as shown in FIG. 12, intermediate data wx′ in an additional register X of the operation stage 220-b is obtained by processing, by the first sub-module 231, expansion data w1 stored in a 1st expansion register R1 and expansion data w15 stored in a 15th expansion register R15 of the operation stage 220-a. Specifically, in this example, the first sub-module 231 comprises a σ1 operator for performing a σ1 operation and an adder ADD1 for performing an addition operation, wherein the expansion data w15 is input to the σ1 operator, output of the σ1 operator and the expansion data w1 are input to the adder ADD1, and output of the adder ADD1 is provided to the additional register X of the operation stage 220-b, so that wx′=w11(w15).
  • As further shown in FIG. 12, expansion data w15′ in a 15th expansion register R15 of the operation stage 220-b is obtained by processing, by the second sub-module 232, intermediate data wx stored in an additional register X, expansion data w1 stored in a 1st expansion register R1, and expansion data w9 stored in a 9th expansion register R9 of the operation stage 220-a. Specifically, in this example, the second sub-module 232 comprises a σ0 operator for performing a σ0 operation, and a full-adder FAA and an adder ADD2 for performing an addition operation, wherein the expansion data w1 is input to the σ0 operator, output of the σ0 operator, the intermediate data wx, and the expansion data w9 are input to the full-adder FAA, outputs of the full-adder FAA are input to the adder ADD2, and output of the adder ADD2 is provided to the 15th expansion register R15 of the operation stage 220-b, so that w15′=wx0(w1)+w9.
  • As further shown in FIG. 12, expansion data stored in an ith expansion register of the operation stage 220-a is directly shifted into an (i−1)th expansion register of the operation stage 220-b, where 1≤i≤15 and i is an integer.
  • In the example shown in FIG. 12, the number of operation logic stages experienced by the first sub-module 231 is 2, and the number of operation logic stages experienced by the second sub-module 232 is 3. The first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220-b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • In some embodiments, the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R1, a 2nd expansion register R2, and a 15th expansion register R15 of the first operation stage, and the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 9th expansion register R9 of the first operation stage. Specifically, in some examples, intermediate data wx′ in an additional register X of the operation stage 220-b can be obtained by processing, by the first sub-module 231, expansion data w1 stored in a 1st expansion register R1, expansion data w2 stored in a 2nd expansion register R2 and expansion data w15 stored in a 15th expansion register R15 of the operation stage 220-a, and expansion data w15′ in a 15th expansion register R15 of the operation stage 220-b can be obtained by processing, by the second sub-module 232, intermediate data wx stored in an additional register X of the operation stage 220-a and expansion data w9 stored in a 9th expansion register R9 of the operation stage 220-a, so that wx′=w10(w2)+σ1(w15), w15′=wx+w9.
  • In some embodiments, the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 1st expansion register R1, a 10th expansion register R10, and a 15th expansion register R15 of the first operation stage, and the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 1st expansion register R1 of the first operation stage. Specifically, in some examples, intermediate data wx′ in an additional register X of the operation stage 220-b can be obtained by processing, by the first sub-module 231, expansion data w1 stored in a 1st expansion register R1, expansion data w10 stored in a 10th expansion register R10 and expansion data w15 stored in a 15th expansion register R15 of the operation stage 220-a, and expansion data w15′ in a 15th expansion register R15 of the operation stage 220-b can be obtained by processing, by the second sub-module 232, intermediate data wx in an additional register X of the operation stage 220-a and expansion data w1 stored in a 1st expansion register R1 of the operation stage 220-a, so that wx′=w1+w101(w15), w15′=wx0(w1).
  • In some embodiments, the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 2nd expansion register R2 and a 10th expansion register R10 of the first operation stage, and the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 0th expansion register R0 and a 14th expansion register R14 of the first operation stage.
  • For example, in some examples, as shown in FIG. 13, intermediate data wx′ in an additional register X of the operation stage 220-b is obtained by processing, by the first sub-module 231, expansion data w2 stored in a 2nd expansion register R2 and expansion data w10 stored in a 10th expansion register R10 of the operation stage 220-a. Specifically, in this example, the first sub-module 231 comprises a σ0 operator for performing a σ0 operation and an adder ADD1 for performing an addition operation, wherein the expansion data w2 is input to the σ0 operator, output of the σ0 operator and the expansion data w10 are input to the adder ADD1, and output of the adder ADD1 is provided to the additional register X of the operation stage 220-b, so that wx′=σ0(w2)+w10.
  • As further shown in FIG. 13, expansion data w15′ in a 15th expansion register R15 of the operation stage 220-b is obtained by processing, by the second sub-module 232, intermediate data wx stored in an additional register X, expansion data w0 stored in a 0th expansion register R0, and expansion data w14 stored in a 14th expansion register R14 of the operation stage 220-a. Specifically, in this example, the second sub-module 232 comprises a σ1 operator for performing a σ1 operation, and a full-adder FAA and an adder ADD2 for performing an addition operation, wherein the expansion data w14 is input to the σ1 operator, output of the σ1 operator, the intermediate data wx, and the expansion data w0 are input to the full-adder FAA, outputs of the full-adder FAA are input to the adder ADD2, and output of the adder ADD2 is provided to the 15th expansion register R15 of the operation stage 220-b, so that w15′=wx+w01(w14).
  • As further shown in FIG. 13, expansion data stored in an ith expansion register of the operation stage 220-a is directly shifted into an (i−1)th expansion register of the operation stage 220-b, where 1≤i≤15 and i is an integer.
  • In the example shown in FIG. 13, the number of operation logic stages experienced by the first sub-module 231 is 2, and the number of operation logic stages experienced by the second sub-module 232 is 3. The first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220-b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • In some embodiments, the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 2nd expansion register R2, a 10th expansion register R10, and a 15th expansion register R15 of the first operation stage, and the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 0th expansion register R0 of the first operation stage.
  • For example, in some examples, as shown in FIG. 14, intermediate data wx′ in an additional register X of the operation stage 220-b is obtained by processing, by the first sub-module 231, expansion data w2 stored in a 2nd expansion register R2, expansion data w10 stored in a 10th expansion register R10, and expansion data w15 stored in a 15th expansion register R15 of the operation stage 220-a. Specifically, in this example, the first sub-module 231 comprises a σ0 operator for performing a σ0 operation, a σ1 operator for performing a σ1 operation, and a full-adder FAA and an adder ADD1 for performing an addition operation, wherein the expansion data w2 is input to the σ0 operator, the expansion data w15 is input to the σ1 operator, and the σ0 operation and the σ1 operation can be performed simultaneously. Then, output of the σ0 operator, output of the σ1 operator, and the expansion data w10 are input to the full-adder FAA, outputs of the full-adder FAA are input to the adder ADD1, and output of the adder ADD1 is provided to the additional register X of the operation stage 220-b, so that wx′=σ0(w2)+w101(w15).
  • As further shown in FIG. 14, expansion data w15′ in a 15th expansion register R15 of the operation stage 220-b is obtained by processing, by the second sub-module 232, intermediate data wx stored in an additional register X and expansion data w0 stored in a 0th expansion register R0 of the operation stage 220-a. Specifically, in this example, the second sub-module 232 comprises an adder ADD2, wherein the intermediate data wx and the expansion data w0 are input to the adder ADD2, and output of the adder ADD2 is provided to the 15th expansion register R15 of the operation stage 220-b, so that w15′=wx+w0.
  • As further shown in FIG. 14, expansion data stored in an ith expansion register of the operation stage 220-a is directly shifted into an (i−1)th expansion register of the operation stage 220-b, where 1≤i≤15 and i is an integer.
  • In the example shown in FIG. 14, the number of operation logic stages experienced by the first sub-module 231 is 3, and the number of operation logic stages experienced by the second sub-module 232 is 1. The first sub-module 231 and the second sub-module 232 can be operated in parallel independently of each other, so that the number of operation logic stages that is required to be experienced in computing the expansion data for the operation stage 220-b is finally reduced to 3, and the computation latency is greatly reduced, which makes the operation speed of the pipeline structure significantly improved.
  • In some embodiments, the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 2nd expansion register R2 and a 15th expansion register R15 of the first operation stage, and the second sub-module can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 0th expansion register R0 and a 9th expansion register R9 of the first operation stage. Specifically, in some examples, intermediate data wx′ in an additional register X of the operation stage 220-b can be obtained by processing, by the first sub-module 231, expansion data w2 stored in a 2nd expansion register R2 and expansion data w15 stored in a 15th expansion register R15 of the operation stage 220-a, and expansion data w15′ in a 15th expansion register R15 of the operation stage 220-b can be obtained by processing, by the second sub-module 232, intermediate data wx in an additional register X of the operation stage 220-a and expansion data w0 stored in a 0th expansion register R0 and expansion data w9 stored in a 9th expansion register R9 of the operation stage 220-a, so that wx′=σ0(w2)+σ1(w15), w15′=wx+w0+w9.
  • In some embodiments, the first sub-module 231 can be configured to compute intermediate data for storage into an additional register X of the second operation stage based on expansion data stored in a 10th expansion register R10 and a 15th expansion register R15 of the first operation stage, and the second sub-module 232 can be configured to compute expansion data for storage into a 15th expansion register R15 of the second operation stage based on intermediate data stored in an additional register X of the first operation stage and expansion data stored in a 0th expansion register R0 and a 1st expansion register R1 of the first operation stage. Specifically, in some examples, intermediate data wx′ in an additional register X of the operation stage 220-b can be obtained by processing, by the first sub-module 231, expansion data w10 stored in a 10th expansion register R10 and expansion data w15 stored in a 15th expansion register R15 of the operation stage 220-a, and expansion data w15′ in a 15th expansion register R15 of the operation stage 220-b can be obtained by processing, by the second sub-module 232, intermediate data wx in an additional register X of the operation stage 220-a and expansion data w0 stored in a 0th expansion register R0 and expansion data w1 stored in a 1st expansion register R1 of the operation stage 220-a, so that wx′=w101(w15), w15′=wx+w00(w1).
  • Accordingly, the present disclosure also provides a method of computing expansion data in a circuit for performing a hash algorithm. FIG. 14 shows an exemplary flow diagram of a method 400 of computing expansion data in a circuit for performing a hash algorithm according to embodiments of the present disclosure. Such a circuit can comprise an input module configured to receive data and an operation module configured to compute a hash value based on the received data, wherein the operation module can comprise a plurality of operation stages arranged in a pipeline structure, each operation stage can comprise 0th to 15th expansion registers and an additional register, each expansion register can be configured to store expansion data of the current operation stage, and the additional register can be configured to store intermediate data for computing expansion data. In some embodiments, intermediate data stored in an additional register of a most preceding operation stage and expansion data stored in a 0th expansion register of the most preceding operation stage can be the same. For two adjacent operation stages of the plurality of operation stages of the operation module which comprise a first operation stage and a second operation stage after the first operation stage, the method 400 can comprise: at S401, computing intermediate data for storage into an additional register of the second operation stage based on expansion data stored in an expansion register of the first operation stage; at S402, computing expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage; and at S403, taking expansion data stored in an ith expansion register of the first operation stage as expansion data for storage into an (i−1)th expansion register of the second operation stage, where 1≤i≤15 and i is an integer. Note that S401 to S403 do not need to be performed in sequential order, but can be performed in any order, or can be performed at least partially in parallel.
  • In some embodiments, the computation of the intermediate data for storage into the additional register of the second operation stage and the computation of the expansion data for storage into the 15th expansion register of the second operation stage can be performed simultaneously.
  • In some embodiments, expansion data stored in a 15th expansion register of a subsequent operation stage of the second operation stage can be determined based on expansion data stored in a 1st expansion register, a 2nd expansion register, a 10th expansion register, and a 15th expansion register of the first operation stage.
  • The method 400 can further compute expansion data in various ways described above with respect to the first sub-module 231 and the second sub-module 232, which are not repeated herein. The method 400 can reduce the computation latency caused by computing the expansion data in the circuit for performing the hash algorithm, thereby significantly improving the operation speed of the circuit and thus of a computing chip containing the circuit, thereby achieving a lower ratio of power consumption to hash rate.
  • The present disclosure can further provide a computing chip comprising the circuit as described in any of the above embodiments. The present disclosure can further provide a data processing device comprising one or more computing chips as described above. A data processing device according to the present disclosure, for example, as a crypto currency mining machine, can achieve a lower ratio of power consumption to hash rate, thereby performing a mining process with lower cost and greater efficiency.
  • Terms “left”, “right”, “front”, “back”, “top”, “bottom”, “up”, “down”, “high”, “low” and the like in the specification and claims, if any, are used for descriptive purposes and not necessarily for describing permanent relative positions. It should be understood that the terms so used are interchangeable where appropriate such that the embodiments of the present disclosure described herein are, for example, capable of operation in other orientations different from those shown or otherwise described herein. For example, when a device in the drawings is turned upside down, a feature originally described as “above” other features can be described as “below” the other features at this time. The device can also be otherwise oriented (rotated 90 degrees or in other orientations), and at this time, relative spatial relations will be interpreted accordingly.
  • In the specification and claims, when it is described that one element is “on”, “attached to”, “connected to”, “coupled to”, or “in contact with” another element, and so on, the element can be directly on, directly attached to, directly connected to, directly coupled to, or in direct contact with the other element, or one or more intermediate elements can be present. In contrast, when it is described that one element is “directly on”, “directly attached to”, “directly connected to”, “directly coupled to”, or “in direct contact with” another element, no intermediate elements will be present. In the specification and claims, one feature is arranged “adjacent” to another feature, which can refer to the one feature having a portion overlapping with the adjacent feature or a portion above or below the adjacent feature.
  • As used herein, a term “exemplary” means “serving as an example, instance, or illustration”, and not as a “model” that is to be reproduced exactly. Any implementation exemplarily described herein is not necessarily to be construed as preferred or advantageous over other implementations. Furthermore, the present disclosure is not limited by any expressed or implied theory presented in the technical field, background, summary or detailed description. As used herein, a term “substantially” means to encompass any minor variations caused by design or manufacturing imperfections, tolerances of devices or components, environmental effects and/or other factors. The term “substantially” also allows for differences from a perfect or ideal situation caused by parasitics, noise, and other practical considerations that may exist in a practical implementation.
  • In addition, for reference purposes only, similar terms such as “first”, “second” can also be used herein, and thus are not intended to be limiting. For example, unless clearly indicated by the context, the terms “first,” “second,” and other such numerical terms involving structures or elements do not imply a sequence or order. It will be further understood that terms “comprise/include”, when used herein, specify the presence of stated features, entireties, steps, operations, units, and/or components, but do not preclude the presence or addition of one or more other features, entireties, steps, operations, units, components, and/or combinations thereof. In the present disclosure, a term “providing” is used broadly to encompass all ways of obtaining an object, and thus “providing an object” includes, but is not limited to, “purchasing”, “preparing/manufacturing”, “arranging/setting”, “installing/assembling”, and/or “ordering” the object, and so on.
  • As used herein, terms “and/or” includes any and all combinations of one or more of associated listed items. Terms used herein is for the purpose of describing specific embodiments only and is not intended to limit the present disclosure. As used herein, singular forms “a”, “an” and “the” are intended to include plural forms as well, unless clearly indicated by the context otherwise.
  • Those skilled in the art should realize that boundaries between the above described operations are merely illustrative. Multiple operations can be combined into a single operation, the single operation can be distributed in additional operations, and the execution of the operations can be at least partially overlapped in time. Moreover, an alternative embodiment can comprise multiple instances of a specific operation, and the order of operations can be altered in various other embodiments. However, other modifications, variations, and alternatives are also possible. Aspects and elements of all the embodiments disclosed above can be combined in any manner and/or in combination with aspects or elements of other embodiments to provide multiple additional embodiments. Accordingly, this specification and the accompanying drawings should be regarded as illustrative rather than restrictive.
  • While some specific embodiments of the present disclosure have been described in detail through examples, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. The embodiments disclosed herein can be combined arbitrarily without departing from the spirit and scope of the present disclosure. Those skilled in the art will also appreciate that various modifications can be made to the embodiments without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.

Claims (24)

1. A circuit for performing a hash algorithm, comprising:
an input module configured to receive data; and
an operation module configured to compute a hash value based on the received data, the operation module comprising:
a plurality of operation stages arranged in a pipeline structure, each operation stage of the plurality of operation stages comprising 0th to 15th expansion registers, each expansion register being configured to store expansion data of the current operation stage; and
a plurality of expansion data operation logic modules, each expansion data operation logic module being disposed between two respective adjacent operation stages of the plurality of operation stages, the two adjacent operation stages comprising a first operation stage and a second operation stage after the first operation stage, each expansion data operation logic module comprising:
a first sub-module configured to compute expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register of the first operation stage; and
a second sub-module configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register of the first operation stage,
wherein expansion data for storage into an (i−1)th expansion register of the second operation stage is expansion data stored in an ith expansion register of the first operation stage, where 2≤i≤15 and i is an integer.
2-4. (canceled)
5. The circuit according to claim 1, wherein
the first sub-module is configured to compute expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register and a 2nd expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register, a 9th expansion register, and a 14th expansion register of the first operation stage.
6. The circuit according to claim 1, wherein
the first sub-module is configured to compute expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register and a 10th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register, a 1st expansion register, and a 14th expansion register of the first operation stage.
7. The circuit according to claim 1, wherein
the first sub-module is configured to compute expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register, a 2nd expansion register, and a 10th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register and a 14th expansion register of the first operation stage.
8. The circuit according to claim 1, wherein
the first sub-module is configured to compute expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register and a 15th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register, a 1st expansion register, and a 9th expansion register of the first operation stage.
9. The circuit according to claim 1, wherein
the first sub-module is configured to compute expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register, a 2nd expansion register, and a 15th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register and a 9th expansion register of the first operation stage.
10. The circuit according to claim 1, wherein the first sub-module is configured to compute expansion data for storage into a 0th expansion register of the second operation stage based on expansion data stored in a 1st expansion register, a 10th expansion register, and a 15th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on expansion data stored in a 0th expansion register and a 1st expansion register of the first operation stage.
11. A circuit for performing a hash algorithm, comprising:
an input module configured to receive data; and
an operation module configured to compute a hash value based on the received data, the operation module comprising:
a plurality of operation stages arranged in a pipeline structure, each operation stage of the plurality of operation stages comprising 0th to 15th expansion registers and an additional register, each expansion register being configured to store expansion data of the current operation stage, the additional register being configured to store intermediate data for computing expansion data; and
a plurality of expansion data operation logic modules, each expansion data operation logic module being disposed between two respective adjacent operation stages of the plurality of operation stages, the two adjacent operation stages comprising a first operation stage and a second operation stage after the first operation stage, each expansion data operation logic module comprising:
a first sub-module configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in an expansion register of the first operation stage; and
a second sub-module configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage,
wherein expansion data for storage into an (i−1)th expansion register of the second operation stage is expansion data stored in an ith expansion register of the first operation stage, where 1≤i≤15 and i is an integer.
12-14. (canceled)
15. The circuit according to claim 11, wherein
the first sub-module is configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in a 1st expansion register and a 2nd expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage and expansion data stored in a 9th expansion register and a 14th expansion register of the first operation stage.
16. The circuit according to claim 11, wherein
the first sub-module is configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in a 1st expansion register and a 10th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage and expansion data stored in a 1st expansion register and a 14th expansion register of the first operation stage.
17. The circuit according to claim 11, wherein
the first sub-module is configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in a 1st expansion register, a 2nd expansion register, and a 10th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage and expansion data stored in a 14th expansion register of the first operation stage.
18. The circuit according to claim 11, wherein
the first sub-module is configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in a 1st expansion register and a 15th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage and expansion data stored in a 1st expansion register and a 9th expansion register of the first operation stage.
19. The circuit according to claim 11, wherein
the first sub-module is configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in a 1st expansion register, a 2nd expansion register, and a 15th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage and expansion data stored in a 9th expansion register of the first operation stage.
20. The circuit according to claim 11, wherein
the first sub-module is configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in a 1st expansion register, a 10th expansion register, and a 15th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage and expansion data stored in a 1st expansion register of the first operation stage.
21. The circuit according to claim 11, wherein
the first sub-module is configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in a 2nd expansion register and a 10th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage and expansion data stored in a 0th expansion register and a 14th expansion register of the first operation stage.
22. The circuit according to claim 11, wherein
the first sub-module is configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in a 2nd expansion register and a 15th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage and expansion data stored in a 0th expansion register and a 9th expansion register of the first operation stage.
23. The circuit according to claim 11, wherein
the first sub-module is configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in a 2nd expansion register, a 10th expansion register, and a 15th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage and expansion data stored in a 0th expansion register of the first operation stage.
24. The circuit according to claim 11, wherein
the first sub-module is configured to compute intermediate data for storage into an additional register of the second operation stage based on expansion data stored in a 10th expansion register and a 15th expansion register of the first operation stage; and
the second sub-module is configured to compute expansion data for storage into a 15th expansion register of the second operation stage based on intermediate data stored in an additional register of the first operation stage and expansion data stored in a 0th expansion register and a 1st expansion register of the first operation stage.
25. A computing chip comprising the circuit according to claim 1.
26. A data processing device comprising one or more computing chips according to claim 25.
27. (canceled)
28. (canceled)
US17/630,881 2020-12-18 2021-07-09 Circuit for performing hash algorithm, computing chip, data processing device and method Active US11658807B2 (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN202011509432.7 2020-12-18
CN202011509432.7A CN114648319A (en) 2020-12-18 2020-12-18 Circuit for executing hash algorithm, computing chip, encrypted currency mining machine and method
PCT/CN2021/105350 WO2022127085A1 (en) 2020-12-18 2021-07-09 Circuit for executing hash algorithm, computing chip, and data processing device and method

Publications (2)

Publication Number Publication Date
US20220376893A1 true US20220376893A1 (en) 2022-11-24
US11658807B2 US11658807B2 (en) 2023-05-23

Family

ID=80783444

Family Applications (1)

Application Number Title Priority Date Filing Date
US17/630,881 Active US11658807B2 (en) 2020-12-18 2021-07-09 Circuit for performing hash algorithm, computing chip, data processing device and method

Country Status (5)

Country Link
US (1) US11658807B2 (en)
KR (1) KR102587719B1 (en)
CN (1) CN114648319A (en)
TW (1) TWI801926B (en)
WO (1) WO2022127085A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116094691B (en) * 2022-12-26 2023-11-03 声龙(新加坡)私人有限公司 Data processing method, device and chip based on workload certification

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050089160A1 (en) * 2003-10-10 2005-04-28 Via Technologies, Inc. Apparatus and method for secure hash algorithm
US7376685B2 (en) * 2003-12-26 2008-05-20 Electronics And Telecommunications Research Institute Apparatus and method for computing SHA-1hash function
US7962753B2 (en) * 2006-11-08 2011-06-14 Oki Semiconductor Co., Ltd. Method and a circuit for SHA operation with power saved
US8086864B2 (en) * 2007-07-09 2011-12-27 Electronics And Telecommunications Research Institute Low power HMAC encryption apparatus
US8712039B2 (en) * 2011-04-06 2014-04-29 Certicom Corp. Efficient implementation of hash algorithm on a processor
US8954754B2 (en) * 2011-12-22 2015-02-10 Intel Corporation Method and apparatus to process SHA-1 secure hashing algorithm
US9960909B2 (en) * 2014-12-08 2018-05-01 Open-Silicon Inc. High speed and low power hashing system and method
US10020934B2 (en) * 2015-11-05 2018-07-10 Intel Corporation Hardware accelerator for cryptographic hash operations
US10097345B2 (en) * 2015-04-14 2018-10-09 PeerNova, Inc. Secure hash algorithm in digital hardware for cryptographic applications
US10686591B2 (en) * 2012-12-29 2020-06-16 Intel Corporation Instruction and logic to provide SIMD secure hashing round slice functionality
US10979214B2 (en) * 2018-07-24 2021-04-13 Martin Spence Denham Secure hash algorithm implementation

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI238636B (en) 2003-06-19 2005-08-21 Yen-Fu Liu Operation device and method of fast secure hash algorithm
US20080215849A1 (en) * 2007-02-27 2008-09-04 Thomas Scott Hash table operations with improved cache utilization
US8458377B2 (en) 2010-03-05 2013-06-04 Lsi Corporation DMA engine capable of concurrent data manipulation
US10241817B2 (en) * 2014-11-25 2019-03-26 Red Hat Israel, Ltd. Paravirtualized access for device assignment by bar extension
CN108427575B (en) * 2018-02-01 2022-03-15 深圳市安信智控科技有限公司 Full-flow-structure SHA-2 message expansion optimization method
CN110543481B (en) 2019-08-23 2022-12-06 紫光展锐(重庆)科技有限公司 Data processing method and device, computer equipment and storage medium
CN111612622B (en) 2020-05-20 2021-03-23 深圳比特微电子科技有限公司 Circuit and method for performing a hashing algorithm
CN111930682B (en) 2020-07-16 2024-08-13 深圳比特微电子科技有限公司 Clock tree, hash engine, computing chip, computing board and computing device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050089160A1 (en) * 2003-10-10 2005-04-28 Via Technologies, Inc. Apparatus and method for secure hash algorithm
US7376685B2 (en) * 2003-12-26 2008-05-20 Electronics And Telecommunications Research Institute Apparatus and method for computing SHA-1hash function
US7962753B2 (en) * 2006-11-08 2011-06-14 Oki Semiconductor Co., Ltd. Method and a circuit for SHA operation with power saved
US8086864B2 (en) * 2007-07-09 2011-12-27 Electronics And Telecommunications Research Institute Low power HMAC encryption apparatus
US8712039B2 (en) * 2011-04-06 2014-04-29 Certicom Corp. Efficient implementation of hash algorithm on a processor
US8954754B2 (en) * 2011-12-22 2015-02-10 Intel Corporation Method and apparatus to process SHA-1 secure hashing algorithm
US10686591B2 (en) * 2012-12-29 2020-06-16 Intel Corporation Instruction and logic to provide SIMD secure hashing round slice functionality
US9960909B2 (en) * 2014-12-08 2018-05-01 Open-Silicon Inc. High speed and low power hashing system and method
US10097345B2 (en) * 2015-04-14 2018-10-09 PeerNova, Inc. Secure hash algorithm in digital hardware for cryptographic applications
US10020934B2 (en) * 2015-11-05 2018-07-10 Intel Corporation Hardware accelerator for cryptographic hash operations
US10979214B2 (en) * 2018-07-24 2021-04-13 Martin Spence Denham Secure hash algorithm implementation

Also Published As

Publication number Publication date
KR20230066661A (en) 2023-05-16
TWI801926B (en) 2023-05-11
WO2022127085A1 (en) 2022-06-23
US11658807B2 (en) 2023-05-23
CN114648319A (en) 2022-06-21
TW202141302A (en) 2021-11-01
KR102587719B1 (en) 2023-10-11

Similar Documents

Publication Publication Date Title
US9843441B2 (en) Compact, low power advanced encryption standard circuit
CN111612622B (en) Circuit and method for performing a hashing algorithm
CN111464308A (en) Method and system for realizing reconstruction of multiple Hash algorithms
Seo et al. Optimized implementation of SIKE round 2 on 64-bit ARM Cortex-A processors
CN112367158A (en) Method for accelerating SM3 algorithm, processor, chip and electronic equipment
Salman et al. A scalable ECC processor implementation for high-speed and lightweight with side-channel countermeasures
US11658807B2 (en) Circuit for performing hash algorithm, computing chip, data processing device and method
Farahmand et al. Implementing and benchmarking seven round 2 lattice-based key encapsulation mechanisms using a software/hardware codesign approach
CN116318660B (en) Message expansion and compression method and related device
Wang et al. A hardware implementation of ZUC-256 stream cipher
Seo Compact implementations of Curve Ed448 on low‐end IoT platforms
Noor et al. Resource shared galois field computation for energy efficient AES/CRC in IoT applications
Guneysu et al. Ultra high performance ECC over NIST primes on commercial FPGAs
CN107992283A (en) A kind of method and apparatus that finite field multiplier is realized based on dimensionality reduction
Van Hieu et al. Hardware implementation for fast block generator of Litecoin blockchain system
CN213518334U (en) Circuit for executing Hash algorithm, computing chip and encrypted currency mining machine
CN102684870B (en) Device and method for generating algorithm secret key of Zu Chong-Chi
El-Razouk et al. New Bit-Level Serial GF (2^ m) Multiplication Using Polynomial Basis
CN213482935U (en) Circuit for executing Hash algorithm, computing chip and encrypted currency mining machine
Namin et al. A Fully Serial-In Parallel-Out Digit-Level Finite Field Multiplier in $\mathbb {F} _ {2^{m}} $ Using Redundant Representation
CN114978473A (en) Processing method of SM3 algorithm, processor, chip and electronic equipment
CN114648318A (en) Circuit for executing hash algorithm, computing chip, encrypted currency mining machine and method
KR100954843B1 (en) Method and Apparatus of elliptic curve cryptographic operation based on block indexing on sensor mote and Recording medium using by the same
CN214151680U (en) Arithmetic circuit, calculating chip and encrypted currency mining machine
KR20000000770A (en) Device for multiplying modular

Legal Events

Date Code Title Description
AS Assignment

Owner name: SHENZHEN MICROBT ELECTRONICS TECHNOLOGY CO., LTD., CHINA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:FAN, ZHIJUN;XUE, KE;XU, CHAO;AND OTHERS;REEL/FRAME:058799/0920

Effective date: 20211012

FEPP Fee payment procedure

Free format text: ENTITY STATUS SET TO UNDISCOUNTED (ORIGINAL EVENT CODE: BIG.); ENTITY STATUS OF PATENT OWNER: SMALL ENTITY

FEPP Fee payment procedure

Free format text: ENTITY STATUS SET TO SMALL (ORIGINAL EVENT CODE: SMAL); ENTITY STATUS OF PATENT OWNER: SMALL ENTITY

STPP Information on status: patent application and granting procedure in general

Free format text: DOCKETED NEW CASE - READY FOR EXAMINATION

STCF Information on status: patent grant

Free format text: PATENTED CASE