You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Michael Schmalle (JIRA)" <ji...@apache.org> on 2012/11/14 01:48:12 UTC

[jira] [Created] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

Michael Schmalle created FLEX-33260:
---------------------------------------

             Summary: An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647
                 Key: FLEX-33260
                 URL: https://issues.apache.org/jira/browse/FLEX-33260
             Project: Apache Flex
          Issue Type: Bug
          Components: .Unspecified - Framework
            Reporter: Michael Schmalle
            Priority: Minor
             Fix For: Adobe Flex SDK Next


flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:111
Warning: Initializer value 3144134277 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1150833019 will be used instead.
            var h1:int = 0xbb67ae85;
                         ^

flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:113
Warning: Initializer value 2773480762 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1521486534 will be used instead.
            var h3:int = 0xa54ff53a;
                         ^

sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:115
Warning: Initializer value 2600822924 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1694144372 will be used instead.
            var h5:int = 0x9b05688c;
                         ^

I do not know how to fix these but it looks like the initial value doesn't fit in an int.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Re: [jira] [Created] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

Posted by Frédéric THOMAS <we...@hotmail.com>.
I haven't see any test for the SHA256 but I will work on the mustella tests 
again this week end, I'll try to create a test for if I get time.

-----Message d'origine----- 
From: Gordon Smith
Sent: Wednesday, November 14, 2012 4:03 AM
To: flex-dev@incubator.apache.org
Subject: RE: [jira] [Created] (FLEX-33260) An initial value in SHA256 for 
type 'int' must be between -2147483648 and 2147483647

It seems like that would be the correct way to code the algorithm, but I'd 
be concerned that I might potentially introduce some bug, and I don't know 
that we have any tests for the SHA256 class. Changing from an int which is 
apparently initialized to 3144134277 but which actually gets set 
to -1150833019 to an int that is actually initialized to -1150833019 should 
be a very safe change.

- Gordon

-----Original Message-----
From: Frédéric THOMAS [mailto:webdoublefx@hotmail.com]
Sent: Tuesday, November 13, 2012 5:38 PM
To: flex-dev@incubator.apache.org
Subject: Re: [jira] [Created] (FLEX-33260) An initial value in SHA256 for 
type 'int' must be between -2147483648 and 2147483647

Hi Gordon,

Maybe I wrong but refering to the pseudocode from
http://en.wikipedia.org/wiki/SHA-256 souldn't these variable be unsigned 32 
bits ?

-----Message d'origine-----
From: Gordon Smith
Sent: Wednesday, November 14, 2012 2:27 AM
To: flex-dev@incubator.apache.org
Subject: RE: [jira] [Created] (FLEX-33260) An initial value in SHA256 for 
type 'int' must be between -2147483648 and 2147483647

You should be able to just replace 3144134277 with -1150833019, etc. You 
should verify that 3144134277 assigned to an int produces -1150833019 (due 
to 32-bit wraparound) in both the old compiler and the new compiler.

- Gordon


-----Original Message-----
From: Michael Schmalle (JIRA) [mailto:jira@apache.org]
Sent: Tuesday, November 13, 2012 4:48 PM
To: flex-dev@incubator.apache.org
Subject: [jira] [Created] (FLEX-33260) An initial value in SHA256 for type 
'int' must be between -2147483648 and 2147483647

Michael Schmalle created FLEX-33260:
---------------------------------------

             Summary: An initial value in SHA256 for type 'int' must be 
between -2147483648 and 2147483647
                 Key: FLEX-33260
                 URL: https://issues.apache.org/jira/browse/FLEX-33260
             Project: Apache Flex
          Issue Type: Bug
          Components: .Unspecified - Framework
            Reporter: Michael Schmalle
            Priority: Minor
             Fix For: Adobe Flex SDK Next


flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:111
Warning: Initializer value 3144134277 for type 'int' must be
between -2147483648 and 2147483647 inclusive. An initial value
of -1150833019 will be used instead.
            var h1:int = 0xbb67ae85;
                         ^

flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:113
Warning: Initializer value 2773480762 for type 'int' must be
between -2147483648 and 2147483647 inclusive. An initial value
of -1521486534 will be used instead.
            var h3:int = 0xa54ff53a;
                         ^

sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:115
Warning: Initializer value 2600822924 for type 'int' must be
between -2147483648 and 2147483647 inclusive. An initial value
of -1694144372 will be used instead.
            var h5:int = 0x9b05688c;
                         ^

I do not know how to fix these but it looks like the initial value doesn't
fit in an int.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA
administrators For more information on JIRA, see:
http://www.atlassian.com/software/jira


Re: [jira] [Created] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

Posted by Alex Harui <ah...@adobe.com>.


On 11/13/12 7:03 PM, "Gordon Smith" <go...@adobe.com> wrote:

