Use the ElGamal Digital Signature Scheme in the group $G$ = $F^{×}_{p}$ = <g> where $p$ = $479$ is prime and $g$ = $13$. Your secret signing key is $x = 300$. If you choose an ephemeral key k = 11, what is the signature of your message m = 379?
I followed these steps and thought I had done nothing wrong but when I checked my answer by trying to verify, it was wrong.
First of all, I worked out $r ≡ g^{k}$ (mod $p$) by fast modular exponentiation to get $r ≡ 237$.
Next, I worked out $m ≡ xr + ks$ (mod $p-1$) and plugged in numbers to get
$379 ≡ 300 * 237 + 11s$ (mod $478$), which rearranged to
$11s ≡ 23$ (mod $478$)
I used Euclid's Algorithm to find the inverse of $11$, which I got as $89$, which meant
$s ≡ 89 * 23 ≡ 135$ (mod $478$) was the signature, or I thought was the signature.
When I went to verify my answer by working out $g^{m}$ (mod $p$) and $y^{r} * r^{s}$ (mod $p$),
(I had already worked out the public key $y ≡ g^{x}$ (mod $479$) before and it was $168$)
I expected to get the same number however I got $13^{379} ≡ 370$ (mod $479$) and $168^{237}$ * $237^{135} ≡ 357$ (mod $479$), which meant my signature was wrong.
Can anyone see an error I made?