A data plane cipher processing method based on in-chip MAC-CCP cooperation

By establishing an on-chip secure collaborative interface and context description structure between the network interface control module and the cryptographic coprocessor module, the problem of lacking on-chip MAC-CCP collaborative processing in the prior art is solved, realizing a unified on-chip collaborative design for multi-protocol secure processing, and improving the efficiency and security of data plane cryptographic processing.

CN122909044BActive Publication Date: 2026-11-27SHEN ZHEN SKYSI WISDOM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611398566.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-09-10
Publication Date
2026-11-27
Estimated Expiration
2046-09-10

AI Technical Summary

Technical Problem

Existing technologies lack an on-chip MAC-CCP collaborative data plane processing architecture, which cannot achieve collaborative processing of different security protocols such as MACsec and IPSec on a unified on-chip cryptographic resource. This results in a long data plane processing path and a lack of hardware binding mechanism between network packets and cryptographic security context.

Method used

By constructing a control plane based on a network interface control module and a cryptographic coprocessor module, an on-chip secure collaborative interface is established. The binding of network packets and cryptographic resources is realized using a context description structure and a security context table. Cryptographic task descriptors are generated and cryptographic processing is performed under the on-chip collaborative interface.

Benefits of technology

Hardware binding of network packets to cryptographic security contexts is achieved, reducing external data interaction, lowering the risk of sensitive data exposure, and improving the efficiency and security of cryptographic processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122909044B_ABST
    Figure CN122909044B_ABST
Patent Text Reader

Abstract

The application discloses a data plane password processing method based on on-chip MAC-CCP cooperation, relates to the technical field of network security and the technical field of processor chip architecture design, and comprises the following steps: constructing a control plane, loading original key resources and a security context table, and establishing an on-chip password processing environment; receiving a network message based on a network interface control module, obtaining a security context index according to the network message; obtaining a password task descriptor based on the security context index, and transmitting the password task descriptor to a password coprocessor module based on an on-chip security cooperation interface; performing a password processing operation on the password task descriptor based on the password coprocessor module, updating the security context table based on a password processing result, and transmitting the processed network message back to the network interface control module. The application is used to solve the problems that there is no on-chip MAC-CCP cooperative data plane processing architecture in the prior art, and there is no unified on-chip cooperation mechanism for multi-protocol security processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of network security technology and processor chip architecture design technology, and more specifically, to a data plane cryptographic processing method based on on-chip MAC-CCP collaboration. Background Technology

[0002] With the continuous growth of network bandwidth and the increasing complexity of network security services, cryptographic protection technologies such as IPSec and MACSec have been widely applied in network communication equipment, data centers, and cloud security infrastructure. The performance of cryptographic processing on the network data plane has gradually become a crucial factor affecting system throughput and response latency. While existing solutions have addressed issues such as accelerated cryptographic computation, network offloading, and security protocol processing, they still have the following shortcomings in on-chip MAC-CCP collaborative data plane cryptographic processing: (1) Existing solutions mainly focus on improving the performance of cryptographic devices, offloading network processing and accelerating cryptographic algorithms. They lack an on-chip MAC-CCP collaborative data plane processing architecture. Moreover, existing solutions usually rely on the CPU to complete security policy queries, key association and cryptographic task construction. They lack a hardware binding mechanism for network packets and cryptographic security contexts, resulting in a long data plane processing path. (2) Existing technologies are usually optimized for a single protocol and cannot achieve collaborative processing of different security protocols such as MACsec and IPSec on a unified on-chip cryptographic resource. They lack a unified on-chip collaborative mechanism for multi-protocol security processing.

[0003] To address the aforementioned shortcomings, there is an urgent need for a data plane cryptographic processing method based on on-chip MAC-CCP collaboration. Summary of the Invention

[0004] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a data plane cryptographic processing method based on on-chip MAC-CCP collaboration, in order to solve the problems of the lack of an on-chip MAC-CCP collaborative data plane processing architecture and the lack of a unified on-chip collaborative mechanism for multi-protocol security processing in the prior art.

[0005] To achieve the above objectives, this application provides the following technical solution: This invention provides a data plane cryptographic processing method based on on-chip MAC-CCP collaboration, comprising: constructing a control plane based on a network interface control module and a cryptographic coprocessor module, establishing an on-chip secure collaborative interface between the two, establishing a context description structure including a protocol type field, a key handle field, and an algorithm type field according to a preset network security protocol, establishing a security context based on the context description structure and original key resources, including at least key handle, sequence number status, anti-replay status, and cryptographic status information, and establishing an on-chip cryptographic processing environment based on a security context table composed of all security contexts; receiving network packets based on the network interface control module, and processing the network packets... The system performs feature parsing to generate message descriptors, and queries the security context table based on the message descriptors to obtain the security context index corresponding to the network message. Based on the security context index, it obtains cryptographic resource information, associates the cryptographic resource information with the message descriptors to generate a cryptographic task descriptor, and transmits it to the cryptographic coprocessor module via the message data channel, security context association channel, and cryptographic task channel of the on-chip security collaboration interface. The cryptographic coprocessor module performs cryptographic processing operations on the cryptographic task descriptor to obtain the cryptographic processing result of the network message. Based on the cryptographic processing result, it updates the security context table and transmits the cryptographically processed network message back to the network interface control module.

[0006] In a preferred embodiment, the control plane is constructed based on the network interface control module and the cryptographic coprocessor module, including: initializing the network interface control module and the cryptographic coprocessor module, and establishing an on-chip secure collaborative interface between the network interface control module and the cryptographic coprocessor module after initialization; and constructing the control plane based on the on-chip secure collaborative interface and the network interface control module and the cryptographic coprocessor module after initialization.

