kernel: lib: Add convert functions for hex strings and binary arrays
Move duplicate hex2bin and add bin2hex function so that application can use the functions and avoid code duplication. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
743f3dbae0
commit
7a93e948a9
9 changed files with 161 additions and 140 deletions
|
@ -64,16 +64,6 @@
|
|||
#include <tinycrypt/ecc.h>
|
||||
#include <test_utils.h>
|
||||
|
||||
int hex2int(char hex);
|
||||
|
||||
|
||||
/*
|
||||
* Convert hex string to byte string
|
||||
* Return number of bytes written to buf, or 0 on error
|
||||
*/
|
||||
int hex2bin(uint8_t *buf, const size_t buflen, const char *hex,
|
||||
const size_t hexlen);
|
||||
|
||||
/*
|
||||
* Convert hex string to zero-padded nanoECC scalar
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue