Renesas / SecureDweet
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers signature.h Source File

signature.h

00001 /* signature.h
00002  *
00003  * Copyright (C) 2006-2016 wolfSSL Inc.
00004  *
00005  * This file is part of wolfSSL.
00006  *
00007  * wolfSSL is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * wolfSSL is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
00020  */
00021 
00022 
00023 #ifndef WOLF_CRYPT_SIGNATURE_H
00024 #define WOLF_CRYPT_SIGNATURE_H
00025 
00026 #include <wolfssl/wolfcrypt/types.h>
00027 #include <wolfssl/wolfcrypt/hash.h>
00028 #include <wolfssl/wolfcrypt/random.h>
00029 
00030 #ifdef __cplusplus
00031     extern "C" {
00032 #endif
00033 
00034 enum wc_SignatureType {
00035     WC_SIGNATURE_TYPE_NONE = 0,
00036     WC_SIGNATURE_TYPE_ECC = 1,
00037     WC_SIGNATURE_TYPE_RSA = 2,
00038     WC_SIGNATURE_TYPE_RSA_W_ENC = 3, /* Adds DER header via wc_EncodeSignature */
00039 };
00040 
00041 WOLFSSL_API int wc_SignatureGetSize(enum wc_SignatureType sig_type,
00042     const void* key, word32 key_len);
00043 
00044 WOLFSSL_API int wc_SignatureVerify(
00045     enum wc_HashType hash_type, enum wc_SignatureType sig_type,
00046     const byte* data, word32 data_len,
00047     const byte* sig, word32 sig_len,
00048     const void* key, word32 key_len);
00049 
00050 WOLFSSL_API int wc_SignatureGenerate(
00051     enum wc_HashType hash_type, enum wc_SignatureType sig_type,
00052     const byte* data, word32 data_len,
00053     byte* sig, word32 *sig_len,
00054     const void* key, word32 key_len,
00055     WC_RNG* rng);
00056 
00057 #ifdef __cplusplus
00058     } /* extern "C" */
00059 #endif
00060 
00061 #endif /* WOLF_CRYPT_SIGNATURE_H */
00062