xref: /openbmc/linux/include/crypto/sm2.h (revision 801b27e8)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * sm2.h - SM2 asymmetric public-key algorithm
4  * as specified by OSCCA GM/T 0003.1-2012 -- 0003.5-2012 SM2 and
5  * described at https://tools.ietf.org/html/draft-shen-sm2-ecdsa-02
6  *
7  * Copyright (c) 2020, Alibaba Group.
8  * Written by Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
9  */
10 
11 #ifndef _CRYPTO_SM2_H
12 #define _CRYPTO_SM2_H
13 
14 struct shash_desc;
15 
16 #if IS_REACHABLE(CONFIG_CRYPTO_SM2)
17 int sm2_compute_z_digest(struct shash_desc *desc,
18 			 const void *key, unsigned int keylen, void *dgst);
19 #else
20 static inline int sm2_compute_z_digest(struct shash_desc *desc,
21 				       const void *key, unsigned int keylen,
22 				       void *dgst)
23 {
24 	return -ENOTSUPP;
25 }
26 #endif
27 
28 #endif /* _CRYPTO_SM2_H */
29