/usr/share/doc/libghc-cryptonite-doc/html/Crypto-PubKey-ECC-P256.html is in libghc-cryptonite-doc 0.23-2build5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Crypto.PubKey.ECC.P256</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Crypto-PubKey-ECC-P256.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Crypto-PubKey-ECC-P256.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">cryptonite-0.23: Cryptography Primitives sink</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>License</th><td>BSD-style</td></tr><tr><th>Maintainer</th><td>Vincent Hanquez <vincent@snarc.org></td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Portability</th><td>unknown</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Crypto.PubKey.ECC.P256</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">point arithmetic</a></li><li><a href="#g:2">scalar arithmetic</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>P256 support</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:Scalar">Scalar</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Point">Point</a></li><li class="src short"><a href="#v:pointBase">pointBase</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a></li><li class="src short"><a href="#v:pointAdd">pointAdd</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a></li><li class="src short"><a href="#v:pointMul">pointMul</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a></li><li class="src short"><a href="#v:pointDh">pointDh</a> :: <a href="file:///usr/share/doc/libghc-memory-doc/html/Data-ByteArray.html#t:ByteArray">ByteArray</a> binary => <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> binary</li><li class="src short"><a href="#v:pointsMulVarTime">pointsMulVarTime</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a></li><li class="src short"><a href="#v:pointIsValid">pointIsValid</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:toPoint">toPoint</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a></li><li class="src short"><a href="#v:pointToIntegers">pointToIntegers</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a>)</li><li class="src short"><a href="#v:pointFromIntegers">pointFromIntegers</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a>) -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a></li><li class="src short"><a href="#v:pointToBinary">pointToBinary</a> :: <a href="file:///usr/share/doc/libghc-memory-doc/html/Data-ByteArray.html#t:ByteArray">ByteArray</a> ba => <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> ba</li><li class="src short"><a href="#v:pointFromBinary">pointFromBinary</a> :: <a href="file:///usr/share/doc/libghc-memory-doc/html/Data-ByteArray.html#t:ByteArrayAccess">ByteArrayAccess</a> ba => ba -> <a href="Crypto-Error.html#t:CryptoFailable">CryptoFailable</a> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a></li><li class="src short"><a href="#v:scalarGenerate">scalarGenerate</a> :: <a href="Crypto-Random-Types.html#t:MonadRandom">MonadRandom</a> randomly => randomly <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a></li><li class="src short"><a href="#v:scalarZero">scalarZero</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a></li><li class="src short"><a href="#v:scalarIsZero">scalarIsZero</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:scalarAdd">scalarAdd</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a></li><li class="src short"><a href="#v:scalarSub">scalarSub</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a></li><li class="src short"><a href="#v:scalarInv">scalarInv</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a></li><li class="src short"><a href="#v:scalarCmp">scalarCmp</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ordering">Ordering</a></li><li class="src short"><a href="#v:scalarFromBinary">scalarFromBinary</a> :: <a href="file:///usr/share/doc/libghc-memory-doc/html/Data-ByteArray.html#t:ByteArrayAccess">ByteArrayAccess</a> ba => ba -> <a href="Crypto-Error.html#t:CryptoFailable">CryptoFailable</a> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a></li><li class="src short"><a href="#v:scalarToBinary">scalarToBinary</a> :: <a href="file:///usr/share/doc/libghc-memory-doc/html/Data-ByteArray.html#t:ByteArray">ByteArray</a> ba => <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> ba</li><li class="src short"><a href="#v:scalarFromInteger">scalarFromInteger</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a> -> <a href="Crypto-Error.html#t:CryptoFailable">CryptoFailable</a> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a></li><li class="src short"><a href="#v:scalarToInteger">scalarToInteger</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Scalar" class="def">Scalar</a> <a href="src/Crypto-PubKey-ECC-P256.html#Scalar" class="link">Source</a> <a href="#t:Scalar" class="selflink">#</a></p><div class="doc"><p>A P256 scalar</p></div><div class="subs instances"><p id="control.i:Scalar" class="caption collapser" onclick="toggleSection('i:Scalar')">Instances</p><div id="section.i:Scalar" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Scalar:Eq:1" class="instance expander" onclick="toggleSection('i:id:Scalar:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a></span> <a href="src/Crypto-PubKey-ECC-P256.html#line-60" class="link">Source</a> <a href="#t:Scalar" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Scalar:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Scalar:Show:2" class="instance expander" onclick="toggleSection('i:id:Scalar:Show:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a></span> <a href="src/Crypto-PubKey-ECC-P256.html#line-60" class="link">Source</a> <a href="#t:Scalar" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Scalar:Show:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Scalar:ByteArrayAccess:3" class="instance expander" onclick="toggleSection('i:id:Scalar:ByteArrayAccess:3')"></span> <a href="file:///usr/share/doc/libghc-memory-doc/html/Data-ByteArray.html#t:ByteArrayAccess">ByteArrayAccess</a> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a></span> <a href="src/Crypto-PubKey-ECC-P256.html#line-60" class="link">Source</a> <a href="#t:Scalar" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Scalar:ByteArrayAccess:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:length">length</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="#v:length" class="selflink">#</a></p><p class="src"><a href="#v:withByteArray">withByteArray</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Foreign-Ptr.html#t:Ptr">Ptr</a> p -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a) -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> a <a href="#v:withByteArray" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Point" class="def">Point</a> <a href="src/Crypto-PubKey-ECC-P256.html#Point" class="link">Source</a> <a href="#t:Point" class="selflink">#</a></p><div class="doc"><p>A P256 point</p></div><div class="subs instances"><p id="control.i:Point" class="caption collapser" onclick="toggleSection('i:Point')">Instances</p><div id="section.i:Point" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Point:Eq:1" class="instance expander" onclick="toggleSection('i:id:Point:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a></span> <a href="src/Crypto-PubKey-ECC-P256.html#line-64" class="link">Source</a> <a href="#t:Point" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Point:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Point:Show:2" class="instance expander" onclick="toggleSection('i:id:Point:Show:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a></span> <a href="src/Crypto-PubKey-ECC-P256.html#line-64" class="link">Source</a> <a href="#t:Point" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Point:Show:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><h1 id="g:1">point arithmetic</h1><div class="top"><p class="src"><a id="v:pointBase" class="def">pointBase</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> <a href="src/Crypto-PubKey-ECC-P256.html#pointBase" class="link">Source</a> <a href="#v:pointBase" class="selflink">#</a></p><div class="doc"><p>Get the base point for the P256 Curve</p></div></div><div class="top"><p class="src"><a id="v:pointAdd" class="def">pointAdd</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> <a href="src/Crypto-PubKey-ECC-P256.html#pointAdd" class="link">Source</a> <a href="#v:pointAdd" class="selflink">#</a></p><div class="doc"><p>Add a point to another point</p></div></div><div class="top"><p class="src"><a id="v:pointMul" class="def">pointMul</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> <a href="src/Crypto-PubKey-ECC-P256.html#pointMul" class="link">Source</a> <a href="#v:pointMul" class="selflink">#</a></p><div class="doc"><p>Multiply a point by a scalar</p><p>warning: variable time</p></div></div><div class="top"><p class="src"><a id="v:pointDh" class="def">pointDh</a> :: <a href="file:///usr/share/doc/libghc-memory-doc/html/Data-ByteArray.html#t:ByteArray">ByteArray</a> binary => <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> binary <a href="src/Crypto-PubKey-ECC-P256.html#pointDh" class="link">Source</a> <a href="#v:pointDh" class="selflink">#</a></p><div class="doc"><p>Similar to <code><a href="Crypto-PubKey-ECC-P256.html#v:pointMul">pointMul</a></code>, serializing the x coordinate as binary</p></div></div><div class="top"><p class="src"><a id="v:pointsMulVarTime" class="def">pointsMulVarTime</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> <a href="src/Crypto-PubKey-ECC-P256.html#pointsMulVarTime" class="link">Source</a> <a href="#v:pointsMulVarTime" class="selflink">#</a></p><div class="doc"><p>multiply the point <code>p with </code>n2 and add a lifted to curve value @n1</p><pre>n1 * G + n2 * p</pre><p>warning: variable time</p></div></div><div class="top"><p class="src"><a id="v:pointIsValid" class="def">pointIsValid</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Crypto-PubKey-ECC-P256.html#pointIsValid" class="link">Source</a> <a href="#v:pointIsValid" class="selflink">#</a></p><div class="doc"><p>Check if a <code><a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a></code> is valid</p></div></div><div class="top"><p class="src"><a id="v:toPoint" class="def">toPoint</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> <a href="src/Crypto-PubKey-ECC-P256.html#toPoint" class="link">Source</a> <a href="#v:toPoint" class="selflink">#</a></p><div class="doc"><p>Lift to curve a scalar</p><p>Using the curve generator as base point compute:</p><pre>scalar * G</pre></div></div><div class="top"><p class="src"><a id="v:pointToIntegers" class="def">pointToIntegers</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a>) <a href="src/Crypto-PubKey-ECC-P256.html#pointToIntegers" class="link">Source</a> <a href="#v:pointToIntegers" class="selflink">#</a></p><div class="doc"><p>Convert a point to (x,y) Integers</p></div></div><div class="top"><p class="src"><a id="v:pointFromIntegers" class="def">pointFromIntegers</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a>) -> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> <a href="src/Crypto-PubKey-ECC-P256.html#pointFromIntegers" class="link">Source</a> <a href="#v:pointFromIntegers" class="selflink">#</a></p><div class="doc"><p>Convert from (x,y) Integers to a point</p></div></div><div class="top"><p class="src"><a id="v:pointToBinary" class="def">pointToBinary</a> :: <a href="file:///usr/share/doc/libghc-memory-doc/html/Data-ByteArray.html#t:ByteArray">ByteArray</a> ba => <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> -> ba <a href="src/Crypto-PubKey-ECC-P256.html#pointToBinary" class="link">Source</a> <a href="#v:pointToBinary" class="selflink">#</a></p><div class="doc"><p>Convert a point to a binary representation</p></div></div><div class="top"><p class="src"><a id="v:pointFromBinary" class="def">pointFromBinary</a> :: <a href="file:///usr/share/doc/libghc-memory-doc/html/Data-ByteArray.html#t:ByteArrayAccess">ByteArrayAccess</a> ba => ba -> <a href="Crypto-Error.html#t:CryptoFailable">CryptoFailable</a> <a href="Crypto-PubKey-ECC-P256.html#t:Point">Point</a> <a href="src/Crypto-PubKey-ECC-P256.html#pointFromBinary" class="link">Source</a> <a href="#v:pointFromBinary" class="selflink">#</a></p><div class="doc"><p>Convert from binary to a point</p></div></div><h1 id="g:2">scalar arithmetic</h1><div class="top"><p class="src"><a id="v:scalarGenerate" class="def">scalarGenerate</a> :: <a href="Crypto-Random-Types.html#t:MonadRandom">MonadRandom</a> randomly => randomly <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> <a href="src/Crypto-PubKey-ECC-P256.html#scalarGenerate" class="link">Source</a> <a href="#v:scalarGenerate" class="selflink">#</a></p><div class="doc"><p>Generate a randomly generated new scalar</p></div></div><div class="top"><p class="src"><a id="v:scalarZero" class="def">scalarZero</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> <a href="src/Crypto-PubKey-ECC-P256.html#scalarZero" class="link">Source</a> <a href="#v:scalarZero" class="selflink">#</a></p><div class="doc"><p>The scalar representing 0</p></div></div><div class="top"><p class="src"><a id="v:scalarIsZero" class="def">scalarIsZero</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Crypto-PubKey-ECC-P256.html#scalarIsZero" class="link">Source</a> <a href="#v:scalarIsZero" class="selflink">#</a></p><div class="doc"><p>Check if the scalar is 0</p></div></div><div class="top"><p class="src"><a id="v:scalarAdd" class="def">scalarAdd</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> <a href="src/Crypto-PubKey-ECC-P256.html#scalarAdd" class="link">Source</a> <a href="#v:scalarAdd" class="selflink">#</a></p><div class="doc"><p>Perform addition between two scalars</p><pre>a + b</pre></div></div><div class="top"><p class="src"><a id="v:scalarSub" class="def">scalarSub</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> <a href="src/Crypto-PubKey-ECC-P256.html#scalarSub" class="link">Source</a> <a href="#v:scalarSub" class="selflink">#</a></p><div class="doc"><p>Perform subtraction between two scalars</p><pre>a - b</pre></div></div><div class="top"><p class="src"><a id="v:scalarInv" class="def">scalarInv</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> <a href="src/Crypto-PubKey-ECC-P256.html#scalarInv" class="link">Source</a> <a href="#v:scalarInv" class="selflink">#</a></p><div class="doc"><p>Give the inverse of the scalar</p><pre>1 / a</pre><p>warning: variable time</p></div></div><div class="top"><p class="src"><a id="v:scalarCmp" class="def">scalarCmp</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ordering">Ordering</a> <a href="src/Crypto-PubKey-ECC-P256.html#scalarCmp" class="link">Source</a> <a href="#v:scalarCmp" class="selflink">#</a></p><div class="doc"><p>Compare 2 Scalar</p></div></div><div class="top"><p class="src"><a id="v:scalarFromBinary" class="def">scalarFromBinary</a> :: <a href="file:///usr/share/doc/libghc-memory-doc/html/Data-ByteArray.html#t:ByteArrayAccess">ByteArrayAccess</a> ba => ba -> <a href="Crypto-Error.html#t:CryptoFailable">CryptoFailable</a> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> <a href="src/Crypto-PubKey-ECC-P256.html#scalarFromBinary" class="link">Source</a> <a href="#v:scalarFromBinary" class="selflink">#</a></p><div class="doc"><p>convert a scalar from binary</p></div></div><div class="top"><p class="src"><a id="v:scalarToBinary" class="def">scalarToBinary</a> :: <a href="file:///usr/share/doc/libghc-memory-doc/html/Data-ByteArray.html#t:ByteArray">ByteArray</a> ba => <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> ba <a href="src/Crypto-PubKey-ECC-P256.html#scalarToBinary" class="link">Source</a> <a href="#v:scalarToBinary" class="selflink">#</a></p><div class="doc"><p>convert a scalar to binary</p></div></div><div class="top"><p class="src"><a id="v:scalarFromInteger" class="def">scalarFromInteger</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a> -> <a href="Crypto-Error.html#t:CryptoFailable">CryptoFailable</a> <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> <a href="src/Crypto-PubKey-ECC-P256.html#scalarFromInteger" class="link">Source</a> <a href="#v:scalarFromInteger" class="selflink">#</a></p><div class="doc"><p>Convert from an Integer to a P256 Scalar</p></div></div><div class="top"><p class="src"><a id="v:scalarToInteger" class="def">scalarToInteger</a> :: <a href="Crypto-PubKey-ECC-P256.html#t:Scalar">Scalar</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integer">Integer</a> <a href="src/Crypto-PubKey-ECC-P256.html#scalarToInteger" class="link">Source</a> <a href="#v:scalarToInteger" class="selflink">#</a></p><div class="doc"><p>Convert from a P256 Scalar to an Integer</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|