| 1 | #pragma once |
| 2 | |
| 3 | #include <hpke/hpke.h> |
| 4 | #include <stdexcept> |
| 5 | |
| 6 | namespace mlspp::hpke { |
| 7 | |
| 8 | template<typename T> |
| 9 | void |
| 10 | typed_delete(T* ptr); |
| 11 | |
| 12 | template<typename T> |
| 13 | using typed_unique_ptr = std::unique_ptr<T, decltype(&typed_delete<T>)>; |
| 14 | |
| 15 | template<typename T> |
| 16 | typed_unique_ptr<T> |
| 17 | make_typed_unique(T* ptr) |
| 18 | { |
| 19 | return typed_unique_ptr<T>(ptr, typed_delete<T>); |
| 20 | } |
| 21 | |
| 22 | std::runtime_error |
| 23 | openssl_error(); |
| 24 | |
| 25 | } // namespace mlspp::hpke |