CN109766705B - Circuit-based data verification method and device and electronic equipment - Google Patents

Circuit-based data verification method and device and electronic equipment Download PDF

Info

Publication number
CN109766705B
CN109766705B CN201811503687.5A CN201811503687A CN109766705B CN 109766705 B CN109766705 B CN 109766705B CN 201811503687 A CN201811503687 A CN 201811503687A CN 109766705 B CN109766705 B CN 109766705B
Authority
CN
China
Prior art keywords
data
sub
functional module
output data
certification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811503687.5A
Other languages
Chinese (zh)
Other versions
CN109766705A (en
Inventor
王虎森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Lianhua Future Technology Co.,Ltd.
Original Assignee
Beijing Lianhua Future Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Lianhua Future Technology Co ltd filed Critical Beijing Lianhua Future Technology Co ltd
Priority to CN201811503687.5A priority Critical patent/CN109766705B/en
Publication of CN109766705A publication Critical patent/CN109766705A/en
Application granted granted Critical
Publication of CN109766705B publication Critical patent/CN109766705B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention discloses a data verification method, a data verification device and electronic equipment based on a circuit, wherein the method comprises the following steps: splitting a target circuit into a plurality of mutually independent functional modules and generating a certification key and a verification key of each functional module; sending the functional modules and the certification key of each functional module to a certification party; receiving sub-output data, sub-input data and certification information of each functional module, which are obtained by the certification party based on target data, the functional module and a certification key of each functional module, and output data of the target circuit based on the target data; and verifying the sub-output data, the sub-input data and the certification information of each functional module according to the verification key of each functional module, and verifying the output data to determine whether the certification party holds the target data. By the method, the zero knowledge proof process based on the circuit can be shortened, and the verification efficiency is improved.

Description

Circuit-based data verification method and device and electronic equipment
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a circuit-based data verification method and apparatus, and an electronic device.
Background
With the continuous development of electronic technology, circuits used by people are larger and larger, circuit structures are more and more complex, people pay more attention to privacy problems based on large circuits, people combine zero knowledge proof with the circuits, and the secret data can be confident that the other party holds the secret data while the secret data is not exposed.
Zero-knowledge proof based on a large circuit means that a verifier generates a key pair for the whole circuit, sends the circuit and the key pair to a secret holder (i.e., a prover), the prover inputs secret data into the circuit, obtains data and proof information through circuit calculation, and sends the proof information to the verifier, and the verifier combines the key and the proof information to verify whether the prover holds the secret data.
However, in the above processing procedure, since the whole circuit is large, a certification key pair with a large data volume, a large content and a relatively complex content is generated, so that a large amount of memory resources are consumed, and the calculation procedure is also complex, so that the time for performing zero-knowledge certification by both parties is long, and the efficiency of data verification is low.
Disclosure of Invention
The embodiment of the invention aims to provide a circuit-based data verification method, a circuit-based data verification device and electronic equipment, and aims to solve the problems that in the prior art, a zero-knowledge proof process based on a large circuit is long, memory consumption is high, and data verification efficiency is low.
To solve the above technical problem, the embodiment of the present invention is implemented as follows:
in a first aspect, an embodiment of the present invention provides a data verification method based on a circuit, where the method includes:
splitting a target circuit into a plurality of mutually independent functional modules and generating a certification key and a verification key of each functional module;
sending the functional modules and the certification key of each functional module to a certification party;
receiving sub-output data, sub-input data and certification information of each functional module, which are obtained by the certification party based on target data, the functional module and a certification key of each functional module, and output data of the target circuit based on the target data;
and verifying the sub-output data, the sub-input data and the certification information of each functional module according to the verification key of each functional module, and verifying the output data to determine whether the target data is held by the certification party.
Optionally, after generating the certification key and the verification key of each functional module, the method further includes:
determining a verification function corresponding to the functional module, and sending the verification function to the proving party;
the receiving sub-output data, sub-input data and certification information of each function module, which are obtained by the certification party based on the target data, the function modules and the certification keys of each function module, includes:
and receiving sub-output data, sub-input data and certification information of each functional module, which are obtained by the certification party based on target data, the functional modules, the verification function and the certification key of each functional module.
Optionally, the output data includes target output data and a third random character string of the target circuit based on the target data, and the verifying sub-output data, sub-input data and certification information of each functional module according to the verification key of each functional module and verifying the output data to determine whether the target data is held by the certification party includes:
processing the certification information based on the verification key to obtain a first processing result;
processing the output data based on the verification function to obtain a second processing result;
and if the first processing result is successfully matched with the sub-output data and the sub-input data, and the second processing result is matched with the sub-output data of the last functional module of the target circuit, determining that the target data is held by the proving party.
In a second aspect, an embodiment of the present invention provides a circuit-based data verification method, where the method includes:
receiving a plurality of mutually independent functional modules split from a target circuit and a certification key of each functional module;
obtaining sub-output data, sub-input data and certification information of each functional module based on target data, the functional modules and the certification keys of each functional module, and determining output data of the target circuit based on the target data;
and sending the sub output data, the sub input data and the certification information of each functional module and the output data to a verifier so that the verifier verifies the sub output data, the sub input data and the certification information of each functional module and verifies the output data to determine whether the target data is held by the verifier.
Optionally, before obtaining the sub-output data, the sub-input data, and the certification information of each functional module based on the target data, the functional module, and the certification key of each functional module, the method further includes:
receiving a verification function corresponding to the functional module sent by a verifier;
the obtaining sub-output data, sub-input data, and certification information of each functional module based on the target data, the functional module, and the certification key of each functional module includes:
inputting the target data into the target circuit to obtain first input data and first output data based on each functional module;
acquiring sub-input data corresponding to the first input data of each functional module and sub-output data corresponding to the first output data based on the verification function;
and generating certification information corresponding to each functional module based on the certification key.
Optionally, the obtaining, based on the verification function, sub-input data corresponding to the first input data of each functional module and sub-output data corresponding to the first output data includes:
adding a first random character string into the first input data of each functional module, and generating sub-input data corresponding to each functional module by using the verification function;
and adding a second random character string into the first output data of each functional module, and generating sub-output data corresponding to each functional module by using the verification function.
In a third aspect, an embodiment of the present invention provides a circuit-based data verification apparatus, where the apparatus includes:
the splitting module is used for splitting the target circuit into a plurality of mutually independent functional modules and generating a certification key and a verification key of each functional module;
a sending module, configured to send the functional module and the certification key of each functional module to a certification party;
a receiving module, configured to receive sub output data, sub input data, and certification information of each functional module, which are obtained by the data processing apparatus based on target data, the functional module, and a certification key of each functional module, and output data of the target circuit based on the target data;
and the verification module is used for verifying the sub-output data, the sub-input data and the certification information of each functional module according to the verification key of each functional module and verifying the output data so as to determine whether the data processing device holds the target data.
Optionally, the apparatus further comprises:
the function sending module is used for determining a verification function corresponding to the function module and sending the verification function to the data processing device;
the receiving module comprises:
a receiving unit, configured to receive sub-output data, sub-input data, and certification information of each functional module, which are obtained by the certification party based on target data, the functional module, the verification function, and the certification key of each functional module.
Optionally, the output data includes target output data of the target circuit based on the target data and a third random string, and the verification module includes:
the first processing unit is used for processing the certification information based on the verification key to obtain a first processing result;
the second processing unit is used for processing the output data based on the verification function to obtain a second processing result;
and the verification unit is used for determining that the data processing device holds the target data if the first processing result is successfully matched with the sub-output data and the sub-input data and the second processing result is matched with the sub-output data of the last functional module of the target circuit.
In a fourth aspect, an embodiment of the present invention provides a circuit-based data verification apparatus, where the apparatus includes:
the data receiving module is used for receiving a plurality of mutually independent functional modules which are split from a target circuit and a certification key of each functional module;
the data processing module is used for obtaining sub-output data, sub-input data and certification information of each functional module based on target data, the functional modules and the certification keys of the functional modules, and determining output data of the target circuit based on the target data;
and the data sending module is used for sending the sub-output data, the sub-input data and the certification information of each functional module and the output data to a verifier so that the verifier verifies the sub-output data, the sub-input data and the certification information of each functional module and verifies the output data to determine whether the target data is held by the verifier.
Optionally, the apparatus further comprises:
the function receiving module is used for receiving a verification function corresponding to the function module sent by a verifier;
the data processing module comprises:
the first processing unit is used for inputting the target data into the target circuit to obtain first input data and first output data based on each functional module;
the second processing unit is used for acquiring sub-input data corresponding to the first input data of each functional module and sub-output data corresponding to the first output data based on the verification function;
and the data generation unit is used for generating the certification information corresponding to each functional module based on the certification key.
Optionally, the second processing unit is configured to:
adding a first random character string into the first input data of each functional module, and generating sub-input data corresponding to each functional module by using the verification function;
and adding a second random character string into the first output data of each functional module, and generating sub-output data corresponding to each functional module by using the verification function.
In a fifth aspect, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored on the memory and executable on the processor, and when the computer program is executed by the processor, the steps of the circuit-based data verification method provided in the first aspect are implemented.
In a sixth aspect, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored on the memory and executable on the processor, and when the computer program is executed by the processor, the steps of the circuit-based data verification method provided in the second aspect are implemented.
In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of the circuit-based data verification method provided in the foregoing embodiment.
As can be seen from the above technical solutions provided by the embodiments of the present invention, in the embodiments of the present invention, a target circuit is split into a plurality of mutually independent functional modules, a certification key and a verification key of each functional module are generated, then the functional modules and the certification keys of each functional module are sent to a certification party, sub-output data, sub-input data, and certification information of each functional module, which are obtained by the certification party based on target data, the functional modules, and the certification keys of each functional module, and output data of the target circuit based on the target data are received, then the sub-output data, the sub-input data, and the certification information of each functional module are verified according to the verification keys of each functional module, and the output data are verified to determine whether the certification party holds the target data, so that by splitting the target circuit, a complex large target circuit can be split into a plurality of mutually independent functional modules, by verifying the data of the functional modules respectively and generating the certification keys and the verification keys of the functional modules, the complexity of verifying the whole target circuit is reduced, the verification process is shortened, the space for generating the keys is saved, and the whole efficiency of data verification is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of an embodiment of a circuit-based data verification method of the present invention;
FIG. 2 is a schematic diagram of a target circuit splitting function module according to the present invention;
FIG. 3 is a flow chart of another embodiment of a circuit-based data verification method of the present invention;
FIG. 4 is a schematic diagram of a target circuit splitting function module according to yet another embodiment of the present invention;
FIG. 5 is a flow chart of another embodiment of a circuit-based data verification method according to the present invention;
FIG. 6 is a schematic diagram of a circuit-based data verification apparatus according to the present invention;
FIG. 7 is a schematic diagram of another circuit-based data verification apparatus according to the present invention;
FIG. 8 is a schematic structural diagram of an electronic device according to the present invention;
fig. 9 is a schematic structural diagram of another electronic device according to the present invention.
Detailed Description
The embodiment of the invention provides a circuit-based data verification method and device and electronic equipment.
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
As shown in fig. 1, an embodiment of the present invention provides a circuit-based data verification method, where an execution subject of the method may be a terminal device or a server, where the terminal device may be a device such as a personal computer, or may also be a mobile terminal device such as a mobile phone and a tablet computer, and the terminal device may be a terminal device used by a user. The server may be an independent server or a server cluster composed of a plurality of servers. The method may specifically comprise the steps of:
in step S102, the target circuit is split into a plurality of mutually independent functional modules, and a certification key and a verification key for each functional module are generated.
The target circuit may be any circuit that can be used for data verification, and the functional module may be an independent module obtained by splitting the target circuit according to a preset splitting rule. For the certification key and the verification key, if the verifier uses a symmetric encryption mechanism, the certification key may be a public key used by the verifier to decrypt the received certification information, and the verification key may be a public key used to encrypt data.
In implementation, with the continuous development of electronic technology, circuits used by people are larger and larger, circuit structures are more and more complex, people pay more attention to privacy problems based on large circuits, and people can ensure that an opposite side can certainly hold secret data while not exposing the secret data by combining zero knowledge proof with the circuits. Zero-knowledge proof based on a large circuit means that a verifier generates a key pair for the whole circuit, then sends the circuit and the key pair to a secret holder, namely a prover, the prover inputs secret data into the circuit, data and proof information are obtained through circuit calculation, the proof information is sent to the verifier, and the verifier combines the key and the proof information to verify whether the prover holds the secret data.
However, in this process, since the circuit is large, a large, many and complex certification key pairs are generated, a large amount of memory is consumed, and the calculation process is also complex, so that the time for both parties to perform zero-knowledge certification is long, and the efficiency of data verification is low. Therefore, an embodiment of the present invention provides a technical solution capable of solving the above problems, which may specifically include the following:
the target circuit may be split into a plurality of mutually independent functional modules according to a preset splitting rule, for example, the target circuit may be split into a plurality of mutually independent functional modules according to the size of the target circuit or the arrangement of electronic components in the target circuit, for example, the target circuit may be split into 8 serial electronic components, the target circuit may be split into 2 serial functional modules, each functional module includes 4 electronic components, further, for example, the target circuit may be composed of 8 parallel electronic components, the target circuit may be split into 4 parallel functional modules, each functional module includes 2 electronic components, and for example, the target circuit may be composed of 4 serial electronic components and 2 parallel electronic components, the target circuit may be split into 3 serial functional modules, where the first two functional modules may be split from 4 serial electronic components, the third functional module may be composed of the last two parallel electronic components, and the splitting method for the target circuit may be various, and the embodiment of the present invention provides that the target circuit is split based on the size of the target circuit or the arrangement manner of the electronic components in the target circuit, and in addition, different splitting methods may be implemented for the target circuit according to different actual application scenarios, which is not limited in the embodiment of the present invention. In addition, the functional modules may be arranged according to the arrangement of the electronic components in the target circuit, and may also have a plurality of arrangements, which is not limited in the embodiment of the present invention.
After the target circuit is split, a corresponding certification key and a verification key may be set for each functional module, before generating the keys, a symmetric encryption mechanism or an asymmetric encryption mechanism may be selectively used, if the symmetric encryption mechanism is used, the verification key and the certification key are the same key, a key pair including two same keys needs to be generated for each functional module (i.e., the verification key and the certification key are the same), if the asymmetric encryption mechanism is used, the certification key is a public key for encryption, the verification key is a private key for decryption, and a key pair including two different keys needs to be generated for each functional module, that is, the public key for encryption (certification key) and the private key for decryption (verification key). The key pairs of the functional modules may be the same or different, or the key pairs of the functional modules may be partially the same or different, for example, the target circuit includes 4 functional modules, the key pairs of the first two functional modules may be the same and are both the key pair 1, the key pairs of the second two functional modules may be the same and are both the key pair 2, and the key pair 1 and the key pair 2 are different, and the generation methods of the key pairs of the functional modules may be various, which is not limited in this embodiment of the present invention.
In step S104, the function module and the certification key of each function module are transmitted to the certification party.
In step S106, sub output data, sub input data, and certification information of each function module, which are obtained by the certification party based on the target data, the function module, and the certification key of each function module, and output data of the target circuit based on the target data are received.
The target data may be any data which is held by the proving party and not held by the verifying party, and the proving information may be information obtained based on the sub-output data and the sub-input data, or information which is agreed in advance by the verifying party and the proving party and is used for proving the sub-output data and the sub-input data.
In an implementation, the certification information of each function module received by the verifier may be certification information obtained by the verifier encrypting the sub-output data and the sub-input data of each function module through a certification key, for example, the target circuit includes 2 function modules, each function module has a sub-output data and a sub-input data, if the certification keys of the two function modules are respectively a key 1 and a key 2, the certification information of the first function module is certification information obtained by encrypting the sub-output data and the sub-input data of the function module according to the key 1, and the certification information of the second function module is certification information obtained by encrypting the sub-input data and the sub-output data of the second function module according to the key 2.
In addition, the certification information before encryption may also be information of a logical relationship between the sub input data and the sub output data of each functional module, for example, the certification information before encryption may be: the sub-output data needs to be 3 times the sub-input data, or the certification information may be: the sub-output data is not greater than the sub-input data, etc. The same proof logic information may be provided for different functional blocks, for example, as shown in fig. 2, the target circuit is split into 3 functional blocks, each containing 2 electronic components, wherein, the sub-input data of the function module 1 is the input data (i.e. target data) of the target circuit, the sub-output data of the function module 1 is the sub-input data of the function module 2, the sub-output data of the function module 2 is the sub-input data of the function module 3, the sub-output data of the function module 3 is the output data of the target circuit based on the target data, the proving logic of each function module can be as shown in table 1, according to the certification logic and the certification key of each functional module in table 1, certification information of each functional module can be obtained, for example, the certification information of the function module 1 is certification information obtained by encrypting the certification logic (i.e., the sub input data is smaller than the sub output data) of the function module 1 by the certification key 1.
TABLE 1
Functional module Attestation logic Certifying a secret key
Functional module 1 The sub-input data being smaller than the sub-output data Attestation key 1
Function module 2 The sub-output data is 3 times of the sub-input data Attestation key 1
Function module 3 The sub-input data being smaller than the sub-output data Attestation key 2
In step S108, the sub output data, the sub input data, and the certification information of each function module are verified according to the verification key of each function module, and the output data is verified to determine whether the target data is held by the certification party.
In implementation, after receiving the sub-output data, the sub-input data, and the certification information sent by the certifying party, the certifying information of each function module may be decrypted by the verification key, the sub-output data and the sub-input data of each module may be verified by the decrypted certification information, and whether the certifying party holds the target data is determined according to the certification result, for example, taking the certification logic of the function module in table 1 as an example, the certifying party decrypts the certification information 1-3 respectively according to the verification key to obtain the certification logic of each function module, and then compares and verifies the received sub-output data and sub-input data of each function module to obtain the verification result, if the received logic relationships between the sub-output data and the sub-input data of 3 function modules do not satisfy the corresponding certification logic, or one does not satisfy the certification logic, it is determined that the target data is not held by the proving party.
In addition, the received output data needs to be verified, for example, the output data needs to satisfy a predetermined verification condition, or the relationship between the output data after a predetermined operation and the sub-output data of the last one or more functional modules of the target circuit satisfies a predetermined verification condition, as shown in fig. 2, the output data after the predetermined operation needs to be the same as the sub-output data of the functional module 3, and if the verification of the output data is successful and the sub-output data, the sub-input data, and the certification information of each functional module are also verified, it can be determined that the target data is held by the certification party.
The embodiment of the invention provides a circuit-based data verification method, which comprises the steps of splitting a target circuit into a plurality of mutually independent functional modules, generating a certification key and a verification key of each functional module, sending the functional modules and the certification keys of the functional modules to a certification party, receiving sub-output data, sub-input data and certification information of each functional module, which are obtained by the certification party based on target data, the functional modules and the certification keys of the functional modules, and verifying the sub-output data, the sub-input data and the certification information of each functional module according to the verification keys of the functional modules after the target circuit outputs data based on the target data, and verifying the output data to determine whether the certification party holds the target data, so that the complicated large-scale target circuit can be split into the mutually independent functional modules through splitting the target circuit, by verifying the data of the functional modules and generating the certification keys and the verification keys of the functional modules, the complexity of verifying the whole target circuit is reduced, the verification process is shortened, the space for generating the keys is saved, and the whole efficiency of data verification is improved.
Example two
As shown in fig. 3, an embodiment of the present invention provides a circuit-based data verification method, where an execution subject of the method may be a terminal device or a server, where the terminal device may be a device such as a personal computer, or may also be a mobile terminal device such as a mobile phone and a tablet computer, and the terminal device may be a terminal device used by a user. The server may be an independent server or a server cluster composed of a plurality of servers. The method may specifically comprise the steps of:
in step S302, a plurality of mutually independent functional modules split from the target circuit and a certification key for each functional module are received.
In step S304, the sub output data, the sub input data, and the certification information of each function module are obtained based on the target data, the function module, and the certification key of each function module, and the output data of the target circuit based on the target data is determined.
In implementation, after receiving the function module and the certification key sent by the verifier, the target data may be input to the function module, and after the function module in the target circuit is processed, the output data corresponding to the target data may be obtained, as shown in fig. 2, the target data may be input to the function module 1, and after the function module 1-the function module 3 are processed, the final sub-output data of the function module 3 is the output data obtained by the target data based on the target circuit, and further, as shown in fig. 4, the received target circuit may be composed of 4 function modules, where the input end of the target circuit is the parallel function module 1 and function module 2, and the output end of the target circuit is the parallel function module 3 and function module 4, and at this time, when the target data is input to the target circuit, the target data may be split and input according to a preset rule, for example, the ratio of data input and output may be set according to the number of electronic components included in the function module, for example, if the function module 1 includes 1 electronic component and the function module 2 includes 2 electronic components, one third of the target data may be regarded as sub-input data of the function module 1, two thirds of the target data may be regarded as sub-input data of the function module 2, and when the function module 1 and the function module 2 calculate respective sub-input data to obtain corresponding sub-output data, the sum of one third of the sub-output data of the function module 1 and two thirds of the sub-output data of the function module 2 may be regarded as sub-input data of the next function module, and so on, the sub-input data and the sub-output data of each function module may be obtained, for example, if the target data is 15, the sub-input data of the function module 1 is 5, the sub-input data of the function module 2 is 10, if the sub-output data of the function module 1 is 6 and the sub-output data of the function module 2 is 24, the input data of the function module 3 and the function module 4 is 20(6/3+24 × 2/3 is 20), the sub-input data of the function module 3 is 8(20 × 2/5 is 8), the sub-input data of the function module 4 is 12(20 × 3/5 is 12), and if the sub-output data of the function module 3 is 10 and the sub-output data of the function module 4 is 40, the output data of the target data based on the target data is 28(10 × 2/5+40 × 3/5).
The above embodiment provides an optional and realizable method for obtaining output data based on a target circuit by target data and obtaining sub-input data and sub-output data of each functional module by the target data based on each functional module.
Based on the obtained sub-input data and sub-output data of each functional module, the certification information of each functional module can be obtained, and the method for obtaining the certification information can be found in part of the contents in step S304 in the above embodiment, which is not described herein again.
In step S306, the sub output data, the sub input data, and the certification information of each function module, and the output data are transmitted to the verifier, so that the verifier verifies the sub output data, the sub input data, and the certification information of each function module, and verifies the output data to determine whether the verifier holds the target data.
The embodiment of the invention provides a circuit-based data verification method, which comprises the steps of receiving a plurality of mutually independent functional modules split from a target circuit and a certification key of each functional module, obtaining sub-output data, sub-input data and certification information of each functional module based on target data, the functional modules and the certification keys of each functional module, determining output data of the target circuit based on the target data, sending the sub-output data, the sub-input data and the certification information of each functional module and the output data to a verifier, so that the verifier verifies the sub-output data, the sub-input data and the certification information of each functional module and verifies the output data to determine whether the verifier holds the target data, therefore, the complicated large-scale target circuit can be split into the plurality of mutually independent functional modules through splitting the target circuit, by verifying the data of the functional modules and generating the certification keys and the verification keys of the functional modules, the complexity of verifying the whole target circuit is reduced, the verification process is shortened, the space for generating the keys is saved, and the whole efficiency of data verification is improved.
EXAMPLE III
As shown in fig. 5, an execution subject of the method may be a terminal device or a server, where the terminal device may be a device such as a personal computer, or may also be a mobile terminal device such as a mobile phone and a tablet computer, and the terminal device may be a terminal device used by a user. The server may be an independent server or a server cluster composed of a plurality of servers. The method may specifically comprise the steps of:
in step S502, the verifier splits the target circuit into a plurality of mutually independent functional modules, and generates a certification key and a verification key for each functional module.
For the specific processing procedure of S502, reference may be made to relevant contents of S102 in the first embodiment, which is not described herein again.
In step S504, the verifier sends the functional module and the certification key of each of the functional modules to the certifier.
In step S506, the verifier determines a verification function corresponding to the function module and sends the verification function to the prover.
The verification function may be a function that performs data conversion on the sub-input data and/or the sub-output data of the functional module, such as a custom function, a hash function, and the like.
In implementation, in order to avoid that the verifier converts the received data to obtain the target data held by the prover, a corresponding verification function may be set for each functional module, taking the verification function as a hash function as an example, the hash function may include an MD4 algorithm, an MD5 algorithm, an SHA1 algorithm, and the like, and one of the algorithms may be selected as the verification function of all the functional modules, or a different hash function may be set for each functional module, which is not limited in the embodiment of the present invention.
In step S508, the proving party inputs the target data into the target circuit, resulting in first input data and first output data on a per function block basis.
The first input data may be input data obtained by each functional module based on a previous functional module, and the first output data may be output data obtained by the first input data of each functional module.
In implementation, after receiving the plurality of mutually independent functional modules split from the target circuit, the certification key of each functional module, and the verification function corresponding to each functional module, the certification party may input target data to the target circuit to obtain first input data and first output data based on each functional module.
For the specific processing procedure of S508, reference may be made to the related content of S304 in the second embodiment, which is not described herein again.
In step S510, the proving party obtains sub-input data corresponding to the first input data and sub-output data corresponding to the first output data of each functional module based on the verification function.
In implementation, based on the verification function, the sub-input data corresponding to the first input data of each function module may be obtained, for example, taking the target circuit of fig. 2 as an example, if the verification function of each function module is the same hash function, after the target data is input into the function module 1, the target data is the first input data of the function module 1, the hash value corresponding to the first input data is obtained through the hash function, the hash value is the sub-input data corresponding to the first input data of the function module 1, after the first input data passes through the function module 1, the first output data may be obtained, the corresponding hash value is generated for the first output data, which is the sub-output data of the function module 1 corresponding to the first output data, the first output data of the function module 1 is the first input data of the function module 2, since the verification functions of each function module are the same hash function, the sub-input data corresponding to the first input data of the function module 2 is equal to the sub-output data of the function module 2, and in addition, different hash functions may be set for each function module, for example, if the verification function of the function module 1 received by the proving party is hash function 1, and the verification function of the function module 2 is hash function 2, the sub-output data of the function module 1 and the sub-input data of the function module 2 are different due to different adopted verification functions.
Besides, in addition to the method for acquiring the sub-input data and the sub-output data of each functional module adopted in the above embodiment, there may be the following acquisition method:
adding a first random character string into the first input data of each functional module, and generating sub-input data corresponding to each functional module by using a verification function.
In an implementation, the first random string of each function module may be obtained through a random function, and when calculating the sub-input data of each function module, the first input data of each function module may be added to the first random string, and then the corresponding sub-input data is obtained through a verification function, for example, the verification function is a hash function, the first random string of the ith function module is rand _ str1_ i, and then the sub-input data of the ith function module is digest _ in _ i ═ hash (in _ i | | | rand 1_ i), where in _ i is the first input data of the ith function module.
And step two, adding a second random character string into the first output data of each functional module, and generating sub-output data corresponding to each functional module by using a verification function.
In an implementation, the second random string of each function module may be obtained through a random function, and when calculating the sub-output data of each function module, the first output data of each function module may be added to the second random string, and then the corresponding sub-output data is obtained through a verification function, for example, the verification function is a hash function, the second random string of the ith function module is rand _ str2_ i, and then the sub-output data of the ith function module is digest _ out _ i ═ hash (out _ i | | rand _ str2_ i), where out _ i is the first output data of the ith function module.
In step S512, the proving party generates certification information corresponding to each functional module based on the certification key.
For the specific processing procedure of S512, reference may be made to the related content of S304 in the second embodiment, which is not described herein again.
In step S514, the proving party determines output data of the target circuit based on the target data.
For the specific processing procedure of S514, reference may be made to the relevant content of S304 in the second embodiment, which is not described herein again.
In step S516, the proving party transmits the sub output data, the sub input data, and the proving information of each function module, and the output data to the verifying party.
After the verifier receives the sub output data, the sub input data, and the certification information of each function module, which are obtained by the verifier based on the target data, the function module, the verification function, and the certification key of each function module, and the output data of the target circuit based on the target data, the verifier may process the received data, and the specific processing procedure may be shown in the following steps S518 to S522.
In step S518, the verifier processes the certification information based on the verification key, resulting in a first processing result.
For the specific processing procedure of S518, reference may be made to relevant contents of S106 in the first embodiment, which is not described herein again.
In step S520, the verifier processes the output data based on the verification function to obtain a second processing result.
Wherein the output data may include target output data of the target circuit based on the target data and the third random string.
In an implementation, the output data received by the verifier may include target output data of the target circuit based on the target data, as shown in fig. 2, where the target output function is the first output data of the function module 3, and the output data may further include a third random string, and the verifier may process the target output data and the third random string based on the verification function to obtain a second processing result, that is, the second processing result may be digest _ out1 ═ hash (out | | rand 2), where out is the target output data, and rand _ str2 is the third random string.
In step S522, if the first processing result is successfully matched with the sub output data and the sub input data, and the second processing result is matched with the sub output data of the last functional module of the target circuit, it is determined that the proving party holds the target data.
In addition, after the second processing result is obtained, the second processing result may be matched with the sub-output data of the last functional module obtained by the target circuit based on the target data, as shown in fig. 2, the second processing result obtained by processing the target data based on the target output data obtained by the target circuit based on the verification function needs to be matched with the sub-output data of the functional module 3 received by the verifier, and the first processing result is successfully matched with the sub-output data and the sub-input data, so that it may be determined that the target data is held by the verifier.
The embodiment of the invention provides a circuit-based data verification method, a verifier divides a target circuit into a plurality of mutually independent function modules and generates a certification key and a verification key of each function module, then sends the function modules and the certification keys of each function module to the verifier, the verifier generates sub-output data, sub-input data and certification information of each function module after receiving the function modules and the certification keys, and the target data is based on the output data of the target circuit and then sends the data to the verifier, the verifier receives the sub-output data, sub-input data and certification information of each function module obtained by the verifier based on the target data, the function modules and the certification keys of each function module, and the target circuit is based on the output data of the target data and according to the verification keys of each function module, the sub-output data, the sub-input data and the certification information of each functional module are verified, the output data are verified to determine whether a certification party holds target data, therefore, a complex large-scale target circuit can be split into a plurality of mutually independent functional modules through splitting the target circuit, and the certification keys and the verification keys of the functional modules are generated through verifying the data of the functional modules, so that the complexity of verifying the whole target circuit is reduced, the verification process is shortened, the space for generating the keys is saved, and the overall efficiency of data verification is improved.
Example four
Based on the same idea, the circuit-based data verification method provided in the embodiment of the present invention further provides a circuit-based data verification apparatus, as shown in fig. 6.
The circuit-based data verification apparatus includes: splitting module 601, sending module 602, receiving module 603, and verifying module 604, wherein:
the splitting module 601 is configured to split the target circuit into a plurality of mutually independent functional modules, and generate a certification key and a verification key of each functional module;
a sending module 602, configured to send the functional module and the certification key of each functional module to a certification party;
a receiving module 603, configured to receive sub output data, sub input data, and certification information of each functional module obtained by the data processing apparatus based on target data, the functional module, and a certification key of each functional module, and output data of the target circuit based on the target data;
the verifying module 604 is configured to verify the sub output data, the sub input data, and the certification information of each functional module according to the verification key of each functional module, and verify the output data to determine whether the data processing apparatus holds the target data.
In an embodiment of the present invention, the apparatus further includes:
the function sending module is used for determining a verification function corresponding to the function module and sending the verification function to the data processing device;
the receiving module comprises:
a receiving unit, configured to receive sub-output data, sub-input data, and certification information of each functional module, which are obtained by the certification party based on target data, the functional module, the verification function, and the certification key of each functional module.
In an embodiment of the present invention, the output data includes target output data of the target circuit based on the target data and a third random string, and the verification module 604 includes:
the first processing unit is used for processing the certification information based on the verification key to obtain a first processing result;
the second processing unit is used for processing the output data based on the verification function to obtain a second processing result;
and the verification unit is used for determining that the data processing device holds the target data if the first processing result is successfully matched with the sub-output data and the sub-input data and the second processing result is matched with the sub-output data of the last functional module of the target circuit.
The embodiment of the invention provides a circuit-based data verification device, which is characterized in that a target circuit is divided into a plurality of mutually independent functional modules, a certification key and a verification key of each functional module are generated, then the functional modules and the certification keys of the functional modules are sent to a certification party, sub-output data, sub-input data and certification information of each functional module, which are obtained by the certification party based on target data, the functional modules and the certification keys of the functional modules, are received, and after the target circuit outputs data based on the target data, the sub-output data, the sub-input data and the certification information of each functional module are verified according to the verification keys of the functional modules, and the output data are verified to determine whether the certification party holds the target data, so that the complicated large-scale target circuit can be divided into a plurality of mutually independent functional modules through the division of the target circuit, by verifying the data of the functional modules and generating the certification keys and the verification keys of the functional modules, the complexity of verifying the whole target circuit is reduced, the verification process is shortened, the space for generating the keys is saved, and the whole efficiency of data verification is improved.
EXAMPLE five
Based on the same idea, an embodiment of the present invention further provides a circuit-based data verification apparatus, as shown in fig. 7.
The circuit-based data verification apparatus includes: a data receiving module 701, a data processing module 702, and a data sending module 703, wherein:
a data receiving module 701, configured to receive a plurality of mutually independent functional modules split from a target circuit and a certification key of each of the functional modules;
a data processing module 702, configured to obtain sub-output data, sub-input data, and certification information of each functional module based on target data, the functional module, and a certification key of each functional module, and determine output data of the target circuit based on the target data;
a data sending module 703, configured to send the sub-output data, the sub-input data, and the certification information of each function module, and the output data to a verifier, so that the verifier verifies the sub-output data, the sub-input data, and the certification information of each function module, and verifies the output data to determine whether the target data is held by the verifier.
In an embodiment of the present invention, the apparatus further includes:
the function receiving module is used for receiving a verification function corresponding to the function module sent by a verifier;
the data processing module comprises:
the first processing unit is used for inputting the target data into the target circuit to obtain first input data and first output data based on each functional module;
the second processing unit is used for acquiring sub-input data corresponding to the first input data of each functional module and sub-output data corresponding to the first output data based on the verification function;
and the data generation unit is used for generating the certification information corresponding to each functional module based on the certification key.
In an embodiment of the present invention, the second processing unit is configured to:
adding a first random character string into the first input data of each functional module, and generating sub-input data corresponding to each functional module by using the verification function;
and adding a second random character string into the first output data of each functional module, and generating sub-output data corresponding to each functional module by using the verification function.
The embodiment of the invention provides a fault information collecting device, which receives a plurality of mutually independent functional modules and a certification key of each functional module, which are split from a target circuit, and then obtains sub-output data, sub-input data and certification information of each functional module based on target data and the certification key of the functional modules and each functional module, determines output data of the target circuit based on the target data, and sends the sub-output data, the sub-input data and the certification information of each functional module and the output data to a verifier so that the verifier verifies the sub-output data, the sub-input data and the certification information of each functional module and verifies the output data to determine whether the verifier holds the target data, thus, the complicated large target circuit can be split into a plurality of mutually independent functional modules by splitting the target circuit, by verifying the data of the functional modules and generating the certification keys and the verification keys of the functional modules, the complexity of verifying the whole target circuit is reduced, the verification process is shortened, the space for generating the keys is saved, and the whole efficiency of data verification is improved.
EXAMPLE six
Fig. 8 is a schematic diagram of a hardware structure of an electronic device for implementing various embodiments of the present invention, where the electronic device may be a terminal device or a server provided in the above embodiments,
the electronic device 800 includes, but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, a processor 810, and a power supply 811. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 8 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
The processor 810 is configured to split the target circuit into a plurality of mutually independent functional modules, and generate a certification key and a verification key of each functional module;
a processor 810, further configured to send the functional module and the certification key of each functional module to a certification party;
a processor 810, further configured to receive sub-output data, sub-input data, and certification information of each functional module obtained by the certification party based on target data, the functional module, and a certification key of each functional module, and output data of the target circuit based on the target data;
in addition, the processor 810 is further configured to verify the sub output data, the sub input data, and the certification information of each functional module according to the verification key of each functional module, and verify the output data to determine whether the target data is held by the proving party.
In addition, the processor 810 is further configured to determine a verification function corresponding to the functional module, and send the verification function to the proving party;
the processor 810 is further configured to receive sub-output data, sub-input data, and certification information of each functional module, which are obtained by the certification party based on the target data, the functional module, the verification function, and the certification key of each functional module.
In addition, the processor 810 is further configured to process the certification information based on the verification key to obtain a first processing result;
in addition, the processor 810 is further configured to process the target data based on the verification function to obtain a second processing result;
the processor 810 is further configured to determine that the target data is held by the proving party if the first processing result is successfully matched with the sub-output data and the sub-input data, and the second processing result is successfully matched with the sub-output data of the last functional module of the target circuit.
The embodiment of the invention provides equipment, which is characterized in that a target circuit is split into a plurality of mutually independent functional modules, a certification key and a verification key of each functional module are generated, then the functional modules and the certification keys of each functional module are sent to a certification party, sub output data, sub input data and certification information of each functional module, which are obtained by the certification party based on target data, the functional modules and the certification keys of each functional module, are received, the sub output data, the sub input data and the certification information of each functional module are verified according to the verification keys of each functional module after the target circuit is based on the output data of the target data, and the output data is verified to determine whether the certification party holds the target data, so that the complicated large-scale target circuit can be split into a plurality of mutually independent functional modules through splitting of the target circuit, by verifying the data of the functional modules and generating the certification keys and the verification keys of the functional modules, the complexity of verifying the whole target circuit is reduced, the verification process is shortened, the space for generating the keys is saved, and the whole efficiency of data verification is improved. It should be understood that, in the embodiment of the present invention, the radio frequency unit 801 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 810; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 801 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. Further, the radio frequency unit 801 can also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 802, such as to assist the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 803 may convert audio data received by the radio frequency unit 801 or the network module 802 or stored in the memory 809 into an audio signal and output as sound. Also, the audio output unit 803 may also provide audio output related to a specific function performed by the electronic apparatus 800 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 803 includes a speaker, a buzzer, a receiver, and the like.
The input unit 804 is used for receiving an audio or video signal. The input Unit 804 may include a Graphics Processing Unit (GPU) 8041 and a microphone 8042, and the Graphics processor 8041 processes image data of a still picture or video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 806. The image frames processed by the graphics processor 8041 may be stored in the memory 809 (or other storage medium) or transmitted via the radio frequency unit 801 or the network module 802. The microphone 8042 can receive sound, and can process such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 801 in case of a phone call mode.
The electronic device 800 also includes at least one sensor 805, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 8061 according to the brightness of ambient light and a proximity sensor that can turn off the display panel 8061 and/or the backlight when the electronic device 800 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 805 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 806 is used to display information input by the user or information provided to the user. The Display unit 806 may include a Display panel 8061, and the Display panel 8061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 807 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus. Specifically, the user input unit 807 includes a touch panel 8071 and other input devices 8072. The touch panel 8071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 8071 (e.g., operations by a user on or near the touch panel 8071 using a finger, a stylus, or any other suitable object or accessory). The touch panel 8071 may include two portions of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 810, receives a command from the processor 810, and executes the command. In addition, the touch panel 8071 can be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 8071, the user input unit 807 can include other input devices 8072. In particular, other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 8071 can be overlaid on the display panel 8061, and when the touch panel 8071 detects a touch operation on or near the touch panel 8071, the touch operation is transmitted to the processor 810 to determine the type of the touch event, and then the processor 810 provides a corresponding visual output on the display panel 8061 according to the type of the touch event. Although in fig. 8, the touch panel 8071 and the display panel 8061 are two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 8071 and the display panel 8061 may be integrated to implement the input and output functions of the electronic device, and the implementation is not limited herein.
The interface unit 808 is an interface for connecting an external device to the electronic apparatus 800. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 808 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic device 800 or may be used to transmit data between the electronic device 800 and external devices.
The memory 809 may be used to store software programs as well as various data. The memory 809 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 409 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 810 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 809 and calling data stored in the memory 809, thereby monitoring the whole electronic device. Processor 810 may include one or more processing units; preferably, the processor 810 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 810.
The electronic device 800 may also include a power supply 811 (e.g., a battery) for powering the various components, and preferably, the power supply 811 may be logically coupled to the processor 810 via a power management system to manage charging, discharging, and power consumption management functions via the power management system.
Preferably, an embodiment of the present invention further provides an electronic device, which includes a processor 810, a memory 809, and a computer program stored in the memory 809 and capable of running on the processor 810, where the computer program, when executed by the processor 810, implements each process of the above-mentioned circuit-based data verification method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
EXAMPLE seven
Fig. 9 is a schematic diagram of a hardware structure of an electronic device for implementing various embodiments of the present invention, where the electronic device may be a terminal device or a server provided in the foregoing embodiments,
the electronic device 800 includes, but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, a processor 910, and a power supply 911. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 9 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
The processor 910 is configured to receive a plurality of mutually independent functional modules split from a target circuit and a certification key of each of the functional modules;
a processor 910, further configured to obtain sub-output data, sub-input data, and certification information of each functional module based on target data, the functional module, and a certification key of each functional module, and determine output data of the target circuit based on the target data;
the processor 910 is further configured to send the sub output data, the sub input data, and the certification information of each functional module, and the output data to a verifier, so that the verifier verifies the sub output data, the sub input data, and the certification information of each functional module, and verifies the output data to determine whether the target data is held by the verifier.
In addition, the processor 910 is further configured to receive a verification function corresponding to the functional module sent by the verifier;
in addition, the processor 910 is further configured to input the target data into the target circuit, so as to obtain first input data and first output data based on each of the functional modules;
in addition, the processor 910 is further configured to obtain, based on the verification function, sub-input data corresponding to the first input data of each functional module and sub-output data corresponding to the first output data;
in addition, the processor 910 is further configured to generate certification information corresponding to each functional module based on the certification key.
In addition, the processor 910 is further configured to add a first random character string to the first input data of each functional module, and generate sub-input data corresponding to each functional module by using the verification function;
in addition, the processor 910 is further configured to add a second random string to the first output data of each functional module, and generate sub-output data corresponding to each functional module by using the verification function.
The embodiment of the invention provides electronic equipment, which receives a plurality of mutually independent functional modules split from a target circuit and a certification key of each functional module, then obtains sub-output data, sub-input data and certification information of each functional module based on target data, the functional modules and the certification keys of each functional module, determines output data of the target circuit based on the target data, and sends the sub-output data, the sub-input data and the certification information of each functional module and the output data to a verifier so that the verifier verifies the sub-output data, the sub-input data and the certification information of each functional module and verifies the output data to determine whether the verifier holds the target data, thus, the complicated large-scale target circuit can be split into a plurality of mutually independent functional modules by splitting the target circuit, by verifying the data of the functional modules and generating the certification keys and the verification keys of the functional modules, the complexity of verifying the whole target circuit is reduced, the verification process is shortened, the space for generating the keys is saved, and the whole efficiency of data verification is improved.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 901 may be used for receiving and sending signals during a message transmission and reception process or a call process, and specifically, after receiving downlink data from a base station, the downlink data is processed by the processor 910; in addition, the uplink data is transmitted to the base station. Generally, the radio frequency unit 901 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 901 can also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 902, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 903 may convert audio data received by the radio frequency unit 901 or the network module 902 or stored in the memory 909 into an audio signal and output as sound. Also, the audio output unit 903 may provide audio output related to a specific function performed by the electronic device 900 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 903 includes a speaker, a buzzer, a receiver, and the like.
The input unit 904 is used to receive audio or video signals. The input Unit 904 may include a Graphics Processing Unit (GPU) 9041 and a microphone 9042, and the Graphics processor 9041 processes image data of a still picture or video obtained by an image capturing device (such as a camera) in a video capture mode or an image capture mode. The processed image frames may be displayed on the display unit 906. The image frames processed by the graphic processor 9041 may be stored in the memory 909 (or other storage medium) or transmitted via the radio frequency unit 901 or the network module 902. The microphone 9042 can receive sounds and can process such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 901 in case of the phone call mode.
The electronic device 900 also includes at least one sensor 905, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 9061 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 9061 and/or the backlight when the electronic device 900 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 905 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which are not described in detail herein.
The display unit 906 is used to display information input by the user or information provided to the user. The Display unit 906 may include a Display panel 9061, and the Display panel 9061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 907 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 907 includes a touch panel 9071 and other input devices 9072. The touch panel 9071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 9071 (e.g., operations by a user on or near the touch panel 9071 using a finger, a stylus, or any other suitable object or accessory). The touch panel 9071 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 910, receives a command from the processor 910, and executes the command. In addition, the touch panel 9071 may be implemented by using various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The user input unit 907 may include other input devices 9072 in addition to the touch panel 9071. Specifically, the other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control key, a switch key, and the like), a track ball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 9071 may be overlaid on the display panel 9061, and when the touch panel 9071 detects a touch operation on or near the touch panel 9071, the touch panel is transmitted to the processor 910 to determine the type of the touch event, and then the processor 910 provides a corresponding visual output on the display panel 9061 according to the type of the touch event. Although in fig. 9, the touch panel 9071 and the display panel 9061 are two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 9071 and the display panel 9061 may be integrated to implement the input and output functions of the electronic device, which is not limited herein.
The interface unit 908 is an interface for connecting an external device to the electronic apparatus 900. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 908 may be used to receive input from external devices (e.g., data information, power, etc.) and transmit the received input to one or more elements within the electronic device 900 or may be used to transmit data between the electronic device 900 and external devices.
The memory 909 may be used to store software programs as well as various data. The memory 909 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 409 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 910 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 909 and calling data stored in the memory 909, thereby performing overall monitoring of the electronic device. Processor 910 may include one or more processing units; preferably, the processor 910 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 910.
The electronic device 900 may further include a power supply 911 (e.g., a battery) for supplying power to various components, and preferably, the power supply 911 may be logically connected to the processor 910 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system.
Preferably, an embodiment of the present invention further provides an electronic device, which includes a processor 910, a memory 909, and a computer program that is stored in the memory 909 and can be run on the processor 910, and when the computer program is executed by the processor 910, the electronic device implements each process of the above-mentioned circuit-based data verification method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
Example eight
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the circuit-based data verification method provided in the first to third embodiments, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
The embodiment of the invention provides a computer-readable storage medium, which is formed by splitting a target circuit into a plurality of mutually independent functional modules, generating a certification key and a verification key of each functional module, sending the functional modules and the certification keys of each functional module to a certification party, receiving sub-output data, sub-input data and certification information of each functional module, which are obtained by the certification party based on target data, the functional modules and the certification keys of each functional module, and output data of the target circuit based on the target data, verifying the sub-output data, the sub-input data and the certification information of each functional module according to the verification keys of each functional module, and verifying the output data to determine whether the certification party holds the target data, so that the complicated large-scale target circuit can be split into a plurality of mutually independent functional modules through splitting the target circuit, by verifying the data of the functional modules and generating the certification keys and the verification keys of the functional modules, the complexity of verifying the whole target circuit is reduced, the verification process is shortened, the space for generating the keys is saved, and the whole efficiency of data verification is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present invention, and is not intended to limit the present invention. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (9)

1. A circuit-based data verification method, applied to a verifier, the method comprising:
splitting a target circuit into a plurality of mutually independent functional modules and generating a certification key and a verification key of each functional module;
sending the functional modules and the certification key of each functional module to a certification party;
receiving sub-output data, sub-input data and certification information of each functional module, which are obtained by the certification party based on target data, the functional module and a certification key of each functional module, and output data of the target circuit based on the target data;
verifying the sub-output data, the sub-input data and the certification information of each functional module according to the verification key of each functional module, and verifying the output data to determine whether the target data is held by the certification party;
wherein after generating the certification key and the verification key of each functional module, the method further comprises:
determining a verification function corresponding to the functional module, and sending the verification function to the proving party;
the receiving sub-output data, sub-input data and certification information of each function module, which are obtained by the certification party based on the target data, the function modules and the certification keys of each function module, includes:
receiving sub-output data, sub-input data and certification information of each function module, which are obtained by the certification party based on target data, the function modules, the verification function and the certification key of each function module;
wherein the output data includes target output data and a third random string of the target circuit based on the target data, and the verifying sub-output data, sub-input data and certification information of each functional module according to the verification key of each functional module and verifying the output data to determine whether the target data is held by the certification party includes:
processing the certification information based on the verification key to obtain a first processing result;
processing the output data based on the verification function to obtain a second processing result;
and if the first processing result is successfully matched with the sub-output data and the sub-input data, and the second processing result is matched with the sub-output data of the last functional module of the target circuit, determining that the target data is held by the proving party.
2. A circuit-based data verification method, applied to a proving party, the method comprising:
receiving a plurality of mutually independent functional modules split from a target circuit and a certification key of each functional module;
obtaining sub-output data, sub-input data and certification information of each functional module based on target data, the functional modules and the certification keys of each functional module, and determining output data of the target circuit based on the target data;
sending the sub output data, the sub input data and the certification information of each functional module and the output data to a verifier so that the verifier verifies the sub output data, the sub input data and the certification information of each functional module and verifies the output data to determine whether the verifier holds the target data;
before obtaining the sub-output data, the sub-input data, and the certification information of each functional module based on the target data, the functional module, and the certification key of each functional module, the method further includes:
receiving a verification function corresponding to the functional module sent by a verifier;
the obtaining sub-output data, sub-input data, and certification information of each functional module based on the target data, the functional module, and the certification key of each functional module includes:
inputting the target data into the target circuit to obtain first input data and first output data based on each functional module;
acquiring sub-input data corresponding to the first input data of each functional module and sub-output data corresponding to the first output data based on the verification function;
and generating certification information corresponding to each functional module based on the certification key.
3. The method according to claim 2, wherein the obtaining sub-input data corresponding to the first input data and sub-output data corresponding to the first output data of each functional module based on the verification function comprises:
adding a first random character string into the first input data of each functional module, and generating sub-input data corresponding to each functional module by using the verification function;
and adding a second random character string into the first output data of each functional module, and generating sub-output data corresponding to each functional module by using the verification function.
4. A circuit-based data verification apparatus, the apparatus comprising:
the splitting module is used for splitting the target circuit into a plurality of mutually independent functional modules and generating a certification key and a verification key of each functional module;
a sending module, configured to send the functional module and the certification key of each functional module to a certification party;
a receiving module, configured to receive sub output data, sub input data, and certification information of each functional module, which are obtained by the data processing apparatus based on target data, the functional module, and a certification key of each functional module, and output data of the target circuit based on the target data;
the verification module is used for verifying the sub-output data, the sub-input data and the certification information of each functional module according to the verification key of each functional module and verifying the output data to determine whether the data processing device holds the target data;
wherein the apparatus further comprises:
the function sending module is used for determining a verification function corresponding to the function module and sending the verification function to the data processing device;
the receiving module comprises:
a receiving unit, configured to receive sub-output data, sub-input data, and certification information of each functional module, which are obtained by the certification party based on target data, the functional module, the verification function, and a certification key of each functional module;
wherein the output data includes target output data of the target circuit based on the target data and a third random string, the verification module including:
the first processing unit is used for processing the certification information based on the verification key to obtain a first processing result;
the second processing unit is used for processing the output data based on the verification function to obtain a second processing result;
and the verification unit is used for determining that the data processing device holds the target data if the first processing result is successfully matched with the sub-output data and the sub-input data and the second processing result is matched with the sub-output data of the last functional module of the target circuit.
5. A circuit-based data verification apparatus, the apparatus comprising:
the data receiving module is used for receiving a plurality of mutually independent functional modules which are split from a target circuit and a certification key of each functional module;
the data processing module is used for obtaining sub-output data, sub-input data and certification information of each functional module based on target data, the functional modules and the certification keys of the functional modules, and determining output data of the target circuit based on the target data;
the data sending module is used for sending the sub-output data, the sub-input data and the certification information of each functional module and the output data to a verifier so that the verifier verifies the sub-output data, the sub-input data and the certification information of each functional module and verifies the output data to determine whether the verifier holds the target data;
wherein the apparatus further comprises:
the function receiving module is used for receiving a verification function corresponding to the function module sent by a verifier;
the data processing module comprises:
the first processing unit is used for inputting the target data into the target circuit to obtain first input data and first output data based on each functional module;
the second processing unit is used for acquiring sub-input data corresponding to the first input data of each functional module and sub-output data corresponding to the first output data based on the verification function;
and the data generation unit is used for generating the certification information corresponding to each functional module based on the certification key.
6. The apparatus of claim 5, wherein the second processing unit is configured to:
adding a first random character string into the first input data of each functional module, and generating sub-input data corresponding to each functional module by using the verification function;
and adding a second random character string into the first output data of each functional module, and generating sub-output data corresponding to each functional module by using the verification function.
7. An electronic device comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the circuit-based data verification method of claim 1.
8. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the circuit-based data verification method of any one of claims 2 to 3.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the circuit-based data verification method according to claim 1 or according to any one of claims 2 to 3.
CN201811503687.5A 2018-12-10 2018-12-10 Circuit-based data verification method and device and electronic equipment Active CN109766705B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811503687.5A CN109766705B (en) 2018-12-10 2018-12-10 Circuit-based data verification method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811503687.5A CN109766705B (en) 2018-12-10 2018-12-10 Circuit-based data verification method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109766705A CN109766705A (en) 2019-05-17
CN109766705B true CN109766705B (en) 2021-03-19

Family

ID=66451198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811503687.5A Active CN109766705B (en) 2018-12-10 2018-12-10 Circuit-based data verification method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109766705B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110289950B (en) * 2019-05-29 2021-11-09 北京链化未来科技有限公司 Key information generation method and device
CN111027972B (en) * 2019-11-25 2023-09-01 北京链化未来科技有限公司 Block chain-based data verification method and device and electronic equipment
CN112434269A (en) * 2020-10-23 2021-03-02 上海点融信息科技有限责任公司 Zero knowledge proof method, verification method, computing device and storage medium of file

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101911153A (en) * 2008-01-21 2010-12-08 日本电信电话株式会社 Secure computing system
CN101997683A (en) * 2009-08-10 2011-03-30 北京多思科技发展有限公司 Method and device for authenticating zero knowledge proof
US9244857B2 (en) * 2013-10-31 2016-01-26 Oracle International Corporation Systems and methods for implementing low-latency lookup circuits using multiple hash functions
CN108206735A (en) * 2016-12-16 2018-06-26 波音公司 The method and system of password round key is generated by bit mixer

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8990570B2 (en) * 2012-07-31 2015-03-24 Alcatel Lucent Secure function evaluation for a covert client and a semi-honest server using string selection oblivious transfer

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101911153A (en) * 2008-01-21 2010-12-08 日本电信电话株式会社 Secure computing system
CN101997683A (en) * 2009-08-10 2011-03-30 北京多思科技发展有限公司 Method and device for authenticating zero knowledge proof
US9244857B2 (en) * 2013-10-31 2016-01-26 Oracle International Corporation Systems and methods for implementing low-latency lookup circuits using multiple hash functions
CN108206735A (en) * 2016-12-16 2018-06-26 波音公司 The method and system of password round key is generated by bit mixer

Also Published As

Publication number Publication date
CN109766705A (en) 2019-05-17

Similar Documents

Publication Publication Date Title
CN106850220B (en) Data encryption method, data decryption method and device
CN110417543B (en) Data encryption method, device and storage medium
CN110034876B (en) PUCCH resource indication and processing method, network side equipment and user terminal
CN109257336B (en) Block chain-based password information processing method and terminal equipment
CN109766705B (en) Circuit-based data verification method and device and electronic equipment
CN110826103B (en) Method, device, equipment and storage medium for processing document authority based on blockchain
CN111049980A (en) Application sharing method, electronic equipment and computer readable storage medium
CN111027972B (en) Block chain-based data verification method and device and electronic equipment
CN110572268B (en) Anonymous authentication method and device
CN108933670B (en) Digital signature method and device, mobile device and storage medium
CN109145644B (en) Private key confusion and digital signature generation method and device and intelligent device
CN107995151B (en) Login verification method, device and system
KR20200089695A (en) Orthogonal frequency division multiplexing code generation method and communication device
CN110597840B (en) Partner relationship establishment method, device, equipment and storage medium based on blockchain
CN109743289B (en) Data verification method and device based on neural network and electronic equipment
CN114553612B (en) Data encryption and decryption method and device, storage medium and electronic equipment
CN109451011B (en) Information storage method based on block chain and mobile terminal
CN114092101B (en) Transaction verification method and device, storage medium and electronic equipment
CN115270163B (en) Data processing method, related device and storage medium
CN115589286A (en) Data encryption and decryption method and device, electronic equipment and storage medium
CN110289950B (en) Key information generation method and device
CN115549889A (en) Decryption method, related device and storage medium
CN115174758A (en) Picture encryption method and device, electronic equipment and storage medium
CN114629649B (en) Data processing method and device based on cloud computing and storage medium
CN111050316A (en) Card locking method and device, computer readable storage medium and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20210114

Address after: 100080 1120-64, 11 / F, 18 Zhongguancun Street, Haidian District, Beijing

Applicant after: Beijing Lianhua Future Technology Co.,Ltd.

Address before: 310012 station 7, room 118, No.7 Cuibai Road, Xihu District, Hangzhou City, Zhejiang Province

Applicant before: HANGZHOU YINZHI TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant