Message authentication code calculation method and communication method

By generating keys HK and LK, and utilizing Toeplize to construct and implement basic generic hash functions, the problem of insufficient UMAC security level is solved, enabling the calculation of message authentication codes that support longer tag lengths and have better adaptability, thereby improving the security and efficiency of the communication system.

CN119030703APending Publication Date: 2024-11-26DATA COMM SCI & TECH RES INST +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410988936.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

UMAC, as an existing MAC solution, has limitations such as insufficient security level, lack of support for longer tag lengths, and incompatibility with 64-bit processors. In addition, the large number of keys restricts its use in resource-constrained environments.

Method used

The method uses master key-based key generation keys HK and LK, Toeplize construction and basic generalized hash function, and compresses the message through key matrix and performs finite field GF(2^64) multiplication to generate message authentication codes that support 64, 128, 192 and 256 bit authentication tags.

Benefits of technology

It improves security levels, reduces key size, has good adaptability, and enhances the computational efficiency of authentication tags and the security of communication systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119030703A_ABST
    Figure CN119030703A_ABST
Patent Text Reader

Abstract

The invention relates to a message authentication code calculation method and a communication method, belongs to the technical field of communication, and solves the problems of low security level, large key size and insufficient multi-platform adaptability in the prior art. The method comprises the following specific steps: generating keys HK and LK based on a master key Key, and generating a key KTag based on the master key Key and a one-time number N; respectively establishing Toeplife structures of the secret key HK and the secret key LK to obtain a secret key matrix; based on each group of elements in the key matrix, compressing the to-be-sent message Msg with any length into a compressed message H; and encrypting the compressed message H by using the encryption key KTag to obtain a message authentication code Tag. According to the method and the system, the calculation of 64, 128, 192 and 256-bit authentication tags is supported, the security level is higher, the key size is smaller, the adaptability to a 64-bit software platform and a hardware platform is good, and the calculation efficiency of the authentication tags is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a message authentication code calculation method and a communication method. Background Art

[0002] Message Authentication Code (MAC) is an important symmetric cryptographic technology, an algorithm used to verify the integrity, authenticity, and reliability of a message. The sender takes the message and key as input to generate a fixed-length tag, called MAC. The receiver verifies the integrity of the message by verifying the consistency of the tag. MAC is widely used in network communications, data storage, e-commerce, and other fields to protect the security and reliability of data. In network communications, MAC can prevent data from being tampered with or counterfeited, and ensure the integrity and source authenticity of the data. In data storage, MAC can prevent data from being tampered with or deleted, and protect data integrity and reliability. In e-commerce, MAC can ensure the integrity and authenticity of transaction data, prevent data from being tampered with or counterfeited, and protect user privacy and security.

[0003] Common MAC design methods include the following: the first is based on block cipher design, this type of MAC is called authentication mode, such as OMAC; the second is based on hash function design, such as HMAC; the third is based on public password replacement construction; the fourth is based on general hash function construction, such as UMAC. Among them, MAC based on general hash function construction has good security and implementation performance compared to other technical types. For example, UMAC is superior to OMAC and HMAC in terms of security and implementation performance.

[0004] However, as an earlier standardized MAC, UMAC still has some shortcomings in the face of the rapid development of quantum computing and artificial intelligence. On the one hand, UMAC's security level is insufficient. Its output label lengths include 32, 64, 96, and 128, and it does not support longer label lengths and higher security strengths, such as 256 security levels. On the other hand, UMAC's basic operations are designed for 32-bit processors, which are not friendly to the currently widely used 64-bit processors. In addition, the key size used by the pan-hash algorithm in UMAC is large (greater than 1024 bytes), which will limit its use in resource-constrained environments to a certain extent. Summary of the invention

[0005] In view of the above analysis, the embodiments of the present invention aim to provide a message authentication code calculation method and a communication method to solve the defect of low security level in the prior art.

[0006] The purpose of the present invention is mainly achieved through the following technical solutions:

[0007] On the one hand, an embodiment of the present invention provides a method for calculating a message authentication code, which comprises the following steps:

[0008] Generate keys HK and LK based on the master key Key, and generate key K based on the master key Key and the one-time number N Tag ;

[0009] Establish the Toeplize structure of the keys HK and LK respectively, and obtain the key matrices {HK[1], HK[i]...HK[ω]} and {LK[1], LK[i]...LK[ω]}; wherein ω is the number of key matrix elements; ω=Taglen / 64, and Taglen is the length of the message authentication code;

[0010] Based on each group of elements HK[i] and LK[i] in the key matrix, the message Msg to be sent of any length is compressed to obtain ω single compressed messages H i , merge ω of the single compressed messages H i Get the compressed message H;

[0011] Using the key K Tag The compressed message H is encrypted to obtain a message authentication code Tag.

[0012] Furthermore, based on the elements HK[i] and LK[i] in the key matrix, the message Msg to be sent of any length is compressed to obtain the i-th single compressed message H i ,include:

[0013] The message Msg to be sent of any length is divided into blocks of 1024 bytes each to obtain n block messages M j ;

[0014] Using the element HK[i], each of the block messages M is compressed based on the basic universal hash function. j , combined with each of the block messages M j , based on the following formula, we get n random results B j :

[0015]

[0016] Among them, L j =Bin 64 (|M j |); j = 1, 2, ..., n; Bin m (x) represents the m-bit binary representation of the integer x; |X| represents the operation of obtaining the bit length of the bit string X; MH(K,M) represents the basic universal hash function.

[0017] Merge n of the above mentioned random results Bj Get the message B, use the element LK[i] to compress the message B based on the basic universal hash function, and get the single compressed message H i .

[0018] Furthermore, the single compressed message H i The calculation formula is:

[0019] If n is even, H i =MH(LK[i],B1||B2||…||B n );

[0020] otherwise,

[0021] Among them, || represents the bit string concatenation operator; LSB8(X) represents the low-order 8 bytes of the bit string X; is a finite field GF(2 64 )=GF(2)[x] / f(x), f(x)=x 64 +x 4 +x 3 +x+1.

[0022] Furthermore, the calculation process of the basic universal hash function MH(K,M) includes:

[0023] Divide the message parameter M into blocks of 8 bytes each, and obtain t block sub-messages m i , and M=

[0024] m1||m2||…||m t ,|| represents the bit string concatenation operator;

[0025] The first 4t bytes of the key parameter K are divided into blocks of 8 bytes each to obtain t / 2 block keys k i ;

[0026] Using the block key k i and k i 2 , for t said block sub-messages m i Compression is performed based on XOR operation to obtain the output result.

[0027] Furthermore, the expression of the output result is:

[0028]

[0029] Among them, uh is the output result of the basic universal hash function MH(K,M); is a bitwise XOR operation; is a finite field GF(2 64)=GF(2)[x] / f(x), f(x)=x 64 +x 4 +x 3 +x+1.

[0030] Furthermore, the finite field GF(2 64 )=GF(2)[x] / f(x) The calculation process of the multiplication operation includes:

[0031] Let X and Y be GF(2 64 ) are two 64-bit strings, then The calculation formula is as follows:

[0032] Let Z = 0 64 , T = X;

[0033] For m = 1, 2, ..., 64, calculate:

[0034] If Bit m (Y) = 1, then let

[0035] If Bit 64 (T) = 1, then let Z = T>>1, otherwise,

[0036] make

[0037] Among them, Bit m (Y) indicates the operation of taking the mth bit of the bit string Y; T>>1 indicates the operation of logically shifting the bit string T right by 1 bit, and the highest bit after the logical right shift by 1 bit is 0.

[0038] Furthermore, the keys HK, LK and K Tag The calculation formula is:

[0039] HK=KDF(Key,0 Nlen-1 ||1,HKlen);

[0040] LK=KDF(Key,0 Nlen-2 ||10,LKlen);

