\hypertarget{curve_8h}{}\section{src/curve.h File Reference}
\label{curve_8h}\index{src/curve.\+h@{src/curve.\+h}}
{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include $<$stddef.\+h$>$}\newline
{\ttfamily \#include \char`\"{}signal\+\_\+protocol\+\_\+types.\+h\char`\"{}}\newline
Include dependency graph for curve.\+h\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=280pt]{curve_8h__incl}
\end{center}
\end{figure}
This graph shows which files directly or indirectly include this file\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{curve_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{curve_8h_ad935954495df721cddf8bf2e5363a5e0}{C\+U\+R\+V\+E\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN}~64
\item 
\#define \hyperlink{curve_8h_ae92392eb191bbe4098dbd682c8167b46}{V\+R\+F\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN}~96
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{curve_8h_a4e70a3ca9ec3a4fca5b39f81026aca56}{curve\+\_\+internal\+\_\+fast\+\_\+tests} (int silent)
\item 
int \hyperlink{curve_8h_a639f0d4093114b7a306c6f499e763e7b}{curve\+\_\+decode\+\_\+point} (\hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$$\ast$public\+\_\+key, const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$key\+\_\+data, size\+\_\+t key\+\_\+len, \hyperlink{structsignal__context}{signal\+\_\+context} $\ast$global\+\_\+context)
\item 
int \hyperlink{curve_8h_a4d13ee31a3bb275402d1fad17ba1505c}{ec\+\_\+public\+\_\+key\+\_\+compare} (const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$key1, const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$key2)
\item 
int \hyperlink{curve_8h_a452549d61dcc0a045a9566d09720ca0a}{ec\+\_\+public\+\_\+key\+\_\+memcmp} (const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$key1, const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$key2)
\item 
int \hyperlink{curve_8h_a64eb6ef2ae29f1b7620c6c3113c20b0c}{ec\+\_\+public\+\_\+key\+\_\+serialize} (\hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$buffer, const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$key)
\item 
void \hyperlink{curve_8h_a254436b8ff41d79527bc8ed0e7230fde}{ec\+\_\+public\+\_\+key\+\_\+destroy} (\hyperlink{structsignal__type__base}{signal\+\_\+type\+\_\+base} $\ast$type)
\item 
int \hyperlink{curve_8h_a0b16b47a7a37dced9034a3027c50e774}{curve\+\_\+decode\+\_\+private\+\_\+point} (\hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$$\ast$private\+\_\+key, const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$key\+\_\+data, size\+\_\+t key\+\_\+len, \hyperlink{structsignal__context}{signal\+\_\+context} $\ast$global\+\_\+context)
\item 
int \hyperlink{curve_8h_a3fe43a626c8ab5614f2c02ed2b618058}{ec\+\_\+private\+\_\+key\+\_\+compare} (const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$key1, const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$key2)
\item 
int \hyperlink{curve_8h_ae68eb49b4debe3cd7a1b18f78f20c305}{ec\+\_\+private\+\_\+key\+\_\+serialize} (\hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$buffer, const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$key)
\item 
void \hyperlink{curve_8h_a0c68259cca3a57be933527e57efdbcae}{ec\+\_\+private\+\_\+key\+\_\+destroy} (\hyperlink{structsignal__type__base}{signal\+\_\+type\+\_\+base} $\ast$type)
\item 
int \hyperlink{curve_8h_aeb60aa9c5ea65cd60a737afbeeb0f2e1}{ec\+\_\+key\+\_\+pair\+\_\+create} (\hyperlink{signal__protocol__types_8h_ae66f8b39deda7e0ce46f3ee15561472a}{ec\+\_\+key\+\_\+pair} $\ast$$\ast$key\+\_\+pair, \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$public\+\_\+key, \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$private\+\_\+key)
\item 
\hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$ \hyperlink{curve_8h_a848cdcad1d9e70306aa71858c390711a}{ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+public} (const \hyperlink{signal__protocol__types_8h_ae66f8b39deda7e0ce46f3ee15561472a}{ec\+\_\+key\+\_\+pair} $\ast$key\+\_\+pair)
\item 
\hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$ \hyperlink{curve_8h_af20c38b252095abf2bab8f1371495ea7}{ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+private} (const \hyperlink{signal__protocol__types_8h_ae66f8b39deda7e0ce46f3ee15561472a}{ec\+\_\+key\+\_\+pair} $\ast$key\+\_\+pair)
\item 
void \hyperlink{curve_8h_a160244021314d5e07978b427b6e1c567}{ec\+\_\+key\+\_\+pair\+\_\+destroy} (\hyperlink{structsignal__type__base}{signal\+\_\+type\+\_\+base} $\ast$type)
\item 
int \hyperlink{curve_8h_aa03df94d15f94a679bd3d018e7cbeb26}{curve\+\_\+generate\+\_\+private\+\_\+key} (\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$context, \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$$\ast$private\+\_\+key)
\item 
int \hyperlink{curve_8h_aa3a9251eed3d7903c33c68fc3364b8e7}{curve\+\_\+generate\+\_\+public\+\_\+key} (\hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$$\ast$public\+\_\+key, const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$private\+\_\+key)
\item 
int \hyperlink{curve_8h_a1c10b70b732f247c470eb800b886b18f}{curve\+\_\+generate\+\_\+key\+\_\+pair} (\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$context, \hyperlink{signal__protocol__types_8h_ae66f8b39deda7e0ce46f3ee15561472a}{ec\+\_\+key\+\_\+pair} $\ast$$\ast$key\+\_\+pair)
\item 
\hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$ \hyperlink{curve_8h_aaac465d719b0cf827ee8fd180300bf9d}{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+alloc} (void)
\item 
\hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$ \hyperlink{curve_8h_a37033b8eab71013b20933e200b795054}{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+copy} (const \hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$list)
\item 
int \hyperlink{curve_8h_a02c4c2608064f6c40749d7ac89abc9b3}{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+push\+\_\+back} (\hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$list, \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$value)
\item 
unsigned int \hyperlink{curve_8h_a59715789b6eba3e16bcaed76ac32a104}{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+size} (const \hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$list)
\item 
\hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$ \hyperlink{curve_8h_aded9d36e0f3552f5cab5f846ae1bb74a}{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+at} (const \hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$list, unsigned int index)
\item 
void \hyperlink{curve_8h_ab96bcb8e66e5e2830be91c6e7252568c}{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+sort} (\hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$list)
\item 
void \hyperlink{curve_8h_ae737fdcf410b28bfb00670a6f4178538}{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+free} (\hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$list)
\item 
int \hyperlink{curve_8h_a03f44a7ebf899f25ea6ba0c72ef89a6e}{curve\+\_\+calculate\+\_\+agreement} (\hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$$\ast$shared\+\_\+key\+\_\+data, const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$public\+\_\+key, const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$private\+\_\+key)
\item 
int \hyperlink{curve_8h_aacc8aa4f2a52e20da0d75a6685843ae1}{curve\+\_\+verify\+\_\+signature} (const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$signing\+\_\+key, const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$message\+\_\+data, size\+\_\+t message\+\_\+len, const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$signature\+\_\+data, size\+\_\+t signature\+\_\+len)
\item 
int \hyperlink{curve_8h_a4e9662ececdc85a8dbfa12f3a120b98a}{curve\+\_\+calculate\+\_\+signature} (\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$context, \hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$signature, const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$signing\+\_\+key, const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$message\+\_\+data, size\+\_\+t message\+\_\+len)
\item 
int \hyperlink{curve_8h_aae88e164ae199f15d101d0268ee0880b}{curve\+\_\+verify\+\_\+vrf\+\_\+signature} (\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$context, \hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$vrf\+\_\+output, const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$signing\+\_\+key, const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$message\+\_\+data, size\+\_\+t message\+\_\+len, const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$signature\+\_\+data, size\+\_\+t signature\+\_\+len)
\item 
int \hyperlink{curve_8h_aa05087d02fb659c9ccf6acad96192836}{curve\+\_\+calculate\+\_\+vrf\+\_\+signature} (\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$context, \hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$signature, const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$signing\+\_\+key, const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$message\+\_\+data, size\+\_\+t message\+\_\+len)
\end{DoxyCompactItemize}


\subsection{Macro Definition Documentation}
\mbox{\Hypertarget{curve_8h_ad935954495df721cddf8bf2e5363a5e0}\label{curve_8h_ad935954495df721cddf8bf2e5363a5e0}} 
\index{curve.\+h@{curve.\+h}!C\+U\+R\+V\+E\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN@{C\+U\+R\+V\+E\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN}}
\index{C\+U\+R\+V\+E\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN@{C\+U\+R\+V\+E\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{C\+U\+R\+V\+E\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN}{CURVE\_SIGNATURE\_LEN}}
{\footnotesize\ttfamily \#define C\+U\+R\+V\+E\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN~64}



Definition at line 12 of file curve.\+h.

\mbox{\Hypertarget{curve_8h_ae92392eb191bbe4098dbd682c8167b46}\label{curve_8h_ae92392eb191bbe4098dbd682c8167b46}} 
\index{curve.\+h@{curve.\+h}!V\+R\+F\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN@{V\+R\+F\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN}}
\index{V\+R\+F\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN@{V\+R\+F\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{V\+R\+F\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN}{VRF\_SIGNATURE\_LEN}}
{\footnotesize\ttfamily \#define V\+R\+F\+\_\+\+S\+I\+G\+N\+A\+T\+U\+R\+E\+\_\+\+L\+EN~96}



Definition at line 13 of file curve.\+h.



\subsection{Function Documentation}
\mbox{\Hypertarget{curve_8h_a03f44a7ebf899f25ea6ba0c72ef89a6e}\label{curve_8h_a03f44a7ebf899f25ea6ba0c72ef89a6e}} 
\index{curve.\+h@{curve.\+h}!curve\+\_\+calculate\+\_\+agreement@{curve\+\_\+calculate\+\_\+agreement}}
\index{curve\+\_\+calculate\+\_\+agreement@{curve\+\_\+calculate\+\_\+agreement}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{curve\+\_\+calculate\+\_\+agreement()}{curve\_calculate\_agreement()}}
{\footnotesize\ttfamily int curve\+\_\+calculate\+\_\+agreement (\begin{DoxyParamCaption}\item[{\hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$$\ast$}]{shared\+\_\+key\+\_\+data,  }\item[{const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$}]{public\+\_\+key,  }\item[{const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$}]{private\+\_\+key }\end{DoxyParamCaption})}

Calculates an E\+C\+DH agreement.


\begin{DoxyParams}{Parameters}
{\em shared\+\_\+key\+\_\+data} & Set to a 32-\/byte shared secret on success. \\
\hline
{\em public\+\_\+key} & The Curve25519 (typically remote party\textquotesingle{}s) public key. \\
\hline
{\em private\+\_\+key} & The Curve25519 (typically yours) private key. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
length of the shared secret on success, negative on failure 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_a4e9662ececdc85a8dbfa12f3a120b98a}\label{curve_8h_a4e9662ececdc85a8dbfa12f3a120b98a}} 
\index{curve.\+h@{curve.\+h}!curve\+\_\+calculate\+\_\+signature@{curve\+\_\+calculate\+\_\+signature}}
\index{curve\+\_\+calculate\+\_\+signature@{curve\+\_\+calculate\+\_\+signature}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{curve\+\_\+calculate\+\_\+signature()}{curve\_calculate\_signature()}}
{\footnotesize\ttfamily int curve\+\_\+calculate\+\_\+signature (\begin{DoxyParamCaption}\item[{\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$}]{context,  }\item[{\hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$}]{signature,  }\item[{const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$}]{signing\+\_\+key,  }\item[{const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$}]{message\+\_\+data,  }\item[{size\+\_\+t}]{message\+\_\+len }\end{DoxyParamCaption})}

Calculates a Curve25519 signature.


\begin{DoxyParams}{Parameters}
{\em signature} & Set to a 64-\/byte signature on success. \\
\hline
{\em signing\+\_\+key} & The private Curve25519 key to create the signature with. \\
\hline
{\em message\+\_\+data} & The message to sign. \\
\hline
{\em message\+\_\+len} & The length of the message to sign. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on failure 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_aa05087d02fb659c9ccf6acad96192836}\label{curve_8h_aa05087d02fb659c9ccf6acad96192836}} 
\index{curve.\+h@{curve.\+h}!curve\+\_\+calculate\+\_\+vrf\+\_\+signature@{curve\+\_\+calculate\+\_\+vrf\+\_\+signature}}
\index{curve\+\_\+calculate\+\_\+vrf\+\_\+signature@{curve\+\_\+calculate\+\_\+vrf\+\_\+signature}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{curve\+\_\+calculate\+\_\+vrf\+\_\+signature()}{curve\_calculate\_vrf\_signature()}}
{\footnotesize\ttfamily int curve\+\_\+calculate\+\_\+vrf\+\_\+signature (\begin{DoxyParamCaption}\item[{\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$}]{context,  }\item[{\hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$}]{signature,  }\item[{const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$}]{signing\+\_\+key,  }\item[{const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$}]{message\+\_\+data,  }\item[{size\+\_\+t}]{message\+\_\+len }\end{DoxyParamCaption})}

Calculates a Unique Curve25519 signature.


\begin{DoxyParams}{Parameters}
{\em signature} & Set to a 96-\/byte signature on success. \\
\hline
{\em signing\+\_\+key} & The private Curve25519 key to create the signature with. \\
\hline
{\em message\+\_\+data} & The message to sign. \\
\hline
{\em message\+\_\+len} & The length of the message to sign. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on failure 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_a639f0d4093114b7a306c6f499e763e7b}\label{curve_8h_a639f0d4093114b7a306c6f499e763e7b}} 
\index{curve.\+h@{curve.\+h}!curve\+\_\+decode\+\_\+point@{curve\+\_\+decode\+\_\+point}}
\index{curve\+\_\+decode\+\_\+point@{curve\+\_\+decode\+\_\+point}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{curve\+\_\+decode\+\_\+point()}{curve\_decode\_point()}}
{\footnotesize\ttfamily int curve\+\_\+decode\+\_\+point (\begin{DoxyParamCaption}\item[{\hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$$\ast$}]{public\+\_\+key,  }\item[{const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$}]{key\+\_\+data,  }\item[{size\+\_\+t}]{key\+\_\+len,  }\item[{\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$}]{global\+\_\+context }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_a0b16b47a7a37dced9034a3027c50e774}\label{curve_8h_a0b16b47a7a37dced9034a3027c50e774}} 
\index{curve.\+h@{curve.\+h}!curve\+\_\+decode\+\_\+private\+\_\+point@{curve\+\_\+decode\+\_\+private\+\_\+point}}
\index{curve\+\_\+decode\+\_\+private\+\_\+point@{curve\+\_\+decode\+\_\+private\+\_\+point}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{curve\+\_\+decode\+\_\+private\+\_\+point()}{curve\_decode\_private\_point()}}
{\footnotesize\ttfamily int curve\+\_\+decode\+\_\+private\+\_\+point (\begin{DoxyParamCaption}\item[{\hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$$\ast$}]{private\+\_\+key,  }\item[{const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$}]{key\+\_\+data,  }\item[{size\+\_\+t}]{key\+\_\+len,  }\item[{\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$}]{global\+\_\+context }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_a1c10b70b732f247c470eb800b886b18f}\label{curve_8h_a1c10b70b732f247c470eb800b886b18f}} 
\index{curve.\+h@{curve.\+h}!curve\+\_\+generate\+\_\+key\+\_\+pair@{curve\+\_\+generate\+\_\+key\+\_\+pair}}
\index{curve\+\_\+generate\+\_\+key\+\_\+pair@{curve\+\_\+generate\+\_\+key\+\_\+pair}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{curve\+\_\+generate\+\_\+key\+\_\+pair()}{curve\_generate\_key\_pair()}}
{\footnotesize\ttfamily int curve\+\_\+generate\+\_\+key\+\_\+pair (\begin{DoxyParamCaption}\item[{\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$}]{context,  }\item[{\hyperlink{signal__protocol__types_8h_ae66f8b39deda7e0ce46f3ee15561472a}{ec\+\_\+key\+\_\+pair} $\ast$$\ast$}]{key\+\_\+pair }\end{DoxyParamCaption})}

Generates a Curve25519 keypair.


\begin{DoxyParams}{Parameters}
{\em key\+\_\+pair} & Set to a randomly generated Curve25519 keypair on success. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on failure 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_aa03df94d15f94a679bd3d018e7cbeb26}\label{curve_8h_aa03df94d15f94a679bd3d018e7cbeb26}} 
\index{curve.\+h@{curve.\+h}!curve\+\_\+generate\+\_\+private\+\_\+key@{curve\+\_\+generate\+\_\+private\+\_\+key}}
\index{curve\+\_\+generate\+\_\+private\+\_\+key@{curve\+\_\+generate\+\_\+private\+\_\+key}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{curve\+\_\+generate\+\_\+private\+\_\+key()}{curve\_generate\_private\_key()}}
{\footnotesize\ttfamily int curve\+\_\+generate\+\_\+private\+\_\+key (\begin{DoxyParamCaption}\item[{\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$}]{context,  }\item[{\hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$$\ast$}]{private\+\_\+key }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_aa3a9251eed3d7903c33c68fc3364b8e7}\label{curve_8h_aa3a9251eed3d7903c33c68fc3364b8e7}} 
\index{curve.\+h@{curve.\+h}!curve\+\_\+generate\+\_\+public\+\_\+key@{curve\+\_\+generate\+\_\+public\+\_\+key}}
\index{curve\+\_\+generate\+\_\+public\+\_\+key@{curve\+\_\+generate\+\_\+public\+\_\+key}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{curve\+\_\+generate\+\_\+public\+\_\+key()}{curve\_generate\_public\_key()}}
{\footnotesize\ttfamily int curve\+\_\+generate\+\_\+public\+\_\+key (\begin{DoxyParamCaption}\item[{\hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$$\ast$}]{public\+\_\+key,  }\item[{const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$}]{private\+\_\+key }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_a4e70a3ca9ec3a4fca5b39f81026aca56}\label{curve_8h_a4e70a3ca9ec3a4fca5b39f81026aca56}} 
\index{curve.\+h@{curve.\+h}!curve\+\_\+internal\+\_\+fast\+\_\+tests@{curve\+\_\+internal\+\_\+fast\+\_\+tests}}
\index{curve\+\_\+internal\+\_\+fast\+\_\+tests@{curve\+\_\+internal\+\_\+fast\+\_\+tests}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{curve\+\_\+internal\+\_\+fast\+\_\+tests()}{curve\_internal\_fast\_tests()}}
{\footnotesize\ttfamily int curve\+\_\+internal\+\_\+fast\+\_\+tests (\begin{DoxyParamCaption}\item[{int}]{silent }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_aacc8aa4f2a52e20da0d75a6685843ae1}\label{curve_8h_aacc8aa4f2a52e20da0d75a6685843ae1}} 
\index{curve.\+h@{curve.\+h}!curve\+\_\+verify\+\_\+signature@{curve\+\_\+verify\+\_\+signature}}
\index{curve\+\_\+verify\+\_\+signature@{curve\+\_\+verify\+\_\+signature}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{curve\+\_\+verify\+\_\+signature()}{curve\_verify\_signature()}}
{\footnotesize\ttfamily int curve\+\_\+verify\+\_\+signature (\begin{DoxyParamCaption}\item[{const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$}]{signing\+\_\+key,  }\item[{const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$}]{message\+\_\+data,  }\item[{size\+\_\+t}]{message\+\_\+len,  }\item[{const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$}]{signature\+\_\+data,  }\item[{size\+\_\+t}]{signature\+\_\+len }\end{DoxyParamCaption})}

Verify a Curve25519 signature.


\begin{DoxyParams}{Parameters}
{\em signing\+\_\+key} & The Curve25519 public key the signature belongs to. \\
\hline
{\em message\+\_\+data} & The message that was signed. \\
\hline
{\em message\+\_\+len} & The length of the message that was signed. \\
\hline
{\em signature\+\_\+data} & The signature to verify. \\
\hline
{\em signature\+\_\+len} & The length of the signature to verify. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if valid, 0 if invalid, negative on failure 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_aae88e164ae199f15d101d0268ee0880b}\label{curve_8h_aae88e164ae199f15d101d0268ee0880b}} 
\index{curve.\+h@{curve.\+h}!curve\+\_\+verify\+\_\+vrf\+\_\+signature@{curve\+\_\+verify\+\_\+vrf\+\_\+signature}}
\index{curve\+\_\+verify\+\_\+vrf\+\_\+signature@{curve\+\_\+verify\+\_\+vrf\+\_\+signature}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{curve\+\_\+verify\+\_\+vrf\+\_\+signature()}{curve\_verify\_vrf\_signature()}}
{\footnotesize\ttfamily int curve\+\_\+verify\+\_\+vrf\+\_\+signature (\begin{DoxyParamCaption}\item[{\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$}]{context,  }\item[{\hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$}]{vrf\+\_\+output,  }\item[{const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$}]{signing\+\_\+key,  }\item[{const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$}]{message\+\_\+data,  }\item[{size\+\_\+t}]{message\+\_\+len,  }\item[{const \hyperlink{uthash_8h_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$}]{signature\+\_\+data,  }\item[{size\+\_\+t}]{signature\+\_\+len }\end{DoxyParamCaption})}

Verify a Unique Curve25519 signature.


\begin{DoxyParams}{Parameters}
{\em vrf\+\_\+output} & Set to V\+RF output on success \\
\hline
{\em signing\+\_\+key} & The Curve25519 public key the unique signature belongs to. \\
\hline
{\em message\+\_\+data} & The message that was signed. \\
\hline
{\em message\+\_\+len} & The length of the message that was signed. \\
\hline
{\em signature\+\_\+data} & The signature to verify. \\
\hline
{\em signature\+\_\+len} & The length of the signature to verify. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if valid, 0 if invalid, negative on failure 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_aeb60aa9c5ea65cd60a737afbeeb0f2e1}\label{curve_8h_aeb60aa9c5ea65cd60a737afbeeb0f2e1}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+key\+\_\+pair\+\_\+create@{ec\+\_\+key\+\_\+pair\+\_\+create}}
\index{ec\+\_\+key\+\_\+pair\+\_\+create@{ec\+\_\+key\+\_\+pair\+\_\+create}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+key\+\_\+pair\+\_\+create()}{ec\_key\_pair\_create()}}
{\footnotesize\ttfamily int ec\+\_\+key\+\_\+pair\+\_\+create (\begin{DoxyParamCaption}\item[{\hyperlink{signal__protocol__types_8h_ae66f8b39deda7e0ce46f3ee15561472a}{ec\+\_\+key\+\_\+pair} $\ast$$\ast$}]{key\+\_\+pair,  }\item[{\hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$}]{public\+\_\+key,  }\item[{\hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$}]{private\+\_\+key }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_a160244021314d5e07978b427b6e1c567}\label{curve_8h_a160244021314d5e07978b427b6e1c567}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+key\+\_\+pair\+\_\+destroy@{ec\+\_\+key\+\_\+pair\+\_\+destroy}}
\index{ec\+\_\+key\+\_\+pair\+\_\+destroy@{ec\+\_\+key\+\_\+pair\+\_\+destroy}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+key\+\_\+pair\+\_\+destroy()}{ec\_key\_pair\_destroy()}}
{\footnotesize\ttfamily void ec\+\_\+key\+\_\+pair\+\_\+destroy (\begin{DoxyParamCaption}\item[{\hyperlink{structsignal__type__base}{signal\+\_\+type\+\_\+base} $\ast$}]{type }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_af20c38b252095abf2bab8f1371495ea7}\label{curve_8h_af20c38b252095abf2bab8f1371495ea7}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+private@{ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+private}}
\index{ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+private@{ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+private}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+private()}{ec\_key\_pair\_get\_private()}}
{\footnotesize\ttfamily \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key}$\ast$ ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+private (\begin{DoxyParamCaption}\item[{const \hyperlink{signal__protocol__types_8h_ae66f8b39deda7e0ce46f3ee15561472a}{ec\+\_\+key\+\_\+pair} $\ast$}]{key\+\_\+pair }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_a848cdcad1d9e70306aa71858c390711a}\label{curve_8h_a848cdcad1d9e70306aa71858c390711a}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+public@{ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+public}}
\index{ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+public@{ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+public}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+public()}{ec\_key\_pair\_get\_public()}}
{\footnotesize\ttfamily \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key}$\ast$ ec\+\_\+key\+\_\+pair\+\_\+get\+\_\+public (\begin{DoxyParamCaption}\item[{const \hyperlink{signal__protocol__types_8h_ae66f8b39deda7e0ce46f3ee15561472a}{ec\+\_\+key\+\_\+pair} $\ast$}]{key\+\_\+pair }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_a3fe43a626c8ab5614f2c02ed2b618058}\label{curve_8h_a3fe43a626c8ab5614f2c02ed2b618058}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+private\+\_\+key\+\_\+compare@{ec\+\_\+private\+\_\+key\+\_\+compare}}
\index{ec\+\_\+private\+\_\+key\+\_\+compare@{ec\+\_\+private\+\_\+key\+\_\+compare}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+private\+\_\+key\+\_\+compare()}{ec\_private\_key\_compare()}}
{\footnotesize\ttfamily int ec\+\_\+private\+\_\+key\+\_\+compare (\begin{DoxyParamCaption}\item[{const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$}]{key1,  }\item[{const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$}]{key2 }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_a0c68259cca3a57be933527e57efdbcae}\label{curve_8h_a0c68259cca3a57be933527e57efdbcae}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+private\+\_\+key\+\_\+destroy@{ec\+\_\+private\+\_\+key\+\_\+destroy}}
\index{ec\+\_\+private\+\_\+key\+\_\+destroy@{ec\+\_\+private\+\_\+key\+\_\+destroy}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+private\+\_\+key\+\_\+destroy()}{ec\_private\_key\_destroy()}}
{\footnotesize\ttfamily void ec\+\_\+private\+\_\+key\+\_\+destroy (\begin{DoxyParamCaption}\item[{\hyperlink{structsignal__type__base}{signal\+\_\+type\+\_\+base} $\ast$}]{type }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_ae68eb49b4debe3cd7a1b18f78f20c305}\label{curve_8h_ae68eb49b4debe3cd7a1b18f78f20c305}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+private\+\_\+key\+\_\+serialize@{ec\+\_\+private\+\_\+key\+\_\+serialize}}
\index{ec\+\_\+private\+\_\+key\+\_\+serialize@{ec\+\_\+private\+\_\+key\+\_\+serialize}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+private\+\_\+key\+\_\+serialize()}{ec\_private\_key\_serialize()}}
{\footnotesize\ttfamily int ec\+\_\+private\+\_\+key\+\_\+serialize (\begin{DoxyParamCaption}\item[{\hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$}]{buffer,  }\item[{const \hyperlink{signal__protocol__types_8h_a06d963e532f25681dd462897f844205d}{ec\+\_\+private\+\_\+key} $\ast$}]{key }\end{DoxyParamCaption})}

Serialize the private key into a buffer that can be stored. The format of this data is compatible with the input format of \hyperlink{curve_8h_a0b16b47a7a37dced9034a3027c50e774}{curve\+\_\+decode\+\_\+private\+\_\+point()}.


\begin{DoxyParams}{Parameters}
{\em buffer} & Pointer to a buffer that will be allocated by this function and filled with the contents of the key. The caller is responsible for freeing this buffer with \hyperlink{signal__protocol_8h_abd2b0cfb4df9d11f8903c01d19facdf5}{signal\+\_\+buffer\+\_\+free()}. \\
\hline
{\em key} & Key to serialize \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on failure 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_a4d13ee31a3bb275402d1fad17ba1505c}\label{curve_8h_a4d13ee31a3bb275402d1fad17ba1505c}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+public\+\_\+key\+\_\+compare@{ec\+\_\+public\+\_\+key\+\_\+compare}}
\index{ec\+\_\+public\+\_\+key\+\_\+compare@{ec\+\_\+public\+\_\+key\+\_\+compare}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+public\+\_\+key\+\_\+compare()}{ec\_public\_key\_compare()}}
{\footnotesize\ttfamily int ec\+\_\+public\+\_\+key\+\_\+compare (\begin{DoxyParamCaption}\item[{const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$}]{key1,  }\item[{const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$}]{key2 }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_a254436b8ff41d79527bc8ed0e7230fde}\label{curve_8h_a254436b8ff41d79527bc8ed0e7230fde}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+public\+\_\+key\+\_\+destroy@{ec\+\_\+public\+\_\+key\+\_\+destroy}}
\index{ec\+\_\+public\+\_\+key\+\_\+destroy@{ec\+\_\+public\+\_\+key\+\_\+destroy}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+public\+\_\+key\+\_\+destroy()}{ec\_public\_key\_destroy()}}
{\footnotesize\ttfamily void ec\+\_\+public\+\_\+key\+\_\+destroy (\begin{DoxyParamCaption}\item[{\hyperlink{structsignal__type__base}{signal\+\_\+type\+\_\+base} $\ast$}]{type }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_aaac465d719b0cf827ee8fd180300bf9d}\label{curve_8h_aaac465d719b0cf827ee8fd180300bf9d}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+public\+\_\+key\+\_\+list\+\_\+alloc@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+alloc}}
\index{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+alloc@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+alloc}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+alloc()}{ec\_public\_key\_list\_alloc()}}
{\footnotesize\ttfamily \hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list}$\ast$ ec\+\_\+public\+\_\+key\+\_\+list\+\_\+alloc (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Allocate a new ec\+\_\+public\+\_\+key list

\begin{DoxyReturn}{Returns}
pointer to the allocated list, or 0 on failure 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_aded9d36e0f3552f5cab5f846ae1bb74a}\label{curve_8h_aded9d36e0f3552f5cab5f846ae1bb74a}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+public\+\_\+key\+\_\+list\+\_\+at@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+at}}
\index{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+at@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+at}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+at()}{ec\_public\_key\_list\_at()}}
{\footnotesize\ttfamily \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key}$\ast$ ec\+\_\+public\+\_\+key\+\_\+list\+\_\+at (\begin{DoxyParamCaption}\item[{const \hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$}]{list,  }\item[{unsigned int}]{index }\end{DoxyParamCaption})}

Gets the value of the element at a particular index in the list


\begin{DoxyParams}{Parameters}
{\em list} & the list \\
\hline
{\em index} & the index within the list \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the value 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_a37033b8eab71013b20933e200b795054}\label{curve_8h_a37033b8eab71013b20933e200b795054}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+public\+\_\+key\+\_\+list\+\_\+copy@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+copy}}
\index{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+copy@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+copy}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+copy()}{ec\_public\_key\_list\_copy()}}
{\footnotesize\ttfamily \hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list}$\ast$ ec\+\_\+public\+\_\+key\+\_\+list\+\_\+copy (\begin{DoxyParamCaption}\item[{const \hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$}]{list }\end{DoxyParamCaption})}

Copy an ec\+\_\+public\+\_\+key list

\begin{DoxyReturn}{Returns}
pointer to the copy of the list, or 0 on failure 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_ae737fdcf410b28bfb00670a6f4178538}\label{curve_8h_ae737fdcf410b28bfb00670a6f4178538}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+public\+\_\+key\+\_\+list\+\_\+free@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+free}}
\index{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+free@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+free}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+free()}{ec\_public\_key\_list\_free()}}
{\footnotesize\ttfamily void ec\+\_\+public\+\_\+key\+\_\+list\+\_\+free (\begin{DoxyParamCaption}\item[{\hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$}]{list }\end{DoxyParamCaption})}

Free the ec\+\_\+public\+\_\+key list 
\begin{DoxyParams}{Parameters}
{\em list} & the list to free \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{curve_8h_a02c4c2608064f6c40749d7ac89abc9b3}\label{curve_8h_a02c4c2608064f6c40749d7ac89abc9b3}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+public\+\_\+key\+\_\+list\+\_\+push\+\_\+back@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+push\+\_\+back}}
\index{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+push\+\_\+back@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+push\+\_\+back}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+push\+\_\+back()}{ec\_public\_key\_list\_push\_back()}}
{\footnotesize\ttfamily int ec\+\_\+public\+\_\+key\+\_\+list\+\_\+push\+\_\+back (\begin{DoxyParamCaption}\item[{\hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$}]{list,  }\item[{\hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$}]{value }\end{DoxyParamCaption})}

Push a new value onto the end of the list


\begin{DoxyParams}{Parameters}
{\em list} & the list \\
\hline
{\em value} & the value to push \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on failure 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_a59715789b6eba3e16bcaed76ac32a104}\label{curve_8h_a59715789b6eba3e16bcaed76ac32a104}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+public\+\_\+key\+\_\+list\+\_\+size@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+size}}
\index{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+size@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+size}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+size()}{ec\_public\_key\_list\_size()}}
{\footnotesize\ttfamily unsigned int ec\+\_\+public\+\_\+key\+\_\+list\+\_\+size (\begin{DoxyParamCaption}\item[{const \hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$}]{list }\end{DoxyParamCaption})}

