def _truncate_digest_for_dsa(dsa_cdata, digest, backend):
 order_bits = backend._lib.BN_num_bits(dsa_cdata.q)
 return _truncate_digest(digest, order_bits)

def _truncate_digest_for_dsa ( dsa_cdata , digest , backend ) : order_bits = backend . _lib . BN_num_bits ( dsa_cdata . q ) return _truncate_digest ( digest , order_bits )
this function truncates digests that are longer than a given ds keys length so they can be signed .