Botan 3.4.0
Crypto and TLS for C&
strong_type.h
Go to the documentation of this file.
1/**
2 * A wrapper class to implement strong types
3 * (C) 2022 Jack Lloyd
4 * 2022 René Meusel - Rohde & Schwarz Cybersecurity
5 *
6 * Botan is released under the Simplified BSD License (see license.txt)
7 */
8
9#ifndef BOTAN_STRONG_TYPE_H_
10#define BOTAN_STRONG_TYPE_H_
11
12#include <ostream>
13#include <span>
14
15#include <botan/concepts.h>
16
17namespace Botan {
18
19/**
20 * Added as an additional "capability tag" to enable arithmetic operators with
21 * plain numbers for Strong<> types that wrap a number.
22 */
24
25namespace detail {
26
27/**
28 * Checks whether the @p CapabilityT is included in the @p Tags type pack.
29 */
30template <typename CapabilityT, typename... Tags>
31constexpr bool has_capability = (std::is_same_v<CapabilityT, Tags> || ...);
32
33template <typename T>
35 private:
36 T m_value;
37
38 public:
39 using wrapped_type = T;
40
41 public:
42 Strong_Base() = default;
43 Strong_Base(const Strong_Base&) = default;
44 Strong_Base(Strong_Base&&) noexcept = default;
45 Strong_Base& operator=(const Strong_Base&) = default;
46 Strong_Base& operator=(Strong_Base&&) noexcept = default;
47
48 constexpr explicit Strong_Base(T v) : m_value(std::move(v)) {}
49
50 T& get() { return m_value; }
51
52 const T& get() const { return m_value; }
53};
54
55template <typename T>
56class Strong_Adapter : public Strong_Base<T> {
57 public:
59};
60
61template <std::integral T>
62class Strong_Adapter<T> : public Strong_Base<T> {
63 public:
65};
66
67template <concepts::container T>
68class Strong_Adapter<T> : public Strong_Base<T> {
69 public:
70 using value_type = typename T::value_type;
71 using size_type = typename T::size_type;
72 using iterator = typename T::iterator;
73 using const_iterator = typename T::const_iterator;
74 using pointer = typename T::pointer;
75 using const_pointer = typename T::const_pointer;
76
77 public:
79
80 explicit Strong_Adapter(std::span<const value_type> span)
82 : Strong_Adapter(T(span.begin(), span.end())) {}
83
84 explicit Strong_Adapter(size_t size)
86 : Strong_Adapter(T(size)) {}
87
88 template <typename InputIt>
89 Strong_Adapter(InputIt begin, InputIt end) : Strong_Adapter(T(begin, end)) {}
90
91 // Disambiguates the usage of string literals, otherwise:
92 // Strong_Adapter(std::span<>) and Strong_Adapter(const char*)
93 // would be ambiguous.
94 explicit Strong_Adapter(const char* str)
95 requires(std::same_as<T, std::string>)
96 : Strong_Adapter(std::string(str)) {}
97
98 public:
99 decltype(auto) begin() noexcept(noexcept(this->get().begin())) { return this->get().begin(); }
100
101 decltype(auto) begin() const noexcept(noexcept(this->get().begin())) { return this->get().begin(); }
102
103 decltype(auto) end() noexcept(noexcept(this->get().end())) { return this->get().end(); }
104
105 decltype(auto) end() const noexcept(noexcept(this->get().end())) { return this->get().end(); }
106
107 decltype(auto) cbegin() noexcept(noexcept(this->get().cbegin())) { return this->get().cbegin(); }
108
109 decltype(auto) cbegin() const noexcept(noexcept(this->get().cbegin())) { return this->get().cbegin(); }
110
111 decltype(auto) cend() noexcept(noexcept(this->get().cend())) { return this->get().cend(); }
112
113 decltype(auto) cend() const noexcept(noexcept(this->get().cend())) { return this->get().cend(); }
114
115 size_type size() const noexcept(noexcept(this->get().size())) { return this->get().size(); }
116
117 decltype(auto) data() noexcept(noexcept(this->get().data()))
119 {
120 return this->get().data();
121 }
122
123 decltype(auto) data() const noexcept(noexcept(this->get().data()))
125 {
126 return this->get().data();
127 }
128
129 bool empty() const noexcept(noexcept(this->get().empty()))
130 requires(concepts::has_empty<T>)
131 {
132 return this->get().empty();
133 }
134
135 void resize(size_type size) noexcept(noexcept(this->get().resize(size)))
137 {
138 this->get().resize(size);
139 }
140
141 decltype(auto) operator[](size_type i) const noexcept(noexcept(this->get().operator[](i))) {
142 return this->get()[i];
143 }
144
145 decltype(auto) operator[](size_type i) noexcept(noexcept(this->get().operator[](i))) { return this->get()[i]; }
146};
147
148} // namespace detail
149
150/**
151 * Strong types can be used as wrappers around common types to provide
152 * compile time semantics. They usually contribute to more maintainable and
153 * less error-prone code especially when dealing with function parameters.
154 *
155 * Internally, this provides adapters so that the wrapping strong type behaves
156 * as much as the underlying type as possible and desirable.
157 *
158 * This implementation was inspired by:
159 * https://stackoverflow.com/a/69030899
160 */
161template <typename T, typename TagTypeT, typename... Capabilities>
163 public:
165
166 private:
167 using Tag = TagTypeT;
168};
169
170template <typename T, typename... Tags>
171 requires(concepts::streamable<T>) decltype(auto)
172operator<<(std::ostream& os, const Strong<T, Tags...>& v) {
173 return os << v.get();
174}
175
176template <typename T, typename... Tags>
177 requires(std::equality_comparable<T>) bool
178operator==(const Strong<T, Tags...>& lhs, const Strong<T, Tags...>& rhs) {
179 return lhs.get() == rhs.get();
180}
181
182template <typename T, typename... Tags>
183 requires(std::three_way_comparable<T>)
185 return lhs.get() <=> rhs.get();
186}
187
188template <std::integral T1, std::integral T2, typename... Tags>
190 return a <=> b.get();
191}
192
193template <std::integral T1, std::integral T2, typename... Tags>
195 return a.get() <=> b;
196}
197
198template <std::integral T1, std::integral T2, typename... Tags>
200 return a == b.get();
201}
202
203template <std::integral T1, std::integral T2, typename... Tags>
205 return a.get() == b;
206}
207
208template <std::integral T1, std::integral T2, typename... Tags>
209 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
210constexpr decltype(auto) operator+(T1 a, Strong<T2, Tags...> b) {
211 return Strong<T2, Tags...>(a + b.get());
212}
213
214template <std::integral T1, std::integral T2, typename... Tags>
215 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
216constexpr decltype(auto) operator+(Strong<T1, Tags...> a, T2 b) {
217 return Strong<T1, Tags...>(a.get() + b);
218}
219
220template <std::integral T, typename... Tags>
221constexpr decltype(auto) operator+(Strong<T, Tags...> a, Strong<T, Tags...> b) {
222 return Strong<T, Tags...>(a.get() + b.get());
223}
224
225template <std::integral T1, std::integral T2, typename... Tags>
226 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
227constexpr decltype(auto) operator-(T1 a, Strong<T2, Tags...> b) {
228 return Strong<T2, Tags...>(a - b.get());
229}
230
231template <std::integral T1, std::integral T2, typename... Tags>
232 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
233constexpr decltype(auto) operator-(Strong<T1, Tags...> a, T2 b) {
234 return Strong<T1, Tags...>(a.get() - b);
235}
236
237template <std::integral T, typename... Tags>
238constexpr decltype(auto) operator-(Strong<T, Tags...> a, Strong<T, Tags...> b) {
239 return Strong<T, Tags...>(a.get() - b.get());
240}
241
242template <std::integral T1, std::integral T2, typename... Tags>
243 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
244constexpr decltype(auto) operator*(T1 a, Strong<T2, Tags...> b) {
245 return Strong<T2, Tags...>(a * b.get());
246}
247
248template <std::integral T1, std::integral T2, typename... Tags>
249 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
250constexpr decltype(auto) operator*(Strong<T1, Tags...> a, T2 b) {
251 return Strong<T1, Tags...>(a.get() * b);
252}
253
254template <std::integral T, typename... Tags>
255constexpr decltype(auto) operator*(Strong<T, Tags...> a, Strong<T, Tags...> b) {
256 return Strong<T, Tags...>(a.get() * b.get());
257}
258
259template <std::integral T1, std::integral T2, typename... Tags>
260 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
261constexpr decltype(auto) operator/(T1 a, Strong<T2, Tags...> b) {
262 return Strong<T2, Tags...>(a / b.get());
263}
264
265template <std::integral T1, std::integral T2, typename... Tags>
266 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
267constexpr decltype(auto) operator/(Strong<T1, Tags...> a, T2 b) {
268 return Strong<T1, Tags...>(a.get() / b);
269}
270
271template <std::integral T, typename... Tags>
272constexpr decltype(auto) operator/(Strong<T, Tags...> a, Strong<T, Tags...> b) {
273 return Strong<T, Tags...>(a.get() / b.get());
274}
275
276template <std::integral T1, std::integral T2, typename... Tags>
277 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
278constexpr decltype(auto) operator^(T1 a, Strong<T2, Tags...> b) {
279 return Strong<T2, Tags...>(a ^ b.get());
280}
281
282template <std::integral T1, std::integral T2, typename... Tags>
283 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
284constexpr decltype(auto) operator^(Strong<T1, Tags...> a, T2 b) {
285 return Strong<T1, Tags...>(a.get() ^ b);
286}
287
288template <std::integral T, typename... Tags>
289constexpr decltype(auto) operator^(Strong<T, Tags...> a, Strong<T, Tags...> b) {
290 return Strong<T, Tags...>(a.get() ^ b.get());
291}
292
293template <std::integral T1, std::integral T2, typename... Tags>
294 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
295constexpr decltype(auto) operator&(T1 a, Strong<T2, Tags...> b) {
296 return Strong<T2, Tags...>(a & b.get());
297}
298
299template <std::integral T1, std::integral T2, typename... Tags>
300 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
301constexpr decltype(auto) operator&(Strong<T1, Tags...> a, T2 b) {
302 return Strong<T1, Tags...>(a.get() & b);
303}
304
305template <std::integral T, typename... Tags>
306constexpr decltype(auto) operator&(Strong<T, Tags...> a, Strong<T, Tags...> b) {
307 return Strong<T, Tags...>(a.get() & b.get());
308}
309
310template <std::integral T1, std::integral T2, typename... Tags>
311 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
312constexpr decltype(auto) operator|(T1 a, Strong<T2, Tags...> b) {
313 return Strong<T2, Tags...>(a | b.get());
314}
315
316template <std::integral T1, std::integral T2, typename... Tags>
317 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
318constexpr decltype(auto) operator|(Strong<T1, Tags...> a, T2 b) {
319 return Strong<T1, Tags...>(a.get() | b);
320}
321
322template <std::integral T, typename... Tags>
323constexpr decltype(auto) operator|(Strong<T, Tags...> a, Strong<T, Tags...> b) {
324 return Strong<T, Tags...>(a.get() | b.get());
325}
326
327template <std::integral T1, std::integral T2, typename... Tags>
328 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
329constexpr decltype(auto) operator>>(T1 a, Strong<T2, Tags...> b) {
330 return Strong<T2, Tags...>(a >> b.get());
331}
332
333template <std::integral T1, std::integral T2, typename... Tags>
334 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
335constexpr decltype(auto) operator>>(Strong<T1, Tags...> a, T2 b) {
336 return Strong<T1, Tags...>(a.get() >> b);
337}
338
339template <std::integral T, typename... Tags>
340constexpr decltype(auto) operator>>(Strong<T, Tags...> a, Strong<T, Tags...> b) {
341 return Strong<T, Tags...>(a.get() >> b.get());
342}
343
344template <std::integral T1, std::integral T2, typename... Tags>
345 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
346constexpr decltype(auto) operator<<(T1 a, Strong<T2, Tags...> b) {
347 return Strong<T2, Tags...>(a << b.get());
348}
349
350template <std::integral T1, std::integral T2, typename... Tags>
351 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
352constexpr decltype(auto) operator<<(Strong<T1, Tags...> a, T2 b) {
353 return Strong<T1, Tags...>(a.get() << b);
354}
355
356template <std::integral T, typename... Tags>
357constexpr decltype(auto) operator<<(Strong<T, Tags...> a, Strong<T, Tags...> b) {
358 return Strong<T, Tags...>(a.get() << b.get());
359}
360
361template <std::integral T1, std::integral T2, typename... Tags>
362 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
363constexpr auto operator+=(Strong<T1, Tags...>& a, T2 b) {
364 a.get() += b;
365 return a;
366}
367
368template <std::integral T, typename... Tags>
370 a.get() += b.get();
371 return a;
372}
373
374template <std::integral T1, std::integral T2, typename... Tags>
375 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
376constexpr auto operator-=(Strong<T1, Tags...>& a, T2 b) {
377 a.get() -= b;
378 return a;
379}
380
381template <std::integral T, typename... Tags>
383 a.get() -= b.get();
384 return a;
385}
386
387template <std::integral T1, std::integral T2, typename... Tags>
388 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
389constexpr auto operator*=(Strong<T1, Tags...>& a, T2 b) {
390 a.get() *= b;
391 return a;
392}
393
394template <std::integral T, typename... Tags>
396 a.get() *= b.get();
397 return a;
398}
399
400template <std::integral T1, std::integral T2, typename... Tags>
401 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
402constexpr auto operator/=(Strong<T1, Tags...>& a, T2 b) {
403 a.get() /= b;
404 return a;
405}
406
407template <std::integral T, typename... Tags>
409 a.get() /= b.get();
410 return a;
411}
412
413template <std::integral T1, std::integral T2, typename... Tags>
414 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
415constexpr auto operator^=(Strong<T1, Tags...>& a, T2 b) {
416 a.get() ^= b;
417 return a;
418}
419
420template <std::integral T, typename... Tags>
422 a.get() ^= b.get();
423 return a;
424}
425
426template <std::integral T1, std::integral T2, typename... Tags>
427 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
428constexpr auto operator&=(Strong<T1, Tags...>& a, T2 b) {
429 a.get() &= b;
430 return a;
431}
432
433template <std::integral T, typename... Tags>
435 a.get() &= b.get();
436 return a;
437}
438
439template <std::integral T1, std::integral T2, typename... Tags>
440 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
441constexpr auto operator|=(Strong<T1, Tags...>& a, T2 b) {
442 a.get() |= b;
443 return a;
444}
445
446template <std::integral T, typename... Tags>
448 a.get() |= b.get();
449 return a;
450}
451
452template <std::integral T1, std::integral T2, typename... Tags>
453 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
454constexpr auto operator>>=(Strong<T1, Tags...>& a, T2 b) {
455 a.get() >>= b;
456 return a;
457}
458
459template <std::integral T, typename... Tags>
461 a.get() >>= b.get();
462 return a;
463}
464
465template <std::integral T1, std::integral T2, typename... Tags>
466 requires(detail::has_capability<EnableArithmeticWithPlainNumber, Tags...>)
467constexpr auto operator<<=(Strong<T1, Tags...>& a, T2 b) {
468 a.get() <<= b;
469 return a;
470}
471
472template <std::integral T, typename... Tags>
474 a.get() <<= b.get();
475 return a;
476}
477
478template <std::integral T, typename... Tags>
479constexpr auto operator++(Strong<T, Tags...>& a, int) {
480 auto tmp = a;
481 ++a.get();
482 return tmp;
483}
484
485template <std::integral T, typename... Tags>
486constexpr auto operator++(Strong<T, Tags...>& a) {
487 ++a.get();
488 return a;
489}
490
491template <std::integral T, typename... Tags>
492constexpr auto operator--(Strong<T, Tags...>& a, int) {
493 auto tmp = a;
494 --a.get();
495 return tmp;
496}
497
498template <std::integral T, typename... Tags>
499constexpr auto operator--(Strong<T, Tags...>& a) {
500 --a.get();
501 return a;
502}
503
504/**
505 * This mimmicks a std::span but keeps track of the strong-type information. Use
506 * this when you would want to use `const Strong<...>&` as a parameter
507 * declaration. In particular this allows assigning strong-type information to
508 * slices of a bigger buffer without copying the bytes. E.g:
509 *
510 * using Foo = Strong<std::vector<uint8_t>, Foo_>;
511 *
512 * void bar(StrongSpan<Foo> foo) { ... }
513 *
514 * std::vector<uint8_t> buffer;
515 * BufferSlicer slicer(buffer);
516 * bar(slicer.take<Foo>()); // This does not copy the data from buffer but
517 * // just annotates the 'Foo' strong-type info.
518 */
519template <concepts::contiguous_strong_type T>
521 using underlying_span = std::
522 conditional_t<std::is_const_v<T>, std::span<const typename T::value_type>, std::span<typename T::value_type>>;
523
524 public:
525 using value_type = typename underlying_span::value_type;
526 using size_type = typename underlying_span::size_type;
527 using iterator = typename underlying_span::iterator;
528 using pointer = typename underlying_span::pointer;
529 using const_pointer = typename underlying_span::const_pointer;
530
531 StrongSpan() = default;
532
533 explicit StrongSpan(underlying_span span) : m_span(span) {}
534
535 StrongSpan(T& strong) : m_span(strong) {}
536
537 // Allows implicit conversion from `StrongSpan<T>` to `StrongSpan<const T>`.
538 // Note that this is not bi-directional. Conversion from `StrongSpan<const T>`
539 // to `StrongSpan<T>` is not allowed.
540 //
541 // TODO: Technically, we should be able to phrase this with a `requires std::is_const_v<T>`
542 // instead of the `std::enable_if` constructions. clang-tidy (14 or 15) doesn't seem
543 // to pick up on that (yet?). As a result, for a non-const T it assumes this to be
544 // a declaration of an ordinary copy constructor. The existance of a copy constructor
545 // is interpreted as "not cheap to copy", setting off the `performance-unnecessary-value-param` check.
546 // See also: https://github.com/randombit/botan/issues/3591
548 typename = std::enable_if_t<std::is_same_v<T2, std::remove_const_t<T>>>>
549 StrongSpan(const StrongSpan<T2>& other) : m_span(other.get()) {}
550
551 StrongSpan(const StrongSpan& other) = default;
552
553 ~StrongSpan() = default;
554
555 /**
556 * @returns the underlying std::span without any type constraints
557 */
558 underlying_span get() const { return m_span; }
559
560 /**
561 * @returns the underlying std::span without any type constraints
562 */
563 underlying_span get() { return m_span; }
564
565 decltype(auto) data() noexcept(noexcept(this->m_span.data())) { return this->m_span.data(); }
566
567 decltype(auto) data() const noexcept(noexcept(this->m_span.data())) { return this->m_span.data(); }
568
569 decltype(auto) size() const noexcept(noexcept(this->m_span.size())) { return this->m_span.size(); }
570
571 bool empty() const noexcept(noexcept(this->m_span.empty())) { return this->m_span.empty(); }
572
573 decltype(auto) begin() noexcept(noexcept(this->m_span.begin())) { return this->m_span.begin(); }
574
575 decltype(auto) begin() const noexcept(noexcept(this->m_span.begin())) { return this->m_span.begin(); }
576
577 decltype(auto) end() noexcept(noexcept(this->m_span.end())) { return this->m_span.end(); }
578
579 decltype(auto) end() const noexcept(noexcept(this->m_span.end())) { return this->m_span.end(); }
580
581 decltype(auto) operator[](typename underlying_span::size_type i) const noexcept { return this->m_span[i]; }
582
583 private:
584 underlying_span m_span;
585};
586
587} // namespace Botan
588
589#endif
typename underlying_span::size_type size_type
decltype(auto) begin() noexcept(noexcept(this->m_span.begin()))
StrongSpan()=default
decltype(auto) data() noexcept(noexcept(this->m_span.data()))
underlying_span get() const
StrongSpan(const StrongSpan< T2 > &other)
StrongSpan(T &strong)
typename underlying_span::value_type value_type
~StrongSpan()=default
decltype(auto) begin() const noexcept(noexcept(this->m_span.begin()))
StrongSpan(const StrongSpan &other)=default
decltype(auto) end() noexcept(noexcept(this->m_span.end()))
StrongSpan(underlying_span span)
typename underlying_span::const_pointer const_pointer
bool empty() const noexcept(noexcept(this->m_span.empty()))
underlying_span get()
typename underlying_span::pointer pointer
decltype(auto) data() const noexcept(noexcept(this->m_span.data()))
decltype(auto) end() const noexcept(noexcept(this->m_span.end()))
typename underlying_span::iterator iterator
decltype(auto) size() const noexcept(noexcept(this->m_span.size()))
decltype(auto) data() const noexcept(noexcept(this->get().data()))
typename T::size_type size_type
Definition strong_type.h:71
decltype(auto) end() const noexcept(noexcept(this->get().end()))
void resize(size_type size) noexcept(noexcept(this->get().resize(size)))
typename T::iterator iterator
Definition strong_type.h:72
decltype(auto) begin() noexcept(noexcept(this->get().begin()))
Definition strong_type.h:99
size_type size() const noexcept(noexcept(this->get().size()))
decltype(auto) cbegin() noexcept(noexcept(this->get().cbegin()))
typename T::const_pointer const_pointer
Definition strong_type.h:75
typename T::value_type value_type
Definition strong_type.h:70
decltype(auto) begin() const noexcept(noexcept(this->get().begin()))
decltype(auto) cend() const noexcept(noexcept(this->get().cend()))
decltype(auto) end() noexcept(noexcept(this->get().end()))
typename T::const_iterator const_iterator
Definition strong_type.h:73
bool empty() const noexcept(noexcept(this->get().empty()))
decltype(auto) data() noexcept(noexcept(this->get().data()))
Strong_Adapter(std::span< const value_type > span)
Definition strong_type.h:80
decltype(auto) cend() noexcept(noexcept(this->get().cend()))
decltype(auto) cbegin() const noexcept(noexcept(this->get().cbegin()))
Strong_Adapter(InputIt begin, InputIt end)
Definition strong_type.h:89
const T & get() const
Definition strong_type.h:52
Strong_Base(Strong_Base &&) noexcept=default
Strong_Base(const Strong_Base &)=default
FE_25519 T
Definition ge.cpp:34
constexpr bool has_capability
Definition strong_type.h:31
ASN1_Type operator|(ASN1_Type x, ASN1_Type y)
Definition asn1_obj.h:74
BigInt operator*(const BigInt &x, const BigInt &y)
Definition big_ops3.cpp:46
constexpr auto operator>>=(Strong< T1, Tags... > &a, T2 b)
OctetString operator^(const OctetString &k1, const OctetString &k2)
Definition symkey.cpp:109
OctetString operator+(const OctetString &k1, const OctetString &k2)
Definition symkey.cpp:99
constexpr auto operator++(Strong< T, Tags... > &a, int)
std::ostream & operator<<(std::ostream &out, const OID &oid)
Definition asn1_oid.cpp:140
BigInt operator/(const BigInt &x, const BigInt &y)
Definition big_ops3.cpp:95
BigInt operator-(const BigInt &x, const BigInt &y)
Definition bigint.h:963
constexpr auto operator/=(Strong< T1, Tags... > &a, T2 b)
constexpr auto operator|=(Strong< T1, Tags... > &a, T2 b)
constexpr auto operator<<=(Strong< T1, Tags... > &a, T2 b)
constexpr auto operator&=(Strong< T1, Tags... > &a, T2 b)
bool operator==(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
Definition alg_id.cpp:54
std::vector< uint8_t, Alloc > & operator^=(std::vector< uint8_t, Alloc > &out, const std::vector< uint8_t, Alloc2 > &in)
Definition mem_ops.h:447
std::vector< T, Alloc > & operator+=(std::vector< T, Alloc > &out, const std::vector< T, Alloc2 > &in)
Definition secmem.h:80
int operator>>(int fd, Pipe &pipe)
Definition fd_unix.cpp:39
constexpr auto operator-=(Strong< T1, Tags... > &a, T2 b)
constexpr auto operator--(Strong< T, Tags... > &a, int)
auto operator<=>(const Strong< T, Tags... > &lhs, const Strong< T, Tags... > &rhs)
ECIES_Flags operator&(ECIES_Flags a, ECIES_Flags b)
Definition ecies.h:49
constexpr auto operator*=(Strong< T1, Tags... > &a, T2 b)