Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
azure-cloud-mining-script
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
azure-cloud-mining-script
Commits
29363d5a
There was an error fetching the commit references. Please try again later.
Commit
29363d5a
authored
7 years ago
by
psychocrypt
Browse files
Options
Downloads
Patches
Plain Diff
fix illegal memory access
remove restricted pointer
parent
6701b0c2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xmrstak/backend/nvidia/nvcc_code/cuda_blake.hpp
+9
-8
9 additions, 8 deletions
xmrstak/backend/nvidia/nvcc_code/cuda_blake.hpp
with
9 additions
and
8 deletions
xmrstak/backend/nvidia/nvcc_code/cuda_blake.hpp
+
9
−
8
View file @
29363d5a
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
typedef
struct
{
typedef
struct
{
uint32_t
h
[
8
],
s
[
4
],
t
[
2
];
uint32_t
h
[
8
],
s
[
4
],
t
[
2
];
int
buflen
,
nullt
;
uint32_t
buflen
;
int
nullt
;
uint8_t
buf
[
64
];
uint8_t
buf
[
64
];
}
blake_state
;
}
blake_state
;
...
@@ -50,7 +51,7 @@ __constant__ uint32_t d_blake_cst[16]
...
@@ -50,7 +51,7 @@ __constant__ uint32_t d_blake_cst[16]
0xC0AC29B7
,
0xC97C50DD
,
0x3F84D5B5
,
0xB5470917
0xC0AC29B7
,
0xC97C50DD
,
0x3F84D5B5
,
0xB5470917
};
};
__device__
void
cn_blake_compress
(
blake_state
*
__restrict__
S
,
const
uint8_t
*
__restrict__
block
)
__device__
void
cn_blake_compress
(
blake_state
*
S
,
const
uint8_t
*
block
)
{
{
uint32_t
v
[
16
],
m
[
16
],
i
;
uint32_t
v
[
16
],
m
[
16
],
i
;
...
@@ -89,12 +90,12 @@ __device__ void cn_blake_compress(blake_state * __restrict__ S, const uint8_t *
...
@@ -89,12 +90,12 @@ __device__ void cn_blake_compress(blake_state * __restrict__ S, const uint8_t *
for
(
i
=
0
;
i
<
8
;
++
i
)
S
->
h
[
i
]
^=
S
->
s
[
i
%
4
];
for
(
i
=
0
;
i
<
8
;
++
i
)
S
->
h
[
i
]
^=
S
->
s
[
i
%
4
];
}
}
__device__
void
cn_blake_update
(
blake_state
*
__restrict__
S
,
const
uint8_t
*
__restrict__
data
,
uint64_t
datalen
)
__device__
void
cn_blake_update
(
blake_state
*
S
,
const
uint8_t
*
data
,
uint64_t
datalen
)
{
{
int
left
=
S
->
buflen
>>
3
;
u
int
32_t
left
=
S
->
buflen
>>
3
;
int
fill
=
64
-
left
;
u
int
32_t
fill
=
64
-
left
;
if
(
left
&&
(((
datalen
>>
3
)
&
0x3F
)
>=
(
unsigned
)
fill
))
if
(
left
&&
(((
datalen
>>
3
)
&
0x3F
)
>=
fill
))
{
{
memcpy
((
void
*
)
(
S
->
buf
+
left
),
(
void
*
)
data
,
fill
);
memcpy
((
void
*
)
(
S
->
buf
+
left
),
(
void
*
)
data
,
fill
);
S
->
t
[
0
]
+=
512
;
S
->
t
[
0
]
+=
512
;
...
@@ -125,7 +126,7 @@ __device__ void cn_blake_update(blake_state * __restrict__ S, const uint8_t * __
...
@@ -125,7 +126,7 @@ __device__ void cn_blake_update(blake_state * __restrict__ S, const uint8_t * __
}
}
}
}
__device__
void
cn_blake_final
(
blake_state
*
__restrict__
S
,
uint8_t
*
__restrict__
digest
)
__device__
void
cn_blake_final
(
blake_state
*
S
,
uint8_t
*
digest
)
{
{
const
uint8_t
padding
[]
=
const
uint8_t
padding
[]
=
{
{
...
@@ -177,7 +178,7 @@ __device__ void cn_blake_final(blake_state * __restrict__ S, uint8_t * __restric
...
@@ -177,7 +178,7 @@ __device__ void cn_blake_final(blake_state * __restrict__ S, uint8_t * __restric
U32TO8
(
digest
+
28
,
S
->
h
[
7
]);
U32TO8
(
digest
+
28
,
S
->
h
[
7
]);
}
}
__device__
void
cn_blake
(
const
uint8_t
*
__restrict__
in
,
uint64_t
inlen
,
uint8_t
*
__restrict__
out
)
__device__
void
cn_blake
(
const
uint8_t
*
in
,
uint64_t
inlen
,
uint8_t
*
out
)
{
{
blake_state
bs
;
blake_state
bs
;
blake_state
*
S
=
(
blake_state
*
)
&
bs
;
blake_state
*
S
=
(
blake_state
*
)
&
bs
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment