Re: Help with SHA class
Re: Help with SHA class
- Subject: Re: Help with SHA class
- From: Michael Ash <email@hidden>
- Date: Thu, 4 Jun 2009 18:17:34 -0400
On Thu, Jun 4, 2009 at 6:03 PM, Ken Tozier <email@hidden> wrote:
>> Iff you're running it on an Intel CPU, simply compile the code for ppc and
>> use the 'arch' command to run that slice instead of the native slice. If it
>> doesn't produce the same output, then you have an implied-endian bug. If it
>> does produce the same output, you still have a bug.
>
> Is it possible to compile a single class in a project to PPC while
> everything else in the project compiles to Intel?
Nope. Rosetta does not support mixed mode operation. Either everything
in a process must be PPC, or none of it.
>> If you're using an Intel CPU, maybe try finding a little-endian
>> implementation of the algorithm.
>
> No luck on that front.
Huh? You said you have a working version from the MySQL source.
You have some broken code intending to execute a certain algorithm.
You also have some working code which executes that same algorithm.
(And if you don't, there are probably literally hundreds of open
source examples available on the internet.) Set them both up in
parallel to run on identical data, then step through them both in the
debugger line by line until the internal states diverge. Now that you
know where things go wrong, look at the code and see what's different.
This is elementary debugging, in one of the easiest imaginable
scenarios.
And once you've found and fixed the problem and hopefully learned
something in the process, please delete all of your code and use one
of the SHA-1 functions provided by the OS. There is no excuse for
writing your own crypto code for production use in this day and age.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden