I am trying to test my understanding on ECDSA Signature r|s
to ASN.1 DER Encoding for NIST P-256. I have r|s
and when I convert this into ASN.1 DER in Java. I get following format:
0x30|b1|0x02|b2|r|0x02|b3|s
b1
= Length of remaining data
b2
= Length of r
b3
= Length of s
For example, suppose:
r|s = b2b31575f8536b284410d01217f688be3a9faf4ba0ba3a9093f983e40d630ec722a7a25b01403cff0d00b3b853d230f8e96ff832b15d4ccc75203cb65896a2d5
Breakdown ASN.1 DER signature format 0x30|b1|0x02|b2|r|0x02|b3|s
:
3045022100B2B31575F8536B284410D01217F688BE3A9FAF4BA0BA3A9093F983E40D630EC7022022A7A25B01403CFF0D00B3B853D230F8E96FF832B15D4CCC75203CB65896A2D5
My question is - will I be getting this format always or will there be a chance that r
and s
could be converted and to make length of curve?