Exemple #1
0
 /**
  * @brief gets the next file block index from the given file block
  * @param in the knoxcrypt image stream
  * @param n the file block to get the next index from
  * @param totalBlocks the total number of blocks in the knoxcrypt
  * @return the next file block index
  */
 inline uint64_t getIndexOfNextFileBlockFromFileBlockN(knoxcrypt::ContainerImageStream &in,
                                                       uint64_t const n,
                                                       uint64_t const totalBlocks)
 {
     auto offset = getOffsetOfFileBlock(n, totalBlocks) + 4;
     (void)in.seekg(offset);
     uint8_t dat[8];
     (void)in.read((char*)dat, 8);
     return convertInt8ArrayToInt64(dat);
 }
 /**
  * @brief gets the next file block index from the given file block
  * @param in the teasafe image stream
  * @param n the file block to get the next index from
  * @param totalBlocks the total number of blocks in the teasafe
  * @return the next file block index
  */
 inline uint64_t getIndexOfNextFileBlockFromFileBlockN(teasafe::TeaSafeImageStream &in,
                                                       uint64_t const n,
                                                       uint64_t const totalBlocks)
 {
     uint64_t offset = getOffsetOfFileBlock(n, totalBlocks) + 4;
     (void)in.seekg(offset);
     uint8_t dat[8];
     (void)in.read((char*)dat, 8);
     return convertInt8ArrayToInt64(dat);
 }