From: Troy Lee <leetroy@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Andrew Jeffery" <andrew@aj.id.au>,
"Troy Lee" <troy_lee@aspeedtech.com>,
qemu-devel@nongnu.org,
"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
"Joel Stanley" <joel@jms.id.au>,
"Klaus Heinrich Kiwi" <klaus@klauskiwi.com>,
"Cédric Le Goater" <clg@kaod.org>
Subject: Re: [PATCH] Supporting AST2600 HACE engine accumulative mode
Date: Fri, 7 Jan 2022 09:46:41 +0800 [thread overview]
Message-ID: <CAN9Jwz32qQQDWi4jYYzwJ0JDQ6kp3Ph-wENUtPn7c6E0LxkmSg@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA9b-JBPRt4oQkb-=ewcHY9TWJ46_xtRuW1qk6mnq-cBMw@mail.gmail.com>
On Thu, Jan 6, 2022 at 11:27 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Tue, 28 Dec 2021 at 03:34, Troy Lee <leetroy@gmail.com> wrote:
> >
> > Hi Klaus,
> >
> > On Thu, Dec 23, 2021 at 11:57 PM Klaus Heinrich Kiwi
> > <klaus@klauskiwi.com> wrote:
> > >
> > > Em qui., 23 de dez. de 2021 às 09:54, Cédric Le Goater <clg@kaod.org> escreveu:
> > > >
> > > > [ Adding Klaus ]
> > >
> > > Thanks Cedric. It's been a while since I've looked at this but I'll do my best..
> > >
> > > >
> > > > On 12/22/21 03:22, Troy Lee wrote:
>
>
> > > > > + /*
> > > > > + * Read the message length in bit from last 64/128 bits
> > > > > + * and tear the padding bits from iov
> > > > > + */
> > > > > + uint64_t stream_len;
> > > > > +
> > > > > + memcpy(&stream_len, iov[i].iov_base + iov[i].iov_len - 8, 8);
> > > > > + stream_len = __bswap_64(stream_len) / 8;
> > > > > +
> > >
> > > I no longer have access to the aspeed workbook I guess, but what is
> > > the actual specification here? is the message length 64 or 128 bits?
> > > and bswap seems arch-dependent - you probably want to be explicit if
> > > this is big or little-endian and use the appropriate conversion
> > > function.
> > The message length is described in RFC4634:
> > - SHA224 or SHA256 should be 64-bit.
> > - SHA384 or SHA512 should be 128-bit.
> > And it should be in big-endian.
>
> You can read a 64-bit BE value with
> uint64_t val = ldq_be_p(iov[i].iov_base + iov[i].iov_len - 8);
> or similar. (We don't have a similar function for 128 bits because
> there's no fully-portable native C data type for that.)
>
> -- PMM
Thanks for the suggestion!
Troy Lee
prev parent reply other threads:[~2022-01-07 1:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-22 2:22 [PATCH] Supporting AST2600 HACE engine accumulative mode Troy Lee
2021-12-23 12:54 ` Cédric Le Goater
2021-12-23 15:57 ` Klaus Heinrich Kiwi
2021-12-28 3:34 ` Troy Lee
2022-01-06 15:27 ` Peter Maydell
2022-01-07 1:46 ` Troy Lee [this message]
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=CAN9Jwz32qQQDWi4jYYzwJ0JDQ6kp3Ph-wENUtPn7c6E0LxkmSg@mail.gmail.com \
--to=leetroy@gmail.com \
--cc=andrew@aj.id.au \
--cc=clg@kaod.org \
--cc=joel@jms.id.au \
--cc=klaus@klauskiwi.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=troy_lee@aspeedtech.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).