#ifndef UNWRAP_H
#define UNWRAP_H
#include "stored_key.h"
#include <openssl/opensslv.h>
#ifdef __cplusplus
#include <cstdbool>
#include <cstddef>
#include <cstdint>
extern "C" {
#else
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#endif
sa_status unwrap_aes_ecb(
stored_key_t** stored_key_unwrapped,
const void* in,
size_t in_length,
const sa_rights* rights,
sa_key_type key_type,
void* type_parameters,
sa_cipher_algorithm cipher_algorithm,
const stored_key_t* stored_key_wrapping);
sa_status unwrap_aes_cbc(
stored_key_t** stored_key_unwrapped,
const void* in,
size_t in_length,
const sa_rights* rights,
sa_key_type key_type,
void* type_parameters,
sa_cipher_algorithm cipher_algorithm,
const void* iv,
const stored_key_t* stored_key_wrapping);
sa_status unwrap_aes_ctr(
stored_key_t** stored_key_unwrapped,
const void* in,
size_t in_length,
const sa_rights* rights,
sa_key_type key_type,
void* type_parameters,
const void* ctr,
const stored_key_t* stored_key_wrapping);
sa_status unwrap_aes_gcm(
stored_key_t** stored_key_unwrapped,
const void* in,
size_t in_length,
const sa_rights* rights,
sa_key_type key_type,
void* type_parameters,
const sa_unwrap_parameters_aes_gcm* algorithm_parameters,
const stored_key_t* stored_key_wrapping);
#if OPENSSL_VERSION_NUMBER >= 0x10100000
sa_status unwrap_chacha20(
stored_key_t** stored_key_unwrapped,
const void* in,
size_t in_length,
const sa_rights* rights,
sa_key_type key_type,
void* type_parameters,
const sa_unwrap_parameters_chacha20* algorithm_parameters,
const stored_key_t* stored_key_wrapping);
sa_status unwrap_chacha20_poly1305(
stored_key_t** stored_key_unwrapped,
const void* in,
size_t in_length,
const sa_rights* rights,
sa_key_type key_type,
void* type_parameters,
const sa_unwrap_parameters_chacha20_poly1305* algorithm_parameters,
const stored_key_t* stored_key_wrapping);
#endif
sa_status unwrap_rsa(
stored_key_t** stored_key_unwrapped,
const void* in,
size_t in_length,
const sa_rights* rights,
sa_cipher_algorithm cipher_algorithm,
void* algorithm_parameters,
const stored_key_t* stored_key_wrapping);
sa_status unwrap_ec(
stored_key_t** stored_key_unwrapped,
const void* in,
size_t in_length,
const sa_rights* rights,
sa_unwrap_parameters_ec_elgamal* algorithm_parameters,
const stored_key_t* stored_key_wrapping);
#ifdef __cplusplus
}
#endif
#endif