Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Белов Никита Сергеевич
libakrypt-stb34v2
Commits
560cad59
Commit
560cad59
authored
2 months ago
by
Белов Никита Сергеевич
Browse files
Options
Download
Patches
Plain Diff
Update ak_belt_hash.c
parent
f4b80e29
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/ak_belt_hash.c
+5
-5
source/ak_belt_hash.c
with
5 additions
and
5 deletions
+5
-5
source/ak_belt_hash.c
+
5
−
5
View file @
560cad59
...
@@ -101,7 +101,7 @@ static int ak_hash_context_belt_update(ak_pointer sctx, const ak_pointer in, con
...
@@ -101,7 +101,7 @@ static int ak_hash_context_belt_update(ak_pointer sctx, const ak_pointer in, con
memcpy
(
compress_in
,
dt
,
32
);
// Загружаем данные для функции сжатия
memcpy
(
compress_in
,
dt
,
32
);
// Загружаем данные для функции сжатия
memcpy
(
compress_in
+
4
,
cx
->
h
,
32
);
memcpy
(
compress_in
+
4
,
cx
->
h
,
32
);
ak_belt_compress
(
compress_out
,
compress_in
,
&
(
cx
->
bcctx
)
)
;
// Сжимаем данные
ak_belt_compress
(
compress_out
,
compress_in
,
cx
->
bcctx
);
// Сжимаем данные
memcpy
(
cx
->
h
,
compress_out
+
2
,
32
);
// Обновляем h
memcpy
(
cx
->
h
,
compress_out
+
2
,
32
);
// Обновляем h
...
@@ -127,9 +127,9 @@ static int ak_hash_context_belt_finalize(ak_pointer sctx,
...
@@ -127,9 +127,9 @@ static int ak_hash_context_belt_finalize(ak_pointer sctx,
if
(
out_size
<
32
)
return
ak_error_message
(
ak_error_wrong_length
,
__func__
,
if
(
out_size
<
32
)
return
ak_error_message
(
ak_error_wrong_length
,
__func__
,
"output length is too small"
);
"output length is too small"
);
ak_uint8
*
din
=
(
ak_uint8
*
)
in
;
size_t
ssize
=
size
;
size_t
ssize
=
size
&
31
;
ak_uint8
*
din
=
((
ak_uint8
*
)
in
)
+
size
-
ssize
;
ak_uint64
lastBlock
[
8
];
ak_uint64
lastBlock
[
8
];
ak_hash_context_belt_update
(
sctx
,
in
,
(
size
/
32
)
*
32
);
ak_hash_context_belt_update
(
sctx
,
in
,
(
size
/
32
)
*
32
);
...
@@ -153,7 +153,7 @@ static int ak_hash_context_belt_finalize(ak_pointer sctx,
...
@@ -153,7 +153,7 @@ static int ak_hash_context_belt_finalize(ak_pointer sctx,
memcpy
(
lastBlock
+
4
,
cx
->
h
,
32
);
memcpy
(
lastBlock
+
4
,
cx
->
h
,
32
);
ak_uint64
final
[
6
];
ak_uint64
final
[
6
];
ak_belt_compress
(
final
,
lastBlock
,
&
(
cx
->
bcctx
)
)
;
ak_belt_compress
(
final
,
lastBlock
,
cx
->
bcctx
);
memcpy
(
out
,
final
+
2
,
32
);
memcpy
(
out
,
final
+
2
,
32
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets