\hypertarget{blake2-sw_8c_source}{}\doxysection{blake2-\/sw.c}
\label{blake2-sw_8c_source}\index{crypto/blake2/blake2-\/sw.c@{crypto/blake2/blake2-\/sw.c}}
\mbox{\hyperlink{blake2-sw_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00001}00001 \textcolor{comment}{/* This file is in the public domain. */}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00002}00002 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00003}00003 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00004}\mbox{\hyperlink{blake2-sw_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00004}} \mbox{\hyperlink{blake2-sw_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00005}00005 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00006}00006 \textcolor{preprocessor}{\#include <contrib/libb2/blake2.h>}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00007}00007 \textcolor{preprocessor}{\#include <opencrypto/xform\_auth.h>}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00008}00008 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00009}\mbox{\hyperlink{blake2-sw_8c_ac64fef68c581767271bf554f0877c9d8}{00009}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_ac64fef68c581767271bf554f0877c9d8}{blake2b\_init\_ref}}(blake2b\_state *\mbox{\hyperlink{sha1_8c_af15513bee028c2c0146fa50ae1e26d84}{S}}, \textcolor{keywordtype}{size\_t} outlen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00010}\mbox{\hyperlink{blake2-sw_8c_a108ba8cfc5da00b5d3ebf73ac98a2ef3}{00010}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_a108ba8cfc5da00b5d3ebf73ac98a2ef3}{blake2b\_init\_param\_ref}}(blake2b\_state *\mbox{\hyperlink{sha1_8c_af15513bee028c2c0146fa50ae1e26d84}{S}}, \textcolor{keyword}{const} blake2b\_param *P);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00011}\mbox{\hyperlink{blake2-sw_8c_ac25423d3491519e68c313d70ac93597a}{00011}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_ac25423d3491519e68c313d70ac93597a}{blake2b\_init\_key\_ref}}(blake2b\_state *\mbox{\hyperlink{sha1_8c_af15513bee028c2c0146fa50ae1e26d84}{S}}, \textcolor{keywordtype}{size\_t} outlen,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00012}00012     \textcolor{keyword}{const} \textcolor{keywordtype}{void} *key, \textcolor{keywordtype}{size\_t} keylen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00013}\mbox{\hyperlink{blake2-sw_8c_a22f3819db496b9acdd8ddbc82243e953}{00013}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_a22f3819db496b9acdd8ddbc82243e953}{blake2b\_update\_ref}}(blake2b\_state *\mbox{\hyperlink{sha1_8c_af15513bee028c2c0146fa50ae1e26d84}{S}}, \textcolor{keyword}{const} uint8\_t *in,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00014}00014     \textcolor{keywordtype}{size\_t} inlen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00015}\mbox{\hyperlink{blake2-sw_8c_a6ccf2708a9c72561e46622817899c00f}{00015}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_a6ccf2708a9c72561e46622817899c00f}{blake2b\_final\_ref}}(blake2b\_state *\mbox{\hyperlink{sha1_8c_af15513bee028c2c0146fa50ae1e26d84}{S}}, uint8\_t *out, \textcolor{keywordtype}{size\_t} outlen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00016}\mbox{\hyperlink{blake2-sw_8c_a74a8ba16523ec9499787faf4191b6d66}{00016}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_a74a8ba16523ec9499787faf4191b6d66}{blake2b\_ref}}(uint8\_t *out, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *in, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *key,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00017}00017     \textcolor{keywordtype}{size\_t} outlen, \textcolor{keywordtype}{size\_t} inlen, \textcolor{keywordtype}{size\_t} keylen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00018}00018 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00019}\mbox{\hyperlink{blake2-sw_8c_ab99b9255708531a7b7dcd7f7ba4b310c}{00019}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_ab99b9255708531a7b7dcd7f7ba4b310c}{blake2s\_init\_ref}}(blake2s\_state *\mbox{\hyperlink{sha1_8c_af15513bee028c2c0146fa50ae1e26d84}{S}}, \textcolor{keywordtype}{size\_t} outlen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00020}\mbox{\hyperlink{blake2-sw_8c_a598b2609c03eedeb815ecd30c32830b3}{00020}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_a598b2609c03eedeb815ecd30c32830b3}{blake2s\_init\_param\_ref}}(blake2s\_state *\mbox{\hyperlink{sha1_8c_af15513bee028c2c0146fa50ae1e26d84}{S}}, \textcolor{keyword}{const} blake2s\_param *P);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00021}\mbox{\hyperlink{blake2-sw_8c_a39f08d307bc4c7390f34be83cf446a3d}{00021}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_a39f08d307bc4c7390f34be83cf446a3d}{blake2s\_init\_key\_ref}}(blake2s\_state *\mbox{\hyperlink{sha1_8c_af15513bee028c2c0146fa50ae1e26d84}{S}}, \textcolor{keywordtype}{size\_t} outlen,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00022}00022     \textcolor{keyword}{const} \textcolor{keywordtype}{void} *key, \textcolor{keywordtype}{size\_t} keylen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00023}\mbox{\hyperlink{blake2-sw_8c_acb5a68716de2e01c4f265cd1fa6700ba}{00023}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_acb5a68716de2e01c4f265cd1fa6700ba}{blake2s\_update\_ref}}(blake2s\_state *\mbox{\hyperlink{sha1_8c_af15513bee028c2c0146fa50ae1e26d84}{S}}, \textcolor{keyword}{const} uint8\_t *in,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00024}00024     \textcolor{keywordtype}{size\_t} inlen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00025}\mbox{\hyperlink{blake2-sw_8c_a26b45d22e245708d6e34611fde5bd81a}{00025}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_a26b45d22e245708d6e34611fde5bd81a}{blake2s\_final\_ref}}(blake2s\_state *\mbox{\hyperlink{sha1_8c_af15513bee028c2c0146fa50ae1e26d84}{S}}, uint8\_t *out, \textcolor{keywordtype}{size\_t} outlen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00026}\mbox{\hyperlink{blake2-sw_8c_aec1b880928cd6c6212f059c216c3a857}{00026}} \textcolor{keyword}{extern} \textcolor{keywordtype}{int} \mbox{\hyperlink{blake2-sw_8c_aec1b880928cd6c6212f059c216c3a857}{blake2s\_ref}}(uint8\_t *out, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *in, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *key,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00027}00027     \textcolor{keywordtype}{size\_t} outlen, \textcolor{keywordtype}{size\_t} inlen, \textcolor{keywordtype}{size\_t} keylen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00029}\mbox{\hyperlink{structblake2b__xform__ctx}{00029}} \textcolor{keyword}{struct }\mbox{\hyperlink{structblake2b__xform__ctx}{blake2b\_xform\_ctx}} \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00030}\mbox{\hyperlink{structblake2b__xform__ctx_a9f5d746340f0e2bbf3acdfc913e7b228}{00030}}         blake2b\_state \mbox{\hyperlink{structblake2b__xform__ctx_a9f5d746340f0e2bbf3acdfc913e7b228}{state}};}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00031}00031 \};}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00032}\mbox{\hyperlink{blake2-sw_8c_a47ab2ae089788287ad12cad045740138}{00032}} \mbox{\hyperlink{blake2-sw_8c_a47ab2ae089788287ad12cad045740138}{CTASSERT}}(\textcolor{keyword}{sizeof}(\textcolor{keyword}{union} authctx) >= \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structblake2b__xform__ctx}{blake2b\_xform\_ctx}}));}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00033}00033 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00034}00034 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00035}\mbox{\hyperlink{blake2-sw_8c_acd2fa98580a1c36fe608310caa484415}{00035}} \mbox{\hyperlink{blake2-sw_8c_acd2fa98580a1c36fe608310caa484415}{blake2b\_xform\_init}}(\textcolor{keywordtype}{void} *vctx)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00036}00036 \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00037}00037         \textcolor{keyword}{struct }\mbox{\hyperlink{structblake2b__xform__ctx}{blake2b\_xform\_ctx}} *ctx = vctx;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00038}00038         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00040}00040         rc = \mbox{\hyperlink{blake2-sw_8c_ac64fef68c581767271bf554f0877c9d8}{blake2b\_init\_ref}}(\&ctx-\/>\mbox{\hyperlink{structblake2b__xform__ctx_a9f5d746340f0e2bbf3acdfc913e7b228}{state}}, BLAKE2B\_OUTBYTES);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00041}00041         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00042}00042                 panic(\textcolor{stringliteral}{"{}blake2b\_init: invalid arguments"{}});}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00043}00043 \}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00045}00045 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00046}\mbox{\hyperlink{blake2-sw_8c_aba9b41ba6296ea30dfc7cfa93c6a34aa}{00046}} \mbox{\hyperlink{blake2-sw_8c_aba9b41ba6296ea30dfc7cfa93c6a34aa}{blake2b\_xform\_setkey}}(\textcolor{keywordtype}{void} *vctx, \textcolor{keyword}{const} uint8\_t *key, u\_int klen)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00047}00047 \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00048}00048         \textcolor{keyword}{struct }\mbox{\hyperlink{structblake2b__xform__ctx}{blake2b\_xform\_ctx}} *ctx = vctx;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00049}00049         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00051}00051         rc = \mbox{\hyperlink{blake2-sw_8c_ac25423d3491519e68c313d70ac93597a}{blake2b\_init\_key\_ref}}(\&ctx-\/>\mbox{\hyperlink{structblake2b__xform__ctx_a9f5d746340f0e2bbf3acdfc913e7b228}{state}}, BLAKE2B\_OUTBYTES, key,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00052}00052             klen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00053}00053         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00054}00054                 panic(\textcolor{stringliteral}{"{}blake2b\_init\_key: invalid arguments"{}});}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00055}00055 \}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00057}00057 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00058}\mbox{\hyperlink{blake2-sw_8c_a8dbfb7a6e0f9517aa5e0b36e007a494c}{00058}} \mbox{\hyperlink{blake2-sw_8c_a8dbfb7a6e0f9517aa5e0b36e007a494c}{blake2b\_xform\_update}}(\textcolor{keywordtype}{void} *vctx, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *data, u\_int len)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00059}00059 \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00060}00060         \textcolor{keyword}{struct }\mbox{\hyperlink{structblake2b__xform__ctx}{blake2b\_xform\_ctx}} *ctx = vctx;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00061}00061         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00063}00063         rc = \mbox{\hyperlink{blake2-sw_8c_a22f3819db496b9acdd8ddbc82243e953}{blake2b\_update\_ref}}(\&ctx-\/>\mbox{\hyperlink{structblake2b__xform__ctx_a9f5d746340f0e2bbf3acdfc913e7b228}{state}}, data, len);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00064}00064         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00065}00065                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00066}00066         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00067}00067 \}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00069}00069 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00070}\mbox{\hyperlink{blake2-sw_8c_a5029525075a2a5c3d8313be078f54124}{00070}} \mbox{\hyperlink{blake2-sw_8c_a5029525075a2a5c3d8313be078f54124}{blake2b\_xform\_final}}(uint8\_t *out, \textcolor{keywordtype}{void} *vctx)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00071}00071 \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00072}00072         \textcolor{keyword}{struct }\mbox{\hyperlink{structblake2b__xform__ctx}{blake2b\_xform\_ctx}} *ctx = vctx;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00073}00073         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00075}00075         rc = \mbox{\hyperlink{blake2-sw_8c_a6ccf2708a9c72561e46622817899c00f}{blake2b\_final\_ref}}(\&ctx-\/>\mbox{\hyperlink{structblake2b__xform__ctx_a9f5d746340f0e2bbf3acdfc913e7b228}{state}}, out, BLAKE2B\_OUTBYTES);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00076}00076         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00077}00077                 panic(\textcolor{stringliteral}{"{}blake2b\_final: invalid"{}});}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00078}00078 \}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00080}\mbox{\hyperlink{blake2-sw_8c_afdb37c01da991dee307dd6ecb0f4eb36}{00080}} \textcolor{keyword}{const} \textcolor{keyword}{struct }auth\_hash \mbox{\hyperlink{blake2-sw_8c_afdb37c01da991dee307dd6ecb0f4eb36}{auth\_hash\_blake2b}} = \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00081}00081         .type = CRYPTO\_BLAKE2B,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00082}00082         .name = \textcolor{stringliteral}{"{}Blake2b"{}},}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00083}00083         .keysize = BLAKE2B\_KEYBYTES,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00084}00084         .hashsize = BLAKE2B\_OUTBYTES,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00085}00085         .ctxsize = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structblake2b__xform__ctx}{blake2b\_xform\_ctx}}),}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00086}00086         .Setkey = \mbox{\hyperlink{blake2-sw_8c_aba9b41ba6296ea30dfc7cfa93c6a34aa}{blake2b\_xform\_setkey}},}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00087}00087         .Init = \mbox{\hyperlink{blake2-sw_8c_acd2fa98580a1c36fe608310caa484415}{blake2b\_xform\_init}},}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00088}00088         .Update = \mbox{\hyperlink{blake2-sw_8c_a8dbfb7a6e0f9517aa5e0b36e007a494c}{blake2b\_xform\_update}},}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00089}00089         .Final = \mbox{\hyperlink{blake2-sw_8c_a5029525075a2a5c3d8313be078f54124}{blake2b\_xform\_final}},}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00090}00090 \};}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00091}00091 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00092}\mbox{\hyperlink{structblake2s__xform__ctx}{00092}} \textcolor{keyword}{struct }\mbox{\hyperlink{structblake2s__xform__ctx}{blake2s\_xform\_ctx}} \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00093}\mbox{\hyperlink{structblake2s__xform__ctx_a4d61d54c13ae3aa94ebd72dc92c7a096}{00093}}         blake2s\_state \mbox{\hyperlink{structblake2s__xform__ctx_a4d61d54c13ae3aa94ebd72dc92c7a096}{state}};}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00094}00094 \};}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00095}\mbox{\hyperlink{blake2-sw_8c_a0dcfeb3368ff48703af3ec10ffe6fb16}{00095}} \mbox{\hyperlink{blake2-sw_8c_a47ab2ae089788287ad12cad045740138}{CTASSERT}}(\textcolor{keyword}{sizeof}(\textcolor{keyword}{union} authctx) >= \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structblake2s__xform__ctx}{blake2s\_xform\_ctx}}));}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00097}00097 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00098}\mbox{\hyperlink{blake2-sw_8c_a9ea7307bdc5e13b52b231acbe5944bd0}{00098}} \mbox{\hyperlink{blake2-sw_8c_a9ea7307bdc5e13b52b231acbe5944bd0}{blake2s\_xform\_init}}(\textcolor{keywordtype}{void} *vctx)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00099}00099 \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00100}00100         \textcolor{keyword}{struct }\mbox{\hyperlink{structblake2s__xform__ctx}{blake2s\_xform\_ctx}} *ctx = vctx;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00101}00101         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00103}00103         rc = \mbox{\hyperlink{blake2-sw_8c_ab99b9255708531a7b7dcd7f7ba4b310c}{blake2s\_init\_ref}}(\&ctx-\/>\mbox{\hyperlink{structblake2s__xform__ctx_a4d61d54c13ae3aa94ebd72dc92c7a096}{state}}, BLAKE2S\_OUTBYTES);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00104}00104         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00105}00105                 panic(\textcolor{stringliteral}{"{}blake2s\_init: invalid arguments"{}});}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00106}00106 \}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00107}00107 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00108}00108 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00109}\mbox{\hyperlink{blake2-sw_8c_a48279f23fbfdf3e872f44619c5b6ff6b}{00109}} \mbox{\hyperlink{blake2-sw_8c_a48279f23fbfdf3e872f44619c5b6ff6b}{blake2s\_xform\_setkey}}(\textcolor{keywordtype}{void} *vctx, \textcolor{keyword}{const} uint8\_t *key, u\_int klen)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00110}00110 \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00111}00111         \textcolor{keyword}{struct }\mbox{\hyperlink{structblake2s__xform__ctx}{blake2s\_xform\_ctx}} *ctx = vctx;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00112}00112         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00113}00113 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00114}00114         rc = \mbox{\hyperlink{blake2-sw_8c_a39f08d307bc4c7390f34be83cf446a3d}{blake2s\_init\_key\_ref}}(\&ctx-\/>\mbox{\hyperlink{structblake2s__xform__ctx_a4d61d54c13ae3aa94ebd72dc92c7a096}{state}}, BLAKE2S\_OUTBYTES, key,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00115}00115             klen);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00116}00116         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00117}00117                 panic(\textcolor{stringliteral}{"{}blake2s\_init\_key: invalid arguments"{}});}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00118}00118 \}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00120}00120 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00121}\mbox{\hyperlink{blake2-sw_8c_a49077e46b311abbeab176ad13067bcb0}{00121}} \mbox{\hyperlink{blake2-sw_8c_a49077e46b311abbeab176ad13067bcb0}{blake2s\_xform\_update}}(\textcolor{keywordtype}{void} *vctx, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *data, u\_int len)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00122}00122 \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00123}00123         \textcolor{keyword}{struct }\mbox{\hyperlink{structblake2s__xform__ctx}{blake2s\_xform\_ctx}} *ctx = vctx;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00124}00124         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00126}00126         rc = \mbox{\hyperlink{blake2-sw_8c_acb5a68716de2e01c4f265cd1fa6700ba}{blake2s\_update\_ref}}(\&ctx-\/>\mbox{\hyperlink{structblake2s__xform__ctx_a4d61d54c13ae3aa94ebd72dc92c7a096}{state}}, data, len);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00127}00127         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00128}00128                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00129}00129         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00130}00130 \}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00132}00132 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00133}\mbox{\hyperlink{blake2-sw_8c_aec9ab67de3d7070276948a3ffcf25e8f}{00133}} \mbox{\hyperlink{blake2-sw_8c_aec9ab67de3d7070276948a3ffcf25e8f}{blake2s\_xform\_final}}(uint8\_t *out, \textcolor{keywordtype}{void} *vctx)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00134}00134 \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00135}00135         \textcolor{keyword}{struct }\mbox{\hyperlink{structblake2s__xform__ctx}{blake2s\_xform\_ctx}} *ctx = vctx;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00136}00136         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00137}00137 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00138}00138         rc = \mbox{\hyperlink{blake2-sw_8c_a26b45d22e245708d6e34611fde5bd81a}{blake2s\_final\_ref}}(\&ctx-\/>\mbox{\hyperlink{structblake2s__xform__ctx_a4d61d54c13ae3aa94ebd72dc92c7a096}{state}}, out, BLAKE2S\_OUTBYTES);}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00139}00139         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00140}00140                 panic(\textcolor{stringliteral}{"{}blake2s\_final: invalid"{}});}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00141}00141 \}}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00142}00142 }
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00143}\mbox{\hyperlink{blake2-sw_8c_afba80bd9e629638ba4d76898b5943964}{00143}} \textcolor{keyword}{const} \textcolor{keyword}{struct }auth\_hash \mbox{\hyperlink{blake2-sw_8c_afba80bd9e629638ba4d76898b5943964}{auth\_hash\_blake2s}} = \{}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00144}00144         .type = CRYPTO\_BLAKE2S,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00145}00145         .name = \textcolor{stringliteral}{"{}Blake2s"{}},}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00146}00146         .keysize = BLAKE2S\_KEYBYTES,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00147}00147         .hashsize = BLAKE2S\_OUTBYTES,}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00148}00148         .ctxsize = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structblake2s__xform__ctx}{blake2s\_xform\_ctx}}),}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00149}00149         .Setkey = \mbox{\hyperlink{blake2-sw_8c_a48279f23fbfdf3e872f44619c5b6ff6b}{blake2s\_xform\_setkey}},}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00150}00150         .Init = \mbox{\hyperlink{blake2-sw_8c_a9ea7307bdc5e13b52b231acbe5944bd0}{blake2s\_xform\_init}},}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00151}00151         .Update = \mbox{\hyperlink{blake2-sw_8c_a49077e46b311abbeab176ad13067bcb0}{blake2s\_xform\_update}},}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00152}00152         .Final = \mbox{\hyperlink{blake2-sw_8c_aec9ab67de3d7070276948a3ffcf25e8f}{blake2s\_xform\_final}},}
\DoxyCodeLine{\Hypertarget{blake2-sw_8c_source_l00153}00153 \};}

\end{DoxyCode}