[0041] K Tag =KDF(Key,N,Taglen);

[0042]

[0043] HKlen=512+8(ω-1);

[0044] If n is an even number, LKlen = 4n + 8 (ω-1); otherwise, LKlen = 4 (n + 1) + 8 (ω-1);

[0045] Wherein, HKlen is the bit length of the key HK; LKlen is the bit length of the key LK; KDF(K,p,Len) represents the key derivation function, K,p,Len are the input parameters of the function; r Represents binary data consisting of r bits of "0"; || represents the bit string concatenation operator; |X| represents the operation of taking the bit length of the bit string X; It represents the operation of finding the smallest integer not less than x.

[0046] Furthermore, the calculation formula of the message authentication code Tag is: in, It is a bitwise XOR operation.

[0047] Furthermore, the calculation formula of the Toeplize structure is:

[0048] HK[i]=HK[8(i-1)+1,8(i-1)+512];

[0049] If n is an even number, LK[i]=LK[8(i-1)+1,8(i-1)+4n];

[0050] Otherwise, LK[i]=LK[8(i-1)+1,8(i-1)+4(n+1)];

[0051] Wherein, i=1, 2, ..., ω; K[i, j] represents the operation of taking the i-th byte to the j-th byte of the key K.

[0052] On the other hand, an embodiment of the present invention provides a communication method using a message authentication code, comprising the following steps:

[0053] The sender generates a one-time number N, and obtains the message authentication code Tag based on the master key Key shared with the receiver, the one-time number N, and the message Msg to be sent;

[0054] The sending end sends the one-time number N, the message Msg and the message authentication code Tag to the receiving end through a public channel in the form of a message (N, Msg, Tag);

[0055] After receiving the message (N, Msg, Tag), the receiving end obtains the message authentication code Tag′ according to the received one-time number N, the message Msg and the shared master key Key;

[0056] The receiving end compares the message authentication code Tag′ with the received message authentication code Tag. If Tag′=Tag, the message is accepted; otherwise, the message is rejected.

[0057] The sending end and the receiving end calculate the message authentication code Tag or the message authentication code Tag′ according to the message authentication code calculation method described in any one of the schemes in the above embodiments.

[0058] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0059] 1. The message authentication code calculation method proposed in the present invention supports the calculation of 64, 128, 192, and 256-bit authentication tags, has a higher security level, and can resist existing attack technologies;

[0060] 2. The basic universal hash function designed with key compression technology has a smaller key size than the existing technology; the main computing components use the finite field GF (2 64 ) multiplication operation, which has good adaptability to 64-bit software and hardware platforms, thereby improving the calculation efficiency of the authentication tag;

[0061] 3. The communication method using message authentication code proposed in the present invention is used for data integrity protection and to ensure the authenticity and reliability of the data source. The received message authentication code is verified at the receiving end. It is a provably secure and efficient authentication method, which improves the security and communication efficiency of the communication system.

[0062] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.

[0064] Figure 1 A flowchart of a method for calculating a message authentication code according to an embodiment of the present invention;

[0065] Figure 2 It is a design framework diagram of an embodiment of the present invention;

[0066] Figure 3 FIG. 4 is a schematic diagram of calculating a basic universal hash function MH according to an embodiment of the present invention. DETAILED DESCRIPTION

[0067] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0068] Example 1

[0069] A specific embodiment of the present invention discloses a method for calculating a message authentication code, such as Figure 1 As shown, the following steps are included:

[0070] Step S1: Generate keys HK and LK based on the master key Key, and generate key K based on the master key Key and the one-time number N Tag The master key Key is a shared key set by the message sender and the receiver before the message is sent. The message to be sent is compressed twice using the HK and LK. The one-time number N is set by the message sender.

[0071] Step S2, respectively establish the Toeplize structure of the keys HK and LK to obtain the key matrices {HK[1], HK[i]...HK[ω]} and {LK[1], LK[i]...LK[ω]};

