wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more

Committer:
wolfSSL
Date:
Tue Aug 22 10:48:22 2017 +0000
Revision:
13:f67a6c6013ca
Parent:
3:6f956bdb3073
wolfSSL3.12.0 with TLS1.3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 3:6f956bdb3073 1 /* signature.h
wolfSSL 3:6f956bdb3073 2 *
wolfSSL 3:6f956bdb3073 3 * Copyright (C) 2006-2016 wolfSSL Inc.
wolfSSL 3:6f956bdb3073 4 *
wolfSSL 3:6f956bdb3073 5 * This file is part of wolfSSL.
wolfSSL 3:6f956bdb3073 6 *
wolfSSL 3:6f956bdb3073 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 3:6f956bdb3073 8 * it under the terms of the GNU General Public License as published by
wolfSSL 3:6f956bdb3073 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 3:6f956bdb3073 10 * (at your option) any later version.
wolfSSL 3:6f956bdb3073 11 *
wolfSSL 3:6f956bdb3073 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 3:6f956bdb3073 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 3:6f956bdb3073 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 3:6f956bdb3073 15 * GNU General Public License for more details.
wolfSSL 3:6f956bdb3073 16 *
wolfSSL 3:6f956bdb3073 17 * You should have received a copy of the GNU General Public License
wolfSSL 3:6f956bdb3073 18 * along with this program; if not, write to the Free Software
wolfSSL 3:6f956bdb3073 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 3:6f956bdb3073 20 */
wolfSSL 3:6f956bdb3073 21
wolfSSL 3:6f956bdb3073 22
wolfSSL 3:6f956bdb3073 23 #ifndef WOLF_CRYPT_SIGNATURE_H
wolfSSL 3:6f956bdb3073 24 #define WOLF_CRYPT_SIGNATURE_H
wolfSSL 3:6f956bdb3073 25
wolfSSL 3:6f956bdb3073 26 #include <wolfssl/wolfcrypt/types.h>
wolfSSL 3:6f956bdb3073 27 #include <wolfssl/wolfcrypt/hash.h>
wolfSSL 3:6f956bdb3073 28 #include <wolfssl/wolfcrypt/random.h>
wolfSSL 3:6f956bdb3073 29
wolfSSL 3:6f956bdb3073 30 #ifdef __cplusplus
wolfSSL 3:6f956bdb3073 31 extern "C" {
wolfSSL 3:6f956bdb3073 32 #endif
wolfSSL 3:6f956bdb3073 33
wolfSSL 3:6f956bdb3073 34 enum wc_SignatureType {
wolfSSL 3:6f956bdb3073 35 WC_SIGNATURE_TYPE_NONE = 0,
wolfSSL 3:6f956bdb3073 36 WC_SIGNATURE_TYPE_ECC = 1,
wolfSSL 3:6f956bdb3073 37 WC_SIGNATURE_TYPE_RSA = 2,
wolfSSL 3:6f956bdb3073 38 WC_SIGNATURE_TYPE_RSA_W_ENC = 3, /* Adds DER header via wc_EncodeSignature */
wolfSSL 3:6f956bdb3073 39 };
wolfSSL 3:6f956bdb3073 40
wolfSSL 3:6f956bdb3073 41 WOLFSSL_API int wc_SignatureGetSize(enum wc_SignatureType sig_type,
wolfSSL 3:6f956bdb3073 42 const void* key, word32 key_len);
wolfSSL 3:6f956bdb3073 43
wolfSSL 3:6f956bdb3073 44 WOLFSSL_API int wc_SignatureVerify(
wolfSSL 3:6f956bdb3073 45 enum wc_HashType hash_type, enum wc_SignatureType sig_type,
wolfSSL 3:6f956bdb3073 46 const byte* data, word32 data_len,
wolfSSL 3:6f956bdb3073 47 const byte* sig, word32 sig_len,
wolfSSL 3:6f956bdb3073 48 const void* key, word32 key_len);
wolfSSL 3:6f956bdb3073 49
wolfSSL 3:6f956bdb3073 50 WOLFSSL_API int wc_SignatureGenerate(
wolfSSL 3:6f956bdb3073 51 enum wc_HashType hash_type, enum wc_SignatureType sig_type,
wolfSSL 3:6f956bdb3073 52 const byte* data, word32 data_len,
wolfSSL 3:6f956bdb3073 53 byte* sig, word32 *sig_len,
wolfSSL 3:6f956bdb3073 54 const void* key, word32 key_len,
wolfSSL 3:6f956bdb3073 55 WC_RNG* rng);
wolfSSL 3:6f956bdb3073 56
wolfSSL 3:6f956bdb3073 57 #ifdef __cplusplus
wolfSSL 3:6f956bdb3073 58 } /* extern "C" */
wolfSSL 3:6f956bdb3073 59 #endif
wolfSSL 3:6f956bdb3073 60
wolfSSL 3:6f956bdb3073 61 #endif /* WOLF_CRYPT_SIGNATURE_H */
wolfSSL 3:6f956bdb3073 62