From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sigma.offblast.org ([199.191.58.44]) by pp; Mon Apr 27 14:50:05 EDT 2015 Date: Mon, 27 Apr 2015 14:49:57 -0400 From: mischief@9.offblast.org To: counter@9.offblast.org, mode@9.offblast.org, goof", 9front@9front.org Subject: "AES Message-ID: <5fe747ab8c15b2527ffcb60e266ecf05@sigma.offblast.org> List-ID: <9front.9front.org> X-Glyph: ➈ X-Bullshit: stateless content-addressed element-based cloud configuration session manager MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit 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.