The present disclosure relates to a
digital signature method and device, the method comprising: determining input signals of each gate circuit and a target Boolean circuit according to an
encryption algorithm, a private key and a public key message of a preset signature
algorithm; generating N random first
mask information for each input
signal of an
AND gate in the target Boolean circuit, and generating N-1 random second
mask information for each
AND gate, and the XOR sum of the N
mask information is the value of the preset mask information; for each
AND gate, performing a calculation operation to complete a
digital signature, comprising: determining first information using the first mask information of each input
signal and each second mask information; determining second information using the first information, each second mask information, each input
signal and the first mask information thereof; and completing the
digital signature using the first information and the second information, which reduces redundant calculation, processes the target Boolean circuit calculation in parallel, improves signature efficiency, and reduces operation cost.