lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 2 Nov 2010 04:50:45 +0900
From:	Paul Mundt <lethal@...ux-sh.org>
To:	Tracey Dent <tdent48227@...il.com>
Cc:	greg@...ah.com, manningc2@...rix.gen.nz,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 08/29] Staging: yaffs2: yaffs_ecc: Add files

On Mon, Nov 01, 2010 at 02:40:56PM -0400, Tracey Dent wrote:
> +/*
> + * This code implements the ECC algorithm used in SmartMedia.
> + *
> + * The ECC comprises 22 bits of parity information and is stuffed into 3 bytes.
> + * The two unused bit are set to 1.
> + * The ECC can correct single bit errors in a 256-byte page of data. Thus, two such ECC
> + * blocks are used on a 512-byte NAND page.
> + *
> + */
> +
> +/* Table generated by gen-ecc.c
> + * Using a table means we do not have to calculate p1..p4 and p1'..p4'
> + * for each byte of data. These are instead provided in a table in bits7..2.
> + * Bit 0 of each entry indicates whether the entry has an odd or even parity, and therefore
> + * this bytes influence on the line parity.
> + */
> +
This all looks pretty generic. Have you considered just adding gen-ecc to
lib/, tying it in to hostprogs, and generating the tables during build
(see the crc32 code for reference)?

The rest of this would probably also be better off living in lib/ and
simply being selected by the YAFFS code as necessary.

> +/* Calculate the ECC for a 256-byte block of data */
> +void yaffs_ecc_cacl(const unsigned char *data, unsigned char *ecc)
> +void yaffs_ecc_calc_other(const unsigned char *data, unsigned n_bytes,
> +				yaffs_ecc_other *ecc_other)

Is there some reason for this naming inconistency?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