• Janos Follath's avatar
    ECP: Prevent freeing a buffer on stack · 7dadc2f2
    Janos Follath authored
    The function ecp_mod_koblitz computed the space for the result of a
    multiplication optimally for that specific case, but unfortunately
    the function mbedtls_mpi_mul_mpi performs a generic, suboptimal
    calculation and needs one more limb for the result. Since the result's
    buffer is on the stack, the best case scenario is that the program
    stops.
    
    This only happened on 64 bit platforms.
    
    Fixes #569
    7dadc2f2