mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 04:57:53 +00:00
Some crypto comment fixes.
This commit is contained in:
parent
45a1e048bb
commit
c3cbc92757
@ -16,7 +16,7 @@ namespace ZeroTier {
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void add(unsigned int h[17],const unsigned int c[17])
|
||||
static inline void add(unsigned int h[17],const unsigned int c[17])
|
||||
{
|
||||
unsigned int j;
|
||||
unsigned int u;
|
||||
@ -24,7 +24,7 @@ static void add(unsigned int h[17],const unsigned int c[17])
|
||||
for (j = 0;j < 17;++j) { u += h[j] + c[j]; h[j] = u & 255; u >>= 8; }
|
||||
}
|
||||
|
||||
static void squeeze(unsigned int h[17])
|
||||
static inline void squeeze(unsigned int h[17])
|
||||
{
|
||||
unsigned int j;
|
||||
unsigned int u;
|
||||
@ -40,7 +40,7 @@ static const unsigned int minusp[17] = {
|
||||
5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252
|
||||
} ;
|
||||
|
||||
static void freeze(unsigned int h[17])
|
||||
static inline void freeze(unsigned int h[17])
|
||||
{
|
||||
unsigned int horig[17];
|
||||
unsigned int j;
|
||||
@ -51,7 +51,7 @@ static void freeze(unsigned int h[17])
|
||||
for (j = 0;j < 17;++j) h[j] ^= negative & (horig[j] ^ h[j]);
|
||||
}
|
||||
|
||||
static void mulmod(unsigned int h[17],const unsigned int r[17])
|
||||
static inline void mulmod(unsigned int h[17],const unsigned int r[17])
|
||||
{
|
||||
unsigned int hr[17];
|
||||
unsigned int i;
|
||||
|
@ -38,8 +38,11 @@ namespace ZeroTier {
|
||||
*
|
||||
* This takes a one-time-use 32-byte key and generates a 16-byte message
|
||||
* authentication code. The key must never be re-used for a different
|
||||
* message. Normally this is done by taking a base key and mangling it
|
||||
* using a nonce and possibly other data, as in Packet.
|
||||
* message.
|
||||
*
|
||||
* In Packet this is done by using the first 32 bytes of the stream cipher
|
||||
* keystream as a one-time-use key. These 32 bytes are then discarded and
|
||||
* the packet is encrypted with the next N bytes.
|
||||
*/
|
||||
class Poly1305
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user