Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename constant and move definitions to common header.
- Loading branch information
Showing
5 changed files
with
63 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef __COMMON_H__ | ||
#define __COMMON_H__ | ||
|
||
#if defined(__CUDACC__) // NVCC | ||
#define MY_ALIGN(n) __align__(n) | ||
#elif defined(__GNUC__) // GCC | ||
#define MY_ALIGN(n) __attribute__((aligned(n))) | ||
#elif defined(_MSC_VER) // MSVC | ||
#define MY_ALIGN(n) __declspec(align(n)) | ||
#else | ||
#error "Please provide a definition for MY_ALIGN macro for your host compiler!" | ||
#endif | ||
|
||
#define ROUNDS 20 | ||
#ifndef UINT64_MAX | ||
#define UINT64_MAX (18446744073709551615ULL) | ||
#endif | ||
|
||
#define THREADS_PER_BLOCK (128) | ||
#define XSALSA20_CRYPTO_KEYBYTES 32 | ||
#define XSALSA20_CRYPTO_NONCEBYTES 24 | ||
#define XSALSA20_BLOCKSZ 64 | ||
#define CTR_INBLOCK_SZ (16) | ||
#define CTR_KS_SZ (XSALSA20_BLOCKSZ) | ||
#define BLOCKS_PER_CHUNK_1X 4 | ||
#define BLOCKS_PER_CHUNK_2X 1 | ||
#define NUM_STREAMS 16 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters