AstroBWT algorithm (DERO) support
To test: - Download https://github.com/deroproject/derosuite/releases/tag/AstroBWT - Run daemon with `--testnet` in command line In config.json: - "coin":"dero" - "url":"127.0.0.1:30306" - "daemon:"true"
This commit is contained in:
parent
2cd45a9e38
commit
14ef99ca67
29 changed files with 2316 additions and 11 deletions
52
src/crypto/astrobwt/Salsa20.hpp
Normal file
52
src/crypto/astrobwt/Salsa20.hpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Based on public domain code available at: http://cr.yp.to/snuffle.html
|
||||
*
|
||||
* This therefore is public domain.
|
||||
*/
|
||||
|
||||
#ifndef ZT_SALSA20_HPP
|
||||
#define ZT_SALSA20_HPP
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <emmintrin.h>
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
/**
|
||||
* Salsa20 stream cipher
|
||||
*/
|
||||
class Salsa20
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @param key 256-bit (32 byte) key
|
||||
* @param iv 64-bit initialization vector
|
||||
*/
|
||||
Salsa20(const void *key,const void *iv)
|
||||
{
|
||||
init(key,iv);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize cipher
|
||||
*
|
||||
* @param key Key bits
|
||||
* @param iv 64-bit initialization vector
|
||||
*/
|
||||
void init(const void *key,const void *iv);
|
||||
|
||||
void XORKeyStream(void *out,unsigned int bytes);
|
||||
|
||||
private:
|
||||
union {
|
||||
__m128i v[4];
|
||||
uint32_t i[16];
|
||||
} _state;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue