Security API¶
Digest¶
-
typedef union digest_ctx
digest_ctx
¶
-
struct
digest_func
¶ - #include <digest.h>
Abstraction to use different cryptographic libraries to calculate the hash
SHA 256¶
-
SHA256_INIT
(lib)¶
-
SHA256_UPDATE
(lib)¶
-
SHA256_FINAL
(lib)¶
-
DIGEST_FUNC
(lib)¶ This struct defines a set of default digest function. You can define your own structure adding the function you need.
Verifier¶
-
safestore_t
-
pull_error
verify_object
(mem_object_t *obj, digest_func f, const uint8_t *x, const uint8_t *y, ecc_func_t ef, uint8_t *buffer, size_t buffer_len)¶ This function verifies the signature on the object id.
The digest function and the curve must match the one used to generate the signature stored into the memory object metadata. The ECC signature does not accept any format to reduce space used to store keys.
- Note
- The size of the buffer must be greather or equal to the chunk of manifest to be hashed
- Return
- PULL_SUCCESS if verification succeded or the specific error otherwise.
- Parameters
obj_t
: The memory object to validatef
: The digest function.x
: The X parameter of the signer’s public key.y
: The Y parameter of the signer’s public key.curve
: The curve parameters.buffer
: The buffer used to read data from the objectbuffer_len
: The size of the buffer
- union
Public Members
-
uint8_t struct::x[32]
-
uint8_t struct::y[32]
-