1 2 /*! 3 \ingroup ECCSI_Setup 4 */ 5 WOLFSSL_API int wc_InitEccsiKey(EccsiKey* key, void* heap, int devId); 6 /*! 7 \ingroup ECCSI_Setup 8 */ 9 WOLFSSL_API int wc_InitEccsiKey_ex(EccsiKey* key, int keySz, int curveId, 10 void* heap, int devId); 11 /*! 12 \ingroup ECCSI_Setup 13 */ 14 WOLFSSL_API void wc_FreeEccsiKey(EccsiKey* key); 15 16 /*! 17 \ingroup ECCSI_Setup 18 */ 19 WOLFSSL_API int wc_MakeEccsiKey(EccsiKey* key, WC_RNG* rng); 20 21 /*! 22 \ingroup ECCSI_Operations 23 */ 24 WOLFSSL_API int wc_MakeEccsiPair(EccsiKey* key, WC_RNG* rng, 25 enum wc_HashType hashType, const byte* id, word32 idSz, mp_int* ssk, 26 ecc_point* pvt); 27 /*! 28 \ingroup ECCSI_Operations 29 */ 30 WOLFSSL_API int wc_ValidateEccsiPair(EccsiKey* key, enum wc_HashType hashType, 31 const byte* id, word32 idSz, const mp_int* ssk, ecc_point* pvt, 32 int* valid); 33 /*! 34 \ingroup ECCSI_Operations 35 */ 36 WOLFSSL_API int wc_ValidateEccsiPvt(EccsiKey* key, const ecc_point* pvt, 37 int* valid); 38 /*! 39 \ingroup ECCSI_Operations 40 */ 41 WOLFSSL_API int wc_EncodeEccsiPair(const EccsiKey* key, mp_int* ssk, 42 ecc_point* pvt, byte* data, word32* sz); 43 /*! 44 \ingroup ECCSI_Operations 45 */ 46 WOLFSSL_API int wc_EncodeEccsiSsk(const EccsiKey* key, mp_int* ssk, byte* data, 47 word32* sz); 48 /*! 49 \ingroup ECCSI_Operations 50 */ 51 WOLFSSL_API int wc_EncodeEccsiPvt(const EccsiKey* key, ecc_point* pvt, 52 byte* data, word32* sz, int raw); 53 /*! 54 \ingroup ECCSI_Operations 55 */ 56 WOLFSSL_API int wc_DecodeEccsiPair(const EccsiKey* key, const byte* data, 57 word32 sz, mp_int* ssk, ecc_point* pvt); 58 /*! 59 \ingroup ECCSI_Operations 60 */ 61 WOLFSSL_API int wc_DecodeEccsiSsk(const EccsiKey* key, const byte* data, 62 word32 sz, mp_int* ssk); 63 /*! 64 \ingroup ECCSI_Operations 65 */ 66 WOLFSSL_API int wc_DecodeEccsiPvt(const EccsiKey* key, const byte* data, 67 word32 sz, ecc_point* pvt); 68 /*! 69 \ingroup ECCSI_Operations 70 */ 71 WOLFSSL_API int wc_DecodeEccsiPvtFromSig(const EccsiKey* key, const byte* sig, 72 word32 sz, ecc_point* pvt); 73 74 /*! 75 \ingroup ECCSI_Setup 76 */ 77 WOLFSSL_API int wc_ExportEccsiKey(EccsiKey* key, byte* data, word32* sz); 78 /*! 79 \ingroup ECCSI_Setup 80 */ 81 WOLFSSL_API int wc_ImportEccsiKey(EccsiKey* key, const byte* data, word32 sz); 82 83 /*! 84 \ingroup ECCSI_Setup 85 */ 86 WOLFSSL_API int wc_ExportEccsiPrivateKey(EccsiKey* key, byte* data, word32* sz); 87 /*! 88 \ingroup ECCSI_Setup 89 */ 90 WOLFSSL_API int wc_ImportEccsiPrivateKey(EccsiKey* key, const byte* data, 91 word32 sz); 92 93 /*! 94 \ingroup ECCSI_Setup 95 */ 96 WOLFSSL_API int wc_ExportEccsiPublicKey(EccsiKey* key, byte* data, word32* sz, 97 int raw); 98 /*! 99 \ingroup ECCSI_Setup 100 */ 101 WOLFSSL_API int wc_ImportEccsiPublicKey(EccsiKey* key, const byte* data, 102 word32 sz, int trusted); 103 104 /*! 105 \ingroup ECCSI_Operations 106 */ 107 WOLFSSL_API int wc_HashEccsiId(EccsiKey* key, enum wc_HashType hashType, 108 const byte* id, word32 idSz, ecc_point* pvt, byte* hash, byte* hashSz); 109 /*! 110 \ingroup ECCSI_Setup 111 */ 112 WOLFSSL_API int wc_SetEccsiHash(EccsiKey* key, const byte* hash, byte hashSz); 113 /*! 114 \ingroup ECCSI_Setup 115 */ 116 WOLFSSL_API int wc_SetEccsiPair(EccsiKey* key, const mp_int* ssk, 117 const ecc_point* pvt); 118 119 /*! 120 \ingroup ECCSI_Operations 121 */ 122 WOLFSSL_API int wc_SignEccsiHash(EccsiKey* key, WC_RNG* rng, 123 enum wc_HashType hashType, const byte* msg, word32 msgSz, byte* sig, 124 word32* sigSz); 125 /*! 126 \ingroup ECCSI_Operations 127 */ 128 WOLFSSL_API int wc_VerifyEccsiHash(EccsiKey* key, enum wc_HashType hashType, 129 const byte* msg, word32 msgSz, const byte* sig, word32 sigSz, 130 int* verified); 131 132