[0072] Step S3: Based on each group of elements HK[i] and LK[i] in the key matrix, compress the message Msg to be sent of any length to obtain ω single compressed messages H i , merge ω of the single compressed messages H i Get the compressed message H; get ω single compressed messages H through ω group elements HK[i] and LK[i] i .

[0073] Step S4: Using the key K Tag The compressed message H is encrypted to obtain a message authentication code Tag.

[0074] Through the above message authentication code algorithm, the keys HK and LK are used to compress the message to be sent with any length, and the key K Tag Encrypted and compressed messages can obtain authentication tags that support the calculation of 64, 128, 192, and 256 bits, have a higher security level, and can resist existing attack technologies.

[0075] Furthermore, in step S1, the key derivation function KDF(K, p, Len) is used to derive the keys HK, LK and the encryption key K Tag The calculation formula is:

[0076] make

[0077] HKlen=512+8(ω-1);

[0078] When n is an even number, LKlen1=4n+8(ω-1),

[0079] Otherwise, LKlen1=4(n+1)+8(ω-1);

[0080] HK=KDF(Key,0 Nlen-1 ||1,HKlen);

[0081] LK=KDF(Key,0 Nlen-2 ||10,LKlen1);

[0082] K Tag =KDF(Key,N,Taglen);

[0083] Among them, HKlen is the bit length of the key HK; LKlen1 is the bit length of the key LK; Taglen is the bit length of the message authentication code, which is a multiple of 64, generally 64, 128, 192 or 256 bits, which is determined by the actual application; KDF(K,p,Len) represents the key derivation function, K,p,Len are the input parameters of the function, which is determined by the actual application; |X| represents the operation of taking the bit length of the bit string X; Indicates the smallest integer operation not less than x; || indicates the bit string concatenation operator; 0 r Represents binary data consisting of r bits of "0".

[0084] It should be noted that the key derivation algorithm KDF can be constructed through the OFB or CTR mode of the block cipher, or by a sequence cipher or a hash cipher, and the specific construction is determined by the actual application; the one-time number N and the master key Key are both bit strings, and the length Nlen of the one-time number N and the length Keylen of the master key are both positive integers. The specific value is determined by the cryptographic algorithm used by the KDF algorithm, and is usually 128 or 256.

[0085] In addition, each time a message is processed, the one-time number N generates a different value, so for the key K Tag Need to be recalculated; however, the keys HK and LK can be reused by saving. When processing different messages, the saved HK and LK can be directly read to improve the efficiency of the algorithm.

[0086] Further, such as Figure 2 As shown in the design framework diagram, the process of steps S2 and S3 is defined as mhHash T , the mhHash T The compressed message H with a length of Taglen is obtained based on the following formula:

[0087] Let H be the empty string;

[0088] For i = 1 to ω, calculate:

[0089] HK[i]=HK[8(i-1)+1,8(i-1)+512];

[0090] If n is an even number, LK[i]=LK[8(i-1)+1,8(i-1)+4n];

[0091] Otherwise, LK[i]=LK[8(i-1)+1,8(i-1)+4(n+1)];

[0092] H=H||mhHash(HK[i],LK[i],Msg);

[0093] Among them, mhHash(K1, K2, Ms) represents a universal hash function for messages of arbitrary length; [i, j] represents the operation of taking the i-th byte to the j-th byte of the key; and the final output result H is the compressed message.

[0094] It should be noted that the function mhHash(K1, K2, Ms) uses K1 and K2 to compress Ms into a 64-bit bit string; K1 is a key parameter, a bit string of 512 bytes in length; K2 is a key parameter, a bit string of LKLen2 bytes in length, and Ms is a message parameter of any length. When n is an even number, LKlen2=4n, otherwise, LKlen2=4(n+1).

[0095] Furthermore, the specific steps of mhHash(HK[i], LK[i], Msg) include:

[0096] Step S31: Divide the message Msg to be sent of any length into blocks of 1024 bytes each to obtain n block messages Msg. j , the expression is:

