<trclass="memdesc:gabbefb2b18707ad13f8d50ba1d53a0eaf"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sign a raw message. <ahref="#gabbefb2b18707ad13f8d50ba1d53a0eaf"></a><br/></td></tr>
<trclass="memdesc:ga3afd124c16427247dcd58e49b8b6f6f5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sign a raw message using s->mastersecret. <ahref="#ga3afd124c16427247dcd58e49b8b6f6f5"></a><br/></td></tr>
<trclass="memdesc:ga8a3d79ddcfbe3fe69f14dbe9d5ad7c79"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Verify a signature. <ahref="#ga8a3d79ddcfbe3fe69f14dbe9d5ad7c79"></a><br/></td></tr>
<trclass="memdesc:ga15fef528d9d44c9e2b2b9edc159222c5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Verify a signature using the mastersecret. <ahref="#ga15fef528d9d44c9e2b2b9edc159222c5"></a><br/></td></tr>
<trclass="memitem:gabc079b17c0ba452c978b56a6507b3db7"><tdclass="memItemLeft"align="right"valign="top">size_t </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="group__ED.html#gabc079b17c0ba452c978b56a6507b3db7">pcp_ed_sign_buffered</a> (<aclass="el"href="group__Pcpstream.html#gaec72241f86d5391d5cae7477c66cdd73">Pcpstream</a> *in, <aclass="el"href="group__Pcpstream.html#gaec72241f86d5391d5cae7477c66cdd73">Pcpstream</a> *out, <aclass="el"href="group__KEYS.html#gae88eb39995125f3b68b4ce9175b41732">pcp_key_t</a> *s, int z85)</td></tr>
<trclass="memdesc:gabc079b17c0ba452c978b56a6507b3db7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sign a stream in 32k block mode. <ahref="#gabc079b17c0ba452c978b56a6507b3db7"></a><br/></td></tr>
<trclass="memdesc:ga251ca21c3128e4fdfa2392439d14411e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Verify a signature from a stream in 32k block mode. <ahref="#ga251ca21c3128e4fdfa2392439d14411e"></a><br/></td></tr>
<trclass="memdesc:ga60df616ebdb499671067edb15e66cb9e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Generate a detached signature from a stream in 32k block mode. <ahref="#ga60df616ebdb499671067edb15e66cb9e"></a><br/></td></tr>
<trclass="memdesc:ga944290e7b36e6b856f6cff981128f89f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Verify a detached signature from a stream in 32k block mode. <ahref="#ga944290e7b36e6b856f6cff981128f89f"></a><br/></td></tr>
<p>Generate a detached signature from a stream in 32k block mode. </p>
<p>This function reads blockwise from the stream <em>in</em> and generates a hash of the contents of the stream. It then signs that hash and writes the hash and the signature to the output stream <em>out</em>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">in</td><td>Stream to read from.</td></tr>
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">out</td><td>Stream to write to.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">s</td><td>Pointer to secret key.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns the size of the detached signature written or 0 in case of errors. Check fatals_if_any(). </dd></dl>
<p>Verify a detached signature from a stream in 32k block mode. </p>
<p>This function reads blockwise from the stream <em>in</em> and generates a hash of the contents of the stream. It then reads the signature from the stream <em>sigfd</em> and verifies the signature from it using p->edpub and compares the signature hash with the hash it calculated from the signed content.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">in</td><td>Stream to read from.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">sigfd</td><td>Stream containing the detached signature.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">p</td><td>Pointer to public key structure.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns a pointer to a public key which were used to verify the signature or NULL if an error occurred. Check fatals_if_any(). </dd></dl>
<p>Sign a message of messagesize using s->edsecret. This is just a convenience wrapper around crypto_sign().</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">message</td><td>The message to sign.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">messagesize</td><td>Size of the message.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">s</td><td>Pointer to secret key structure.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns message+signature with size of messagesize + crypto_sign_BYTES, or NULL in case of an error. </dd></dl>
<p>This function reads blockwise from the stream <em>in</em> and generates a hash of the contents of the stream. It outputs the stream to <em>out</em>, also blockwise and appends the signature afterwards, which consists of the hash+nacl-signature.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">in</td><td>Stream to read from.</td></tr>
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">out</td><td>Stream to write to.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">s</td><td>Pointer to secret key.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">z85</td><td>Flag which indicates if to create an armored signature or not. 1=armored, 0=raw.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns the number of bytes written to the output stream. </dd></dl>
<p>Sign a raw message using s->mastersecret. </p>
<p>The same as <aclass="el"href="group__ED.html#gabbefb2b18707ad13f8d50ba1d53a0eaf"title="Sign a raw message.">pcp_ed_sign()</a> but uses the mastersecret for signing. Usually used for key signing only.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">message</td><td>The message to sign.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">messagesize</td><td>Size of the message.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">s</td><td>Pointer to secret key structure.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns message+signature with size of messagesize + crypto_sign_BYTES, or NULL in case of an error. </dd></dl>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">siglen</td><td>Size of message+signature.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">p</td><td>Pointer to public key structure.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>If the signature verifies return the raw message with the signature removed (size: siglen - crypto_sign_BYTES), returns NULL in case of errors. Check fatals_if_any(). </dd></dl>
<p>Verify a signature from a stream in 32k block mode. </p>
<p>This function reads blockwise from the stream <em>in</em> and generates a hash of the contents of the stream. While reading from the stream it extracts the appended signature (hash+sig). It then verifies the signature using p->edpub and compares the signature hash with the hash it calculated from the signed content.</p>
<p>The parameter <em>p</em> can be NULL. In this case the function loops through the global public key hash pcppubkey_hash to find a public key which is able to verify the signature.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">in</td><td>Stream to read from.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">p</td><td>Pointer to public key structure.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Returns a pointer to a public key which were used to verify the signature or NULL if an error occurred. Check fatals_if_any(). </dd></dl>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">siglen</td><td>Size of message+signature.</td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">p</td><td>Pointer to public key structure.</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>If the signature verifies return the raw message with the signature removed (size: siglen - crypto_sign_BYTES), returns NULL in case of errors. Check fatals_if_any(). </dd></dl>