From dev-return-5148-archive-asf-public=cust-asf.ponee.io@royale.apache.org Fri Jun 22 12:21:08 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C1B58180647 for ; Fri, 22 Jun 2018 12:21:07 +0200 (CEST) Received: (qmail 76013 invoked by uid 500); 22 Jun 2018 10:21:06 -0000 Mailing-List: contact dev-help@royale.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@royale.apache.org Delivered-To: mailing list dev@royale.apache.org Received: (qmail 76001 invoked by uid 99); 22 Jun 2018 10:21:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jun 2018 10:21:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id D29F0C04C5 for ; Fri, 22 Jun 2018 10:21:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.202 X-Spam-Level: X-Spam-Status: No, score=0.202 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1.697, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id CNmdVrGi_-Pu for ; Fri, 22 Jun 2018 10:21:01 +0000 (UTC) Received: from mail-wr0-f179.google.com (mail-wr0-f179.google.com [209.85.128.179]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 478E45F357 for ; Fri, 22 Jun 2018 10:21:01 +0000 (UTC) Received: by mail-wr0-f179.google.com with SMTP id k16-v6so6181007wro.0 for ; Fri, 22 Jun 2018 03:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=Pq0GnYDopfMZN7nTomfGpM3MbfDylIYezxF3zB8/PTI=; b=XbA6j8+HR/vBH3fPC99k7xZJEhmB+AOTJ23vaKLf/GoZig7Yxenn5NVerF+rjYm9Ou pjFkZjKItG7pN6oqzrQnE0Pg5N8GdXwqhtzrmKJw9rbOmniOkN7nlhoDstNPT1lS2QVh Jh+eYQiOjHb5jrs2H7F0csghPc+FbRtC2l/2uL3vbVKcqCE7sx/B6/m6VUci0b0pgt1T btANheEfCttTYmQeGl8Oue4FcULQQz3d704NwlozxdTLVSbG4xHjmhT+Q3R9GJgSKyNX KzEpMKec3LlN82+yBGBoTGKcuBt4p9ObEcyFUuq/sENTvym2MgIOtcQ9ZkWgJZ+x/Gzp 7bFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=Pq0GnYDopfMZN7nTomfGpM3MbfDylIYezxF3zB8/PTI=; b=O6W82uIF0SC5+HOFTS8l7mniPoWW7S/Ow8Cd+qwARyrFXt57zbA2xtKj10Qy8NFfK+ 18yBOKMe/iULQBkzAbx2/lInE41Trjb7kddHnUWVj8TU/6ob7qi9cdugXgTEkcoYfjPb SZxlwFAEPDyulQjqHMdP6S07rdk8CXvkYxTKwQ08rEY1obIOGao+538r9eF1egrserBo VNOoBv6NApWtHf5jODvDfR9hH4ZqTjER+2eUg4Gp7RAg8f1WvXk/H1bl+MHS76BLubjJ n+D9iA7088n4swgG8BZSU6XhhgeDEpWU0irBZf/5FOhQB/O8IpZ7RMNe4AW7iw1BN6LT t8DA== X-Gm-Message-State: APt69E2b3r1L72RW5C89fbVZgWmF9HYie5SBWSP9INFjqm2HC04Kmd28 pyXJt3oOFcWWZCfR3p74gtxWdEMH X-Google-Smtp-Source: AAOMgpdd5/gGMK6f+ulFhBahGNHqTbmQLvz2MYdAeDhfLL3AQcapIfn6QqFmN1wa+MlfzSxEevezNg== X-Received: by 2002:adf:b8c7:: with SMTP id c7-v6mr1107865wrg.65.1529662860158; Fri, 22 Jun 2018 03:21:00 -0700 (PDT) Received: from [10.0.0.3] ([185.120.124.11]) by smtp.gmail.com with ESMTPSA id z16-v6sm10923692wro.41.2018.06.22.03.20.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 03:20:59 -0700 (PDT) From: Harbs Content-Type: multipart/alternative; boundary="Apple-Mail=_CE9114A4-1400-4729-A66C-37EB10D8AA05" Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: MD5 [was: Re: BinaryData and odd bytes] Date: Fri, 22 Jun 2018 13:20:56 +0300 References: <300E0487-72F4-4F07-9BDD-3A486042D9F3@gmail.com> <088DCF85-CC53-4EAD-90F9-BAA4FFDFB7D2@gmail.com> <446A9775-DF6F-442A-A843-379BA6D78646@gmail.com> <14875127-BFC9-4BE7-9D4C-7D9CA806F0E5@adobe.com> <9D222F43-B0F9-4BAA-8607-7470ABF84E8E@gmail.com> <2BFCB26C-F939-46EA-8A7D-EDD75C28E7E5@gmail.com> <44A05E1D-305F-414E-9E80-326EB6782EC2@adobe.com> To: dev@royale.apache.org In-Reply-To: <44A05E1D-305F-414E-9E80-326EB6782EC2@adobe.com> Message-Id: X-Mailer: Apple Mail (2.3273) --Apple-Mail=_CE9114A4-1400-4729-A66C-37EB10D8AA05 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 In Flash, the error is ReferenceError: Error: 1069. I took another look and it looks like the problem is the bracketed = access to the BinaryData. The code s[ i / 8 ] needs to be changed to either s.readByteAt(i/8) or = s.array[i/8]. Making either of these changes fixed the Flash error, but did not fix = the JS error: expected 80338e79d2ca9b9c090ebaaa2ef293c7 but was: = 996f93cb21f81b54962909fd0ea18074 I=E2=80=99m guessing that the problem is related to the comment here in = the JS MD5 implementation: * Add integers, wrapping at 2^32. This uses 16-bit = operations internally * to work around bugs in some JS interpreters. I think part of the problem is that JS only has 32 bit ints. I did not = follow this article completely, but this might shed some light: = http://blog.vjeux.com/2013/javascript/conversion-from-uint8-to-int8-x-24.h= tml = Harbs > On Jun 22, 2018, at 9:22 AM, Alex Harui = wrote: >=20 > On 6/21/18, 11:20 AM, "Harbs" wrote: >=20 > The MD5 test actually failed in Flash too. Although the error was = different. >=20 > I=E2=80=99m not sure why it was failing. I=E2=80=99m pretty sure = the code was the same as the Flex version with ByteArray swapped for = BinaryData. >=20 > Even more bothersome. We really should dig deeper on this. We can't = have other people's business logic have similar issues. Any volunteers? >=20 > -Alex >=20 >=20 --Apple-Mail=_CE9114A4-1400-4729-A66C-37EB10D8AA05--