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 :|