ModInverse from the package math/big is used to implement InvModP. However the implementation of InvModP does not check the return value, which could be nil in case the arguments are not relatively prime, in which case the multiplicative inverse does not exist.
ModInversefrom the packagemath/bigis used to implementInvModP. However the implementation ofInvModPdoes not check the return value, which could benilin case the arguments are not relatively prime, in which case the multiplicative inverse does not exist.