I'm implementing arithmetics for elliptic curves over secp256r1 as a homework assignment.


For scalar multiplication, the assignment specifically specifies that $k$ is "any hexidecimal encoded integer" (for the multiplication $kP$).


How is multiplication defined for negative values of $k$? My best guess is that $k$ is calculated modulo #$E(\mathbb{F}\_p)$, which in this case is $nh$ (the cardinality of the group of the points on the curve) as specified by SEC (in <http://www.secg.org/download/aid-386/sec2_final.pdf>). Is that correct?


If not, how is scalar multiplication defined for negative $k$'s?



Elliptic curve over finite field: scalar multiplication
I am not familiar with some of the abbreviations you use, and do not know what is better in your case, but: 


a. for any commutative group $(G,+)$ one has $kP = (-k) (-P)$, k integer and $P$ in $G$. So, computing one inverse in $G$ (and one in the integers) one can reduce to scalar multiplication for positive integers. Or, in other words, one can define multiplication of $P$ by a negative $k$, as multplication of $-P$ by $|k|$. 
[Actually, the 'commutative' is irrelevant here.]


b. in case $G$ is finite, there is also the option you mentioned, 
as $kP = mP$ if $k$ and $m$ are congruent modulo the cardinality of the group (the cardinality of the group, could be replaced by the exponent of the group, or if you just want it for a specific $P$ by the order of this element $P$.)


ps: I know that in general 'homework' is not answered on this site, but this seems to be an atypical case to me, and thus I thought an exception might be justified.
(If I misjudged this, feel free to delete, or ask me to delete.)


