OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [PATCH v4 07/13] virtio-crypto: set capacity of algorithms supported


On Wed, Sep 28, 2016 at 04:25:46PM +0800, Gonglei wrote:
>  static void virtio_crypto_get_config(VirtIODevice *vdev, uint8_t *config)
>  {
> -
> +    VirtIOCrypto *c = VIRTIO_CRYPTO(vdev);
> +    struct virtio_crypto_config crypto_cfg;
> +
> +    crypto_cfg.status = c->status;
> +    crypto_cfg.max_dataqueues = c->max_queues;
> +    crypto_cfg.crypto_services = c->conf.crypto_services;
> +    crypto_cfg.cipher_algo_l = c->conf.cipher_algo_l;
> +    crypto_cfg.cipher_algo_h = c->conf.cipher_algo_h;
> +    crypto_cfg.hash_algo = c->conf.hash_algo;
> +    crypto_cfg.mac_algo_l = c->conf.mac_algo_l;
> +    crypto_cfg.mac_algo_h = c->conf.mac_algo_h;
> +    crypto_cfg.aead_algo = c->conf.aead_algo;
> +
> +    memcpy(config, &crypto_cfg, c->config_size);
>  }

What about endianness?  For example, if the host is big-endian then this
VIRTIO 1.0 device needs to byteswap multi-byte fields.  There is a
family of functions to help with this: virtio_stl_p().

Attachment: signature.asc
Description: PGP signature



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]