diff --git a/modules/dap-sdk/crypto/include/wrapping_dap_sign.h b/modules/dap-sdk/crypto/include/wrapping_dap_sign.h index 55fbaa5ab2529937d5aa4bbf96c188099bc134f1..2ba1a48f86784c891cdccba8c8b68ab54043fa7b 100644 --- a/modules/dap-sdk/crypto/include/wrapping_dap_sign.h +++ b/modules/dap-sdk/crypto/include/wrapping_dap_sign.h @@ -86,11 +86,13 @@ typedef struct PyDapSign{ PyObject *wrapping_dap_sign_get_type(PyObject *self, void *closure); PyObject *wrapping_dap_sign_get_pkey(PyObject *self, void *closure); +PyObject *wrapping_dap_sign_get_pkey_hash(PyObject *self, void *closure); PyObject *wrapping_dap_sign_get_size(PyObject *self, void *closure); static PyGetSetDef DapSignObjectGetsSetsDef[] = { {"type", (getter)wrapping_dap_sign_get_type, NULL, NULL, NULL}, {"pkey", (getter)wrapping_dap_sign_get_pkey, NULL, NULL, NULL}, + {"pkeyHash", (getter)wrapping_dap_sign_get_pkey_hash, NULL,NULL, NULL}, {"size", (getter)wrapping_dap_sign_get_size, NULL, NULL, NULL}, {NULL} }; diff --git a/modules/dap-sdk/crypto/src/wrapping_dap_sign.c b/modules/dap-sdk/crypto/src/wrapping_dap_sign.c index 9ac7d27548fa4e9d389583ae84930b66e49eab85..be175709d7c1ca4674be570454ed08402a9c7ac9 100644 --- a/modules/dap-sdk/crypto/src/wrapping_dap_sign.c +++ b/modules/dap-sdk/crypto/src/wrapping_dap_sign.c @@ -18,6 +18,14 @@ PyObject *wrapping_dap_sign_get_pkey(PyObject *self, void *closure){ obj_pkey->pkey = (dap_pkey_t*)((PyDapSignObject*)self)->sign->pkey_n_sign; return (PyObject*)obj_pkey; } +PyObject *wrapping_dap_sign_get_pkey_hash(PyObject *self, void *closure){ + (void)closure; + PyDapHashFastObject *obj_hash = PyObject_New(PyDapHashFastObject, &DapHashFastObject_DapHashFastObjectType); + PyObject_Dir((PyObject*)obj_hash); + obj_hash->hash_fast = DAP_NEW(dap_chain_hash_fast_t); + dap_sign_get_pkey_hash(((PyDapSignObject*)self)->sign, obj_hash->hash_fast); + return (PyObject*)obj_hash; +} PyObject *wrapping_dap_sign_get_size(PyObject *self, void *closure){ (void)closure; return Py_BuildValue("I", ((PyDapSignObject*)self)->sign->header.sign_size);