Bouncy Castle Cryptography Library 1.87

org.bouncycastle.crypto.params
Class SM9SigMasterPublicKeyParameters

java.lang.Object
  extended byorg.bouncycastle.crypto.params.AsymmetricKeyParameter
      extended byorg.bouncycastle.crypto.params.SM9SigMasterPublicKeyParameters
All Implemented Interfaces:
CipherParameters

public class SM9SigMasterPublicKeyParameters
extends AsymmetricKeyParameter

SM9 signature master public key P_pub-s = [ks]P2, a point of G2 (GM/T 0044.2-2016). Held by verifiers and used to derive users' public keys from their identities.


Method Summary
static SM9SigMasterPublicKeyParameters fromEncoded(byte[] enc)
           
 byte[] getEncoded()
          The master public key point P_pub-s of G2 in uncompressed form (0x04 || x || y, 129 bytes).
 SM9G2Point getPointG2()
           
 Fp12 pairingWithP1()
          g = e(P1, P_pub-s), the fixed pairing value signing raises to its nonce.
 
Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter
isPrivate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPointG2

public SM9G2Point getPointG2()

pairingWithP1

public Fp12 pairingWithP1()
g = e(P1, P_pub-s), the fixed pairing value signing raises to its nonce. Verification does not use it: it takes its w' as a single product of pairings, through SM9Pairing.multiPair(org.bouncycastle.math.ec.ECPoint[], org.bouncycastle.math.ec.sm9.SM9G2Point[]).

It depends on this key alone, which is immutable, so it is computed once and kept, as SM9EncMasterPublicKeyParameters.pairingWithP2() keeps its counterpart: signing would otherwise pay a pairing for it every time. It involves no secret, so it is computed as its counterpart is, through SM9Pairing.multiPair(org.bouncycastle.math.ec.ECPoint[], org.bouncycastle.math.ec.sm9.SM9G2Point[]), over the lines of P_pub-s's Miller loop, which P_pub-s keeps, as it keeps them for verification. Two threads asking for it first may both compute it, and get equal values. Signing raises it to each nonce through Fp12.powSecureFixedBase(java.math.BigInteger), which keeps sixty-four powers of it with it, 24 KB, once the first signature has made them.


getEncoded

public byte[] getEncoded()
The master public key point P_pub-s of G2 in uncompressed form (0x04 || x || y, 129 bytes).


fromEncoded

public static SM9SigMasterPublicKeyParameters fromEncoded(byte[] enc)

Bouncy Castle Cryptography Library 1.87