<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — R, S components of ECDSA signature as binary string]]></title>
		<link>https://www.wolfssl.com/forums/topic1833-r-s-components-of-ecdsa-signature-as-binary-string.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1833.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in R, S components of ECDSA signature as binary string.]]></description>
		<lastBuildDate>Thu, 16 Dec 2021 07:30:35 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: R, S components of ECDSA signature as binary string]]></title>
			<link>https://www.wolfssl.com/forums/post6425.html#p6425</link>
			<description><![CDATA[<div class="quotebox"><cite>kareem_wolfssl wrote:</cite><blockquote><p>Hi werchter,</p><p>You should build with WOLFSSL_PUBLIC_MP defined and use mp_read_unsigned_bin, which will be built as a public API.<br />Check out our example here: <a href="https://github.com/wolfSSL/wolfssl-examples/blob/master/pk/ecc/ecc_sign.c">https://github.com/wolfSSL/wolfssl-exam … ecc_sign.c</a></p><p>Thanks,<br />Kareem</p></blockquote></div><p>Thanks! That helped a lot, building with WOLFSSL_PUBLIC_MP was an important part of the puzzle that I was missing.</p><p>BTW: When looking at the example, I think for exporting the key as binary string, mp_to_unsigned_bin needs to be used, instead of mp_read_unsigned_bin (for importing)?<br />At least mp_read_unsigned_bin seems to work for me </p>]]></description>
			<author><![CDATA[null@example.com (werchter)]]></author>
			<pubDate>Thu, 16 Dec 2021 07:30:35 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6425.html#p6425</guid>
		</item>
		<item>
			<title><![CDATA[Re: R, S components of ECDSA signature as binary string]]></title>
			<link>https://www.wolfssl.com/forums/post6424.html#p6424</link>
			<description><![CDATA[<p>Hi werchter,</p><p>You should build with WOLFSSL_PUBLIC_MP defined and use mp_read_unsigned_bin, which will be built as a public API.<br />Check out our example here: <a href="https://github.com/wolfSSL/wolfssl-examples/blob/master/pk/ecc/ecc_sign.c">https://github.com/wolfSSL/wolfssl-exam … ecc_sign.c</a></p><p>Thanks,<br />Kareem</p>]]></description>
			<author><![CDATA[null@example.com (kareem_wolfssl)]]></author>
			<pubDate>Wed, 15 Dec 2021 18:36:36 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6424.html#p6424</guid>
		</item>
		<item>
			<title><![CDATA[R, S components of ECDSA signature as binary string]]></title>
			<link>https://www.wolfssl.com/forums/post6423.html#p6423</link>
			<description><![CDATA[<p>Hi,</p><p>I’m using </p><div class="codebox"><pre><code>wc_ecc_sign_hash_ex</code></pre></div><p> to get generate an ECDSA signature, and get the R and S components.</p><p>I need these to encode a CBOR COSE message (RFC 8152). The signature in a COSE message is a concatenation of the R and S components as a byte string. From RFC 8152:</p><div class="quotebox"><blockquote><p>The signature algorithm results in a pair of integers (R, S).&nbsp; These<br />&nbsp; &nbsp;integers will be the same length as the length of the key used for<br />&nbsp; &nbsp;the signature process.&nbsp; The signature is encoded by converting the<br />&nbsp; &nbsp;integers into byte strings of the same length as the key size.&nbsp; The<br />&nbsp; &nbsp;length is rounded up to the nearest byte and is left padded with zero<br />&nbsp; &nbsp;bits to get to the correct length.&nbsp; The two integers are then<br />&nbsp; &nbsp;concatenated together to form a byte string that is the resulting<br />&nbsp; &nbsp;signature.</p></blockquote></div><p>But, I can’t figure out how to get from R and S as (mp_int), to a byte string, with wolfSSL, without using the internal mp_read_unsigned_bin.<br />Is there a way?</p><p>Thanks for any help!</p>]]></description>
			<author><![CDATA[null@example.com (werchter)]]></author>
			<pubDate>Wed, 15 Dec 2021 17:42:56 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6423.html#p6423</guid>
		</item>
	</channel>
</rss>
