Key Coupling Obfuscation Method and System for On-Chip Network-In-Memory Computing
By maintaining row and column keys for the VMM module in the in-memory computing architecture and transmitting confused state data in the on-chip network, the problems of model weight and data leakage in the in-memory computing architecture are solved, and low-overhead security protection is achieved.
Patent Information
- Application Number
- CN202611268515.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-11-17
AI Technical Summary
In existing in-memory computing architectures, attackers can steal chips and directly read the model weights stored in the array, leading to the leakage of neural network model parameters and related intellectual property. Existing protection methods are difficult to effectively prevent data leakage both inside the array and in the on-chip network, while also introducing significant hardware, latency, and power consumption overhead.
A key coupling obfuscation method for on-chip networks is adopted. By maintaining row and column keys for each VMM module, the model weights are obfuscated and the obfuscated intermediate data is transmitted in the on-chip network. The reversible obfuscation operation can complete the calculation without restoring the original weight arrangement. Downstream modules adjust the data state by converting keys to avoid exposing plaintext weights.
It effectively protects model weights and on-chip network data transmission, prevents attackers from recovering the original weights, reduces hardware, latency and power consumption overhead, simplifies the conversion key generation process, and reduces hardware overhead and latency.
Smart Images

Figure CN123122807A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of in-memory computing architecture and chip security technology, and more specifically, relates to a key coupling obfuscation method and system for in-memory computing on-chip networks. Background Technology
[0002] Memristor-based in-memory computing architectures can perform in-situ computations within a memristor array that stores model weights. Each memristor cell has its conductance... ( For line numbers, (Column number) indicates the corresponding weight. When the input voltage... When applied to each row of the array, the first The output current of the column satisfies This allows for parallel vector-matrix multiplication within the array. Typical memristor-based in-memory computing chips typically employ a multi-level organizational structure. Figure 1 This paper demonstrates a five-layer architecture, consisting of an array, a physical layer (PE), a tile, a bank, and a chip, arranged from bottom to top. Compared to traditional processors that require frequent weight transfers between computing units and memory, in-memory computing architectures reduce data transfer overhead, improve computational parallelism and energy efficiency, and are therefore widely used to accelerate neural network inference.
[0003] However, memristors are non-volatile; their stored conductance states are retained even when the chip is powered off. Attackers who physically steal the chip can directly read the model weights stored in the array, thereby leaking neural network model parameters and related intellectual property. Therefore, protecting the model weights in in-memory computing chips has become a crucial security issue in in-memory computing system design. One direct protection method is to encrypt the weights using traditional cryptographic algorithms such as the Advanced Encryption Standard (AES). However, these methods require decrypting and re-encrypting large amounts of weight data before and after computation, resulting in significant latency, area, and power consumption overhead, making them unsuitable for high-efficiency in-memory computing systems.
[0004] To address the aforementioned issues, existing research has proposed lightweight protection methods such as runtime encryption and weight obfuscation. Runtime encryption typically modifies only some sensitive weights or rearranges their positions to reduce the overhead of fully encrypting all weights. However, it still requires restoring the original weights before or during computation, making it difficult to completely prevent plaintext weight exposure. Weight obfuscation methods, on the other hand, change the arrangement of weights and apply key-related control to the rows and columns of the array, rendering weights directly accessible to attackers unusable. Compared to traditional encryption, weight obfuscation is more suitable for in-memory computing architectures and has therefore gradually become an important method for protecting weights in in-memory computing models.
[0005] As in-memory computing chips scale up, Network on Chip (NoC) becomes a crucial channel for transmitting input data, intermediate feature vectors, some computation results, and control information between different modules and chip levels, while also introducing new confidentiality risks. Attackers may eavesdrop on on-chip data transmission through compromised routers or network interfaces to obtain the input and output data of the in-memory computing array; attackers may also inject specific inputs into the target array and observe the corresponding outputs. Based on the collected input and output data, attackers can deduce the original weights stored in the array. Existing in-memory computing confidentiality protection methods mostly focus on protecting individual arrays, primarily preventing attackers from directly reading the weights within the array, while paying less attention to the data transmission process between arrays. Weight obfuscation methods, although storing weights in an obfuscated form within the array, restore the output to the correct logical order after computation before sending it to the next module via the on-chip network. In this case, although the weights within the array are not directly exposed, input data and intermediate computation results with correct logical relationships still appear in the on-chip network. Attackers can collect multiple sets of input and output data and use model fitting methods such as least squares linear regression to recover the original weights in the array; in active attack scenarios, they can also directly query the target array by injecting specific inputs such as unit vectors.
[0006] Therefore, existing weight obfuscation methods only protect the weights within the array, making it difficult to cover system-level data leakage problems introduced by on-chip networks. Using traditional packet encryption to protect all data in the on-chip network can, to some extent, prevent direct eavesdropping on intermediate data. However, large-scale in-memory computing inference requires transmitting a large number of intermediate features and some computation results on the on-chip network. Encrypting and decrypting this data one by one introduces additional encryption / decryption modules, data caching, and key management overhead, significantly increasing communication latency and power consumption, thus impacting the original advantages of high parallelism, low latency, and high energy efficiency of the in-memory computing architecture. Summary of the Invention
[0007] To address the shortcomings and improvement needs of existing technologies, this invention provides a key coupling obfuscation method and system for on-chip network in-memory computing. Its purpose is to protect the model weights inside the array and the data transmission in the on-chip network with relatively small hardware, latency and power consumption overhead, and to prevent attackers from recovering the original weights by exploiting the input-output relationship.
[0008] To achieve the above objectives, according to one aspect of the present invention, a key coupling obfuscation method for on-chip network in-memory computing is provided, comprising: Maintain row and column keys for each VMM module in the in-memory computing system used to implement vector-matrix multiplication; For each VMM module, the row key is used to perform a scrambling operation on the corresponding model weight matrix in the row dimension to obtain the scrambling state data corresponding to the row key. Then, the column key is used to perform a scrambling operation on the scrambling state data corresponding to the row key in the column dimension to obtain the scrambling state data corresponding to the column key and store it in the memristor array of the VMM module. Furthermore, vector-matrix multiplication is performed using the VMM module, including: Convert the input vector of the VMM module into the row key of the VMM module. Corresponding obfuscated intermediate data Then, a corresponding input voltage is applied to the memristor array within the VMM module, thereby performing vector-matrix multiplication within the array to obtain the column key of the VMM module. Corresponding obfuscated intermediate data ; If downstream modules exist, the confused intermediate data is transmitted through the on-chip network. Transmit to downstream modules; otherwise, follow the column key of the VMM module. For confused intermediate data Perform a deobfuscation operation to restore the original order; The obfuscation operation is reversible, meaning that data is processed using the same key. After performing two consecutive obfuscation operations, the resulting data satisfy Deobfuscation is the inverse operation of obfuscation.
[0009] Furthermore, the input vector of the VMM module is converted into the row key of the VMM module. Corresponding obfuscated intermediate data ,include: Determine if the input vector of the VMM module is confused intermediate data. If so, then follow the confused intermediate data. Corresponding key to line key conversion key Perform a scrambling operation on the input vector to obtain the row key. Corresponding obfuscated intermediate data Otherwise, follow the row key. Perform a scrambling operation on the input vector to obtain the row key. Corresponding obfuscated intermediate data ; in, , Let the key conversion function be denoted as ; the key conversion function satisfies: [denotes ] Indicates from key To key The conversion key is then determined according to the key. Key Corresponding obfuscated intermediate data After performing the obfuscation operation, the resulting obfuscated intermediate data is compared with the data obtained using the key. For confused intermediate data Perform the deobfuscation operation and then follow the key. The intermediate data in the obfuscated state after the obfuscation operation is the same.
[0010] Furthermore, the key coupling obfuscation method for on-chip network in-memory computing provided by the present invention also includes: Maintain a confusion key for each auxiliary computing module; When the downstream auxiliary computing module receives confused intermediate data from multiple upstream modules, it calculates the conversion key from the output key of each upstream module to the input key of the downstream auxiliary computing module through the key conversion function, and encrypts the conversion key respectively. The ciphertext of each conversion key is transmitted to the downstream auxiliary computing module via the on-chip network. After receiving the ciphertext of each conversion key, the downstream auxiliary computing module decrypts the received ciphertext to obtain the conversion key corresponding to each upstream module. Each conversion key is used to convert the confused intermediate data output by the corresponding upstream module into the input confused state required by the downstream auxiliary computing module; the input key and output key of the auxiliary computing module are both the corresponding confusion key; the input key of the VMM module is the row key and the output key is the column key.
[0011] Furthermore, the downstream auxiliary module performs the decryption operation of each conversion key ciphertext in parallel with the corresponding calculation operation in the upstream module.
[0012] Furthermore, for the addition module, the calculation process includes: Received confused intermediate data from each upstream module Then, the obfuscated intermediate data from each upstream module is obfuscated according to the conversion key from each upstream module to the addition module, thereby converting the obfuscated intermediate data from each upstream module into the obfuscation key of the addition module. The corresponding obfuscated intermediate data; After summing the transformed confused intermediate data, the result is... The data is transmitted to downstream modules via the on-chip network.
[0013] Furthermore, for the pooling module, the calculation process includes: Receive confused intermediate data from each upstream module And the output keys of each upstream module; The received obfuscated intermediate data is deobfuscated according to the output keys of each upstream module to obtain the plaintext operation data; After performing a pooling operation on the plaintext of the operation data, the obfuscation key of the pooling module is used. Perform an obfuscation operation on the result of the operation to obtain the obfuscation key. Corresponding obfuscated intermediate data It is then transmitted to downstream modules via the on-chip network.
[0014] Furthermore, for the activation function module, the calculation process includes: After receiving the confused intermediate data from the upstream module, the activation function is used to activate it, and the activation result is transmitted to the downstream module through the on-chip network.
[0015] In some preferred embodiments, when performing the obfuscation operation, each key bit in the key corresponds to a row pair or column pair, indicating whether the two rows in the row pair or the two columns in the column pair are swapped; Furthermore, obfuscation operations are performed according to the key, including: Perform the swap operation on the two rows or two columns that need to be swapped, according to the key bit instructions.
[0016] According to another aspect of the present invention, a key coupling and obfuscation system for on-chip network-in-memory computing is provided, comprising: an on-chip computing system wherein different modules and different chip levels are interconnected via an on-chip network; In the in-memory computing system, each VMM module used to implement vector-matrix multiplication has a corresponding row key and column key; each VMM module includes: a memristor array and peripheral circuits connected to the memristor array, the peripheral circuits including conversion modules; The memristor array stores the corresponding model weights, and the writing method of the model weights includes: performing a scrambling operation on the corresponding model weight matrix in the row dimension according to the row key to obtain the scrambling state data corresponding to the row key, and then performing a scrambling operation on the scrambling state data corresponding to the row key in the column dimension according to the column key to obtain the scrambling state data corresponding to the column key and storing it in the memristor array of the VMM module. The conversion module is used to convert the input vector of the VMM module into the row key of the VMM module. Corresponding obfuscated intermediate data ; The peripheral circuitry is also used to perform the following operations: Based on the transformed confused state intermediate data By applying the corresponding input voltage to the memristor array and performing corresponding peripheral processing on the output of the memristor array, vector-matrix multiplication is achieved through the memristor array to obtain the confused intermediate data corresponding to the column key of the VMM module. ; When the calculation results of the VMM module need to be transmitted to downstream modules, the intermediate data will be mixed. The data is transmitted to downstream modules via the on-chip network; when the calculation result is the final output of the in-memory computing system, the intermediate data in the confused state is de-obfuscated according to the corresponding column key to restore the original order. The obfuscation operation is reversible, meaning that data is processed using the same key. After performing two consecutive obfuscation operations, the resulting data satisfy Deobfuscation is the inverse operation of obfuscation.
[0017] In some alternative embodiments, when performing the obfuscation operation, each key bit in the key corresponds to a row pair or column pair, used to indicate whether the two rows in the row pair or the two columns in the column pair are swapped; Furthermore, obfuscation operations are performed according to the key, including: Perform the swap operation on the two rows or two columns that need to be swapped, according to the key bit instructions; Furthermore, the conversion module consists of m independent 2-to-1 multiplexers; m is the key length; Each 2-to-1 multiplexer uses the corresponding key bit as the selection signal, and the two inputs correspond to the cases of swapping two rows / two columns and not swapping two rows / two columns, respectively.
[0018] In summary, the above-described technical solutions conceived in this invention can achieve the following beneficial effects: (1) This invention stores model weights in an obfuscated form and directly adjusts the order of input data in the VMM module during vector-matrix multiplication, completing correct calculations without restoring the original weight order. Furthermore, it directly transmits obfuscated intermediate data on the on-chip network between upstream and downstream modules, avoiding the exposure of plaintext weights. Therefore, even if an attacker obtains the array inputs and outputs in the on-chip network, the obtained data remains obfuscated and cannot directly correspond to the original weights stored in the array, thus ensuring data security in the on-chip network. Moreover, this invention eliminates the need to encrypt and decrypt a large number of intermediate features and some calculation results transmitted over the network, effectively reducing hardware, latency, and power consumption overhead. In summary, this invention can protect the model weights within the array and the data transmission in the on-chip network with relatively low hardware, latency, and power consumption overhead, preventing attackers from recovering the original weights using input-output relationships.
[0019] (2) In the preferred embodiment of the present invention, the present invention directly performs a scrambling operation on the scrambling intermediate data from the upstream module according to the conversion key between adjacent modules, and converts it into the scrambling intermediate data corresponding to the key of the current module, thereby realizing key coupling between different computing modules. Based on key coupling, when performing calculation, there is no need to descramble and then re-scramble, which reduces the hardware overhead of state transition and simplifies the process of generating conversion keys.
[0020] (3) After the model is mapped, the data flow and confusion state between modules are determined. For multi-input convergence scenarios where multiple upstream modules converge to the same downstream module, the downstream module needs to use different conversion keys for different input paths. If all conversion keys are pre-stored in the downstream module, the local storage and key management overhead will increase with the number of inputs. Therefore, in the preferred embodiment of the present invention, the conversion keys and their ciphertexts from each upstream module to the downstream module are pre-calculated, and during the inference process, the ciphertexts of each conversion key are sent to the downstream module along with the corresponding confusion state intermediate data via the on-chip network. After receiving the data, the downstream module decrypts the ciphertexts to obtain the corresponding conversion keys and uses the conversion module to complete the data state adjustment. For fixed data transmission paths that do not involve multi-input convergence, the corresponding conversion keys can be pre-stored in the downstream module. Thus, while avoiding the local storage overhead of a large number of conversion keys, only the conversion keys with a small amount of data need to be encrypted, without the need to encrypt the model weights and intermediate features as a whole, thereby reducing hardware, latency and power consumption overhead. In a further preferred embodiment, the downstream module performs the decryption operation of the converted key ciphertext in parallel with the computation operation in the upstream module, thereby hiding the decryption delay of the converted ciphertext.
[0021] (4) In a preferred embodiment of the present invention, the obfuscation operation is specifically a non-overlapping pairwise swap operation. The implementation logic of this operation is simple, and the key conversion function used to calculate the conversion key is an XOR operation, thereby further reducing the hardware overhead and latency of the implementation. Attached Figure Description
[0022] Figure 1 This is a diagram of the existing memristor-based in-memory computing chip hierarchy and a threat model.
[0023] Figure 2 This is an overall block diagram of a key coupling and obfuscation method for on-chip network in-memory computing provided in an embodiment of the present invention.
[0024] Figure 3 The diagram illustrates the pairwise weighted obfuscation and the hardware implementation of the conversion module, as provided in this embodiment of the invention.
[0025] Figure 4 This is a schematic diagram of an array key coupling design provided for an embodiment of the present invention.
[0026] Figure 5 This is a schematic diagram of the key coupling design of the auxiliary computing module provided in an embodiment of the present invention; wherein, (a) is an adder module, (b) is a pooling module, and (c) is an activation function module.
[0027] Figure 6 This is a schematic diagram of the encrypted transmission of the conversion key provided in an embodiment of the present invention.
[0028] Figure 7 This is a schematic diagram of cyclic shift weight obfuscation provided in an embodiment of the present invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0030] In this invention, the terms "first," "second," etc. (if present) in the invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0031] To address the issues that existing in-memory computing confidentiality protection schemes primarily target single arrays, struggle to prevent the leakage of input / output information in on-chip networks, and incur significant overhead for overall encryption of on-chip network data, this invention provides a key coupling obfuscation method and system for in-memory computing with on-chip networks. The overall concept involves designing a reversible obfuscation operation and maintaining the obfuscated state of model weights and intermediate data during inference. This approach protects the model weights within the array and the data transmission within the on-chip network with minimal hardware, latency, and power consumption overhead, preventing attackers from recovering the original weights using input / output relationships.
[0032] Based on the above ideas, such as Figure 2 As shown, this invention stores model weights in an obfuscated form within an in-memory computing array, and intermediate data generated by each computing module is also transmitted in an obfuscated state via an on-chip network. Downstream modules use a conversion key to adjust the received data to the obfuscated state required for their own computation, thereby completing correct calculations without exposing the plaintext input-output relationship. Furthermore, some of the conversion keys are encrypted and transmitted along with the obfuscated data. Finally, the correct logical order of the data is restored only at the system output.
[0033] First, this invention designs a specific obfuscation method, the obfuscation operation of which is reversible, that is, data is processed using the same key. After performing two consecutive obfuscation operations, the resulting data satisfy Based on this obfuscation method, the obfuscation and deobfuscation operations can reuse the same set of hardware logic, effectively reducing hardware overhead. In practical applications, non-overlapping pairwise swaps, cyclic shifts, and other operations can be used to implement this. For ease of description, the following embodiments will use non-overlapping pairwise swaps as an example.
[0034] When non-overlapping pairwise swaps are used to implement reversible obfuscation operations, the specific obfuscation methods are as follows: Figure 3 As shown. For one mapped to the array Weight matrix, set row keys respectively and column keys Both contain Each binary key bit controls whether two rows in a row pair or two columns in a column pair are swapped. Row pairs and column pairs do not overlap.
[0035] For example, the row key's first Position control row and number Row pairs are swapped when the key bit is 1, and remain unchanged when it is 0. Column swaps are performed in the same way. Since each row or column participates in only one pair swap, for a given set of rows... When reordering a vector of elements, the following can be used: The conversion module consists of several independent 2-to-1 multiplexers. This method achieves a linear increase in hardware complexity with array size, while... Arrays can still be formed Different row and column confusion layouts disrupt the correspondence between logical inputs, physical weights, and logical outputs.
[0036] It is easy to understand that, apart from the weight matrix, the input and output of each calculation module are vectors. Therefore, the corresponding obfuscation operation can be performed in the vector dimension.
[0037] To ensure that model weights and intermediate data remain obfuscated during inference, this invention directly converts the input data of the VMM module into the obfuscated state corresponding to the row key of the current VMM module when calculating vector-matrix multiplication using the VMM module. It then performs vector-matrix multiplication with the model weights in the obfuscated state to obtain the calculation result corresponding to the column key in the obfuscated state, and sends it directly to the downstream module through the on-chip network, without restoring the logical order at the array output.
[0038] Using the above method, even if an attacker obtains the array input and output of the on-chip network, the obtained data remains in a key-related obfuscated state and cannot directly correspond to the original weights stored in the array. Simultaneously, the array input can reuse the aforementioned conversion module composed of multiplexers, while the original deobfuscation module at the array output can be removed to further reduce hardware overhead.
[0039] by Indicates according to the key Perform obfuscation. Indicates the key The corresponding obfuscated intermediate data undergoes deobfuscation. For general obfuscation methods, the data is deobfuscated from the key. The corresponding obfuscated state is converted into a key. The corresponding obfuscated state can be represented as That is, first to Perform deobfuscation on the corresponding obfuscated intermediate data, and then... Perform obfuscation operations, where, Indicates continuous operation. For the conversion key, and , This represents the key conversion function.
[0040] Because this invention uses non-overlapping pairwise swaps to implement obfuscation, the original order can be restored by performing the swap again using the same key. In other words, the obfuscation, deobfuscation, and swap operations performed with the same key are identical. When two consecutive pairwise swaps are performed, the following conditions are met: , Indicates according to the key Perform a pairwise swap. This represents the XOR operation. Therefore, the conversion key can be directly generated based on the keys of the upstream and downstream modules. The conversion module only needs to perform one exchange to directly convert the data from the upstream obfuscated state to the obfuscated state required by the downstream computation, without the need for deobfuscation and re-obfuscation. This method reduces the hardware overhead of state conversion, simplifies the generation process of conversion keys, and further provides a foundation for key coupling between different computation modules.
[0041] To quickly convert the input data of the VMM module into the obfuscated state corresponding to the row key of the current VMM module, this invention further proposes key coupling based on key conversion, such as... Figure 4 As shown. Assume the upstream module output data is in the key... The corresponding obfuscated state, the current array row key is Then the array input uses the conversion key. The control conversion module adjusts the input data to the row obfuscation state required by the current array, i.e., the row key is... The corresponding obfuscation state. After completing the vector-matrix multiplication, the array output is naturally in the column key state. The corresponding obfuscated state is directly sent to downstream modules via the on-chip network, and is no longer restored to the correct logical order at the array output. Using this method, even if an attacker obtains the array input and output from the on-chip network, the obtained data remains in a key-related obfuscated state and cannot directly correspond to the original weights stored in the array. Simultaneously, the array input can reuse the aforementioned conversion module composed of multiplexers, while the original deobfuscated module at the array output can be removed.
[0042] The key coupling method proposed in this invention is simultaneously applied to auxiliary computation modules such as addition, pooling, and activation. Corresponding obfuscation keys are also maintained for each of these auxiliary computation modules.
[0043] For the addition module, such as Figure 5 As shown in (a), inputs from different upstream modules may be in different obfuscated states. Using the upstream modules respectively... Conversion key to the addition module Adjust each input to the key of the addition module. If the corresponding obfuscation state is the same, then perform element-wise addition directly, and the output will still maintain the obfuscation state. Indicates upstream module The key.
[0044] For pooling modules, such as Figure 5 As shown in (b), since the pooling operation relies on a fixed spatial neighborhood relationship, the input needs to be temporarily adjusted to the correct order within the pooling module. After pooling is complete, the pooling module key is then used... The output is obfuscated, and the obfuscated result is sent to the downstream module. During this process, the data in the correct order exists only within the trusted pooling module and is not transmitted through the on-chip network.
[0045] For element-wise activation function modules such as ReLU, such as Figure 5 As shown in (c), its calculation does not depend on the arrangement order between the feature elements, nor does it change the relative position between the elements. Therefore, it can be directly performed on intermediate data in a confused state without adding any additional state transition operations.
[0046] To further enhance the security of the conversion key, this invention proposes a secure transmission method for the conversion key in multi-input convergence scenarios, such as... Figure 6 As shown. For the upstream module to downstream modules For any data transmission path, the required conversion key is denoted as . After the model has completed its mapping, the data flow and obfuscation state between modules are determined, so the conversion key ciphertext can be pre-calculated. In practical applications, the encryption algorithm used to generate the conversion key ciphertext can be flexibly selected, such as the PRINCE encryption algorithm. PRINCE is a lightweight, low-latency block cipher algorithm used to encrypt and protect the conversion key. Contextual information such as source and target module identifiers, For downstream modules The encryption key can be obtained from the root key. and module identifier Generate via key derivation function: The key-transformed ciphertext can be represented as: .
[0047] During inference, each conversion key ciphertext is sent via the on-chip network along with the obfuscated intermediate data generated by the corresponding upstream module. The downstream module decrypts the received conversion key ciphertext to obtain the conversion key corresponding to each input path, and uses the conversion module to convert the obfuscated intermediate data from different upstream modules into the obfuscated state required for the current downstream module's calculation.
[0048] For fixed data transmission paths that do not involve multiple input convergence, such as when an upstream module sends data to one or more downstream modules with fixed data sources, the corresponding conversion key can be pre-stored in the corresponding downstream module after the model mapping is completed, without needing to be transmitted through the on-chip network along with the intermediate data during the inference process.
[0049] Furthermore, the transmission and decryption of the conversion key can be performed in parallel with in-memory computation. For example, in a convolutional layer, while the upstream array sequentially performs vector-matrix multiplication, analog-to-digital conversion, and peripheral processing, the corresponding conversion key ciphertext can be sent to the downstream module in advance and decrypted, ensuring the conversion key is ready before the obfuscated data arrives. For fully connected layers, the key decryption process can overlap with different batches of computation; in the case of a single batch, it can also overlap with multi-cycle shift-accumulation processes, thereby preventing the conversion key decryption from entering the main computation path.
[0050] In this way, the content transmitted on the on-chip network during in-memory computing inference mainly consists of obfuscated intermediate data and encrypted conversion keys. Model weights are always stored in obfuscated form, and intermediate data maintains a key-coupled obfuscated state between various arrays and auxiliary modules, only being restored to the correct logical order at the final output.
[0051] The following is an example.
[0052] Example 1: A key coupling obfuscation method for on-chip network in-memory computing, such as Figure 2 , Figure 3 , Figure 4 As shown, it includes: Maintain row and column keys for each VMM module in the in-memory computing system used to implement vector-matrix multiplication; For each VMM module, the row key is used to perform a scrambling operation on the corresponding model weight matrix in the row dimension to obtain the scrambling intermediate data corresponding to the row key. Then, the column key is used to perform a scrambling operation on the column dimension on the scrambling intermediate data corresponding to the row key to obtain the scrambling intermediate data corresponding to the column key and store it in the memristor array of the VMM module. Furthermore, vector-matrix multiplication is performed using the VMM module, including: Convert the input vector of the VMM module into the row key of the VMM module. Corresponding obfuscated intermediate data Then, a corresponding input voltage is applied to the memristor array within the VMM module, thereby performing vector-matrix multiplication within the array to obtain the column key of the VMM module. Corresponding obfuscated intermediate data ; If downstream modules exist, the confused intermediate data is transmitted through the on-chip network. Transmit to downstream modules; otherwise, follow the column key of the VMM module. For confused intermediate data Perform a deobfuscation operation to restore the original order; The obfuscation operation is reversible, meaning that data is processed using the same key. After performing two consecutive obfuscation operations, the resulting data satisfy The de-obfuscation operation is the inverse operation of the obfuscation operation. In this embodiment, when the obfuscation operation is performed, each key bit in the key corresponds to a row pair or column pair, which is used to indicate whether the two rows in the row pair or the two columns in the column pair are swapped. Furthermore, obfuscation operations are performed according to the key, including: Perform the swap operation on the two rows or two columns that need to be swapped, according to the key bit instructions.
[0053] In this embodiment, the input vector of the VMM module is converted into the row key of the VMM module. Corresponding obfuscated intermediate data ,include: Determine if the input vector of the VMM module is confused intermediate data. If so, then follow the confused intermediate data. Corresponding key to line key conversion key Perform a scrambling operation on the input vector to obtain the row key. Corresponding obfuscated intermediate data Otherwise, follow the row key. Perform a scrambling operation on the input vector to obtain the row key. Corresponding obfuscated intermediate data ; in, , Let the key conversion function be denoted as ; the key conversion function satisfies: [denotes ] Indicates from key To key The conversion key is then determined according to the key. Key Corresponding obfuscated intermediate data After performing the obfuscation operation, the resulting obfuscated intermediate data is compared with the data obtained using the key. For confused intermediate data Perform the deobfuscation operation and then follow the key. The intermediate data in the obfuscated state after the obfuscation operation is identical. In this embodiment, the key conversion function is an XOR operation function, i.e. .
[0054] like Figure 6 As shown, this embodiment also includes: Maintain a confusion key for each auxiliary computing module; When the downstream auxiliary computing module receives confused intermediate data from multiple upstream modules, it calculates the conversion key from the output key of each upstream module to the input key of the downstream auxiliary computing module through the key conversion function, and encrypts the conversion key respectively. The ciphertext of each conversion key is transmitted to the downstream auxiliary computing module via the on-chip network; after receiving the ciphertext of each conversion key, the downstream auxiliary computing module decrypts the received ciphertext of the conversion key to obtain the conversion key corresponding to each upstream module. Each conversion key is used to convert the obfuscated intermediate data output by the corresponding upstream module into the input obfuscated state required by the downstream auxiliary computing module; the input key and output key of the auxiliary computing module are both the corresponding obfuscated keys; the input key of the VMM module is the row key, and the output key is the column key; the decryption operation of the conversion key ciphertext by the downstream module is performed in parallel with the calculation operation in the upstream module.
[0055] In this embodiment, for the addition module, such as Figure 5 As shown in (a), the calculation process includes: Received confused intermediate data from each upstream module Then, the obfuscated intermediate data from each upstream module is obfuscated according to the conversion key from each upstream module to the addition module, thereby converting the obfuscated intermediate data from each upstream module into the obfuscation key of the addition module. The corresponding obfuscated intermediate data; After summing the transformed confused intermediate data, the result is... The data is transmitted to downstream modules via the on-chip network.
[0056] In this implementation, for the pooling module, such as Figure 5 As shown in (b) above, the calculation process includes: Receive confused intermediate data from each upstream module And the output keys of each upstream module; The received obfuscated intermediate data is deobfuscated according to the output keys of each upstream module to obtain the plaintext operation data; After performing a pooling operation on the plaintext of the operation data, the obfuscation key of the pooling module is used. Perform an obfuscation operation on the result of the operation to obtain the obfuscation key. Corresponding obfuscated intermediate data It is then transmitted to downstream modules via the on-chip network.
[0057] In this embodiment, for the activation function module, such as Figure 5 As shown in (c), the calculation process includes: After receiving the confused intermediate data from the upstream module, the activation function is used to activate it, and the activation result is transmitted to the downstream module through the on-chip network.
[0058] In summary, this embodiment employs a row-column obfuscation method for the in-memory computing array that features low hardware overhead, reversibility, and efficient obfuscation state conversion. This allows model weights to be stored in obfuscated form, and correct calculations can be completed without restoring the original weight arrangement by adjusting the array input order. Furthermore, this embodiment uses key coupling for the obfuscated states of adjacent computing modules. A conversion key is generated based on the obfuscated state output by the upstream module and the required input obfuscated state of the downstream module, enabling direct conversion between different obfuscated states. This ensures that intermediate data maintains its obfuscated state during transmission between different computing modules via NoC. Simultaneously, this embodiment encrypts and decrypts only the relatively small conversion key, without encrypting the model weights and intermediate feature data as a whole. This effectively guarantees the secure transmission of the conversion key and overlaps the transmission and decryption process of the conversion key with the in-memory computing process, reducing the additional latency caused by key protection.
[0059] Example 2: A key coupling and obfuscation system for on-chip network-based in-memory computing includes: an in-memory computing system, wherein different modules and different chip levels are interconnected through an on-chip network; In the in-memory computing system, each VMM module used to implement vector-matrix multiplication has a corresponding row key and column key; each VMM module includes: a memristor array and peripheral circuits connected to the memristor array, the peripheral circuits including conversion modules; The memristor array stores the corresponding model weights, and the writing method of the model weights includes: performing a scrambling operation on the corresponding model weight matrix in the row dimension according to the row key to obtain the scrambling intermediate data corresponding to the row key, and then performing a scrambling operation on the scrambling intermediate data corresponding to the row key in the column dimension according to the column key to obtain the scrambling intermediate data corresponding to the column key and storing it in the memristor array of the VMM module. The conversion module is used to convert the input vector of the VMM module into the row key of the VMM module. Corresponding obfuscated intermediate data ; The peripheral circuitry is also used to perform the following operations: Based on the transformed confused state intermediate data By applying a corresponding input voltage to the memristor array and performing corresponding peripheral processing on the output of the memristor array, vector-matrix multiplication is achieved through the memristor array to obtain the confused state data corresponding to the column key of the VMM module. ; When the calculation results of the VMM module need to be transmitted to downstream modules, the intermediate data will be mixed. The data is transmitted to downstream modules via the on-chip network; when the calculation result is the final output of the in-memory computing system, the intermediate data in the confused state is de-obfuscated according to the corresponding column key to restore the original order. The obfuscation operation is reversible, meaning that data is processed using the same key. After performing two consecutive obfuscation operations, the resulting data satisfy Deobfuscation is the inverse operation of obfuscation.
[0060] In this embodiment, when performing the obfuscation operation, each key bit in the key corresponds to a row pair or column pair, which is used to indicate whether the two rows in the row pair or the two columns in the column pair are swapped. Furthermore, obfuscation operations are performed according to the key, including: Perform the swap operation on the two rows or two columns that need to be swapped, according to the key bit instructions; Furthermore, the conversion module consists of m independent 2-to-1 multiplexers; m is the key length; Each 2-to-1 multiplexer uses the corresponding key bit as the selection signal, and the two inputs correspond to the cases of swapping two rows / two columns and not swapping two rows / two columns, respectively.
[0061] In this embodiment, the specific implementation of each module can be referred to the description in Embodiment 1 above, and will not be repeated here.
[0062] Example 3: A key coupling obfuscation method for on-chip network in-memory computing is disclosed. This embodiment is similar to Embodiment 1 above, except that the obfuscation operation in this embodiment is a cyclic shift operation.
[0063] Specifically, for those containing The data of each element is shifted cyclically. As the corresponding obfuscation key, According to the obfuscated key When performing an obfuscation operation, the data is cyclically shifted in a preset direction. Each position. For the model weight matrix, set the row key respectively. and column keys The rows of the weight matrix are cyclically shifted according to the cyclic shift amount corresponding to the row key, and the columns of the weight matrix are cyclically shifted according to the cyclic shift amount corresponding to the column key.
[0064] Cyclic shift operations are reversible. Let's assume that according to the key... The obfuscation operation performed is a circular shift. If there are positions, then the cyclic shift amount corresponding to its inverse operation is . .
[0065] Furthermore, the cyclic shift operation supports direct transitions between different obfuscated states. Suppose the data is currently in the key... The corresponding obfuscated state needs to be converted into a key. The corresponding confusion state, then the conversion key between the two. for .
[0066] According to the conversion key Key The key can be obtained by performing a single cyclic shift operation on the corresponding confused intermediate data. The corresponding obfuscated intermediate data does not require restoring the original order of the data before re-performing the obfuscation operation.
[0067] Apart from the above-mentioned obfuscation operations and conversion key generation methods, the model weight obfuscation, key coupling between VMM modules and between auxiliary calculation modules, encryption transmission of conversion keys, and data transmission of obfuscated intermediate data in this embodiment are all the same as in Embodiment 1, and will not be repeated here.
[0068] Example 4: A key coupling obfuscation system for on-chip network in-memory computing is disclosed. This embodiment is similar to Embodiment 2 above, except that in this embodiment, the obfuscation operation is a cyclic shift operation, and the conversion module is a cyclic shifter.
[0069] Specifically, such as Figure 7 As shown, the conversion module performs a cyclic shift on each element in the input data according to the cyclic shift amount represented by the input obfuscation key or conversion key. In hardware implementation, the cyclic shifter typically employs the mature standard structure of a barrel shifter to support data rearrangement controlled by the shift amount within a single clock cycle, thereby enabling the input data to be cyclically shifted to a predetermined position in a single conversion process according to the shift amount.
[0070] In one alternative implementation, for containing The input data of n elements, the cyclic shift amount is from the width of The control signal is represented by the barrel shifter, which uses a multi-stage selection network to select whether to perform a shift of the corresponding number of bits based on each control bit, thereby realizing the shift of input data. to This involves cyclic shifting within a range of positions. This structure is a commonly used shifting implementation in existing digital circuits, and its internal structure is not modified in this embodiment.
[0071] When the conversion module is used to convert the key The corresponding obfuscated intermediate data is converted into a key. When dealing with the corresponding obfuscated intermediate data, a conversion key is used. The indicated shift amount controls the cyclic shifter, thereby enabling a direct transition between two confused states through a single cyclic shift.
[0072] Except for the specific implementation of the conversion module and the generation method of the conversion key, the composition, connection relationship and working method of other modules in this embodiment are the same as those in embodiment 2, and will not be repeated here.
[0073] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. In-memory computing chips are not limited to... Figure 1The five-layer structure shown, consisting of array, PE, Tile, Bank, and chip, can have its number of layers and module organization adjusted according to the specific chip architecture. The weight obfuscation method is not limited to non-overlapping pairwise swapping and cyclic shifting; other row-column obfuscation methods with lower hardware overhead, reversibility, and support for direct conversion between different obfuscation states can also be used, such as XOR-based index mapping and block cyclic shifting. The conversion key encryption algorithm is not limited to PRINCE; other lightweight encryption algorithms that meet security and low-overhead requirements, such as PRESENT and GIFT, can also be used. The specific implementation of key coupling, conversion key generation, and transmission can also be adjusted according to the obfuscation method, chip structure, and data flow. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A key coupling obfuscation method for on-chip network in-memory computing, characterized in that, include: Maintain row and column keys for each VMM module in the in-memory computing system used to implement vector-matrix multiplication; For each VMM module, the row key is used to perform a scrambling operation on the corresponding model weight matrix in the row dimension to obtain the scrambling state data corresponding to the row key. Then, the column key is used to perform a scrambling operation on the scrambling state data corresponding to the row key in the column dimension to obtain the scrambling state data corresponding to the column key and store it in the memristor array of the VMM module. Furthermore, vector-matrix multiplication is performed using the VMM module, including: Convert the input vector of the VMM module into the row key of the VMM module. Corresponding obfuscated intermediate data Then, a corresponding input voltage is applied to the memristor array within the VMM module, thereby performing vector-matrix multiplication within the array to obtain the column key of the VMM module. Corresponding obfuscated intermediate data ; If downstream modules exist, the confused intermediate data is transmitted through the on-chip network. Transmit to downstream modules; otherwise, follow the column key of the VMM module. For confused intermediate data Perform a deobfuscation operation to restore the original order; The obfuscation operation is reversible, meaning that data is processed using the same key. After performing two consecutive obfuscation operations, the resulting data satisfy Deobfuscation is the inverse operation of obfuscation.
2. The key coupling obfuscation method for on-chip network in-memory computing as described in claim 1, characterized in that, Convert the input vector of the VMM module into the row key of the VMM module. Corresponding obfuscated intermediate data ,include: Determine if the input vector of the VMM module is confused intermediate data. If so, then follow the confused intermediate data. Corresponding key to line key conversion key Perform a scrambling operation on the input vector to obtain the row key. Corresponding obfuscated intermediate data Otherwise, follow the row key. Perform a scrambling operation on the input vector to obtain the row key. Corresponding obfuscated intermediate data ; in, , Let the key conversion function be denoted as ; the key conversion function satisfies: [denotes ] Indicates from key To key The conversion key is then determined according to the key. Key Corresponding obfuscated intermediate data After performing the obfuscation operation, the resulting obfuscated intermediate data is compared with the data obtained using the key. For confused intermediate data Perform the deobfuscation operation and then follow the key. The intermediate data in the obfuscated state after the obfuscation operation is the same.
3. The key coupling obfuscation method for on-chip network in-memory computing as described in claim 2, characterized in that, Also includes: Maintain a confusion key for each auxiliary computing module; When the downstream auxiliary computing module receives confused intermediate data from multiple upstream modules, it calculates the conversion key from the output key of each upstream module to the input key of the downstream auxiliary computing module through the key conversion function, and encrypts the conversion key respectively. The ciphertext of each conversion key is transmitted to the downstream auxiliary computing module via the on-chip network; after receiving the ciphertext of each conversion key, the downstream auxiliary computing module decrypts the received ciphertext of the conversion key to obtain the conversion key corresponding to each upstream module. Each conversion key is used to convert the obfuscated intermediate data output by the corresponding upstream module into the input obfuscated state required by the downstream auxiliary computing module; the input key and output key of the auxiliary computing module are both the corresponding obfuscated keys; the input key of the VMM module is the row key, and the output key is the column key.
4. The key coupling obfuscation method for on-chip network in-memory computing as described in claim 3, characterized in that, The downstream auxiliary module performs the decryption operation of each conversion key ciphertext in parallel with the corresponding calculation operation in the upstream module.
5. The key coupling obfuscation method for on-chip network in-memory computing as described in claim 3 or 4, characterized in that, For the addition module, the calculation process includes: Received confused intermediate data from each upstream module Then, the obfuscated intermediate data from each upstream module is obfuscated according to the conversion key from each upstream module to the addition module, thereby converting the obfuscated intermediate data from each upstream module into the obfuscation key of the addition module. The corresponding obfuscated intermediate data; After summing the transformed confused intermediate data, the result is... The data is transmitted to downstream modules via the on-chip network.
6. The key coupling obfuscation method for on-chip network in-memory computing as described in claim 3 or 4, characterized in that, For the pooling module, the calculation process includes: Receive confused intermediate data from each upstream module And the output keys of each upstream module; The received obfuscated intermediate data is deobfuscated according to the output keys of each upstream module to obtain the plaintext operation data; After performing a pooling operation on the plaintext of the operation data, the obfuscation key of the pooling module is used. Perform an obfuscation operation on the result of the operation to obtain the obfuscation key. Corresponding obfuscated intermediate data It is then transmitted to downstream modules via the on-chip network.
7. The key coupling obfuscation method for on-chip network in-memory computing as described in claim 3 or 4, characterized in that, For the activation function module, the calculation process includes: After receiving the confused intermediate data from the upstream module, the activation function is used to activate it, and the activation result is transmitted to the downstream module through the on-chip network.
8. The key coupling obfuscation method for on-chip network in-memory computing as described in any one of claims 1 to 4, characterized in that, When performing a scrambling operation, each key bit in the key corresponds to a row pair or column pair, indicating whether the two rows in the row pair or the two columns in the column pair are swapped. Furthermore, obfuscation operations are performed according to the key, including: Perform the swap operation on the two rows or two columns that need to be swapped, according to the key bit instructions.
9. A key coupling and obfuscation system for on-chip network in-memory computing, characterized in that, include: In-store computing system; In the in-memory computing system, different modules and different chip levels are interconnected through on-chip networks; In the in-memory computing system, each VMM module used to implement vector matrix multiplication has a corresponding row key and column key; Each VMM module includes: a memristor array and peripheral circuitry connected to the memristor array, the peripheral circuitry including a conversion module; The memristor array stores the corresponding model weights, and the writing method of the model weights includes: performing a scrambling operation on the corresponding model weight matrix in the row dimension according to the row key to obtain the scrambling state data corresponding to the row key, and then performing a scrambling operation on the scrambling state data corresponding to the row key in the column dimension according to the column key to obtain the scrambling state data corresponding to the column key and storing it in the memristor array of the VMM module. The conversion module is used to convert the input vector of the VMM module into the row key of the VMM module. Corresponding obfuscated intermediate data ; The peripheral circuit is also used to perform the following operations: Based on the transformed confused state intermediate data By applying the corresponding input voltage to the memristor array and performing corresponding peripheral processing on the output of the memristor array, vector-matrix multiplication is achieved through the memristor array to obtain the confused intermediate data corresponding to the column key of the VMM module. ; When the calculation results of the VMM module need to be transmitted to downstream modules, the intermediate data will be mixed. The data is transmitted to downstream modules via an on-chip network; when the calculation result is the final output of the in-memory computing system, the intermediate data in the obfuscated state is deobfuscated according to the corresponding column key to restore the original order. The obfuscation operation is reversible, meaning that data is processed using the same key. After performing two consecutive obfuscation operations, the resulting data satisfy Deobfuscation is the inverse operation of obfuscation.
10. The key coupling and obfuscation system for on-chip network in-memory computing as described in claim 9, characterized in that, When performing a scrambling operation, each key bit in the key corresponds to a row pair or column pair, indicating whether the two rows in the row pair or the two columns in the column pair are swapped. Furthermore, obfuscation operations are performed according to the key, including: Perform the swap operation on the two rows or two columns that need to be swapped, according to the key bit instructions; Furthermore, the conversion module consists of m independent 2-to-1 multiplexers; m is the key length; Each 2-to-1 multiplexer uses the corresponding key bit as the selection signal, and the two inputs correspond to the cases of swapping two rows / two columns and not swapping two rows / two columns, respectively.
