From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Hyman Huang <yong.huang@smartx.com>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH RFC 0/3] Support GM/T 0018-2012 cryptographic standard
Date: Thu, 29 Feb 2024 09:03:48 +0000 [thread overview]
Message-ID: <ZeBIdNQYkq4tnF7h@redhat.com> (raw)
In-Reply-To: <cover.1708527979.git.yong.huang@smartx.com>
On Sat, Feb 24, 2024 at 10:34:55PM +0800, Hyman Huang wrote:
> This patchset introduce GM/T 0018-2012 as a crypto backend driver,
> which is applied for block encryption. Currently, we support SM4
> cipher algorithm only.
>
> GM/T 0018-2012 is a cryptographic standard issued by the State
> Cryptography Administration of China. Visit https://hbba.sacinfo.org.cn
> search GM/T 0018-2012 for brief introduction.
>
> The objective of the standard is to develop a uniform application
> interface standard for the service-based cryptography device under
> the public key cryptographic infrastructure application framework,
> and to call the cryptography device through this interface to
> provide basic cryptographic services for the uppler layer. For
> more information about contents of the standard, download the
> specificaiton from:
> "https://github.com/guanzhi/GM-Standards/blob/master/GMT密码行标/
> GMT 00018-2012 密码设备应用接口规范.pdf"
>
> There are two benefits to doing this, at least.
> * Performance - using a cryptography device for block encryption
> offers an opportunity to enhance the input/output
> performance once the hardware is certified
> * Secrecy - hardware manufacturers may fortify cryptography
> equipment with security features, so increasing the
> secrecy of block encryption.
>
> The precise way that vendors implement the standard APIs for data
> encryption using the cryptographic device is uncoupled from the
> GM/T 0018-2012 specification. Thus, if developers enable this
> functionality with the following conditions met, we could accomplish
> the general implementation:
>
> 1. rename the header file provided by vendor to gmt-0018-2012.h
> and copy it to the /usr/include directory.
> 2. rename the dynamic library provided by vendor to
> gmt_0018_2012.so and copy it to the /usr/lib64 or any directory
> that linker could find before compiling QEMU.
> 3. enable crypto_gmt option when compiling QEMU and make the feature
> availiable.
>
> By offering a development package for GM/T 0018-2012, the above
> provisions could be standardized; unfortunately, the hardware
> manufacturer has not completed this task. So developers who don't
> work with the vendor to obtain the cryptography device and related
> library may not be able to test this functionality because the
> standard implementation depends on the cryptography device supplied
> by the hardware vendor. We are hesitant to contribute to this series
> as a result.
Hmm, yes, that is a pretty unpleasant approach.
IMHO there really needs to be a reference implementation that is
pure software. eg a gmt_0018_2012.so + header files that simply
uses an existing crypto library. That way applications can build
and test their support for this, without having to have access
to a specific piece of hardware. Hardware vendors should only
have to provide their library impl, not the headers.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2024-02-29 9:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-24 14:34 [PATCH RFC 0/3] Support GM/T 0018-2012 cryptographic standard Hyman Huang
2024-02-24 14:34 ` [PATCH RFC 1/3] crypto: Introduce GM/T 0018-2012 cryptographic driver Hyman Huang
2024-02-24 14:34 ` [PATCH RFC 2/3] meson.build: Support GM/T 0018-2012 cryptographic standard Hyman Huang
2024-02-24 14:34 ` [PATCH RFC 3/3] crypto: Allow GM/T 0018-2012 to support SM4 cipher algorithm Hyman Huang
2024-02-29 9:03 ` Daniel P. Berrangé [this message]
2024-02-29 10:13 ` [PATCH RFC 0/3] Support GM/T 0018-2012 cryptographic standard Yong Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZeBIdNQYkq4tnF7h@redhat.com \
--to=berrange@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--cc=yong.huang@smartx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).