Class SM9Sm3
java.lang.Object
org.bouncycastle.crypto.generators.SM9Sm3
The shared SM3-based auxiliary functions of SM9 (GM/T 0044-2016): the
cryptographic functions H1 and H2 that map a byte string to an integer in
[1, n-1] (GM/T 0044.2, 5.4), and the key derivation function KDF
(GM/T 0044.3/0044.4). H_v is SM3 (256-bit output).
-
Method Summary
Modifier and TypeMethodDescriptionstatic BigIntegerh1(byte[] z, BigInteger n) H1(Z, n): hash-to-range with the 0x01 domain prefix (GM/T 0044.2 5.4.2.2).static BigIntegerh2(byte[] z, BigInteger n) H2(Z, n): hash-to-range with the 0x02 domain prefix (GM/T 0044.2 5.4.2.3).static byte[]kdf(byte[] z, int klenBits) The SM9 key derivation function KDF(Z, klen) (GM/T 0044.3/0044.4), a counter-mode construction over SM3 with a 32-bit big-endian counter starting at 1.
-
Method Details
-
h1
H1(Z, n): hash-to-range with the 0x01 domain prefix (GM/T 0044.2 5.4.2.2). -
h2
H2(Z, n): hash-to-range with the 0x02 domain prefix (GM/T 0044.2 5.4.2.3). -
kdf
public static byte[] kdf(byte[] z, int klenBits) The SM9 key derivation function KDF(Z, klen) (GM/T 0044.3/0044.4), a counter-mode construction over SM3 with a 32-bit big-endian counter starting at 1.klenBitsis the requested output length in bits.
-