[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 06/10] crypto: add a nettle cipher implementatio
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [PATCH 06/10] crypto: add a nettle cipher implementation |
Date: |
Fri, 22 May 2015 10:05:10 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Thu, May 21, 2015 at 12:38:01PM -0700, Richard Henderson wrote:
> On 05/21/2015 03:56 AM, Daniel P. Berrange wrote:
> > +static uint8_t *qcrypto_cipher_munge_des_rfb_key(const uint8_t *key,
> > + size_t nkey)
> > +{
> > + uint8_t *ret = g_new0(uint8_t, nkey);
> > + size_t i;
> > + for (i = 0; i < nkey; i++) {
> > + uint8_t r = key[i];
> > + r = (r & 0xf0)>>4 | (r & 0x0f)<<4;
> > + r = (r & 0xcc)>>2 | (r & 0x33)<<2;
> > + r = (r & 0xaa)>>1 | (r & 0x55)<<1;
> > + ret[i] = r;
> > + }
> > + return ret;
> > +}
> > +
>
> Surely you can share this between the gcrypt and nettle files and not
> duplicate
> it...
Potentially, but it was small enough that I felt it not worth the bother
of introducing another file for sharing it. The copyright header on a
new file would be larger than the amount of code shared in a new file.
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 :|
- [Qemu-devel] [PATCH 07/10] block: convert quorum blockdrv to use crypto APIs, (continued)
- [Qemu-devel] [PATCH 07/10] block: convert quorum blockdrv to use crypto APIs, Daniel P. Berrange, 2015/05/21
- [Qemu-devel] [PATCH 05/10] crypto: add a gcrypt cipher implementation, Daniel P. Berrange, 2015/05/21
- [Qemu-devel] [PATCH 08/10] ui: convert VNC websockets to use crypto APIs, Daniel P. Berrange, 2015/05/21
- [Qemu-devel] [PATCH 06/10] crypto: add a nettle cipher implementation, Daniel P. Berrange, 2015/05/21
- [Qemu-devel] [PATCH 09/10] block: convert qcow/qcow2 to use generic cipher API, Daniel P. Berrange, 2015/05/21
- [Qemu-devel] [PATCH 10/10] ui: convert VNC to use generic cipher API, Daniel P. Berrange, 2015/05/21
- Re: [Qemu-devel] [PATCH 00/10] Consolidate crypto APIs & implementations, Gonglei, 2015/05/22