2018-05-24 18:27:26 +00:00
|
|
|
#include "Poly1305.h"
|
|
|
|
/**
|
|
|
|
This code is licensed under the MCGSI Public License
|
|
|
|
Copyright 2018 Jeff Becker
|
|
|
|
|
|
|
|
Kovri go write your own code
|
|
|
|
|
|
|
|
*/
|
2018-11-22 17:13:16 +00:00
|
|
|
|
2019-01-06 22:43:05 +00:00
|
|
|
#if !OPENSSL_AEAD_CHACHA20_POLY1305
|
2018-05-24 18:27:26 +00:00
|
|
|
namespace i2p
|
|
|
|
{
|
|
|
|
namespace crypto
|
|
|
|
{
|
|
|
|
|
2018-11-24 15:07:17 +00:00
|
|
|
void Poly1305HMAC(uint64_t * out, const uint64_t * key, const uint8_t * buf, std::size_t sz)
|
2018-05-24 18:27:26 +00:00
|
|
|
{
|
2018-11-24 15:07:17 +00:00
|
|
|
Poly1305 p(key);
|
2018-05-28 13:49:59 +00:00
|
|
|
p.Update(buf, sz);
|
|
|
|
p.Finish(out);
|
2018-11-24 15:07:17 +00:00
|
|
|
}
|
2018-05-24 18:27:26 +00:00
|
|
|
}
|
|
|
|
}
|
2018-11-22 17:13:16 +00:00
|
|
|
#endif
|
|
|
|
|