From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 01 Oct 2014 08:22:21 -0500 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: Should Ada runtime provide special primitives for cryptography? Date: Wed, 01 Oct 2014 09:22:31 -0400 Organization: IISS Elusive Unicorn Message-ID: References: X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.79.220.130 X-Trace: sv3-ITkz91/n6PysxZqL5cWmMWtfbIuoOT8ZnwzHKD7aVbrygms1+Fu/rQZqqQwuH5n5VEiWSifJ+Z2ih0w!qadH4csHP7jN8mS8WnXTExlpqla9j/vbd9JlexqHPOHGoW3PIiKiXSPRNw8XjJSYXOZETUK8Ksya!A+adFu1W6qLU4aZw69s6plng/PzH X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2209 Xref: number.nntp.giganews.com comp.lang.ada:189274 Date: 2014-10-01T09:22:31-04:00 List-Id: On Wed, 1 Oct 2014 08:42:17 +0000 (UTC), Natasha Kerensikova declaimed the following: >However, when actually implementing cryptographic stuff, cleverness from >compiler and optimizer are often enemies. For example, overwriting a >buffer with zeroes might be optimized out when the buffer is not >accessed again. > Cryptographic "zeroing" does not fill a buffer with 0x00 values. One approved method is to: generate random sequence (in a second buffer as you'll need it again) copy random sequence into crypto buffer compare buffers to ensure data was changed invert the bits of the random sequence copy random sequence into crypto buffer compare to ensure all data changed generate second random sequence copy second sequence into buffer compare buffers The first two copy operations ensure every bit in the buffer has been toggled to both states -- the compares ensure you don't have a "sticky bit". -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/