> It seems like that would be the correct way to code the algorithm, but I'd be
> concerned that I might potentially introduce some bug, and I don't know that
> we have any tests for the SHA256 class.
Gordon, I have this vague recollection that Darrell found some tests on-line
to validate the code when he first wrote it.  I'll check with him.
> Changing from an int which is
> apparently initialized to 3144134277 but which actually gets set to
> -1150833019 to an int that is actually initialized to -1150833019 should be a
> very safe change.
> 
> - Gordon

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


RE: [jira] [Created] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

Posted by Gordon Smith <go...@adobe.com>.
It seems like that would be the correct way to code the algorithm, but I'd be concerned that I might potentially introduce some bug, and I don't know that we have any tests for the SHA256 class. Changing from an int which is apparently initialized to 3144134277 but which actually gets set to -1150833019 to an int that is actually initialized to -1150833019 should be a very safe change.

- Gordon

-----Original Message-----
From: Frédéric THOMAS [mailto:webdoublefx@hotmail.com] 
Sent: Tuesday, November 13, 2012 5:38 PM
To: flex-dev@incubator.apache.org
Subject: Re: [jira] [Created] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

Hi Gordon,

Maybe I wrong but refering to the pseudocode from
http://en.wikipedia.org/wiki/SHA-256 souldn't these variable be unsigned 32 bits ?

-----Message d'origine-----
From: Gordon Smith
Sent: Wednesday, November 14, 2012 2:27 AM
To: flex-dev@incubator.apache.org
Subject: RE: [jira] [Created] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

You should be able to just replace 3144134277 with -1150833019, etc. You should verify that 3144134277 assigned to an int produces -1150833019 (due to 32-bit wraparound) in both the old compiler and the new compiler.

- Gordon


-----Original Message-----
From: Michael Schmalle (JIRA) [mailto:jira@apache.org]
Sent: Tuesday, November 13, 2012 4:48 PM
To: flex-dev@incubator.apache.org
Subject: [jira] [Created] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

Michael Schmalle created FLEX-33260:
---------------------------------------

             Summary: An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647
                 Key: FLEX-33260
                 URL: https://issues.apache.org/jira/browse/FLEX-33260
             Project: Apache Flex
          Issue Type: Bug
          Components: .Unspecified - Framework
            Reporter: Michael Schmalle
            Priority: Minor
             Fix For: Adobe Flex SDK Next


flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:111
Warning: Initializer value 3144134277 for type 'int' must be 
between -2147483648 and 2147483647 inclusive. An initial value 
of -1150833019 will be used instead.
            var h1:int = 0xbb67ae85;
                         ^

flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:113
Warning: Initializer value 2773480762 for type 'int' must be 
between -2147483648 and 2147483647 inclusive. An initial value 
of -1521486534 will be used instead.
            var h3:int = 0xa54ff53a;
                         ^

sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:115
Warning: Initializer value 2600822924 for type 'int' must be 
between -2147483648 and 2147483647 inclusive. An initial value 
of -1694144372 will be used instead.
            var h5:int = 0x9b05688c;
                         ^

I do not know how to fix these but it looks like the initial value doesn't 
fit in an int.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA 
administrators For more information on JIRA, see: 
http://www.atlassian.com/software/jira 


Re: [jira] [Created] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

Posted by Frédéric THOMAS <we...@hotmail.com>.
Hi Gordon,

Maybe I wrong but refering to the pseudocode from 
http://en.wikipedia.org/wiki/SHA-256 souldn't these variable be unsigned 32 
bits ?

-----Message d'origine----- 
From: Gordon Smith
Sent: Wednesday, November 14, 2012 2:27 AM
To: flex-dev@incubator.apache.org
Subject: RE: [jira] [Created] (FLEX-33260) An initial value in SHA256 for 
type 'int' must be between -2147483648 and 2147483647

You should be able to just replace 3144134277 with -1150833019, etc. You 
should verify that 3144134277 assigned to an int produces -1150833019 (due 
to 32-bit wraparound) in both the old compiler and the new compiler.

- Gordon


-----Original Message-----
From: Michael Schmalle (JIRA) [mailto:jira@apache.org]
Sent: Tuesday, November 13, 2012 4:48 PM
To: flex-dev@incubator.apache.org
Subject: [jira] [Created] (FLEX-33260) An initial value in SHA256 for type 
'int' must be between -2147483648 and 2147483647

Michael Schmalle created FLEX-33260:
---------------------------------------

             Summary: An initial value in SHA256 for type 'int' must be 
between -2147483648 and 2147483647
                 Key: FLEX-33260
                 URL: https://issues.apache.org/jira/browse/FLEX-33260
             Project: Apache Flex
          Issue Type: Bug
          Components: .Unspecified - Framework
            Reporter: Michael Schmalle
            Priority: Minor
             Fix For: Adobe Flex SDK Next


flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:111
Warning: Initializer value 3144134277 for type 'int' must be 
between -2147483648 and 2147483647 inclusive. An initial value 
of -1150833019 will be used instead.
            var h1:int = 0xbb67ae85;
                         ^

flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:113
Warning: Initializer value 2773480762 for type 'int' must be 
between -2147483648 and 2147483647 inclusive. An initial value 
of -1521486534 will be used instead.
            var h3:int = 0xa54ff53a;
                         ^

sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:115
Warning: Initializer value 2600822924 for type 'int' must be 
between -2147483648 and 2147483647 inclusive. An initial value 
of -1694144372 will be used instead.
            var h5:int = 0x9b05688c;
                         ^

I do not know how to fix these but it looks like the initial value doesn't 
fit in an int.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA 
administrators For more information on JIRA, see: 
http://www.atlassian.com/software/jira 


RE: [jira] [Created] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

Posted by Gordon Smith <go...@adobe.com>.
You should be able to just replace 3144134277 with -1150833019, etc. You should verify that 3144134277 assigned to an int produces -1150833019 (due to 32-bit wraparound) in both the old compiler and the new compiler.

- Gordon


-----Original Message-----
From: Michael Schmalle (JIRA) [mailto:jira@apache.org] 
Sent: Tuesday, November 13, 2012 4:48 PM
To: flex-dev@incubator.apache.org
Subject: [jira] [Created] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

Michael Schmalle created FLEX-33260:
---------------------------------------

             Summary: An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647
                 Key: FLEX-33260
                 URL: https://issues.apache.org/jira/browse/FLEX-33260
             Project: Apache Flex
          Issue Type: Bug
          Components: .Unspecified - Framework
            Reporter: Michael Schmalle
            Priority: Minor
             Fix For: Adobe Flex SDK Next


flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:111
Warning: Initializer value 3144134277 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1150833019 will be used instead.
            var h1:int = 0xbb67ae85;
                         ^

flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:113
Warning: Initializer value 2773480762 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1521486534 will be used instead.
            var h3:int = 0xa54ff53a;
                         ^

sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:115
Warning: Initializer value 2600822924 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1694144372 will be used instead.
            var h5:int = 0x9b05688c;
                         ^

I do not know how to fix these but it looks like the initial value doesn't fit in an int.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496735#comment-13496735 ] 

Frédéric THOMAS commented on FLEX-33260:
----------------------------------------

these variables have to be uint (unsigned 32 bits)
                
> An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647
> ------------------------------------------------------------------------------------
>
>                 Key: FLEX-33260
>                 URL: https://issues.apache.org/jira/browse/FLEX-33260
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: .Unspecified - Framework
>            Reporter: Michael Schmalle
>            Priority: Minor
>              Labels: EasyFix, Falcon
>             Fix For: Adobe Flex SDK Next
>
>
> flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:111
> Warning: Initializer value 3144134277 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1150833019 will be used instead.
>             var h1:int = 0xbb67ae85;
>                          ^
> flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:113
> Warning: Initializer value 2773480762 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1521486534 will be used instead.
>             var h3:int = 0xa54ff53a;
>                          ^
> sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:115
> Warning: Initializer value 2600822924 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1694144372 will be used instead.
>             var h5:int = 0x9b05688c;
>                          ^
> I do not know how to fix these but it looks like the initial value doesn't fit in an int.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FLEX-33260) An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647

Posted by "Frédéric THOMAS (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13499841#comment-13499841 ] 

Frédéric THOMAS commented on FLEX-33260:
----------------------------------------

I just did the test replacing the int with uint, the computeDigest function still gives the same good results, the advantage is that you won't have those warnings anymore.
                
> An initial value in SHA256 for type 'int' must be between -2147483648 and 2147483647
> ------------------------------------------------------------------------------------
>
>                 Key: FLEX-33260
>                 URL: https://issues.apache.org/jira/browse/FLEX-33260
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: .Unspecified - Framework
>            Reporter: Michael Schmalle
>            Priority: Minor
>              Labels: EasyFix, Falcon
>             Fix For: Adobe Flex SDK Next
>
>
> flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:111
> Warning: Initializer value 3144134277 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1150833019 will be used instead.
>             var h1:int = 0xbb67ae85;
>                          ^
> flex\sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:113
> Warning: Initializer value 2773480762 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1521486534 will be used instead.
>             var h3:int = 0xa54ff53a;
>                          ^
> sdk\branches\develop\frameworks\projects\framework\src\mx\utils\SHA256.as:115
> Warning: Initializer value 2600822924 for type 'int' must be between -2147483648 and 2147483647 inclusive. An initial value of -1694144372 will be used instead.
>             var h5:int = 0x9b05688c;
>                          ^
> I do not know how to fix these but it looks like the initial value doesn't fit in an int.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira