# US 2024/0007269 A1 · General-Purpose Lightweight Hash Processing Method and System and Storable Medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0007269 A1
- Document ID: US20240007269A1
- Status: Published application
- Kind: A1
- Application number: 18/348,872
- Filed: 2023-07-07
- Published: 2024-01-04
- Earliest claimed: 2022-07-04
- Assignees: Guangxi Bohan Technology Co., Ltd.
- Applicants: Guangxi Bohan Technology Co., Ltd.
- Inventors: Jianliang ZHENG; Evan ZHENG
- Web page: https://patentgrep.com/patent/US20240007269A1

## CPC

- H04L 9/0643: {Hash functions, e.g. MD5, SHA, HMAC or f9 MAC}
- G09C 1/00: Apparatus or methods whereby a given sequence of signs, e.g. an intelligible text, is transformed into an unintelligible sequence of signs by transposing the signs or groups of signs or by replacing them by others according to a predetermined system (cryptographic typewriters G09C3/00)
- H04L 2209/046: of operations, operands or results of the operations
- H04L 2209/12: Details relating to cryptographic hardware or logic circuitry
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G09C: CIPHERING OR DECIPHERING APPARATUS FOR CRYPTOGRAPHIC OR OTHER PURPOSES INVOLVING THE NEED FOR SECRECY
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

Disclosed are a general-purpose lightweight hash processing method, a general-purpose lightweight hash processing system and a storable medium. The method includes: selecting a linear feedback shift register, and performing state transition on the linear feedback shift register by using a register state transition function; initializing an internal state of a hash algorithm by using an output of the linear feedback shift register in combination with an initialize algorithm; inputting data of which a hash value needs to be calculated, and updating the initialized internal state by using an update algorithm, wherein the data of which the hash value needs to be calculated is the padded data; and processing the updated internal state by using a finalize algorithm to generate a final hash value. The problems of speed and security of existing hash processing are solved.

## Claims

### Claim 1

A general-purpose lightweight hash processing method, applied to a general-purpose lightweight hash processing system and comprising:
selecting a linear feedback shift register, and performing state transition on the linear feedback shift register by using a register state transition function;
initializing an internal state of a hash algorithm by using an output of the linear feedback shift register in combination with an initialize algorithm;
inputting data of which a hash value needs to be calculated, and updating the initialized internal state by using an update algorithm, where the data of which the hash value needs to be calculated is the padded data; and
processing the updated internal state by using a finalize algorithm to generate a final hash value.

### Claim 2 (depends on 1)

The general-purpose lightweight hash processing method according to claim 1, wherein a formula of the initialize algorithm is represented as:
Const: The toggle mask m
Input: The uninitialized internal matrix M=[S0; S1; . . . ; Sn] and three 64-bit words s, t and x
Result: The initialized M, s, t and x
a0→m
b0→lfsr (a0)
c0→lfsr (b0)
d0→lfsr (c0)
s→a0+b0+c0+do
t→s
x→0
for i=1 to n do
ai→-ai−1
for j=1 to 68 do
ai<lfsr (ai)
bi→lfsr (ai)
ci→lfsr (bi)
di→lfsr (ci)
the i-th row Si=[ai, bi, ci, di] of the internal matrix M is directly set to four register state values starting from the i×68-th state, while the toggle mask m is used as the first state value of the register; in addition, s, t, and x are also initialized, with s and t being set to (a0+b0+c0+d0) and x being set to 0.

### Claim 3 (depends on 2)

The general-purpose lightweight hash processing method according to claim 2, wherein the update algorithm is represented as:
Input: The data to be hashed
Result: Updated internal matrix M=[S0; S1; . . . ; Sn] and three 64-bit words s, t and x
Function update (data):
for each 64-bit word w in data do
x→x⊕w
S0→S0 ▪⊕t
S0→S0+x
t→t+w
t+t⊕s
t→t+(t<<<31)
t→t+(t<<<15)
t→t+(t<<<7)
s→lfsr (s)
x→x+s
x→x⊕(x>>8)
x→x⊕(x>>17)
x→x⊕(x<<31)
for i=1 to n do
Si→Si ▪⊕S0
Si→Si+x
wherein ⊕ is bitwise XOR, <<< is left bitwise rotation, >> is right logical bitwise shift, << is left logical bitwise shift, ▪⊕ is element-wise bitwise XOR (for compound data), and ▪+ is element-wise addition (for compound data); the update algorithm uses each 64-bit word of an input data to update the internal state, the input data is padded to a length containing one or multiple complete 64-bit words, an input of an update function is one 64-bit state word in the register, one 64-bit word of the padded data and the current internal state, and an output of the update function is a new internal state returned by calling the update function each time.

### Claim 4 (depends on 1)

The general-purpose lightweight hash processing method according to claim 1, wherein a data padding method comprises:
suffix-free padding and prefix-free padding.

### Claim 5 (depends on 4)

The general-purpose lightweight hash processing method according to claim 4, wherein the suffix-free padding is as follows:
the data padding comprises the following steps:
step one: simply appending enough 0 (if the original data contains exactly one or multiple complete 64-bit words, there is no need to append 0); and
step two: appending one 64-bit word w, wherein w is calculated from the data length (number of bytes contained in the data) z and the word s, namely:
s→lfsr (s)
w=z⊕s.

### Claim 6 (depends on 5)

The general-purpose lightweight hash processing method according to claim 5, wherein by applying the finalize algorithm, mixes S0=[a0, b0, c0, d0] with each remaining set Si=[ai, bi, ci, di], and then the mixed result is compressed to generate a hash word hi, where i=1, 2, . . . , n, and the finalize algorithm is represented as:
Input: The internal matrix M=[S0; S1; . . . ; Sn]
Result: The hash value H=h1h2 . . . hn
for i=1 to n do
a→a0
b→b0
c→c0
d→d0
for j=1 to 9 do
a→a+(a<<<31)
b→b⊕a
b→b+(b<<<15)
c→c⊕b
c→c+(c<<<7)
d→d⊕c
d→d+(d<<<3)
ai→ai⊕d
ai→ai+(ai>>>31)
bi→bi⊕ai
bi→bi+(bi>>>15)
ci→ci⊕bi
ci→ci+(ci>>>7)
di→di⊕ci
di→di+(di>>>3)
a→a⊕di
hi→a
wherein >>> is right bitwise rotation.

### Claim 7 (depends on 1)

The general-purpose lightweight hash processing method according to claim 1, wherein the update algorithm and the finalize algorithm are designed in a two-layer construction, the upper layer is the update algorithm and the lower layer is the finalize algorithm.
