Guardtime KSI c SDK
|
Data Structures | |
struct | KSI_TreeNode_st |
struct | KSI_TreeBuilderLeafProcessor_st |
struct | KSI_TreeBuilderLeafProcessor_list_st |
struct | KSI_TreeBuilder_st |
struct | KSI_TreeLeafHandle_list_st |
Macros | |
#define | KSI_TREE_BUILDER_STACK_LEN 0x100 |
#define | KSI_TreeBuilderLeafProcessorList_append(lst, o) KSI_APPLY_TO_NOT_NULL((lst), append, ((lst), (o))) |
#define | KSI_TreeBuilderLeafProcessorList_remove(lst, pos, o) KSI_APPLY_TO_NOT_NULL((lst), removeElement, ((lst), (pos), (o))) |
#define | KSI_TreeBuilderLeafProcessorList_indexOf(lst, o, i) KSI_APPLY_TO_NOT_NULL((lst), indexOf, ((lst), (o), (i))) |
#define | KSI_TreeBuilderLeafProcessorList_insertAt(lst, pos, o) KSI_APPLY_TO_NOT_NULL((lst), insertAt, ((lst), (pos), (o))) |
#define | KSI_TreeBuilderLeafProcessorList_replaceAt(lst, pos, o) KSI_APPLY_TO_NOT_NULL((lst), replaceAt, ((lst), (pos), (o))) |
#define | KSI_TreeBuilderLeafProcessorList_elementAt(lst, pos, o) KSI_APPLY_TO_NOT_NULL((lst), elementAt, ((lst), (pos), (o))) |
#define | KSI_TreeBuilderLeafProcessorList_length(lst) (((lst) != NULL && (lst)->length != NULL) ? (lst)->length((lst)) : 0) |
#define | KSI_TreeBuilderLeafProcessorList_sort(lst, cmp) KSI_APPLY_TO_NOT_NULL((lst), sort, ((lst), (cmp))) |
#define | KSI_TreeBuilderLeafProcessorList_foldl(lst, foldCtx, foldFn) (((lst) != NULL) ? ( ((lst)->foldl != NULL) ? ((lst)->foldl((lst), (foldCtx), (foldFn)))) : KSI_INVALID_STATE) : KSI_OK) |
#define | KSI_TreeBuilderLeafProcessorList_find(lst, o, f, i) KSI_APPLY_TO_NOT_NULL((lst), find, ((lst), (o), (f), (i))) |
#define | KSI_TreeLeafHandleList_append(lst, o) KSI_APPLY_TO_NOT_NULL((lst), append, ((lst), (o))) |
#define | KSI_TreeLeafHandleList_remove(lst, pos, o) KSI_APPLY_TO_NOT_NULL((lst), removeElement, ((lst), (pos), (o))) |
#define | KSI_TreeLeafHandleList_indexOf(lst, o, i) KSI_APPLY_TO_NOT_NULL((lst), indexOf, ((lst), (o), (i))) |
#define | KSI_TreeLeafHandleList_insertAt(lst, pos, o) KSI_APPLY_TO_NOT_NULL((lst), insertAt, ((lst), (pos), (o))) |
#define | KSI_TreeLeafHandleList_replaceAt(lst, pos, o) KSI_APPLY_TO_NOT_NULL((lst), replaceAt, ((lst), (pos), (o))) |
#define | KSI_TreeLeafHandleList_elementAt(lst, pos, o) KSI_APPLY_TO_NOT_NULL((lst), elementAt, ((lst), (pos), (o))) |
#define | KSI_TreeLeafHandleList_length(lst) (((lst) != NULL && (lst)->length != NULL) ? (lst)->length((lst)) : 0) |
#define | KSI_TreeLeafHandleList_sort(lst, cmp) KSI_APPLY_TO_NOT_NULL((lst), sort, ((lst), (cmp))) |
#define | KSI_TreeLeafHandleList_foldl(lst, foldCtx, foldFn) (((lst) != NULL) ? ( ((lst)->foldl != NULL) ? ((lst)->foldl((lst), (foldCtx), (foldFn)))) : KSI_INVALID_STATE) : KSI_OK) |
#define | KSI_TreeLeafHandleList_find(lst, o, f, i) KSI_APPLY_TO_NOT_NULL((lst), find, ((lst), (o), (f), (i))) |
Typedefs | |
typedef struct KSI_TreeNode_st | KSI_TreeNode |
typedef struct KSI_TreeBuilderLeafProcessor_st | KSI_TreeBuilderLeafProcessor |
typedef struct KSI_TreeBuilderLeafProcessor_list_st | KSI_TreeBuilderLeafProcessorList |
typedef struct KSI_TreeLeafHandle_st | KSI_TreeLeafHandle |
typedef struct KSI_TreeLeafHandle_list_st | KSI_TreeLeafHandleList |
typedef struct KSI_TreeBuilder_st | KSI_TreeBuilder |
The tree builder is used to create an aggregation tree locally. This can be used to create multiple signatures with a single aggregation request.
#define KSI_TREE_BUILDER_STACK_LEN 0x100 |
#define KSI_TreeBuilderLeafProcessorList_append | ( | lst, | |
o | |||
) | KSI_APPLY_TO_NOT_NULL((lst), append, ((lst), (o))) |
#define KSI_TreeBuilderLeafProcessorList_elementAt | ( | lst, | |
pos, | |||
o | |||
) | KSI_APPLY_TO_NOT_NULL((lst), elementAt, ((lst), (pos), (o))) |
#define KSI_TreeBuilderLeafProcessorList_find | ( | lst, | |
o, | |||
f, | |||
i | |||
) | KSI_APPLY_TO_NOT_NULL((lst), find, ((lst), (o), (f), (i))) |
#define KSI_TreeBuilderLeafProcessorList_foldl | ( | lst, | |
foldCtx, | |||
foldFn | |||
) | (((lst) != NULL) ? ( ((lst)->foldl != NULL) ? ((lst)->foldl((lst), (foldCtx), (foldFn)))) : KSI_INVALID_STATE) : KSI_OK) |
#define KSI_TreeBuilderLeafProcessorList_indexOf | ( | lst, | |
o, | |||
i | |||
) | KSI_APPLY_TO_NOT_NULL((lst), indexOf, ((lst), (o), (i))) |
#define KSI_TreeBuilderLeafProcessorList_insertAt | ( | lst, | |
pos, | |||
o | |||
) | KSI_APPLY_TO_NOT_NULL((lst), insertAt, ((lst), (pos), (o))) |
#define KSI_TreeBuilderLeafProcessorList_length | ( | lst | ) | (((lst) != NULL && (lst)->length != NULL) ? (lst)->length((lst)) : 0) |
#define KSI_TreeBuilderLeafProcessorList_remove | ( | lst, | |
pos, | |||
o | |||
) | KSI_APPLY_TO_NOT_NULL((lst), removeElement, ((lst), (pos), (o))) |
#define KSI_TreeBuilderLeafProcessorList_replaceAt | ( | lst, | |
pos, | |||
o | |||
) | KSI_APPLY_TO_NOT_NULL((lst), replaceAt, ((lst), (pos), (o))) |
#define KSI_TreeBuilderLeafProcessorList_sort | ( | lst, | |
cmp | |||
) | KSI_APPLY_TO_NOT_NULL((lst), sort, ((lst), (cmp))) |
#define KSI_TreeLeafHandleList_append | ( | lst, | |
o | |||
) | KSI_APPLY_TO_NOT_NULL((lst), append, ((lst), (o))) |
#define KSI_TreeLeafHandleList_elementAt | ( | lst, | |
pos, | |||
o | |||
) | KSI_APPLY_TO_NOT_NULL((lst), elementAt, ((lst), (pos), (o))) |
#define KSI_TreeLeafHandleList_find | ( | lst, | |
o, | |||
f, | |||
i | |||
) | KSI_APPLY_TO_NOT_NULL((lst), find, ((lst), (o), (f), (i))) |
#define KSI_TreeLeafHandleList_foldl | ( | lst, | |
foldCtx, | |||
foldFn | |||
) | (((lst) != NULL) ? ( ((lst)->foldl != NULL) ? ((lst)->foldl((lst), (foldCtx), (foldFn)))) : KSI_INVALID_STATE) : KSI_OK) |
#define KSI_TreeLeafHandleList_indexOf | ( | lst, | |
o, | |||
i | |||
) | KSI_APPLY_TO_NOT_NULL((lst), indexOf, ((lst), (o), (i))) |
#define KSI_TreeLeafHandleList_insertAt | ( | lst, | |
pos, | |||
o | |||
) | KSI_APPLY_TO_NOT_NULL((lst), insertAt, ((lst), (pos), (o))) |
#define KSI_TreeLeafHandleList_length | ( | lst | ) | (((lst) != NULL && (lst)->length != NULL) ? (lst)->length((lst)) : 0) |
#define KSI_TreeLeafHandleList_remove | ( | lst, | |
pos, | |||
o | |||
) | KSI_APPLY_TO_NOT_NULL((lst), removeElement, ((lst), (pos), (o))) |
#define KSI_TreeLeafHandleList_replaceAt | ( | lst, | |
pos, | |||
o | |||
) | KSI_APPLY_TO_NOT_NULL((lst), replaceAt, ((lst), (pos), (o))) |
#define KSI_TreeLeafHandleList_sort | ( | lst, | |
cmp | |||
) | KSI_APPLY_TO_NOT_NULL((lst), sort, ((lst), (cmp))) |
typedef struct KSI_TreeBuilder_st KSI_TreeBuilder |
An object for building an aggregation tree on the fly.
typedef struct KSI_TreeBuilderLeafProcessor_st KSI_TreeBuilderLeafProcessor |
The leaf processor structure contains the function to pre processes the node specified as the input and a context for the preprocessor. The function may alter the input node and optionally generate a new one - usually meaning the input hash has been aggregated and the output node is the root value of the aggregation.
typedef struct KSI_TreeLeafHandle_st KSI_TreeLeafHandle |
The tree leaf handle is used to generate an aggregation hash chain for a specific leaf added to the tree builder.
typedef struct KSI_TreeLeafHandle_list_st KSI_TreeLeafHandleList |
typedef struct KSI_TreeNode_st KSI_TreeNode |
A structure to represent the leaf and internal nodes of a hash tree.
int KSI_TreeBuilder_addDataHash | ( | KSI_TreeBuilder * | builder, |
KSI_DataHash * | hsh, | ||
int | level, | ||
KSI_TreeLeafHandle ** | leaf | ||
) |
Adds a new leaf to the tree.
[in] | builder | The builder. |
[in] | hsh | The data hash of the leaf. |
[in] | level | The level of the leaf. |
[out] | leaf | Pointer to the receiving pointer for the handle. |
int KSI_TreeBuilder_addMetaData | ( | KSI_TreeBuilder * | builder, |
KSI_MetaData * | metaData, | ||
int | level, | ||
KSI_TreeLeafHandle ** | leaf | ||
) |
Adds a new leaf to the tree containing a meta-data value instead of the data hash as in KSI_TreeBuilder_addDataHash.
[in] | builder | The builder. |
[in] | metaData | The meta-data of the leaf. |
[in] | level | The level of the leaf. |
[out] | leaf | Pointer to the receiving pointer for the handle. |
int KSI_TreeBuilder_close | ( | KSI_TreeBuilder * | builder | ) |
This function finalizes the building of the tree. After calling this function no more leafs may be added to the computation and doing so would result in an error.
[in] | builder | The builder. |
void KSI_TreeBuilder_free | ( | KSI_TreeBuilder * | builder | ) |
Destructor for the KSI_TreeBuilder object.
[in] | builder | Pointer to the object. |
int KSI_TreeBuilder_new | ( | KSI_CTX * | ctx, |
KSI_HashAlgorithm | algo, | ||
KSI_TreeBuilder ** | builder | ||
) |
Constructor for the KSI_TreeBuilder object.
[in] | ctx | KSI context. |
[in] | algo | Algorithm used for the internal nodes. |
[out] | builder | Pointer to the receiving pointer. |
void KSI_TreeBuilderLeafProcessorList_free | ( | KSI_TreeBuilderLeafProcessorList * | list | ) |
int KSI_TreeBuilderLeafProcessorList_new | ( | KSI_TreeBuilderLeafProcessorList ** | list | ) |
void KSI_TreeLeafHandle_free | ( | KSI_TreeLeafHandle * | handle | ) |
Free the tree leaf handle.
[in] | handle | The tree leaf handle. |
int KSI_TreeLeafHandle_getAggregationChain | ( | const KSI_TreeLeafHandle * | handle, |
KSI_AggregationHashChain ** | chain | ||
) |
Generates an aggregation hash chain starting from the added leaf that the tree leaf handle is based on. The resulting object must be feed by the caller.
[in] | handle | The tree leaf handle. |
[out] | chain | Pointer to the receiving pointer. |
int KSI_TreeLeafHandle_getTreeNode | ( | const KSI_TreeLeafHandle * | handle, |
KSI_TreeNode ** | node | ||
) |
KSI_TreeLeafHandle* KSI_TreeLeafHandle_ref | ( | KSI_TreeLeafHandle * | o | ) |
[in] | o | Pointer to KSI_TreeLeafHandle * |
NULL
on error. * void KSI_TreeLeafHandleList_free | ( | KSI_TreeLeafHandleList * | list | ) |
int KSI_TreeLeafHandleList_new | ( | KSI_TreeLeafHandleList ** | list | ) |
void KSI_TreeNode_free | ( | KSI_TreeNode * | node | ) |
Destructor method for KSI_TreeNode.
[in] | node | Pointer to the object. |
int KSI_TreeNode_new | ( | KSI_CTX * | ctx, |
KSI_DataHash * | hash, | ||
KSI_MetaData * | metaData, | ||
int | level, | ||
KSI_TreeNode ** | node | ||
) |
This is the constructor method for the KSI_TreeNode structure.
[in] | ctx | KSI context. |
[in] | hash | Input hash. |
[in] | metaData | Metadata field. |
[in] | level | The level of the tree node. |
[out] | node | Pointer to the receiving ponter. |
hash
or metaData
must be a not NULL pointer. hash
or metaData
fields and thus the pointers must be freed by the caller.