Gets the size of the list.


\begin{DoxyParams}{Parameters}
{\em list} & the list \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the size of the list 
\end{DoxyReturn}
\mbox{\Hypertarget{curve_8h_ab96bcb8e66e5e2830be91c6e7252568c}\label{curve_8h_ab96bcb8e66e5e2830be91c6e7252568c}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+public\+\_\+key\+\_\+list\+\_\+sort@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+sort}}
\index{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+sort@{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+sort}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+public\+\_\+key\+\_\+list\+\_\+sort()}{ec\_public\_key\_list\_sort()}}
{\footnotesize\ttfamily void ec\+\_\+public\+\_\+key\+\_\+list\+\_\+sort (\begin{DoxyParamCaption}\item[{\hyperlink{signal__protocol__types_8h_ac3820e3142fd7136e199c9bea5b5a1e8}{ec\+\_\+public\+\_\+key\+\_\+list} $\ast$}]{list }\end{DoxyParamCaption})}

Sorts the list based on a comparison of the key data.


\begin{DoxyParams}{Parameters}
{\em list} & the list \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{curve_8h_a452549d61dcc0a045a9566d09720ca0a}\label{curve_8h_a452549d61dcc0a045a9566d09720ca0a}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+public\+\_\+key\+\_\+memcmp@{ec\+\_\+public\+\_\+key\+\_\+memcmp}}
\index{ec\+\_\+public\+\_\+key\+\_\+memcmp@{ec\+\_\+public\+\_\+key\+\_\+memcmp}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+public\+\_\+key\+\_\+memcmp()}{ec\_public\_key\_memcmp()}}
{\footnotesize\ttfamily int ec\+\_\+public\+\_\+key\+\_\+memcmp (\begin{DoxyParamCaption}\item[{const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$}]{key1,  }\item[{const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$}]{key2 }\end{DoxyParamCaption})}

