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-motygullin-pcdch
Commits
8042561d
Commit
8042561d
authored
3 months ago
by
motygullin amir
Browse files
Options
Download
Patches
Plain Diff
add
parent
096eb54e
master
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/tests/test.c
+42
-0
examples/tests/test.c
source/ak_random.c
+1211
-1061
source/ak_random.c
source/libakrypt.h
+2507
-2503
source/libakrypt.h
with
3760 additions
and
3564 deletions
+3760
-3564
examples/tests/test.c
0 → 100644
+
42
−
0
View file @
8042561d
/* --------------------------------------------------------------------------------- */
/* example-g03n01.c */
/* --------------------------------------------------------------------------------- */
#include
<stdio.h>
#include
<libakrypt.h>
#include
<unistd.h>
int
main
(
void
)
{
/* , */
int
error
=
ak_error_ok
;
/* */
int
exitstatus
=
EXIT_FAILURE
;
/* */
struct
bckey
ctx
;
struct
random
rnd
;
/* */
ak_uint8
generated
[
800
];
ak_uint8
key
[
32
]
=
{
0x00
,
0x01
,
0x02
,
0x03
,
0x04
,
0x05
,
0x06
,
0x07
,
0x08
,
0x09
,
0x0A
,
0x0B
,
0x0C
,
0x0D
,
0x0E
,
0x0F
,
0x10
,
0x11
,
0x12
,
0x13
,
0x14
,
0x15
,
0x16
,
0x17
,
0x18
,
0x19
,
0x1A
,
0x1B
,
0x1C
,
0x1D
,
0x1E
,
0x1F
,
};
/* */
if
(
ak_libakrypt_create
(
NULL
)
!=
ak_true
)
{
ak_libakrypt_destroy
();
return
EXIT_FAILURE
;
}
ak_bckey_create_magma
(
&
ctx
);
ak_bckey_set_key
(
&
ctx
,
key
,
32
);
ak_random_create_magma
(
&
rnd
,
&
ctx
);
rnd
.
random
(
&
rnd
,
generated
,
800
);
write
(
1
,
"a"
,
1
);
printf
(
"%s
\n\n
"
,
ak_ptr_to_hexstr
(
generated
,
40
,
ak_false
));
printf
(
"%s
\n\n
"
,
ak_ptr_to_hexstr
((
ak_uint8
*
)
generated
+
760
,
40
,
ak_false
));
rnd
.
free
(
&
rnd
);
/* */
if
(
error
==
ak_error_ok
)
exitstatus
=
EXIT_SUCCESS
;
ak_libakrypt_destroy
();
return
exitstatus
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
source/ak_random.c
+
1211
−
1061
View file @
8042561d
This diff is collapsed.
Click to expand it.
source/libakrypt.h
+
2507
−
2503
View file @
8042561d
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