Botan 3.2.0
Crypto and TLS for C&
loadstor.h
Go to the documentation of this file.
1/*
2* Load/Store Operators
3* (C) 1999-2007,2015,2017 Jack Lloyd
4* 2007 Yves Jerschow
5*
6* Botan is released under the Simplified BSD License (see license.txt)
7*/
8
9#ifndef BOTAN_LOAD_STORE_H_
10#define BOTAN_LOAD_STORE_H_
11
12#include <botan/mem_ops.h>
13#include <botan/types.h>
14#include <botan/internal/bswap.h>
15#include <vector>
16
17namespace Botan {
18
19/**
20* Byte extraction
21* @param byte_num which byte to extract, 0 == highest byte
22* @param input the value to extract from
23* @return byte byte_num of input
24*/
25template <typename T>
26inline constexpr uint8_t get_byte_var(size_t byte_num, T input) {
27 return static_cast<uint8_t>(input >> (((~byte_num) & (sizeof(T) - 1)) << 3));
28}
29
30/**
31* Byte extraction
32* @param input the value to extract from
33* @return byte byte number B of input
34*/
35template <size_t B, typename T>
36inline constexpr uint8_t get_byte(T input)
37 requires(B < sizeof(T))
38{
39 const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
40 return static_cast<uint8_t>((input >> shift) & 0xFF);
41}
42
43/**
44* Make a uint16_t from two bytes
45* @param i0 the first byte
46* @param i1 the second byte
47* @return i0 || i1
48*/
49inline constexpr uint16_t make_uint16(uint8_t i0, uint8_t i1) {
50 return static_cast<uint16_t>((static_cast<uint16_t>(i0) << 8) | i1);
51}
52
53/**
54* Make a uint32_t from four bytes
55* @param i0 the first byte
56* @param i1 the second byte
57* @param i2 the third byte
58* @param i3 the fourth byte
59* @return i0 || i1 || i2 || i3
60*/
61inline constexpr uint32_t make_uint32(uint8_t i0, uint8_t i1, uint8_t i2, uint8_t i3) {
62 return ((static_cast<uint32_t>(i0) << 24) | (static_cast<uint32_t>(i1) << 16) | (static_cast<uint32_t>(i2) << 8) |
63 (static_cast<uint32_t>(i3)));
64}
65
66/**
67* Make a uint64_t from eight bytes
68* @param i0 the first byte
69* @param i1 the second byte
70* @param i2 the third byte
71* @param i3 the fourth byte
72* @param i4 the fifth byte
73* @param i5 the sixth byte
74* @param i6 the seventh byte
75* @param i7 the eighth byte
76* @return i0 || i1 || i2 || i3 || i4 || i5 || i6 || i7
77*/
78inline constexpr uint64_t make_uint64(
79 uint8_t i0, uint8_t i1, uint8_t i2, uint8_t i3, uint8_t i4, uint8_t i5, uint8_t i6, uint8_t i7) {
80 return ((static_cast<uint64_t>(i0) << 56) | (static_cast<uint64_t>(i1) << 48) | (static_cast<uint64_t>(i2) << 40) |
81 (static_cast<uint64_t>(i3) << 32) | (static_cast<uint64_t>(i4) << 24) | (static_cast<uint64_t>(i5) << 16) |
82 (static_cast<uint64_t>(i6) << 8) | (static_cast<uint64_t>(i7)));
83}
84
85/**
86* Load a big-endian word
87* @param in a pointer to some bytes
88* @param off an offset into the array
89* @return off'th T of in, as a big-endian value
90*/
91template <typename T>
92inline constexpr T load_be(const uint8_t in[], size_t off) {
93 in += off * sizeof(T);
94 T out = 0;
95 for(size_t i = 0; i != sizeof(T); ++i) {
96 out = static_cast<T>((out << 8) | in[i]);
97 }
98 return out;
99}
100
101/**
102* Load a little-endian word
103* @param in a pointer to some bytes
104* @param off an offset into the array
105* @return off'th T of in, as a litte-endian value
106*/
107template <typename T>
108inline constexpr T load_le(const uint8_t in[], size_t off) {
109 in += off * sizeof(T);
110 T out = 0;
111 for(size_t i = 0; i != sizeof(T); ++i) {
112 out = (out << 8) | in[sizeof(T) - 1 - i];
113 }
114 return out;
115}
116
117/**
118* Load a big-endian uint16_t
119* @param in a pointer to some bytes
120* @param off an offset into the array
121* @return off'th uint16_t of in, as a big-endian value
122*/
123template <>
124inline constexpr uint16_t load_be<uint16_t>(const uint8_t in[], size_t off) {
125 in += off * sizeof(uint16_t);
126
127#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
128 return typecast_copy<uint16_t>(in);
129#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
130 return reverse_bytes(typecast_copy<uint16_t>(in));
131#else
132 return make_uint16(in[0], in[1]);
133#endif
134}
135
136/**
137* Load a little-endian uint16_t
138* @param in a pointer to some bytes
139* @param off an offset into the array
140* @return off'th uint16_t of in, as a little-endian value
141*/
142template <>
143inline constexpr uint16_t load_le<uint16_t>(const uint8_t in[], size_t off) {
144 in += off * sizeof(uint16_t);
145
146#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
147 return reverse_bytes(typecast_copy<uint16_t>(in));
148#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
149 return typecast_copy<uint16_t>(in);
150#else
151 return make_uint16(in[1], in[0]);
152#endif
153}
154
155/**
156* Load a big-endian uint32_t
157* @param in a pointer to some bytes
158* @param off an offset into the array
159* @return off'th uint32_t of in, as a big-endian value
160*/
161template <>
162inline constexpr uint32_t load_be<uint32_t>(const uint8_t in[], size_t off) {
163 in += off * sizeof(uint32_t);
164
165#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
166 return typecast_copy<uint32_t>(in);
167#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
168 return reverse_bytes(typecast_copy<uint32_t>(in));
169#else
170 return make_uint32(in[0], in[1], in[2], in[3]);
171#endif
172}
173
174/**
175* Load a little-endian uint32_t
176* @param in a pointer to some bytes
177* @param off an offset into the array
178* @return off'th uint32_t of in, as a little-endian value
179*/
180template <>
181inline constexpr uint32_t load_le<uint32_t>(const uint8_t in[], size_t off) {
182 in += off * sizeof(uint32_t);
183
184#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
185 return reverse_bytes(typecast_copy<uint32_t>(in));
186#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
187 return typecast_copy<uint32_t>(in);
188#else
189 return make_uint32(in[3], in[2], in[1], in[0]);
190#endif
191}
192
193/**
194* Load a big-endian uint64_t
195* @param in a pointer to some bytes
196* @param off an offset into the array
197* @return off'th uint64_t of in, as a big-endian value
198*/
199template <>
200inline constexpr uint64_t load_be<uint64_t>(const uint8_t in[], size_t off) {
201 in += off * sizeof(uint64_t);
202
203#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
204 return typecast_copy<uint64_t>(in);
205#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
206 return reverse_bytes(typecast_copy<uint64_t>(in));
207#else
208 return make_uint64(in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]);
209#endif
210}
211
212/**
213* Load a little-endian uint64_t
214* @param in a pointer to some bytes
215* @param off an offset into the array
216* @return off'th uint64_t of in, as a little-endian value
217*/
218template <>
219inline constexpr uint64_t load_le<uint64_t>(const uint8_t in[], size_t off) {
220 in += off * sizeof(uint64_t);
221
222#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
223 return reverse_bytes(typecast_copy<uint64_t>(in));
224#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
225 return typecast_copy<uint64_t>(in);
226#else
227 return make_uint64(in[7], in[6], in[5], in[4], in[3], in[2], in[1], in[0]);
228#endif
229}
230
231/**
232* Load two little-endian words
233* @param in a pointer to some bytes
234* @param x0 where the first word will be written
235* @param x1 where the second word will be written
236*/
237template <typename T>
238inline constexpr void load_le(const uint8_t in[], T& x0, T& x1) {
239 x0 = load_le<T>(in, 0);
240 x1 = load_le<T>(in, 1);
241}
242
243/**
244* Load four little-endian words
245* @param in a pointer to some bytes
246* @param x0 where the first word will be written
247* @param x1 where the second word will be written
248* @param x2 where the third word will be written
249* @param x3 where the fourth word will be written
250*/
251template <typename T>
252inline constexpr void load_le(const uint8_t in[], T& x0, T& x1, T& x2, T& x3) {
253 x0 = load_le<T>(in, 0);
254 x1 = load_le<T>(in, 1);
255 x2 = load_le<T>(in, 2);
256 x3 = load_le<T>(in, 3);
257}
258
259/**
260* Load eight little-endian words
261* @param in a pointer to some bytes
262* @param x0 where the first word will be written
263* @param x1 where the second word will be written
264* @param x2 where the third word will be written
265* @param x3 where the fourth word will be written
266* @param x4 where the fifth word will be written
267* @param x5 where the sixth word will be written
268* @param x6 where the seventh word will be written
269* @param x7 where the eighth word will be written
270*/
271template <typename T>
272inline constexpr void load_le(const uint8_t in[], T& x0, T& x1, T& x2, T& x3, T& x4, T& x5, T& x6, T& x7) {
273 x0 = load_le<T>(in, 0);
274 x1 = load_le<T>(in, 1);
275 x2 = load_le<T>(in, 2);
276 x3 = load_le<T>(in, 3);
277 x4 = load_le<T>(in, 4);
278 x5 = load_le<T>(in, 5);
279 x6 = load_le<T>(in, 6);
280 x7 = load_le<T>(in, 7);
281}
282
283/**
284* Load a variable number of little-endian words
285* @param out the output array of words
286* @param in the input array of bytes
287* @param count how many words are in in
288*/
289template <typename T>
290inline constexpr void load_le(T out[], const uint8_t in[], size_t count) {
291 if(count > 0) {
292#if defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
293 typecast_copy(out, in, count);
294
295#elif defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
296 typecast_copy(out, in, count);
297
298 for(size_t i = 0; i != count; ++i)
299 out[i] = reverse_bytes(out[i]);
300#else
301 for(size_t i = 0; i != count; ++i)
302 out[i] = load_le<T>(in, i);
303#endif
304 }
305}
306
307/**
308* Load two big-endian words
309* @param in a pointer to some bytes
310* @param x0 where the first word will be written
311* @param x1 where the second word will be written
312*/
313template <typename T>
314inline constexpr void load_be(const uint8_t in[], T& x0, T& x1) {
315 x0 = load_be<T>(in, 0);
316 x1 = load_be<T>(in, 1);
317}
318
319/**
320* Load four big-endian words
321* @param in a pointer to some bytes
322* @param x0 where the first word will be written
323* @param x1 where the second word will be written
324* @param x2 where the third word will be written
325* @param x3 where the fourth word will be written
326*/
327template <typename T>
328inline constexpr void load_be(const uint8_t in[], T& x0, T& x1, T& x2, T& x3) {
329 x0 = load_be<T>(in, 0);
330 x1 = load_be<T>(in, 1);
331 x2 = load_be<T>(in, 2);
332 x3 = load_be<T>(in, 3);
333}
334
335/**
336* Load eight big-endian words
337* @param in a pointer to some bytes
338* @param x0 where the first word will be written
339* @param x1 where the second word will be written
340* @param x2 where the third word will be written
341* @param x3 where the fourth word will be written
342* @param x4 where the fifth word will be written
343* @param x5 where the sixth word will be written
344* @param x6 where the seventh word will be written
345* @param x7 where the eighth word will be written
346*/
347template <typename T>
348inline constexpr void load_be(const uint8_t in[], T& x0, T& x1, T& x2, T& x3, T& x4, T& x5, T& x6, T& x7) {
349 x0 = load_be<T>(in, 0);
350 x1 = load_be<T>(in, 1);
351 x2 = load_be<T>(in, 2);
352 x3 = load_be<T>(in, 3);
353 x4 = load_be<T>(in, 4);
354 x5 = load_be<T>(in, 5);
355 x6 = load_be<T>(in, 6);
356 x7 = load_be<T>(in, 7);
357}
358
359/**
360* Load a variable number of big-endian words
361* @param out the output array of words
362* @param in the input array of bytes
363* @param count how many words are in in
364*/
365template <typename T>
366inline constexpr void load_be(T out[], const uint8_t in[], size_t count) {
367 if(count > 0) {
368#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
369 typecast_copy(out, in, count);
370
371#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
372 typecast_copy(out, in, count);
373
374 for(size_t i = 0; i != count; ++i) {
375 out[i] = reverse_bytes(out[i]);
376 }
377#else
378 for(size_t i = 0; i != count; ++i)
379 out[i] = load_be<T>(in, i);
380#endif
381 }
382}
383
384/**
385* Store a big-endian uint16_t
386* @param in the input uint16_t
387* @param out the byte array to write to
388*/
389inline constexpr void store_be(uint16_t in, uint8_t out[2]) {
390#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
391 typecast_copy(out, in);
392#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
394#else
395 out[0] = get_byte<0>(in);
396 out[1] = get_byte<1>(in);
397#endif
398}
399
400/**
401* Store a little-endian uint16_t
402* @param in the input uint16_t
403* @param out the byte array to write to
404*/
405inline constexpr void store_le(uint16_t in, uint8_t out[2]) {
406#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
408#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
409 typecast_copy(out, in);
410#else
411 out[0] = get_byte<1>(in);
412 out[1] = get_byte<0>(in);
413#endif
414}
415
416/**
417* Store a big-endian uint32_t
418* @param in the input uint32_t
419* @param out the byte array to write to
420*/
421inline constexpr void store_be(uint32_t in, uint8_t out[4]) {
422#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
423 typecast_copy(out, in);
424#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
426#else
427 out[0] = get_byte<0>(in);
428 out[1] = get_byte<1>(in);
429 out[2] = get_byte<2>(in);
430 out[3] = get_byte<3>(in);
431#endif
432}
433
434/**
435* Store a little-endian uint32_t
436* @param in the input uint32_t
437* @param out the byte array to write to
438*/
439inline constexpr void store_le(uint32_t in, uint8_t out[4]) {
440#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
442#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
443 typecast_copy(out, in);
444#else
445 out[0] = get_byte<3>(in);
446 out[1] = get_byte<2>(in);
447 out[2] = get_byte<1>(in);
448 out[3] = get_byte<0>(in);
449#endif
450}
451
452/**
453* Store a big-endian uint64_t
454* @param in the input uint64_t
455* @param out the byte array to write to
456*/
457inline constexpr void store_be(uint64_t in, uint8_t out[8]) {
458#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
459 typecast_copy(out, in);
460#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
462#else
463 out[0] = get_byte<0>(in);
464 out[1] = get_byte<1>(in);
465 out[2] = get_byte<2>(in);
466 out[3] = get_byte<3>(in);
467 out[4] = get_byte<4>(in);
468 out[5] = get_byte<5>(in);
469 out[6] = get_byte<6>(in);
470 out[7] = get_byte<7>(in);
471#endif
472}
473
474/**
475* Store a little-endian uint64_t
476* @param in the input uint64_t
477* @param out the byte array to write to
478*/
479inline constexpr void store_le(uint64_t in, uint8_t out[8]) {
480#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
482#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
483 typecast_copy(out, in);
484#else
485 out[0] = get_byte<7>(in);
486 out[1] = get_byte<6>(in);
487 out[2] = get_byte<5>(in);
488 out[3] = get_byte<4>(in);
489 out[4] = get_byte<3>(in);
490 out[5] = get_byte<2>(in);
491 out[6] = get_byte<1>(in);
492 out[7] = get_byte<0>(in);
493#endif
494}
495
496/**
497* Store two little-endian words
498* @param out the output byte array
499* @param x0 the first word
500* @param x1 the second word
501*/
502template <typename T>
503inline constexpr void store_le(uint8_t out[], T x0, T x1) {
504 store_le(x0, out + (0 * sizeof(T)));
505 store_le(x1, out + (1 * sizeof(T)));
506}
507
508/**
509* Store two big-endian words
510* @param out the output byte array
511* @param x0 the first word
512* @param x1 the second word
513*/
514template <typename T>
515inline constexpr void store_be(uint8_t out[], T x0, T x1) {
516 store_be(x0, out + (0 * sizeof(T)));
517 store_be(x1, out + (1 * sizeof(T)));
518}
519
520/**
521* Store four little-endian words
522* @param out the output byte array
523* @param x0 the first word
524* @param x1 the second word
525* @param x2 the third word
526* @param x3 the fourth word
527*/
528template <typename T>
529inline constexpr void store_le(uint8_t out[], T x0, T x1, T x2, T x3) {
530 store_le(x0, out + (0 * sizeof(T)));
531 store_le(x1, out + (1 * sizeof(T)));
532 store_le(x2, out + (2 * sizeof(T)));
533 store_le(x3, out + (3 * sizeof(T)));
534}
535
536/**
537* Store four big-endian words
538* @param out the output byte array
539* @param x0 the first word
540* @param x1 the second word
541* @param x2 the third word
542* @param x3 the fourth word
543*/
544template <typename T>
545inline constexpr void store_be(uint8_t out[], T x0, T x1, T x2, T x3) {
546 store_be(x0, out + (0 * sizeof(T)));
547 store_be(x1, out + (1 * sizeof(T)));
548 store_be(x2, out + (2 * sizeof(T)));
549 store_be(x3, out + (3 * sizeof(T)));
550}
551
552/**
553* Store eight little-endian words
554* @param out the output byte array
555* @param x0 the first word
556* @param x1 the second word
557* @param x2 the third word
558* @param x3 the fourth word
559* @param x4 the fifth word
560* @param x5 the sixth word
561* @param x6 the seventh word
562* @param x7 the eighth word
563*/
564template <typename T>
565inline constexpr void store_le(uint8_t out[], T x0, T x1, T x2, T x3, T x4, T x5, T x6, T x7) {
566 store_le(x0, out + (0 * sizeof(T)));
567 store_le(x1, out + (1 * sizeof(T)));
568 store_le(x2, out + (2 * sizeof(T)));
569 store_le(x3, out + (3 * sizeof(T)));
570 store_le(x4, out + (4 * sizeof(T)));
571 store_le(x5, out + (5 * sizeof(T)));
572 store_le(x6, out + (6 * sizeof(T)));
573 store_le(x7, out + (7 * sizeof(T)));
574}
575
576/**
577* Store eight big-endian words
578* @param out the output byte array
579* @param x0 the first word
580* @param x1 the second word
581* @param x2 the third word
582* @param x3 the fourth word
583* @param x4 the fifth word
584* @param x5 the sixth word
585* @param x6 the seventh word
586* @param x7 the eighth word
587*/
588template <typename T>
589inline constexpr void store_be(uint8_t out[], T x0, T x1, T x2, T x3, T x4, T x5, T x6, T x7) {
590 store_be(x0, out + (0 * sizeof(T)));
591 store_be(x1, out + (1 * sizeof(T)));
592 store_be(x2, out + (2 * sizeof(T)));
593 store_be(x3, out + (3 * sizeof(T)));
594 store_be(x4, out + (4 * sizeof(T)));
595 store_be(x5, out + (5 * sizeof(T)));
596 store_be(x6, out + (6 * sizeof(T)));
597 store_be(x7, out + (7 * sizeof(T)));
598}
599
600template <typename T>
601void copy_out_be(uint8_t out[], size_t out_bytes, const T in[]) {
602 while(out_bytes >= sizeof(T)) {
603 store_be(in[0], out);
604 out += sizeof(T);
605 out_bytes -= sizeof(T);
606 in += 1;
607 }
608
609 for(size_t i = 0; i != out_bytes; ++i) {
610 out[i] = get_byte_var(i % 8, in[0]);
611 }
612}
613
614template <typename T, typename Alloc>
615void copy_out_vec_be(uint8_t out[], size_t out_bytes, const std::vector<T, Alloc>& in) {
616 copy_out_be(out, out_bytes, in.data());
617}
618
619template <typename T>
620void copy_out_le(uint8_t out[], size_t out_bytes, const T in[]) {
621 while(out_bytes >= sizeof(T)) {
622 store_le(in[0], out);
623 out += sizeof(T);
624 out_bytes -= sizeof(T);
625 in += 1;
626 }
627
628 for(size_t i = 0; i != out_bytes; ++i) {
629 out[i] = get_byte_var(sizeof(T) - 1 - (i % 8), in[0]);
630 }
631}
632
633template <typename T, typename Alloc>
634void copy_out_vec_le(uint8_t out[], size_t out_bytes, const std::vector<T, Alloc>& in) {
635 copy_out_le(out, out_bytes, in.data());
636}
637
638} // namespace Botan
639
640#endif
FE_25519 T
Definition ge.cpp:34
constexpr uint8_t get_byte(T input)
Definition loadstor.h:36
constexpr uint32_t load_le< uint32_t >(const uint8_t in[], size_t off)
Definition loadstor.h:181
constexpr void store_le(uint16_t in, uint8_t out[2])
Definition loadstor.h:405
void copy_out_le(uint8_t out[], size_t out_bytes, const T in[])
Definition loadstor.h:620
constexpr uint64_t make_uint64(uint8_t i0, uint8_t i1, uint8_t i2, uint8_t i3, uint8_t i4, uint8_t i5, uint8_t i6, uint8_t i7)
Definition loadstor.h:78
constexpr uint16_t load_le< uint16_t >(const uint8_t in[], size_t off)
Definition loadstor.h:143
void copy_out_vec_le(uint8_t out[], size_t out_bytes, const std::vector< T, Alloc > &in)
Definition loadstor.h:634
constexpr uint64_t load_be< uint64_t >(const uint8_t in[], size_t off)
Definition loadstor.h:200
constexpr uint32_t make_uint32(uint8_t i0, uint8_t i1, uint8_t i2, uint8_t i3)
Definition loadstor.h:61
constexpr T load_le(const uint8_t in[], size_t off)
Definition loadstor.h:108
constexpr uint32_t load_be< uint32_t >(const uint8_t in[], size_t off)
Definition loadstor.h:162
constexpr uint16_t reverse_bytes(uint16_t x)
Definition bswap.h:19
constexpr uint16_t load_be< uint16_t >(const uint8_t in[], size_t off)
Definition loadstor.h:124
constexpr void store_be(uint16_t in, uint8_t out[2])
Definition loadstor.h:389
constexpr uint8_t get_byte_var(size_t byte_num, T input)
Definition loadstor.h:26
constexpr uint64_t load_le< uint64_t >(const uint8_t in[], size_t off)
Definition loadstor.h:219
constexpr void typecast_copy(T &out, const uint8_t in[])
Definition mem_ops.h:150
void copy_out_be(uint8_t out[], size_t out_bytes, const T in[])
Definition loadstor.h:601
constexpr T load_be(const uint8_t in[], size_t off)
Definition loadstor.h:92
void copy_out_vec_be(uint8_t out[], size_t out_bytes, const std::vector< T, Alloc > &in)
Definition loadstor.h:615
constexpr uint16_t make_uint16(uint8_t i0, uint8_t i1)
Definition loadstor.h:49