[0007] In a preferred embodiment, the network interface control module receives network packets and performs feature parsing on the network packets to generate a message descriptor. This includes: caching the received network packets based on the network interface control module and obtaining the input data, output data, data length, and packet cache location of the network packets; performing feature parsing on the network packets to obtain the packet data, protocol type, flow identifier, and security identifier in the network packets; and generating a message descriptor corresponding to the network packets based on the packet data, protocol type, flow identifier, and security identifier. The message descriptor also includes a reserved fixed field for storing a security context index.

[0008] In a preferred embodiment, querying the security context table based on the message descriptor to obtain the security context index corresponding to the network packet includes: obtaining the flow identifier and security identifier in the message descriptor; using the flow identifier and security identifier as query keywords to perform a security context matching query in the security context table; obtaining the security context index corresponding to the network packet based on the matched security context; and writing the security context index into a reserved fixed field in the message descriptor; the security context index includes the location information of the security context in the security context table and cryptographic resource information.

[0009] In a preferred embodiment, obtaining cryptographic resource information corresponding to a network packet based on the security context index, and associating the cryptographic resource information with a packet descriptor to obtain a cryptographic task descriptor includes: reading the corresponding cryptographic resource information from a security context table based on the security context index, wherein the cryptographic resource information includes a security context identifier, a cryptographic algorithm identifier, a key handle, and cryptographic state index information; obtaining the input data address, output data address, and data length from the packet descriptor, and associating and binding the cryptographic resource information with the input data address, output data address, and data length from the packet descriptor to generate a cryptographic task descriptor; wherein the cryptographic task descriptor includes the input data address, output data address, data length, algorithm type, operation type, security context index, key handle, and cryptographic state index information.

[0010] In a preferred embodiment, the data is transmitted to the cryptographic coprocessor module via the message data channel, security context association channel, and cryptographic task channel of the on-chip security collaboration interface, including: the message data channel for transmitting message descriptors of network messages, the security context association channel for transmitting cryptographic resource information corresponding to network messages, and the cryptographic task channel for transmitting cryptographic task descriptors.

[0011] In a preferred embodiment, the cryptographic processing result of the network packet is obtained by performing cryptographic processing operations on the cryptographic task descriptor according to the cryptographic coprocessor module, including: the cryptographic coprocessor module extracting cryptographic processing information based on the cryptographic task descriptor, the cryptographic processing information including data input address, data length, output data address, cryptographic algorithm identifier, operation type identifier, key handle, security context index, and cryptographic state index information; performing at least one cryptographic operation on the cryptographic processing information according to the cryptographic coprocessor module, including data encryption, data decryption, integrity authentication, and message digest calculation, to obtain the cryptographic processing result; the cryptographic processing result includes the encryption completion status, decryption completion status, integrity verification result, sequence number update information, and cryptographic context update information of the network packet.

[0012] In a preferred embodiment, updating the security context table based on the cryptographic processing result includes: after obtaining the cryptographic processing result based on the cryptographic coprocessor module, transmitting the cryptographic processing result to the network interface control module through the on-chip security collaboration interface; extracting state update information based on the cryptographic processing result, and updating the cryptographic state information in the security context based on the state update information, wherein the cryptographic state information includes the current sequence number, the anti-replay window state, and the intermediate calculation state.

[0013] In a preferred embodiment, transmitting the password-processed network packet back to the network interface control module includes: obtaining the original encapsulation parameters of the network packet and obtaining the protocol type based on the packet descriptor corresponding to the network packet; determining the packet encapsulation format of the network packet based on the protocol type, and encapsulating the network packet according to the packet encapsulation format and the original encapsulation parameters to obtain the corresponding transmission packet; and sending the encapsulated transmission packet to the network link through the physical interface.

[0014] The beneficial effects of this invention are: 1. This invention constructs a control plane based on a network interface control module and a cryptographic coprocessor module. Based on the control plane, it loads the original key resources and security context table, and establishes an on-chip cryptographic processing environment. Based on the on-chip cryptographic processing environment, it builds an on-chip MAC-CCP collaborative data plane processing architecture. In addition, based on the network interface control module, it receives network packets, performs feature parsing on the network packets to generate packet descriptors, and queries the security context table based on the packet descriptors to obtain the security context index corresponding to the network packet. The security context index is used to realize the binding mechanism between network packets and cryptographic security context.

[0015] 2. This invention obtains cryptographic resource information corresponding to network packets based on a security context index, associates the cryptographic resource information with packet descriptors to obtain a cryptographic task descriptor, and transmits the cryptographic task descriptor to a cryptographic coprocessor module based on a preset on-chip security collaboration interface. In addition, the cryptographic coprocessor module performs cryptographic processing operations on the cryptographic task descriptor to obtain the cryptographic processing result of the network packets. Based on the cryptographic processing result, the security context table is updated, and the cryptographically processed network packets are transmitted back to the network interface control module. This realizes an on-chip collaborative design that performs multi-protocol secure processing of network interface processing, security context management, and cryptographic calculation processes, reducing external data interaction in the cryptographic processing process and lowering the risk of sensitive data exposure. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating a data plane cryptographic processing method based on on-chip MAC-CCP collaboration; Figure 2This is a schematic diagram illustrating the implementation process of a data plane cryptographic processing method based on on-chip MAC-CCP collaboration. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0018] Example 1, please refer to Figure 1 , Figure 1 This invention presents a data plane cryptographic processing method based on on-chip MAC-CCP collaboration, comprising the following steps: S1. Construct a control plane based on the network interface control module and the cryptographic coprocessor module, and establish an on-chip security collaboration interface between the two. Establish a context description structure containing protocol type field, key handle field and algorithm type field according to the preset network security protocol. Establish a security context based on the context description structure and the original key resources, including at least key handle, sequence number status, anti-replay status and cryptographic status information. Establish an on-chip cryptographic processing environment based on the security context table composed of all security contexts. S2. The network interface control module receives network packets, performs feature parsing on the network packets to generate packet descriptors, and queries the security context table based on the packet descriptors to obtain the security context index corresponding to the network packets. S3. Obtain cryptographic resource information based on the security context index, associate the cryptographic resource information with the message descriptor to generate a cryptographic task descriptor, and transmit it to the cryptographic coprocessor module through the message data channel, security context association channel and cryptographic task channel of the on-chip security collaboration interface. S4. Perform cryptographic processing operations on the cryptographic task descriptor according to the cryptographic coprocessor module, obtain the cryptographic processing result of the network packet, update the security context table based on the cryptographic processing result, and transmit the cryptographically processed network packet back to the network interface control module.

