public Digest() { super(new SM3Digest()); }
/** * Copy constructor. This will copy the state of the provided * message digest. */ public SM3Digest(SM3Digest t) { super(t); copyIn(t); }
int wj13 = this.W[j - 13]; int r7 = ((wj13 << 7) | (wj13 >>> (32 - 7))); this.W[j] = P1(this.W[j - 16] ^ this.W[j - 9] ^ r15) ^ r7 ^ this.W[j - 6]; int SS1 = ((s1_ << 7) | (s1_ >>> (32 - 7))); int SS2 = SS1 ^ a12; int TT1 = FF0(A, B, C) + D + SS2 + this.W1[j]; int TT2 = GG0(E, F, G) + H + SS1 + this.W[j]; D = C; C = ((B << 9) | (B >>> (32 - 9))); G = ((F << 19) | (F >>> (32 - 19))); F = E; E = P0(TT2); int SS1 = ((s1_ << 7) | (s1_ >>> (32 - 7))); int SS2 = SS1 ^ a12; int TT1 = FF1(A, B, C) + D + SS2 + this.W1[j]; int TT2 = GG1(E, F, G) + H + SS1 + this.W[j]; D = C; C = ((B << 9) | (B >>> (32 - 9))); G = ((F << 19) | (F >>> (32 - 19))); F = E; E = P0(TT2);
SM3Digest digest = new SM3Digest(); digest.update(z, 0, z.length); digest.update(message, 0, message.length); byte[] eHash = new byte[digest.getDigestSize()]; digest.doFinal(eHash, 0);
public int doFinal(byte[] out, int outOff) { finish(); Pack.intToBigEndian(this.V[0], out, outOff + 0); Pack.intToBigEndian(this.V[1], out, outOff + 4); Pack.intToBigEndian(this.V[2], out, outOff + 8); Pack.intToBigEndian(this.V[3], out, outOff + 12); Pack.intToBigEndian(this.V[4], out, outOff + 16); Pack.intToBigEndian(this.V[5], out, outOff + 20); Pack.intToBigEndian(this.V[6], out, outOff + 24); Pack.intToBigEndian(this.V[7], out, outOff + 28); reset(); return DIGEST_LENGTH; }
public BigInteger[] generateSignature(byte[] message) SM3Digest digest = new SM3Digest(); digest.update(z, 0, z.length); digest.update(message, 0, message.length); byte[] eHash = new byte[digest.getDigestSize()]; digest.doFinal(eHash, 0);
public SM2KeyExchange() { this(new SM3Digest()); }
public void reset(Memoable other) { SM3Digest d = (SM3Digest)other; super.copyIn(d); copyIn(d); }
public Memoable copy() { return new SM3Digest(this); }
public SM2Engine() { this(new SM3Digest()); }
public Object clone() throws CloneNotSupportedException { Digest d = (Digest)super.clone(); d.digest = new SM3Digest((SM3Digest)digest); return d; } }
public sm3WithSM2() { super(new SM3Digest(), new SM2Signer(), new StdDSAEncoder()); } }