Added RFC 6879 calculation for K in ecdsa signatures