[0019] Please see Figure 2 , Figure 2 This is a schematic diagram of the implementation process of the present invention. Figure 2This invention constructs an on-chip cryptographic processing environment through the collaborative capabilities of the network interface control module and the cryptographic coprocessor module within the processor chip. This enables network packets to complete network packet reception, security context matching, cryptographic task descriptor generation, cryptographic calculation, cryptographic state information updating, and packet transmission processing within the processor chip. Furthermore, this invention is applicable to, but not limited to: heterogeneous processor architectures integrating a network interface control module and a cryptographic coprocessor; secure communication devices supporting network security protocols such as IPSec and MACsec; VPN gateways and network security devices; data center security processing platforms; smart network interface cards and network offloading devices; cloud computing security infrastructure; and high-speed embedded network security systems. It should be noted that the network interface control module and the cryptographic coprocessor module can also be abbreviated as the MAC module and the CCP module, respectively.

[0020] S1-S4 are as follows: S1. Construct a control plane based on the network interface control module and the cryptographic coprocessor module, and establish an on-chip security collaboration interface between the two. Establish a context description structure containing protocol type field, key handle field and algorithm type field according to the preset network security protocol. Establish a security context based on the context description structure and the original key resources, including at least key handle, sequence number status, anti-replay status and cryptographic status information. Establish an on-chip cryptographic processing environment based on the security context table composed of all security contexts.

[0021] S11. Construct a control plane based on the network interface control module and the cryptographic coprocessor module, including: S111. Initialize the network interface control module and the cryptographic coprocessor module, and establish an on-chip secure collaborative interface between the network interface control module and the cryptographic coprocessor module after initialization.

[0022] In this embodiment, after the processor starts up, the network interface control module is initialized through the control plane firmware. Specifically, the physical interface parameters of the network interface control module (such as rate, duplex mode, and flow control enable) are configured; the start address and depth of the receive buffer and transmit buffer of the network interface control module in the on-chip storage are configured; the packet filtering rules of the network interface control module (such as receiving all packets or only receiving packets of a specified Ethernet type) are configured; the data path between the network interface control module and the on-chip secure collaboration interface is enabled; and the network interface control module is reset and released, so that it enters the packet transmission and reception ready state.

[0023] In this embodiment, the cryptographic coprocessor module is initialized through the control plane firmware, specifically by: loading the microcode or firmware of the cryptographic coprocessor module (if the CCP is a programmable architecture); configuring the operating mode of the cryptographic algorithm engine (AES, SM4, SHA, etc.) of the cryptographic coprocessor module; configuring the starting address and depth of the input / output buffer of the cryptographic coprocessor module in on-chip storage; configuring the task receiving path and status feedback path between the cryptographic coprocessor module and the on-chip secure collaboration interface; and completing the reset and release of the cryptographic coprocessor module, enabling it to enter the cryptographic computation ready state.

[0024] In this embodiment, the on-chip secure collaborative interface is used to connect the network interface control module and the cryptographic coprocessor module, and to establish a low-latency cryptographic data path within the processor chip to achieve on-chip collaborative transmission between the network interface control module and the cryptographic coprocessor module.

[0025] S112. Construct a control plane based on the on-chip secure collaborative interface, as well as the network interface control module and cryptographic coprocessor module after initialization.

[0026] In this embodiment, the control plane is controlled based on the control plane firmware.

[0027] S12. Load the original key resources and security context table based on the control plane, and establish an on-chip cryptographic processing environment, including: S121. Load the raw key resources of the control plane.

[0028] In this embodiment, loading the original key resources of the control plane refers to the control plane firmware securely loading the original key materials required for cryptographic calculation into the preset on-chip secure key storage area in the cryptographic coprocessor module. Specifically, this includes: (1) the control plane transmits key materials (such as a 32-byte key of AES-256, a 16-byte key of SM4, a 32-byte key of HMAC-SHA256, etc.) to the cryptographic coprocessor module through a secure channel; (2) the cryptographic coprocessor module stores the received key materials in the on-chip secure key storage area; (3) the cryptographic coprocessor module generates a unique key handle for each loaded key material and returns the key handle to the control plane; (4) the key material itself does not leave the on-chip secure key storage area of ​​the cryptographic coprocessor module after loading is completed, and is only referenced through the key handle in subsequent cryptographic calculations.

[0029] S122. Establish a context description structure based on a preset network security protocol. The context description structure shall include at least a protocol type field, a key handle field, and an algorithm type field.

[0030] In this embodiment, the control plane selects the corresponding context description structure template according to the preset network security protocol. The types of network security protocols include IPSec security protocol and MACsec security protocol. The template of the context description structure corresponding to IPSec security protocol is the IPSec template, and the template of the context description structure corresponding to MACsec security protocol is the MACsec template.

[0031] S123. Based on the context description structure and the original key resources, establish the security context corresponding to each security association in the network security protocol. The security context shall include at least the security association identifier, the network security protocol type, the cryptographic algorithm type, and the key index information.

[0032] In this embodiment, before establishing the context description structure according to the preset network security protocol, the control plane obtains the pre-configured security policy information in the original key resources. The security policy information includes: the type of network security protocol to be used (such as IPSec or MACsec), the type of cryptographic algorithm (AES-GCM, AES-CBC, SM4-CBC, etc.), the key handle, the initial sequence number, the anti-replay window bitmap, and other information. The obtained security policy information is then filled into the template of the context description structure to generate a security context in a unified format. After the security context is generated, the control plane assigns a unique security context index to each security context.

[0033] It should be noted that in network security protocols, a security association refers to a set of security parameters set by the two communicating parties to establish a secure data transmission channel. It includes at least a security parameter index or association number, encryption algorithm type, decryption algorithm type, integrity algorithm type, key handle, and current sequence number. Each security association uniquely corresponds to a security context.

[0034] S124. Based on all security contexts, a security context table is formed, and an on-chip cryptographic processing environment is established based on the security context table and the control plane.

[0035] In this embodiment, the security context table contains all security contexts. After the security context table is generated, the control plane configures the base address and number of entries of the security context table in the on-chip storage to the on-chip security collaboration interface, so that the on-chip security collaboration interface can independently query the security context table based on the message descriptor.

[0036] In this embodiment, for a security context that supports anti-replay detection, the control plane initializes its corresponding anti-replay window bitmap and writes the starting address and window size of the anti-replay window bitmap into the anti-replay state field of the security context.

[0037] It should be noted that the anti-replay window bitmap is stored in the security context. Specifically, the anti-replay window bitmap is a bitmap of a binary array, implemented using a sliding window mechanism. Its structural parameters include window size, left boundary, and right boundary. The window size is usually 32, 64, or 128, with the unit being the number of packets. For example, a window size of 64 indicates that only the 64 most recently received sequence numbers are recorded. The left boundary is the smallest sequence number in the current window, and the right boundary is the largest sequence number in the current window. The relationship between the right boundary and the left boundary is that the value of the right boundary is equal to the value of the left boundary plus the window size minus 1.

[0038] The judgment logic of the anti-replay window bitmap is as follows: If the sequence number of the network packet received by the anti-replay window bitmap is less than its left boundary, the sequence number of the network packet is discarded; if the sequence number of the network packet received by the anti-replay window bitmap is greater than its right boundary, the sequence number of the network packet is calculated by subtracting the window size from the sequence number of the network packet and adding 1, and the left boundary is moved to this value to slide the window of the anti-replay window bitmap to the right, and the sequence number of the network packet is registered in the new window; if the sequence number of the network packet received by the anti-replay window bitmap is within the anti-replay window bitmap, the corresponding bit of the sequence number in the bitmap is checked. If the corresponding bit is 0, it is recorded as 1, indicating that the network packet is received normally. If the corresponding bit is 1, it indicates that the sequence has been received and the network packet is a duplicate reception. At this time, the anti-replay mechanism is triggered to discard the sequence number of the packet, and the sequence number status in the security context is not updated.

[0039] In this embodiment, the anti-replay window bitmap is specifically applied as follows: When a sequence number is received from the sequence number update information returned by the cryptographic coprocessor module, the hardware logic automatically calculates the offset between the sequence number and the left boundary of the window, and checks the value of the corresponding bit in the bitmap. If the value of the corresponding bit in the bitmap is 0, the position is changed to 1 and the sequence number is received; if the value of the corresponding bit in the bitmap is 1, the sequence number is determined to be a replay reception, the sequence number is discarded, and the sequence number state is not updated. When the received sequence number exceeds the right boundary of the window, the hardware logic automatically slides the entire window to the right and records the bitmap position corresponding to the new sequence number as 1. All of the above operations are automatically completed by the on-chip hardware state machine without software intervention.

[0040] S2. The network interface control module receives network packets, performs feature parsing on the network packets to generate packet descriptors, and queries the security context table based on the packet descriptors to obtain the security context index corresponding to the network packets.

[0041] S21. Based on the network interface control module receiving network packets, perform feature parsing on the network packets to generate packet descriptors, including: S211. The network interface control module buffers the received network packets and obtains the input data, output data, data length, and packet buffer location of the network packets.

[0042] In this embodiment, after the network interface control module detects a valid data frame on the network link, it starts receiving network packets and performs CRC check and length check on the received network packets. Invalid network packets that fail the check or have abnormal length are discarded. Network packets that pass the check are written into the on-chip receive buffer, and the starting address, data length, receive port number and receive timestamp of the network packets that pass the check are recorded in the on-chip receive buffer. The on-chip receive buffer is located inside the network interface control module or in the on-chip shared SRAM, and is dedicated to the network interface control module or shared with the on-chip security collaboration interface.

[0043] S212. Perform feature parsing on network packets to obtain the packet data, protocol type, flow identifier, and security identifier in the network packets.

[0044] In this embodiment, feature parsing of network packets is performed, specifically as follows: (1) Parse the Ethernet type field of the network packet to determine the network layer protocol type encapsulated in the network packet. The network layer protocol type can include IPv4, IPv6, IPSec, and MACsec. For network packets of IPv4 / IPv6 protocol type, extract the source IP address, destination IP address, and protocol field. If the protocol field indicates that the packet is encapsulated with security payload or association number, the protocol type of the network packet is determined to be an IPSec encrypted packet, and its security parameter index value is extracted as a security identifier. For network packets of MACsec protocol type, parse its association number as a security identifier and obtain the parsing result.

[0045] (2) Construct a flow identifier based on the parsing result to quickly locate the corresponding security context in the security context table. For network packets of the IPSec protocol, the flow identifier is composed of the following fields: protocol type + source IP address + destination IP address + security parameter index value or protocol type + destination IP address + security parameter index value, forming a variable-length or fixed-length flow identifier. For network packets of the MACsec protocol, the flow identifier is composed of the following fields: security channel identifier + association number.

[0046] It should be noted that, in order to facilitate fast table lookup, the stream identifier can be hashed and compressed into a fixed-width (such as 32-bit or 64-bit) hardware stream identifier.

[0047] S213. Generate a message descriptor corresponding to the network message based on the message data, protocol type, flow identifier, and security identifier. The message descriptor also includes a reserved fixed field for storing the security context index.

[0048] In this embodiment, the message descriptor is a data structure with a fixed bit width (such as 128 bits or 256 bits), which is generated by organizing and laying out message data, protocol type, flow identifier and security identifier according to a predefined field layout. That is, the message descriptor contains fields corresponding to message data, protocol type, flow identifier and security identifier.

[0049] S22. Query the security context table based on the message descriptor to obtain the security context index corresponding to the network message, including: S221. Obtain the flow identifier and security identifier from the message descriptor, and use the flow identifier and security identifier as query keywords to perform a security context matching query in the security context table.

[0050] In this embodiment, obtaining the flow identifier and security identifier in the message descriptor specifically involves: reading the flow identifier field in the message descriptor, which is a fixed-width (e.g., 32-bit) hardware flow identifier; reading the security identifier field in the message descriptor; and reading the protocol type field in the message descriptor to determine the security context table partition to be queried (e.g., IPSec partition or MACSec partition).

[0051] In this context, a security context table partition refers to a protocol partition within the security context specifically used to store the security associations corresponding to the same network security protocol (such as IPSec or MACsec). In this embodiment, the security context table partitions include an IPSec partition and a MACsec partition. The IPSec partition contains the security contexts of all IPSec protocols, and the MACsec partition contains the security contexts of all MACsec protocols. It should be noted that the security context table is divided into multiple security context table partitions during the initialization phase; in this embodiment, the security context table partitions include IPSec and MACsec partitions.

[0052] It should be noted that, based on the security context table partitioning settings, when reading the protocol type field in the packet descriptor, the corresponding protocol partition can be selected according to the direct protocol type field. Specifically, if the protocol type field indicates IPSec, the hardware lookup engine locates the base address of the IPSec partition and uses the number of entries in that partition as the search range; if the protocol type indicates MACsec, it locates the base address of the MACsec partition. Through the security context table partitioning mechanism, the security contexts corresponding to security associations of different protocols are isolated from each other in terms of storage space and search path. This not only avoids matching ambiguities caused by different lengths of key fields such as security parameter indexes and association numbers, but also reduces the traversal range of a single search, improving the processing efficiency of the hardware pipeline.

[0053] In this embodiment, the security context matching query is performed in the security context table using the flow identifier and security identifier as query keywords. Specifically, the corresponding security context table partition, starting address, and number of entries in the security context table partition are located based on the protocol type. Then, the flow identifier or security identifier is used as the query keyword to perform a matching search within the corresponding security context table partition. The search method adopts any one or a combination of the following: Direct index search: If the flow identifier is a direct index value, the flow identifier is directly used as the index offset of the security context table to locate the corresponding table entry within a single period; Hash search: If the flow identifier is a hash compressed value, the hash value is used as the index to locate the candidate table entry, and a precise match is confirmed by the conflict resolution field; Content association search: The security identifier is used as the primary keyword to perform content association matching, and the security identifier field in the security context table is traversed or compared in parallel.

[0054] It should be noted that if a unique matching security context is found, the security context index corresponding to the network packet is obtained based on the matching security context; if no matching security context is found, the network packet is marked as "match failed, discard", and the network packet will not proceed to subsequent steps, but will be directly discarded by the network interface control module or sent to the control plane.

[0055] S222. Obtain the security context index corresponding to the network packet based on the security context obtained from the matching query, and write the security context index into the reserved fixed field in the packet descriptor.

[0056] In this embodiment, each security context in the security context table corresponds to a unique security context index, and the security context index corresponding to the network packet can be obtained based on the security context obtained by matching the query.

[0057] It should be noted that the security context index is written into a reserved fixed field in the message descriptor. This writing operation is completed before the generation of the cryptographic task descriptor. This ensures that subsequent steps can directly obtain the security context index when reading the message descriptor. Furthermore, the security context index adopts a fixed bit-width encoding format (such as 16-bit or 32-bit) to facilitate rapid parsing and use by subsequent hardware.

[0058] S223. The security context index contains information about the location of the security context in the security context table and cryptographic resource information.

[0059] In this embodiment, the physical location of the security context in the security context table is specifically the entry number or the starting address offset; the cryptographic resource information of the security context in the security context table specifically includes the location of the key handle, algorithm type, and cryptographic state information in the relevant storage area of ​​the cryptographic coprocessor module.

[0060] S3. Obtain cryptographic resource information based on the security context index, associate the cryptographic resource information with the message descriptor to generate a cryptographic task descriptor, and transmit it to the cryptographic coprocessor module through the message data channel, security context association channel and cryptographic task channel of the on-chip security collaboration interface.

[0061] S31. Obtain the cryptographic resource information corresponding to the network packet based on the security context index, and associate the cryptographic resource information with the packet descriptor to obtain the cryptographic task descriptor, including: S311. Based on the security context index, read the corresponding cryptographic resource information from the security context table. The cryptographic resource information includes the security context identifier, cryptographic algorithm identifier, key handle, and cryptographic state index information.

[0062] In this embodiment, the encoded structure of the security context index is parsed to extract the entry number of the security context in the security context table and the corresponding cryptographic resource location information. The cryptographic resource location information includes the storage location of the key handle, algorithm type, and cryptographic state information. Based on the entry number, the corresponding entry of the security context in the security context table is located, and the following cryptographic resource information is read from the corresponding entry: security context identifier, which is a unique identifier for security association, used for association and traceability; cryptographic algorithm identifier, which indicates the type of algorithm to be executed by the cryptographic coprocessor module, including but not limited to AES-GCM-256, AES-CBC-128, SM4-CBC, SM4-GCM, etc.; key handle, which refers to the handle value pointing to the original key material in the on-chip secure key storage area; and cryptographic state index information, which points to the storage location of the cryptographic state information (such as sequence number, anti-replay window bitmap, etc.) of the current security context.

[0063] S312. Obtain the input data address, output data address, and data length from the message descriptor. Associate and bind the cryptographic resource information with the input data address, output data address, and data length from the message descriptor to generate a cryptographic task descriptor. The cryptographic task descriptor includes the input data address, output data address, data length, algorithm type, operation type, security context index, key handle, and cryptographic state index information.

[0064] In this embodiment, cryptographic resource information is associated with message descriptors to generate a standard format cryptographic task descriptor. The cryptographic task descriptor is a hardware data structure with a fixed bit width (such as 256 bits or 512 bits). Specifically, the cryptographic resource information is organized into a cryptographic task descriptor according to a predefined field layout. The predefined field layout includes the field name and bit width corresponding to each parameter information in the cryptographic resource information.

[0065] S32. Based on a preset on-chip secure co-processor interface, the cryptographic task descriptor is transmitted to the cryptographic coprocessor module, including: S321. The on-chip security collaboration interface adopts a multi-channel collaborative transmission structure, including a message data channel, a security context association channel, and a cryptographic task channel.

[0066] In this embodiment, the on-chip secure collaborative interface is used to connect the network interface control module and the cryptographic coprocessor module, and to establish a low-latency cryptographic data path within the processor chip to achieve on-chip collaborative transmission between the network interface control module and the cryptographic coprocessor module.

[0067] It should be noted that the on-chip security collaboration interface differs from traditional data transmission interfaces. It simultaneously supports the transmission of network packet data, cryptographic task descriptions, and security context association information, enabling data collaboration between the network interface control module and the cryptographic coprocessor module.

[0068] S322. The message data channel is used to transmit the message descriptor of network messages, the security context association channel is used to transmit the cryptographic resource information corresponding to the network message, and the cryptographic task channel is used to transmit the cryptographic task descriptor.

[0069] It should be noted that, through the on-chip secure collaborative interface of the multi-channel collaborative transmission structure between the network interface control module and the cryptographic coprocessor module, network packets, security contexts, and cryptographic task descriptors can be synchronously transmitted within the processor chip, realizing data association between network packets and cryptographic computing resources.

[0070] S4. Perform cryptographic processing operations on the cryptographic task descriptor according to the cryptographic coprocessor module, obtain the cryptographic processing result of the network packet, update the security context table based on the cryptographic processing result, and transmit the cryptographically processed network packet back to the network interface control module.

[0071] S41. Perform cryptographic processing operations on the cryptographic task descriptor according to the cryptographic coprocessor module to obtain the cryptographic processing result of the network packet, including: S411, the cryptographic coprocessor module extracts cryptographic processing information based on the cryptographic task descriptor. The cryptographic processing information includes data input address, data length, output data address, cryptographic algorithm identifier, operation type identifier, key handle, security context index, and cryptographic state index information.

[0072] In this embodiment, the cryptographic processing information specifically includes the following: data input address, which refers to the starting position of the data to be processed in the on-chip storage; data length, which refers to the byte length of the data to be processed; output data address, which refers to the position where the processing result is written to the on-chip storage; cryptographic algorithm identifier, which refers to the identifier information generated based on the algorithm type (AES-GCM-256, SM4-CBC, AES-GCM-128, etc.); operation type identifier, which refers to the identifier information generated by operation types such as encryption, decryption, and integrity verification; key handle, which refers to the handle pointing to the original key material in the on-chip secure key storage area; security context index, used for locating during state write-back; and cryptographic state index information, which refers to the location of the cryptographic state storage associated with the current security.

[0073] S412. Perform at least one cryptographic operation on the cryptographic processing information, including data encryption, data decryption, integrity authentication, and message digest calculation, based on the cryptographic coprocessor module, to obtain the cryptographic processing result.

[0074] In this embodiment, before performing cryptographic operations, the cryptographic coprocessor module needs to extract the original key material from the on-chip secure key storage area according to the key handle, and select the corresponding cryptographic calculation engine according to the cryptographic algorithm identifier.

[0075] Specifically, the process of retrieving the original key material from the on-chip secure key storage area based on the key handle involves receiving the key handle from the cryptographic processing information, locating it in the on-chip secure key storage area based on the key handle, and retrieving the corresponding original key material (such as a 32-byte key for AES-256, a 16-byte key for SM4, etc.) from the on-chip secure key storage area.

[0076] Specifically, the corresponding cryptographic calculation engine is selected based on the cryptographic algorithm identifier, as follows: if the cryptographic algorithm identifier is AES-GCM-256 or AES-GCM-128, the AES-GCM engine is selected; if the cryptographic algorithm identifier is AES-CBC-128, the AES-CBC engine is selected; if the algorithm identifier is SM4-CBC, the SM4-CBC engine is selected; if the cryptographic algorithm identifier is SM4-GCM, the SM4-GCM engine is selected; if the cryptographic algorithm identifier is SHA-256 or SHA-384, the HASH engine (used for integrity calculation) is selected; if the cryptographic algorithm identifier is other values, the corresponding algorithm engine is selected or an algorithm-unsupported exception is triggered.

[0077] In this embodiment, the cryptographic calculation engine reads the input data from the cryptographic processing information in the input buffer and performs the corresponding cryptographic operation according to the operation type. The encryption operation refers to encrypting the plaintext data in the input data using the extracted key material and generating ciphertext data; the decryption operation refers to decrypting the ciphertext data in the input data using the extracted key material and generating plaintext data; the integrity verification refers to calculating the integrity check value of the input data using the extracted key material, comparing the calculated integrity check value with the check value carried in the network packet, and outputting the integrity verification result (pass / fail) and the calculated integrity check value.

[0078] S413. The cryptographic processing results include the encryption completion status, decryption completion status, integrity verification results, sequence number update information, and cryptographic context update information of the network message.

[0079] In this embodiment, the encryption completion status indicates whether the encryption operation was successfully completed; the decryption completion status indicates whether the decryption operation was successfully completed; the integrity verification result indicates whether the integrity verification passed or failed for the integrity verification operation; the sequence number update information refers to the sequence number of the currently processed message; and the password context update information refers to the updated data of the password status information.

[0080] S42. Update the security context table based on the cryptographic processing result, including: S421. After obtaining the cryptographic processing result based on the cryptographic coprocessor module, the cryptographic processing result is returned to the network interface control module through the on-chip secure co-processor interface.

[0081] It should be noted that the reception of the password processing results is automatically completed by the hardware state machine, without the need for the CPU to read them through interrupts or polling. The received password processing results include the encryption completion status, decryption completion status, integrity verification results, sequence number update information, and password context update information of the network packet.

[0082] S422. Extract state update information based on the cryptographic processing result, and update the cryptographic state information in the security context based on the state update information. The cryptographic state information includes the current sequence number, the anti-replay window state, and the intermediate calculation state.

[0083] In this embodiment, the current sequence number refers to the sequence number corresponding to the network packet, which is used to update the sequence number status in the security context; the anti-replay window status refers to updating the anti-replay window bitmap according to the current sequence number for a security context that supports anti-replay detection; and the intermediate calculation status refers to recording the intermediate status of the password calculation process, which is used to support the continuity of status between multiple network packets.

[0084] In this embodiment, the extracted status update information is organized into a hardware-recognizable format by field, and the write address of the corresponding entry in the security context table is obtained according to the security context index. The status update information is then updated to the write address of the security context table to update the password status information in the security context, which includes the sequence number status, the anti-replay window status, and the intermediate calculation status.

[0085] S43. Transmit the password-processed network message back to the network interface control module, including: S431. Obtain the original encapsulation parameters of the network packet and obtain the protocol type based on the packet descriptor corresponding to the network packet.

[0086] In this embodiment, the original encapsulation parameters are specifically as follows: for IPSec network packets, the original encapsulation parameters include the security parameter index and current sequence number obtained from the security context table, and the integrity verification value obtained from the integrity verification result; for MACsec network packets, the parameters include the security channel identifier, association number, and current sequence number obtained from the security context table, and the integrity verification value obtained from the integrity verification result.

[0087] In this embodiment, the on-chip security collaboration interface is monitored by the network interface control module to detect whether a network packet with completed password processing has arrived. For a network packet with completed password processing, the protocol type in the corresponding packet descriptor is read.

[0088] S432. Determine the message encapsulation format of the network message based on the protocol type, and encapsulate the network message according to the message encapsulation format and the original encapsulation parameters to obtain the corresponding transmission message of the network message.

[0089] In this embodiment, the message encapsulation format is determined according to the protocol type in the message descriptor. Specifically, if the protocol type is IPSec, the message encapsulation format is determined to be IPSec; if the protocol type is MACsec, the message encapsulation format is determined to be MACsec. After determining the message encapsulation format, the corresponding transmission message for the network message is constructed based on the message encapsulation format and the original encapsulation parameters.

[0090] S433. Send the encapsulated message to the network link through the physical interface.

[0091] In this embodiment, the network interface control module sends the transmission packets in the transmission buffer to the network link or network device through the physical interface according to the configured physical interface parameters (rate, duplex mode, etc.).

[0092] In another embodiment of the present invention, a processing system using a data plane cryptographic processing method based on on-chip MAC-CCP collaboration is provided. This processing system includes: a MAC network interface processing module; an on-chip secure collaboration interface module; a security context management module; a cryptographic task description generation module; a CCP cryptographic calculation module; and a cryptographic state maintenance module. Specifically, the MAC network interface processing module is used for receiving and sending network packets; the on-chip secure collaboration interface module connects the MAC network interface processing module and the CCP cryptographic calculation module, and is used to establish a low-latency cryptographic data path within the chip; the security context management module is used to maintain the cryptographic state information corresponding to the network packets based on the security context; the cryptographic task description generation module is used to generate cryptographic task descriptors corresponding to the network packets; the CCP cryptographic calculation module is used to perform cryptographic operation processing based on the cryptographic task descriptors to obtain cryptographic processing results; and the cryptographic state maintenance module is used to update the cryptographic state information of the network packets after cryptographic processing.

[0093] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.

[0094] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0095] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0096] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

[0097] In conclusion, the above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A data plane cryptographic processing method based on on-chip MAC-CCP collaboration, characterized in that, Includes the following steps: The control plane is constructed based on the network interface control module and the cryptographic coprocessor module, and an on-chip security collaboration interface is established between the two. A context description structure containing protocol type field, key handle field and algorithm type field is established according to the preset network security protocol. A security context including key handle, sequence number status, anti-replay status and cryptographic status information is established based on the context description structure and the original key resources. An on-chip cryptographic processing environment is established based on the security context table composed of all security contexts. The network interface control module receives network packets, performs feature parsing on the network packets to generate packet descriptors, and queries the security context table based on the packet descriptors to obtain the security context index corresponding to the network packets. Based on the security context index, cryptographic resource information is obtained, and the cryptographic resource information is associated with the message descriptor to generate a cryptographic task descriptor. This descriptor is then transmitted to the cryptographic coprocessor module via the message data channel, security context association channel, and cryptographic task channel of the on-chip security collaboration interface. The message data channel is used to transmit the message descriptor of the network message, the security context association channel is used to transmit the cryptographic resource information corresponding to the network message, and the cryptographic task channel is used to transmit the cryptographic task descriptor. The cryptographic coprocessor module performs cryptographic processing operations on the cryptographic task descriptor to obtain the cryptographic processing result of the network packet. After obtaining the cryptographic processing result based on the cryptographic coprocessor module, the cryptographic processing result is transmitted to the network interface control module through the on-chip security collaboration interface. Based on the cryptographic processing result, state update information is extracted, and the cryptographic state information in the security context is updated based on the state update information. The cryptographic state information includes the current sequence number, the anti-replay window state, and the intermediate calculation state. The cryptographically processed network packet is then transmitted back to the network interface control module.

2. The data plane cryptographic processing method based on on-chip MAC-CCP collaboration according to claim 1, characterized in that, The control plane is constructed based on the network interface control module and the cryptographic coprocessor module, including: The network interface control module and the cryptographic coprocessor module are initialized, and an on-chip secure collaborative interface is established between the network interface control module and the cryptographic coprocessor module after initialization. The control plane is constructed based on the on-chip security collaboration interface, as well as the network interface control module and cryptographic coprocessor module after initialization.

3. The data plane cryptographic processing method based on on-chip MAC-CCP collaboration according to claim 1, characterized in that, Based on the network interface control module receiving network packets, the module performs feature parsing on the network packets to generate packet descriptors, including: The network interface control module buffers the received network packets and obtains the input data, output data, data length, and packet buffer location of the network packets. Feature parsing is performed on network packets to obtain the packet data, protocol type, flow identifier, and security identifier in the network packets; A message descriptor corresponding to a network message is generated based on the message data, protocol type, flow identifier, and security identifier. The message descriptor also includes a reserved fixed field for storing a security context index.

4. The data plane cryptographic processing method based on on-chip MAC-CCP collaboration according to claim 3, characterized in that, By querying the security context table based on the message descriptor, the security context index corresponding to the network message is obtained, including: Obtain the flow identifier and security identifier from the message descriptor, and use the flow identifier and security identifier as query keywords to perform a security context matching query in the security context table; Based on the security context obtained from the matching query, the security context index corresponding to the network packet is obtained, and the security context index is written into the reserved fixed field in the packet descriptor; The security context index contains information about the location of the security context in the security context table and cryptographic resource information.

5. The data plane cryptographic processing method based on on-chip MAC-CCP collaboration according to claim 1, characterized in that, Based on the security context index, the cryptographic resource information corresponding to the network packet is obtained. The cryptographic resource information is then associated with the packet descriptor to obtain the cryptographic task descriptor, including: Based on the security context index, the corresponding cryptographic resource information is read from the security context table. The cryptographic resource information includes a security context identifier, a cryptographic algorithm identifier, a key handle, and cryptographic state index information. Obtain the input data address, output data address, and data length from the message descriptor, and associate and bind the cryptographic resource information with the input data address, output data address, and data length from the message descriptor to generate a cryptographic task descriptor; The cryptographic task descriptor includes input data address, output data address, data length, algorithm type, operation type, security context index, key handle, and cryptographic state index information.

6. The data plane cryptographic processing method based on on-chip MAC-CCP collaboration according to claim 1, characterized in that, The cryptographic coprocessor module performs cryptographic processing operations on the cryptographic task descriptor to obtain the cryptographic processing result of the network packet, including: The cryptographic coprocessor module extracts cryptographic processing information based on the cryptographic task descriptor. The cryptographic processing information includes data input address, data length, output data address, cryptographic algorithm identifier, operation type identifier, key handle, security context index, and cryptographic state index information. The cryptographic coprocessor module performs at least one cryptographic operation on the cryptographic processing information, including data encryption, data decryption, integrity authentication, and message digest calculation, to obtain the cryptographic processing result. The cryptographic processing results include the encryption completion status, decryption completion status, integrity verification results, sequence number update information, and cryptographic context update information of the network message.

7. The data plane cryptographic processing method based on on-chip MAC-CCP collaboration according to claim 1, characterized in that, The network packets processed by the password are sent back to the network interface control module, including: Obtain the raw encapsulation parameters of the network packet and obtain the protocol type based on the packet descriptor corresponding to the network packet; The packet encapsulation format of the network packet is determined based on the protocol type, and the network packet is encapsulated according to the packet encapsulation format and the original encapsulation parameters to obtain the corresponding transmission packet of the network packet. The encapsulated message is sent to the network link through the physical interface.

Citation Information

Patent Citations

  • Power network protocol parsing system, method, device, medium and program product

    CN120658812A

  • Password algorithm adaptation and hardware encryption and decryption acceleration method suitable for gateway protocol

    CN121508915A