File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1
1
add_subdirectory (simple-send-canbus )
2
2
add_subdirectory (simple-send-usart )
3
+ add_subdirectory (hmac )
Original file line number Diff line number Diff line change
1
+ add_executable (sample-hmac EXCLUDE_FROM_ALL src/main.c )
2
+ target_include_directories (sample-hmac PRIVATE ${csp_inc} )
3
+ target_link_libraries (sample-hmac PRIVATE csp )
Original file line number Diff line number Diff line change
1
+ #include <csp/csp.h>
2
+ #include <csp/csp_debug.h>
3
+ #include <csp/csp_id.h>
4
+ #include <csp/crypto/csp_hmac.h>
5
+
6
+ int main (int argc , char * argv [])
7
+ {
8
+ csp_packet_t * packet ;
9
+
10
+ csp_init ();
11
+
12
+ packet = csp_buffer_get_always ();
13
+
14
+ csp_id_prepend (packet );
15
+
16
+ memcpy (packet -> data , "abc" , 3 );
17
+ packet -> length += 3 ;
18
+ packet -> frame_length += 3 ;
19
+
20
+ csp_hmac_append (packet , true);
21
+ csp_hmac_verify (packet , true);
22
+
23
+ return 0 ;
24
+ }
You can’t perform that action at this time.
0 commit comments