Cryptographic converters.
More...
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <virgil/iot/secmodule/secmodule.h>
Go to the source code of this file.
|
bool | vs_converters_pubkey_to_raw (vs_secmodule_keypair_type_e keypair_type, const uint8_t *public_key, uint16_t public_key_sz, uint8_t *pubkey_raw, uint16_t buf_sz, uint16_t *pubkey_raw_sz) |
| Convert public key from Virgil format to raw format. More...
|
|
bool | vs_converters_pubkey_to_virgil (vs_secmodule_keypair_type_e keypair_type, const uint8_t *public_key_in, uint16_t public_key_in_sz, uint8_t *public_key_out, uint16_t buf_sz, uint16_t *public_key_out_sz) |
| Convert public key from raw format to Virgil format. More...
|
|
bool | vs_converters_virgil_sign_to_raw (vs_secmodule_keypair_type_e keypair_type, const uint8_t *virgil_sign, uint16_t virgil_sign_sz, uint8_t *sign, uint16_t buf_sz, uint16_t *sign_sz) |
| Convert signature from Virgil format to raw format. More...
|
|
bool | vs_converters_raw_sign_to_virgil (vs_secmodule_keypair_type_e keypair_type, vs_secmodule_hash_type_e hash_type, const uint8_t *raw_sign, uint16_t raw_sign_sz, uint8_t *virgil_sign, uint16_t buf_sz, uint16_t *virgil_sign_sz) |
| Convert signature from raw format to Virgil format. More...
|
|
bool | vs_converters_mbedtls_sign_to_raw (vs_secmodule_keypair_type_e keypair_type, uint8_t *mbedtls_sign, uint16_t mbedtls_sign_sz, uint8_t *raw_sign, uint16_t buf_sz, uint16_t *raw_sz) |
| Convert signature from MbedTLS format to raw format. More...
|
|
bool | vs_converters_raw_sign_to_mbedtls (vs_secmodule_keypair_type_e keypair_type, const unsigned char *raw, uint16_t raw_sz, unsigned char *signature, uint16_t buf_sz, uint16_t *signature_sz) |
| Convert signature from raw format to MbedTLS format. More...
|
|
Cryptographic converters.
This file covers the following conversion cases :
◆ vs_converters_mbedtls_sign_to_raw()
bool vs_converters_mbedtls_sign_to_raw |
( |
vs_secmodule_keypair_type_e |
keypair_type, |
|
|
uint8_t * |
mbedtls_sign, |
|
|
uint16_t |
mbedtls_sign_sz, |
|
|
uint8_t * |
raw_sign, |
|
|
uint16_t |
buf_sz, |
|
|
uint16_t * |
raw_sz |
|
) |
| |
Convert signature from MbedTLS format to raw format.
- Parameters
-
[in] | keypair_type | Keypair type. |
[in] | mbedtls_sign | Source signature in MbedTLS format. Must not be NULL. |
[in] | mbedtls_sign_sz | Source signature size. Must not be zero. |
[out] | raw_sign | Destination buffer for signature in raw format. Must not be NULL. |
[in] | buf_sz | Output buffer size. Must not be zero. |
[in] | raw_sz | Pointer to saved signature size. Must not be NULL. |
- Returns
- true in case of success and false otherwise
◆ vs_converters_pubkey_to_raw()
bool vs_converters_pubkey_to_raw |
( |
vs_secmodule_keypair_type_e |
keypair_type, |
|
|
const uint8_t * |
public_key, |
|
|
uint16_t |
public_key_sz, |
|
|
uint8_t * |
pubkey_raw, |
|
|
uint16_t |
buf_sz, |
|
|
uint16_t * |
pubkey_raw_sz |
|
) |
| |
Convert public key from Virgil format to raw format.
- Parameters
-
[in] | keypair_type | Keypair type. |
[in] | public_key | Source public key in Virgil format. Must not be NULL. |
[in] | public_key_sz | Source public key size. Must not be zero. |
[out] | pubkey_raw | Destination buffer for public key in raw format. Must not be NULL. |
[in] | buf_sz | Output buffer size. Must not be zero. |
[in] | pubkey_raw_sz | Pointer for saved public key size. Must not be NULL. |
- Returns
- true in case of success or false otherwise
◆ vs_converters_pubkey_to_virgil()
bool vs_converters_pubkey_to_virgil |
( |
vs_secmodule_keypair_type_e |
keypair_type, |
|
|
const uint8_t * |
public_key_in, |
|
|
uint16_t |
public_key_in_sz, |
|
|
uint8_t * |
public_key_out, |
|
|
uint16_t |
buf_sz, |
|
|
uint16_t * |
public_key_out_sz |
|
) |
| |
Convert public key from raw format to Virgil format.
- Parameters
-
[in] | keypair_type | Keypair type. |
[in] | public_key_in | Source public key in raw format. Must not be NULL. |
[in] | public_key_in_sz | Source public key size. Must not be zero. |
[out] | public_key_out | Destination buffer for public key in Virgil format. Must not be NULL. |
[in] | buf_sz | Output buffer size. Must not be zero. |
[in] | public_key_out_sz | Pointer for saved public key size. Must not be NULL. |
- Returns
- true in case of success or false otherwise
◆ vs_converters_raw_sign_to_mbedtls()
bool vs_converters_raw_sign_to_mbedtls |
( |
vs_secmodule_keypair_type_e |
keypair_type, |
|
|
const unsigned char * |
raw, |
|
|
uint16_t |
raw_sz, |
|
|
unsigned char * |
signature, |
|
|
uint16_t |
buf_sz, |
|
|
uint16_t * |
signature_sz |
|
) |
| |
Convert signature from raw format to MbedTLS format.
- Parameters
-
[in] | keypair_type | Keypair type. |
[in] | raw | Source signature in raw format. Must not be NULL. |
[in] | raw_sz | Source signature size. Must not be zero. |
[out] | signature | Destination buffer for signature in MbedTLS format. Must not be NULL. |
[in] | buf_sz | Output buffer size. Must not be zero. |
[in] | signature_sz | Pointer to saved signature size. Must not be NULL. |
- Returns
- true in case of success and false otherwise
◆ vs_converters_raw_sign_to_virgil()
Convert signature from raw format to Virgil format.
- Parameters
-
[in] | keypair_type | Keypair type. |
[in] | hash_type | Hash type. |
[in] | raw_sign | Source signature in raw format. Must not be NULL. |
[in] | raw_sign_sz | Source signature size. Must not be zero. |
[out] | virgil_sign | Destination buffer for signature in Virgil format. Must not be NULL. |
[in] | buf_sz | Output buffer size. Must not be zero. |
[in] | virgil_sign_sz | Pointer to saved signature size. Must not be NULL. |
- Returns
- true in case of success and false otherwise
◆ vs_converters_virgil_sign_to_raw()
bool vs_converters_virgil_sign_to_raw |
( |
vs_secmodule_keypair_type_e |
keypair_type, |
|
|
const uint8_t * |
virgil_sign, |
|
|
uint16_t |
virgil_sign_sz, |
|
|
uint8_t * |
sign, |
|
|
uint16_t |
buf_sz, |
|
|
uint16_t * |
sign_sz |
|
) |
| |
Convert signature from Virgil format to raw format.
- Parameters
-
[in] | keypair_type | Keypair type. |
[in] | virgil_sign | Source signature in Virgil format. Must not be NULL. |
[in] | virgil_sign_sz | Source signature size. Must not be zero. |
[out] | sign | Destination buffer for signature in raw format. Must not be NULL. |
[in] | buf_sz | Output buffer size. Must not be zero. |
[in] | sign_sz | Pointer to saved signature size. Must not be NULL. |
- Returns
- true in case of success and false otherwise