00001
00014 #ifndef C4E_DLC_DSA_H
00015 #define C4E_DLC_DSA_H
00016
00017
00018
00019
00020 #include "c4e_sha.h"
00021 #include "c4e_dlc.h"
00022 #include "c4e_gfp.h"
00023
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029
00042
00043
00044
00070 typedef void (*C4eDlcDsaK2rFunc)(void* C4E_RESTRICT ctx,
00071 C4E_CONST C4eElement* C4E_RESTRICT k,
00072 C4eElement* C4E_RESTRICT r);
00073
00074
00103 typedef void (*C4eDlcDsaU2vFunc)(void* C4E_RESTRICT ctx,
00104 C4E_CONST void* C4E_RESTRICT y,
00105 C4E_CONST C4eElement* C4E_RESTRICT u1,
00106 C4E_CONST C4eElement* C4E_RESTRICT u2,
00107 C4eElement* C4E_RESTRICT v);
00108
00109
00110
00111
00112
00113
00118 #define C4E_DLC_DSA_TMPID_SIGN (4U)
00119
00120
00125 #define C4E_DLC_DSA_TMPID_VERIFY (5U)
00126
00127
00138 #define C4E_DLC_DSA_TMPID_MAX C4E_DLC_DSA_TMPID_VERIFY
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00222 C4eSysStatus c4e_dlc_dsa_sign(C4eDlcDomain* C4E_RESTRICT dom,
00223 C4E_CONST C4eElement* C4E_RESTRICT x,
00224 C4eHashId hid,
00225 C4E_CONST C4eArchUint8* C4E_RESTRICT digest,
00226 C4eArchDigit tmp[C4E_RESTRICT],
00227 C4eArchUint8* C4E_RESTRICT signature);
00228
00229
00230
00287 C4eSysStatus c4e_dlc_dsa_verify(C4eDlcDomain* C4E_RESTRICT dom,
00288 C4E_CONST C4eElement* C4E_RESTRICT y,
00289 C4eHashId hid,
00290 C4E_CONST C4eArchUint8* C4E_RESTRICT digest,
00291 C4E_CONST C4eArchUint8* C4E_RESTRICT signature,
00292 C4eArchSize len,
00293 C4eArchDigit tmp[C4E_RESTRICT]);
00294
00299
00366 C4eSysStatus c4e_dlc_dsa_unisig(void* ctx,
00367 C4E_CONST C4eElement* C4E_RESTRICT x,
00368 C4eElemOsp* C4E_RESTRICT q,
00369 C4eDlcDsaK2rFunc fn_k2r,
00370 C4eHashId hid,
00371 C4E_CONST C4eArchUint8* C4E_RESTRICT digest,
00372 C4eArchDigit tmp[C4E_RESTRICT],
00373 C4eArchUint8* C4E_RESTRICT signature);
00374
00375
00376
00448 C4eSysStatus c4e_dlc_dsa_univfy(void* ctx,
00449 C4E_CONST void* C4E_RESTRICT y,
00450 C4eElemOsp* C4E_RESTRICT q,
00451 C4eDlcDsaU2vFunc fn_u2v,
00452 C4eHashId hid,
00453 C4E_CONST C4eArchUint8* C4E_RESTRICT digest,
00454 C4E_CONST C4eArchUint8* C4E_RESTRICT signature,
00455 C4eArchSize len,
00456 C4eArchDigit tmp[C4E_RESTRICT]);
00457
00458
00459 #ifdef __cplusplus
00460 }
00461 #endif
00462
00463
00464
00465
00466 #endif
00467
00468
00469
00470
00471