forked from ANSSI-FR/libecc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecsdsa_common.h
50 lines (43 loc) · 1.67 KB
/
ecsdsa_common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (C) 2017 - This file is part of libecc project
*
* Authors:
* Ryad BENADJILA <ryadbenadjila@gmail.com>
* Arnaud EBALARD <arnaud.ebalard@ssi.gouv.fr>
* Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
*
* Contributors:
* Nicolas VIVET <nicolas.vivet@ssi.gouv.fr>
* Karim KHALFALLAH <karim.khalfallah@ssi.gouv.fr>
*
* This software is licensed under a dual BSD and GPL v2 license.
* See LICENSE file at the root folder of the project.
*/
#include "../lib_ecc_config.h"
#include "../lib_ecc_types.h"
#if (defined(WITH_SIG_ECSDSA) || defined(WITH_SIG_ECOSDSA))
#ifndef __ECSDSA_COMMON_H__
#define __ECSDSA_COMMON_H__
#include "../words/words.h"
#include "ec_key.h"
#include "../hash/hash_algs.h"
#include "../sig/sig_algs.h"
#include "../curves/curves.h"
#include "../utils/utils.h"
struct ec_sign_context;
int __ecsdsa_init_pub_key(ec_pub_key *out_pub, const ec_priv_key *in_priv,
ec_sig_alg_type key_type);
u8 __ecsdsa_siglen(u16 p_bit_len, u16 q_bit_len, u8 hsize, u8 blocksize);
int __ecsdsa_sign_init(struct ec_sign_context *ctx,
ec_sig_alg_type key_type, int optimized);
int __ecsdsa_sign_update(struct ec_sign_context *ctx,
const u8 *chunk, u32 chunklen);
int __ecsdsa_sign_finalize(struct ec_sign_context *ctx, u8 *sig, u8 siglen);
int __ecsdsa_verify_init(struct ec_verify_context *ctx,
const u8 *sig, u8 siglen,
ec_sig_alg_type key_type, int optimized);
int __ecsdsa_verify_update(struct ec_verify_context *ctx,
const u8 *chunk, u32 chunklen);
int __ecsdsa_verify_finalize(struct ec_verify_context *ctx);
#endif /* __ECSDSA_COMMON_H__ */
#endif /* (defined(WITH_SIG_ECSDSA) || defined(WITH_SIG_ECOSDSA)) */