#include "config.h"
#include "bignum.h"
#include "md.h"
Go to the source code of this file.
|
| void | mbedtls_dsa_init (mbedtls_dsa_context *ctx) |
| | This function initializes a DSA context.
|
| |
| void | mbedtls_dsa_free (mbedtls_dsa_context *ctx) |
| | This function frees a DSA context.
|
| |
| int | mbedtls_dsa_set_group (mbedtls_dsa_context *ctx, const mbedtls_mpi *P, const mbedtls_mpi *Q, const mbedtls_mpi *G) |
| | This function sets the DSA group parameters.
|
| |
| int | mbedtls_dsa_genkey (mbedtls_dsa_context *ctx, size_t group_size, size_t modulus_size, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng) |
| | This function generates a DSA keypair.
|
| |
| int | mbedtls_dsa_check_pqg (const mbedtls_mpi *P, const mbedtls_mpi *Q, const mbedtls_mpi *G) |
| | This function checks if the DSA group parameters are valid.
|
| |
| int | mbedtls_dsa_check_pubkey (const mbedtls_dsa_context *ctx) |
| | This function checks if the public key is valid.
|
| |
| int | mbedtls_dsa_check_privkey (const mbedtls_dsa_context *ctx) |
| | This function checks if the private key is valid.
|
| |
| int | mbedtls_dsa_pubkey_from_privkey (mbedtls_dsa_context *ctx) |
| | This function derived public key from private key.
|
| |
| int | mbedtls_dsa_sign (mbedtls_dsa_context *ctx, const unsigned char *hash, size_t hlen, unsigned char *sig, size_t *slen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng) |
| | This function computes the DSA signature of a message hash.
|
| |
| int | mbedtls_dsa_verify (mbedtls_dsa_context *ctx, const unsigned char *hash, size_t hlen, const unsigned char *sig, size_t slen) |
| | This function reads and verifies a DSA signature.
|
| |
◆ MBEDTLS_DSA_ASN_SIGNATURE_MAX_LEN
| #define MBEDTLS_DSA_ASN_SIGNATURE_MAX_LEN 64 |
Definition at line 30 of file dsa.h.
◆ MBEDTLS_DSA_MAX_GROUP
| #define MBEDTLS_DSA_MAX_GROUP 64 |
Definition at line 33 of file dsa.h.
◆ MBEDTLS_DSA_MAX_MODULUS
| #define MBEDTLS_DSA_MAX_MODULUS 1024 |
Definition at line 36 of file dsa.h.
◆ MBEDTLS_ERR_DSA_ALLOC_FAILED
| #define MBEDTLS_ERR_DSA_ALLOC_FAILED -0x3300 |
Memory allocation failed.
Definition at line 25 of file dsa.h.
◆ MBEDTLS_ERR_DSA_BAD_INPUT_DATA
| #define MBEDTLS_ERR_DSA_BAD_INPUT_DATA -0x3180 |
Bad input parameters to function.
Definition at line 22 of file dsa.h.
◆ MBEDTLS_ERR_DSA_FILE_IO_ERROR
| #define MBEDTLS_ERR_DSA_FILE_IO_ERROR -0x3400 |
Read/write of file failed.
Definition at line 27 of file dsa.h.
◆ MBEDTLS_ERR_DSA_INVALID_KEY
| #define MBEDTLS_ERR_DSA_INVALID_KEY -0x3200 |
The private key is not valid.
Definition at line 23 of file dsa.h.
◆ MBEDTLS_ERR_DSA_RANDOM_FAILED
| #define MBEDTLS_ERR_DSA_RANDOM_FAILED -0x3380 |
Generation of random value, such as k, failed.
Definition at line 26 of file dsa.h.
◆ MBEDTLS_ERR_DSA_SIG_LEN_MISMATCH
| #define MBEDTLS_ERR_DSA_SIG_LEN_MISMATCH -0x3480 |
The signature is valid but its length is not matches to the given length.
Definition at line 28 of file dsa.h.
◆ MBEDTLS_ERR_DSA_VERIFY_FAILED
| #define MBEDTLS_ERR_DSA_VERIFY_FAILED -0x3280 |
The signature is not valid.
Definition at line 24 of file dsa.h.
◆ mbedtls_dsa_context
◆ mbedtls_dsa_check_pqg()
This function checks if the DSA group parameters are valid.
- Parameters
-
| P | The prime modulus P. |
| Q | The prime sub-modulus Q. |
| G | The generator G. |
- Returns
- 0 if successful, or a specific error code.
◆ mbedtls_dsa_check_privkey()
This function checks if the private key is valid.
- Parameters
-
- Returns
- 0 if successful, or a specific error code.
◆ mbedtls_dsa_check_pubkey()
This function checks if the public key is valid.
- Parameters
-
- Returns
- 0 if successful, or a specific error code.
◆ mbedtls_dsa_free()
This function frees a DSA context.
- Parameters
-
| ctx | The DSA context to free. |
◆ mbedtls_dsa_genkey()
This function generates a DSA keypair.
- Parameters
-
| ctx | The DSA context to store the keypair in. |
| group_size | The group size for the keypair. |
| modulus_size | The modulus size for the keypair. |
| f_rng | The RNG function. |
| p_rng | The RNG context. |
- Returns
- 0 if successful, or a specific error code.
◆ mbedtls_dsa_init()
This function initializes a DSA context.
- Parameters
-
| ctx | The DSA context to initialize. |
◆ mbedtls_dsa_pubkey_from_privkey()
This function derived public key from private key.
- Parameters
-
- Returns
- 0 if successful, or a specific error code.
◆ mbedtls_dsa_set_group()
This function sets the DSA group parameters.
- Parameters
-
| ctx | The DSA context to store the parameters in. |
| P | The prime modulus P. |
| Q | The prime sub-modulus Q. |
| G | The generator G. |
- Returns
- 0 if successful, or a specific error code.
◆ mbedtls_dsa_sign()
This function computes the DSA signature of a message hash.
- Parameters
-
| ctx | The DSA context. |
| hash | The message hash. |
| hlen | The length of the hash. |
| sig | The buffer to write the signature to. |
| slen | The length of the signature written. |
| f_rng | The RNG function. |
| p_rng | The RNG context. |
- Returns
- 0 if successful, or a specific error code.
◆ mbedtls_dsa_verify()
This function reads and verifies a DSA signature.
- Parameters
-
| ctx | The DSA context. |
| hash | The message hash. |
| hlen | The length of the hash. |
| sig | The signature to read and verify. |
| slen | The length of the signature. |
- Returns
- 0 if successful, or a specific error code.