[0097] Msg=M1||M2||…||M n ,

[0098] When the length of the nth block message is less than 1024 bytes, M is calculated based on the following formula: n Low-order zero padding: M n =M n ||0 q , where q satisfies (|M n |+j) is the smallest integer that is a multiple of 128;

[0099] Through the above operations, each block message can be compressed based on the basic universal hash function MH (K, M).

[0100] Step S32: Based on the element HK[i] in the key matrix, use the basic universal hash function MH(K,M) to convert each of the block messages M into j Compression, combined with the corresponding block message, obtains n random hash results B j , the calculation formula is:

[0101] L i =Bin 64 (|M i |);

[0102]

[0103] Among them, Bin m (x) represents the m-bit binary representation of the integer x, with the high bits filled with 0; MH(K,M) represents the basic universal hash function; Represents a bitwise XOR operation; j = 1, 2, ..., n.

[0104] Step S33: Merge n random results B i , combined with the key LK[i], compression is performed based on the basic universal hash function to obtain a single compressed message H i The calculation formula is:

[0105] When n is an even number:

[0106] H i =MH(LK[i],B1||B2||…||B n );

[0107] otherwise:

[0108]

[0109] Among them, LSB8(X) represents the low-order 8 bytes of the bit string X; is a finite field GF(2 64 ) in multiplication operation, GF(2 64 )=GF(2)[x] / f(x), f(x) is a 64th-degree irreducible polynomial, defined as f(x)=x 64 +x 4 +x 3 +x+1.

[0110] According to the above formula, for the nth random hash result B with less than 64 bits, n ,Through XOR calculation, one low-bit zero padding and two key XOR operations can be reduced, thus improving the compression ,efficiency.

[0111] Further, in step S32, the basic universal hash function MH (K, M) performs a compression calculation on the message parameter M of no more than 1024 bytes by using the key parameter K of 512 bytes to obtain an output result of 64 bits in length; the calculation diagram of the basic universal hash function MH (K, M) is shown in FIG. Figure 3 As shown, the specific steps include:

[0112] Step 321: Divide the message parameter M into blocks of 8 bytes each, and obtain t block sub-messages m of length 8 bytes. i , expressed as:

[0113] M=m1||m2||…||m t ,

[0114] Step 322: Divide the first 4t bytes of the key parameter K into blocks of 8 bytes each to obtain t / 2 8-byte block keys k. i , expressed as: k1||k2||…||k t / 2 ;

[0115] Step 323: Using the block key k i and k i 2 , for t said block sub-messages m i Based on the XOR operation for compression, the calculation formula for the output result is:

[0116]

[0117] Among them, uh is the output result of MH(K,M).

[0118] For example, let X and Y be GF(2 64 ) are two 64-bit strings, then The calculation formula is as follows:

[0119] Let Z = 0 64 , T = X;

[0120] For m = 1, 2, ..., 64, calculate:

[0121] If Bit m (Y) = 1, then let

[0122] If Bit 64 (T) = 1, then let Z = T>>1, otherwise,

[0123] make

[0124] Among them, Bit m(Y) indicates the operation of taking the mth bit of the bit string Y; T>>1 indicates the operation of logically shifting the bit string T right by 1 bit, and the highest bit after the logical right shift by 1 bit is 0;

[0125] Through the design of the basic universal hash function MH(K,M), on the one hand, the block key itself and its square are used to compress the message, which reduces the key size by nearly half; on the other hand, the finite field GF(2 64 ) operations, it has good adaptability to 64-bit software and hardware platforms, and the software and hardware implementation performance is better, especially the speed of square operations is greatly accelerated.

[0126] Furthermore, the calculation formula of the message authentication code Tag in step S4 is:

[0127]

[0128] Compared with the prior art, the message authentication code calculation method provided in this embodiment compresses a message to be sent of any length into a message authentication tag of length Taglen, supports the calculation of 64, 128, 192, and 256-bit authentication tags, has a higher security level, and can resist existing attack technologies; the design of the basic universal hash function adopts the key compression technology, which has a smaller key size on the one hand; on the other hand, the main operation component adopts the finite field GF(2 64 ) multiplication operation, which has good adaptability to 64-bit software and hardware platforms, thereby improving the calculation efficiency of the authentication tag.

[0129] Example 2

[0130] Another specific embodiment of the present invention discloses a communication method of a message authentication calculation method, comprising the following steps:

[0131] Step S1: The sender first generates a one-time number N, and uses the master key Key and the one-time number N shared with the receiver to compress the message Msg to be sent to obtain a message authentication code Tag;

[0132] Step S2, the sending end sends the one-time number N, the message Msg and the message authentication code Tag to the receiving end through a public channel in the form of a message (N, Msg, Tag);

[0133] Step S3: After receiving the message (N, Msg, Tag), the receiving end compresses the received message Msg according to the received one-time number N and the shared master key Key to obtain a message authentication code Tag′;

[0134] Step S4: The receiving end compares Tag′ with the received Tag. If Tag′=Tag, the message is accepted; otherwise, the message is rejected.

[0135] The sending end and the receiving end calculate the message authentication code Tag or the message authentication code Tag′ according to the message authentication code calculation method described in any one of the schemes in Example 1.

[0136] Compared with the prior art, the communication method of a message authentication code provided in this embodiment is a provably secure and efficient authentication method by verifying the received message authentication code at the receiving end, thereby improving the security and communication efficiency of the communication system. It can be used to protect the integrity of data and ensure the authenticity and reliability of the data source. It is applicable to existing network communication systems and mobile communication systems such as 5G and 6G, and can ensure the integrity of data and the authenticity of the source, and prevent illegal users from tampering with the data; it is also applicable to e-commerce systems to ensure the integrity and authenticity of transaction data, prevent data from being tampered with or counterfeited, and protect the privacy and security of users; it can also be applied to data storage systems to prevent data from being tampered with or deleted, and protect data integrity and reliability.

[0137] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0138] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A message authentication code calculation method, It is characterized in that The steps include: Generate keys HK and LK based on the master key Key, and generate key K based on the master key Key and the one-time number N Tag ; Establish the Toeplize structure of the keys HK and LK respectively, and obtain the key matrices {HK[1], HK[i]...HK[ω]} and {LK[1], LK[i]...LK[ω]}; wherein ω is the number of key matrix elements; ω=Taglen / 64, and Taglen is the length of the message authentication code; Based on each group of elements HK[i] and LK[i] in the key matrix, the message Msg to be sent of any length is compressed to obtain ω single compressed messages H i , merge ω of the single compressed messages H i Get the compressed message H; Using the key K Tag The compressed message H is encrypted to obtain a message authentication code Tag.

2. A message authentication code calculation method according to claim 1, It is characterized in that Based on the elements HK[i] and LK[i] in the key matrix, the message Msg to be sent of any length is compressed to obtain the i-th single compressed message H i ,include: The message Msg to be sent of any length is divided into blocks of 1024 bytes each to obtain n block messages M j ; Using the element HK[i], each of the block messages M is compressed based on the basic universal hash function. j , combined with each of the block messages M j , based on the following formula, we get n random results B j : Among them, L j =Bin 64 (|M j |); j = 1, 2, ..., n; Bin m (x) represents the m-bit binary representation of the integer x; |X| represents the operation of obtaining the bit length of the bit string X; MH(K,M) represents the basic universal hash function; is a bitwise XOR operation; Merge n of the above mentioned random results B j Get the message B, use the element LK[i] to compress the message B based on the basic universal hash function, and get the single compressed message H i .

3. A message authentication code calculation method according to claim 2, It is characterized in that The single compressed message H i The calculation formula is: If n is even, H i =MH(LK[i],B 1 ||B 2 ||…||B n ); otherwise, k = LSB 8 (LK[i]); Among them, || represents the bit string concatenation operator; LSB 8 (X) represents the lower 8 bytes of the bit string X; is a finite field GF(2 64 )=GF(2)[x] / f(x), f(x)=x 64 +x 4 +x 3 +x+1.

4. A message authentication code calculation method according to claim 2, It is characterized in that The calculation process of the basic universal hash function MH(K,M) includes: Divide the message parameter M into blocks of 8 bytes each, and obtain t block sub-messages m i , and M = m 1 ||m 2 ||…||m t ,|| represents the bit string concatenation operator; The first 4t bytes of the key parameter K are divided into blocks of 8 bytes each to obtain t / 2 block keys k i ; Using the block key k i and k i 2 , for t said block sub-messages m i Compression is performed based on XOR operation to obtain the output result.

5. A message authentication code calculation method according to claim 4, It is characterized in that The expression of the output result is: Among them, uh is the output result of the basic universal hash function MH(K,M); is a finite field GF(2 64 )=GF(2)[x] / f(x), f(x)=x 64 +x 4 +x 3 +x+1.

6. A message authentication code calculation method according to claim 5, It is characterized in that The finite field GF(2 64 )=GF(2)[x] / f(x) The calculation process of the multiplication operation includes: Let X and Y be GF(2 64 ) in two 64-bit strings, then The calculation formula is as follows: Let Z = 0 64 , T = X; For m = 1, 2, ..., 64, calculate: If Bit m (Y) = 1, then let If Bit 64 (T) = 1, then let Z = T>>1, otherwise, make Among them, Bit m (Y) indicates the operation of taking the mth bit of the bit string Y; T>>1 indicates the operation of logically shifting the bit string T right by 1 bit, and the highest bit after the logical right shift by 1 bit is 0.

7. A message authentication code calculation method according to any one of claims 1 to 6, It is characterized in that The keys HK, LK and K Tag The calculation formula is: HK=KDF(Key,0 Nlen-1 ||1,HKlen); LK=KDF(Key,0 Nlen-2 ||10,LKlen); K Tag =KDF(Key,N,Taglen); HKlen=512+8(ω-1); If n is an even number, LKlen = 4n + 8 (ω-1); otherwise, LKlen = 4 (n + 1) + 8 (ω-1); Wherein, HKlen is the bit length of the key HK; LKlen is the bit length of the key LK; KDF(K,p,Len) represents the key derivation function, K,p,Len are the input parameters of the function; r Represents binary data consisting of r bits of "0"; || represents the bit string concatenation operator; |X| represents the operation of taking the bit length of the bit string X; It represents the operation of finding the smallest integer not less than x.

8. A message authentication code calculation method according to claim 7, It is characterized in that The calculation formula of the message authentication code Tag is: in, It is a bitwise XOR operation.

9. A message authentication code calculation method according to claim 1, It is characterized in that The calculation formula of the Toeplize structure is: HK[i]=HK[8(i-1)+1,8(i-1)+512]; If n is an even number, LK[i]=LK[8(i-1)+1,8(i-1)+4n]; Otherwise, LK[i]=LK[8(i-1)+1,8(i-1)+4(n+1)]; Wherein, i=1, 2, ..., ω; K[i, j] represents the operation of taking the i-th byte to the j-th byte of the key K.

10. A communication method using a message authentication code, comprising the following steps: The sender generates a one-time number N, and obtains the message authentication code Tag based on the master key Key shared with the receiver, the one-time number N, and the message Msg to be sent; The sending end sends the one-time number N, the message Msg and the message authentication code Tag to the receiving end through a public channel in the form of a message (N, Msg, Tag); After receiving the message (N, Msg, Tag), the receiving end obtains the message authentication code Tag′ according to the received one-time number N, the message Msg and the shared master key Key; The receiving end compares the message authentication code Tag′ with the received message authentication code Tag, and if Tag′=Tag, the message is accepted; Otherwise, reject the message; The sending end and the receiving end calculate the message authentication code Tag or the message authentication code Tag′ according to the message authentication code calculation method according to any one of claims 1-9.