From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMCzo-0003wk-TN for qemu-devel@nongnu.org; Thu, 21 Jan 2016 06:01:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMCzm-0002gv-5h for qemu-devel@nongnu.org; Thu, 21 Jan 2016 06:01:44 -0500 Date: Thu, 21 Jan 2016 11:01:27 +0000 From: "Daniel P. Berrange" Message-ID: <20160121110127.GH19835@redhat.com> References: <1453311539-1193-1-git-send-email-berrange@redhat.com> <1453311539-1193-6-git-send-email-berrange@redhat.com> <20160121083728.GG31960@ad.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160121083728.GG31960@ad.usersys.redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 05/17] crypto: add support for anti-forensic split algorithm Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , qemu-devel@nongnu.org, qemu-block@nongnu.org On Thu, Jan 21, 2016 at 04:37:28PM +0800, Fam Zheng wrote: > > > + > > +/** > > + * qcrypto_afsplit_encode: > > + * @hash: the hash algorithm to use for data expansion > > + * @blocklen: the size of @in in bytes > > + * @stripes: the number of times to expand @in in size > > + * @in: the master key to be expanded in size > > + * @out: preallocted buffer to hold the split key > > + * @errp: pointer to a NULL-initialized error object > > + * > > + * Split the data in @in, which is @blocklen bytes in > > + * size, to form a larger piece of data @out, which is > > + * @blocklen * @stripes bytes in size. > > + * > > + * Returns: 0 on success, -1 on error; > > + */ > > +int qcrypto_afsplit_encode(QCryptoHashAlgorithm hash, > > + size_t blocklen, > > + uint32_t stripes, > > + const uint8_t *in, > > + uint8_t *out, > > + Error **errp); > > + > > +/** > > + * qcrypto_afsplit_decode: > > + * @hash: the hash algorithm to use for data compression > > + * @blocklen: the size of @out in bytes > > + * @stripes: the number of times to decrease @in in size > > + * @in: the master key to be expanded in size > > + * @out: preallocted buffer to hold the split key > > I think the descriptions for @in and @out are wrong. Yeah, got them the wrong way around > > > + * @errp: pointer to a NULL-initialized error object > > + * > > + * Join the data in @in, which is @blocklen * @stripes > > + * bytes in size, to form the original small piece o > > piece of > > > + * data @out, which is @blocklen bytes in size. > > + * > > + * Returns: 0 on success, -1 on error; > > + */ > > +int qcrypto_afsplit_decode(QCryptoHashAlgorithm hash, > > + size_t blocklen, > > + uint32_t stripes, > > + const uint8_t *in, > > + uint8_t *out, > > + Error **errp); > > + > > +#endif /* QCRYPTO_AFSPLIT_H__ */ > > Fam Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|