-/* swaroop chain file format:
- *
- * 0 [int16_t] IV length
- * 2 [int16_t] cert #1 length, or 0 for none
- * 4 [int16_t] cert #2 length, or 0 for none
- * 6 [int16_t] cert #3 length, or 0 for none
- * 8 [int16_t] cert #4 length, or 0 for none
- * 10 [int16_t] cert #5 length, or 0 for none
- * 12 [int16_t] cert #6 length, or 0 for none
- * 14 [int16_t] cert #7 length, or 0 for none
- * 16 [int16_t] cert #8 length, or 0 for none
- * 16 [int16_t] private key length
- * 20 IV
- * cert #1
- * cert #2
- * cert #3
- * cert #4
- * cert #5
- * cert #6
- * cert #7
- * cert #8
- * private key
- */
+ /* on the order of a second's worth of copying */
+ boost::uintmax_t const chunk = 20 * 1024 * 1024;
+
+ auto buffer = static_cast<uint8_t*> (malloc(chunk));
+ if (!buffer) {
+ throw std::bad_alloc ();
+ }