9front - general discussion about 9front
 help / color / mirror / Atom feed
From: mischief@9.offblast.org
To: counter@9.offblast.org, mode@9.offblast.org, goof", 9front@9front.org
Subject: "AES
Date: Mon, 27 Apr 2015 14:49:57 -0400	[thread overview]
Message-ID: <5fe747ab8c15b2527ffcb60e266ecf05@sigma.offblast.org> (raw)

i was looking at aes counter mode code recently. in
/sys/src/libsec/port/aes.c i don't see any code that initializes
or modifies AESstate->ctrsz. ctrsz is passed to
/sys/src/libsec/port/aes.c:/^incrementCTR which is supposed to
increment the counter. since ctrsz is always 0, i think it doesn't work
the way it is intended to.

i also think the code

	mpctrsz = itomp(1 << (ctrsz*8), nil);

is wrong, because any ctrsz > 3 will make the integer shift to a value
larger than signed 32 bit integer, and make itomp behave in strange ways,
resulting in incorrect modulo of the aes counter.



                 reply	other threads:[~2015-04-27 18:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=5fe747ab8c15b2527ffcb60e266ecf05@sigma.offblast.org \
    --to=mischief@9.offblast.org \
    --cc=counter@9.offblast.org \
    --cc=mode@9.offblast.org \
    /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).