wolfSSL SSL/TLS library, support up to TLS1.3
Dependents: CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more
wolfssl/wolfcrypt/signature.h@17:a5f916481144, 2020-06-05 (annotated)
- Committer:
- wolfSSL
- Date:
- Fri Jun 05 00:11:07 2020 +0000
- Revision:
- 17:a5f916481144
- Parent:
- 16:8e0d178b1d1e
wolfSSL 4.4.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wolfSSL | 15:117db924cf7c | 1 | /* signature.h |
wolfSSL | 15:117db924cf7c | 2 | * |
wolfSSL | 16:8e0d178b1d1e | 3 | * Copyright (C) 2006-2020 wolfSSL Inc. |
wolfSSL | 15:117db924cf7c | 4 | * |
wolfSSL | 15:117db924cf7c | 5 | * This file is part of wolfSSL. |
wolfSSL | 15:117db924cf7c | 6 | * |
wolfSSL | 15:117db924cf7c | 7 | * wolfSSL is free software; you can redistribute it and/or modify |
wolfSSL | 15:117db924cf7c | 8 | * it under the terms of the GNU General Public License as published by |
wolfSSL | 15:117db924cf7c | 9 | * the Free Software Foundation; either version 2 of the License, or |
wolfSSL | 15:117db924cf7c | 10 | * (at your option) any later version. |
wolfSSL | 15:117db924cf7c | 11 | * |
wolfSSL | 15:117db924cf7c | 12 | * wolfSSL is distributed in the hope that it will be useful, |
wolfSSL | 15:117db924cf7c | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
wolfSSL | 15:117db924cf7c | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
wolfSSL | 15:117db924cf7c | 15 | * GNU General Public License for more details. |
wolfSSL | 15:117db924cf7c | 16 | * |
wolfSSL | 15:117db924cf7c | 17 | * You should have received a copy of the GNU General Public License |
wolfSSL | 15:117db924cf7c | 18 | * along with this program; if not, write to the Free Software |
wolfSSL | 15:117db924cf7c | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA |
wolfSSL | 15:117db924cf7c | 20 | */ |
wolfSSL | 15:117db924cf7c | 21 | |
wolfSSL | 15:117db924cf7c | 22 | /*! |
wolfSSL | 15:117db924cf7c | 23 | \file wolfssl/wolfcrypt/signature.h |
wolfSSL | 15:117db924cf7c | 24 | */ |
wolfSSL | 15:117db924cf7c | 25 | |
wolfSSL | 15:117db924cf7c | 26 | |
wolfSSL | 15:117db924cf7c | 27 | #ifndef WOLF_CRYPT_SIGNATURE_H |
wolfSSL | 15:117db924cf7c | 28 | #define WOLF_CRYPT_SIGNATURE_H |
wolfSSL | 15:117db924cf7c | 29 | |
wolfSSL | 15:117db924cf7c | 30 | #include <wolfssl/wolfcrypt/types.h> |
wolfSSL | 15:117db924cf7c | 31 | #include <wolfssl/wolfcrypt/hash.h> |
wolfSSL | 15:117db924cf7c | 32 | #include <wolfssl/wolfcrypt/random.h> |
wolfSSL | 15:117db924cf7c | 33 | |
wolfSSL | 15:117db924cf7c | 34 | #ifdef __cplusplus |
wolfSSL | 15:117db924cf7c | 35 | extern "C" { |
wolfSSL | 15:117db924cf7c | 36 | #endif |
wolfSSL | 15:117db924cf7c | 37 | |
wolfSSL | 15:117db924cf7c | 38 | enum wc_SignatureType { |
wolfSSL | 15:117db924cf7c | 39 | WC_SIGNATURE_TYPE_NONE = 0, |
wolfSSL | 15:117db924cf7c | 40 | WC_SIGNATURE_TYPE_ECC = 1, |
wolfSSL | 15:117db924cf7c | 41 | WC_SIGNATURE_TYPE_RSA = 2, |
wolfSSL | 15:117db924cf7c | 42 | WC_SIGNATURE_TYPE_RSA_W_ENC = 3, /* Adds DER header via wc_EncodeSignature */ |
wolfSSL | 15:117db924cf7c | 43 | }; |
wolfSSL | 15:117db924cf7c | 44 | |
wolfSSL | 15:117db924cf7c | 45 | WOLFSSL_API int wc_SignatureGetSize(enum wc_SignatureType sig_type, |
wolfSSL | 15:117db924cf7c | 46 | const void* key, word32 key_len); |
wolfSSL | 15:117db924cf7c | 47 | |
wolfSSL | 15:117db924cf7c | 48 | WOLFSSL_API int wc_SignatureVerifyHash( |
wolfSSL | 15:117db924cf7c | 49 | enum wc_HashType hash_type, enum wc_SignatureType sig_type, |
wolfSSL | 15:117db924cf7c | 50 | const byte* hash_data, word32 hash_len, |
wolfSSL | 15:117db924cf7c | 51 | const byte* sig, word32 sig_len, |
wolfSSL | 15:117db924cf7c | 52 | const void* key, word32 key_len); |
wolfSSL | 15:117db924cf7c | 53 | |
wolfSSL | 15:117db924cf7c | 54 | WOLFSSL_API int wc_SignatureVerify( |
wolfSSL | 15:117db924cf7c | 55 | enum wc_HashType hash_type, enum wc_SignatureType sig_type, |
wolfSSL | 15:117db924cf7c | 56 | const byte* data, word32 data_len, |
wolfSSL | 15:117db924cf7c | 57 | const byte* sig, word32 sig_len, |
wolfSSL | 15:117db924cf7c | 58 | const void* key, word32 key_len); |
wolfSSL | 15:117db924cf7c | 59 | |
wolfSSL | 15:117db924cf7c | 60 | WOLFSSL_API int wc_SignatureGenerateHash( |
wolfSSL | 15:117db924cf7c | 61 | enum wc_HashType hash_type, enum wc_SignatureType sig_type, |
wolfSSL | 15:117db924cf7c | 62 | const byte* hash_data, word32 hash_len, |
wolfSSL | 15:117db924cf7c | 63 | byte* sig, word32 *sig_len, |
wolfSSL | 15:117db924cf7c | 64 | const void* key, word32 key_len, WC_RNG* rng); |
wolfSSL | 16:8e0d178b1d1e | 65 | WOLFSSL_API int wc_SignatureGenerateHash_ex( |
wolfSSL | 16:8e0d178b1d1e | 66 | enum wc_HashType hash_type, enum wc_SignatureType sig_type, |
wolfSSL | 16:8e0d178b1d1e | 67 | const byte* hash_data, word32 hash_len, |
wolfSSL | 16:8e0d178b1d1e | 68 | byte* sig, word32 *sig_len, |
wolfSSL | 16:8e0d178b1d1e | 69 | const void* key, word32 key_len, WC_RNG* rng, int verify); |
wolfSSL | 15:117db924cf7c | 70 | WOLFSSL_API int wc_SignatureGenerate( |
wolfSSL | 15:117db924cf7c | 71 | enum wc_HashType hash_type, enum wc_SignatureType sig_type, |
wolfSSL | 15:117db924cf7c | 72 | const byte* data, word32 data_len, |
wolfSSL | 15:117db924cf7c | 73 | byte* sig, word32 *sig_len, |
wolfSSL | 15:117db924cf7c | 74 | const void* key, word32 key_len, |
wolfSSL | 15:117db924cf7c | 75 | WC_RNG* rng); |
wolfSSL | 16:8e0d178b1d1e | 76 | WOLFSSL_API int wc_SignatureGenerate_ex( |
wolfSSL | 16:8e0d178b1d1e | 77 | enum wc_HashType hash_type, enum wc_SignatureType sig_type, |
wolfSSL | 16:8e0d178b1d1e | 78 | const byte* data, word32 data_len, |
wolfSSL | 16:8e0d178b1d1e | 79 | byte* sig, word32 *sig_len, |
wolfSSL | 16:8e0d178b1d1e | 80 | const void* key, word32 key_len, |
wolfSSL | 16:8e0d178b1d1e | 81 | WC_RNG* rng, int verify); |
wolfSSL | 15:117db924cf7c | 82 | |
wolfSSL | 15:117db924cf7c | 83 | #ifdef __cplusplus |
wolfSSL | 15:117db924cf7c | 84 | } /* extern "C" */ |
wolfSSL | 15:117db924cf7c | 85 | #endif |
wolfSSL | 15:117db924cf7c | 86 | |
wolfSSL | 15:117db924cf7c | 87 | #endif /* WOLF_CRYPT_SIGNATURE_H */ |
wolfSSL | 15:117db924cf7c | 88 |