docs: def validate(idText, alpha, r, cert, caPubkey):
      """
      A server can validate an implicit certificate response using identity
      string @idText, private value @alpha (used to generate cert request),
      and the certificate response @r (private key component) and implicit
      @cert.
      @raises Exception if the certificate response is invalid.
      @returns (privkey, pubkey)
      """
      # Verify parameter types
      assertScalarType(alpha)
      assertScalarType(r)
      assertType(cert, ec1Element)
      assertType(caPubkey, ec1Element)
  
      G = generatorEc()
  
      # Compute the private key @s
      e = _exp(cert, idText)
      s = (e*alpha + r) % orderEc()
  
      # Compute the public key two ways: using the privkey and using the cert
      # (the way a client will compute it)
      # The easy way
      S1 = s*G
  
      # Using the cert
      S2 = e*cert + caPubkey
  
      # The two techniques should produce the same pubkey value -- raise an
      # exception if they don't match
      if S1 != S2:
          raise Exception("Implicit certification response failed validation")
      return s, S1