const unsigned char *signature, size_t signature_len,
bool *valid_r, enum dcrypt_padding padding,
const char **error_r);
+ bool (*ecdh_derive_secret)(struct dcrypt_private_key *priv_key,
+ struct dcrypt_public_key *pub_key,
+ buffer_t *shared_secret, const char **error_r);
};
void dcrypt_set_vfs(struct dcrypt_vfs *vfs);
return dcrypt_vfs->ctx_hmac_final(ctx, result, error_r);
}
+bool dcrypt_ecdh_derive_secret(struct dcrypt_private_key *local_key,
+ struct dcrypt_public_key *pub_key,
+ buffer_t *shared_secret,
+ const char **error_r)
+{
+ i_assert(dcrypt_vfs != NULL);
+ if (dcrypt_vfs->ecdh_derive_secret == NULL) {
+ *error_r = "Not implemented";
+ return FALSE;
+ }
+ return dcrypt_vfs->ecdh_derive_secret(local_key, pub_key, shared_secret,
+ error_r);
+}
+
bool dcrypt_ecdh_derive_secret_local(struct dcrypt_private_key *local_key,
buffer_t *R, buffer_t *S,
const char **error_r)
/**
* Elliptic Curve based Diffie-Heffman shared secret derivation */
+bool dcrypt_ecdh_derive_secret(struct dcrypt_private_key *priv_key,
+ struct dcrypt_public_key *pub_key,
+ buffer_t *shared_secret,
+ const char **error_r);
+/**
+ * Helpers for DCRYPT file format */
bool dcrypt_ecdh_derive_secret_local(struct dcrypt_private_key *local_key,
buffer_t *R, buffer_t *S,
const char **error_r);