diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2019-02-01 11:43:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-01 11:43:09 -0500 |
commit | fcbedf191f3b63f3e0a7ae83bd25ce1aabc7cab5 (patch) | |
tree | 9d2bd19a11052e2d7fbb577e40362f4bcbfaaf32 /include | |
parent | 45091c158d956ebb6c23acfe4dcb1f147df55d4a (diff) | |
parent | 48dda7922d0fbb36a219045be01c58f518122448 (diff) |
Merge pull request #81 from matrix-org/dbkr/pk_sign
Add signing class to the pk module
Diffstat (limited to 'include')
-rw-r--r-- | include/olm/pk.h | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/include/olm/pk.h b/include/olm/pk.h index c46baa0..8901621 100644 --- a/include/olm/pk.h +++ b/include/olm/pk.h @@ -1,4 +1,4 @@ -/* Copyright 2018 New Vector Ltd +/* Copyright 2018, 2019 New Vector Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -207,6 +207,48 @@ size_t olm_pk_get_private_key( void *private_key, size_t private_key_length ); +typedef struct OlmPkSigning OlmPkSigning; + +/* The size of a signing object in bytes */ +size_t olm_pk_signing_size(void); + +/** Initialise a signing object using the supplied memory + * The supplied memory must be at least olm_pk_signing_size() bytes */ +OlmPkSigning *olm_pk_signing( + void * memory +); + +/** A null terminated string describing the most recent error to happen to a + * signing object */ +const char * olm_pk_signing_last_error( + OlmPkSigning * sign +); + +/** Clears the memory used to back this signing object */ +size_t olm_clear_pk_signing( + OlmPkSigning *sign +); + +/** + * Initialise the signing object with a public/private keypair from a seed + */ +size_t olm_pk_signing_key_from_seed( + OlmPkSigning * sign, + void * pubkey, size_t pubkey_length, + void * seed, size_t seed_length +); + +size_t olm_pk_sign_seed_length(void); +size_t olm_pk_sign_public_key_length(void); + +size_t olm_pk_signature_length(); + +size_t olm_pk_sign( + OlmPkSigning *sign, + uint8_t const * message, size_t message_length, + uint8_t * signature, size_t signature_length +); + #ifdef __cplusplus } #endif |