\mbox{\Hypertarget{curve_8h_a64eb6ef2ae29f1b7620c6c3113c20b0c}\label{curve_8h_a64eb6ef2ae29f1b7620c6c3113c20b0c}} 
\index{curve.\+h@{curve.\+h}!ec\+\_\+public\+\_\+key\+\_\+serialize@{ec\+\_\+public\+\_\+key\+\_\+serialize}}
\index{ec\+\_\+public\+\_\+key\+\_\+serialize@{ec\+\_\+public\+\_\+key\+\_\+serialize}!curve.\+h@{curve.\+h}}
\subsubsection{\texorpdfstring{ec\+\_\+public\+\_\+key\+\_\+serialize()}{ec\_public\_key\_serialize()}}
{\footnotesize\ttfamily int ec\+\_\+public\+\_\+key\+\_\+serialize (\begin{DoxyParamCaption}\item[{\hyperlink{structsignal__buffer}{signal\+\_\+buffer} $\ast$$\ast$}]{buffer,  }\item[{const \hyperlink{signal__protocol__types_8h_a73ea701c5087163bba608c4706df6176}{ec\+\_\+public\+\_\+key} $\ast$}]{key }\end{DoxyParamCaption})}

Serialize the public key into a buffer that can be stored. The format of this data is compatible with the input format of \hyperlink{curve_8h_a639f0d4093114b7a306c6f499e763e7b}{curve\+\_\+decode\+\_\+point()}.


\begin{DoxyParams}{Parameters}
{\em buffer} & Pointer to a buffer that will be allocated by this function and filled with the contents of the key. The caller is responsible for freeing this buffer with \hyperlink{signal__protocol_8h_abd2b0cfb4df9d11f8903c01d19facdf5}{signal\+\_\+buffer\+\_\+free()}. \\
\hline
{\em key} & Key to serialize \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on failure 
\end{DoxyReturn}
