#ifdef HAVE_SHA256_8WAY
-static const uint32_t finalblk_8way[8 * 16] __attribute__((aligned(32))) = {
+static const uint32_t _ALIGN(32) finalblk_8way[8 * 16] = {
0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001, 0x00000001,
0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000, 0x80000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
static inline void HMAC_SHA256_80_init_8way(const uint32_t *key,
uint32_t *tstate, uint32_t *ostate)
{
- uint32_t ihash[8 * 8] __attribute__((aligned(32)));
- uint32_t pad[8 * 16] __attribute__((aligned(32)));
+ uint32_t _ALIGN(32) ihash[8 * 8];
+ uint32_t _ALIGN(32) pad[8 * 16];
int i;
/* tstate is assumed to contain the midstate of key */
static inline void PBKDF2_SHA256_80_128_8way(const uint32_t *tstate,
const uint32_t *ostate, const uint32_t *salt, uint32_t *output)
{
- uint32_t istate[8 * 8] __attribute__((aligned(32)));
- uint32_t ostate2[8 * 8] __attribute__((aligned(32)));
- uint32_t ibuf[8 * 16] __attribute__((aligned(32)));
- uint32_t obuf[8 * 16] __attribute__((aligned(32)));
+ uint32_t _ALIGN(32) istate[8 * 8];
+ uint32_t _ALIGN(32) ostate2[8 * 8];
+ uint32_t _ALIGN(32) ibuf[8 * 16];
+ uint32_t _ALIGN(32) obuf[8 * 16];
int i, j;
memcpy(istate, tstate, 8 * 32);
static inline void PBKDF2_SHA256_128_32_8way(uint32_t *tstate,
uint32_t *ostate, const uint32_t *salt, uint32_t *output)
{
- uint32_t buf[8 * 16] __attribute__((aligned(32)));
+ uint32_t _ALIGN(32) buf[8 * 16];
int i;
sha256_transform_8way(tstate, salt, 1);
static void scrypt_1024_1_1_256_3way(const uint32_t *input,
uint32_t *output, uint32_t *midstate, unsigned char *scratchpad, int N)
{
- uint32_t tstate[3 * 8], ostate[3 * 8];
- uint32_t X[3 * 32] __attribute__((aligned(64)));
+ uint32_t _ALIGN(64) tstate[3 * 8], ostate[3 * 8];
+ uint32_t _ALIGN(64) X[3 * 32];
uint32_t *V;
V = (uint32_t *)(((uintptr_t)(scratchpad) + 63) & ~ (uintptr_t)(63));
static void scrypt_1024_1_1_256_12way(const uint32_t *input,
uint32_t *output, uint32_t *midstate, unsigned char *scratchpad, int N)
{
- uint32_t tstate[12 * 8] __attribute__((aligned(128)));
- uint32_t ostate[12 * 8] __attribute__((aligned(128)));
- uint32_t W[12 * 32] __attribute__((aligned(128)));
- uint32_t X[12 * 32] __attribute__((aligned(128)));
+ uint32_t _ALIGN(128) tstate[12 * 8];
+ uint32_t _ALIGN(128) ostate[12 * 8];
+ uint32_t _ALIGN(128) W[12 * 32];
+ uint32_t _ALIGN(128) X[12 * 32];
uint32_t *V;
int i, j, k;
static void scrypt_1024_1_1_256_24way(const uint32_t *input,
uint32_t *output, uint32_t *midstate, unsigned char *scratchpad, int N)
{
- uint32_t tstate[24 * 8] __attribute__((aligned(128)));
- uint32_t ostate[24 * 8] __attribute__((aligned(128)));
- uint32_t W[24 * 32] __attribute__((aligned(128)));
- uint32_t X[24 * 32] __attribute__((aligned(128)));
+ uint32_t _ALIGN(128) tstate[24 * 8];
+ uint32_t _ALIGN(128) ostate[24 * 8];
+ uint32_t _ALIGN(128) W[24 * 32];
+ uint32_t _ALIGN(128) X[24 * 32];
uint32_t *V;
int i, j, k;
extern int scanhash_scrypt(int thr_id, uint32_t *pdata,
unsigned char *scratchbuf, const uint32_t *ptarget,
- uint32_t max_nonce, uint64_t *hashes_done, int N)
+ uint32_t max_nonce, uint64_t *hashes_done, uint32_t N)
{
uint32_t data[SCRYPT_MAX_WAYS * 20], hash[SCRYPT_MAX_WAYS * 8];
uint32_t midstate[8];