给出我的SM2数字签名算法代码Java实现,所属文件SM2Signer.java
@Override
public BigInteger[] generateSignature(byte[] message) {
ECDomainParameters ec = key.getParameters();
BigInteger n = ec.getN(); //阶n
ECPoint G = ec.getG(); //基点G
BigInteger r, s;
// 获取私钥d
BigInteger d = ((ECPrivateKeyParameters)key).getD();
ECMultiplier basePointMultiplier = createBasePointMultiplier();
// 初始化随机数生成器
if (kCalculator.isDeterministic()) {
kCalculator.init(n, d, message);
} else {
kCalculator.init(n, random);
}
do {