code: def subkey_public_pair_chain_code_pair(generator, public_pair, chain_code_bytes, i):
      
      INFINITY = generator.infinity()
      ORDER = generator.order()
      i_as_bytes = struct.pack(">l", i)
      sec = public_pair_to_sec(public_pair, compressed=True)
      data = sec + i_as_bytes
  
      I64 = hmac.HMAC(key=chain_code_bytes, msg=data, digestmod=hashlib.sha512).digest()
      I_left_as_exponent = from_bytes_32(I64[:32]) % ORDER
      the_point = I_left_as_exponent * generator + generator.Point(*public_pair)
      if the_point == INFINITY:
          logger.critical(_SUBKEY_VALIDATION_LOG_ERR_FMT)
          raise DerivationError('K_{} == {}'.format(i, the_point))
  
      new_chain_code = I64[32:]
      return the_point, new_chain_code
docs: Yield info for a child node for this node.
  
      generator:
          the ecdsa generator
      public_pair:
          base public pair
      chain_code:
          base chain code
      i:
          the index for this node.
  
      Returns a pair (new_public_pair, new_chain_code)