Hi,
> I've been trying to build aes-armv4 for an embedded ARM 9 using the
> Green Hills Software tools. In the FIPS canister, the line following
> the label .Lok ...
>
> .Lok: stmdb sp!,{r4-r12,lr}
> sub r10,r3,#fips_aes_set_encrypt_key-AES_Te-1024 @ Te4
>
> gets this error:
>
> [asarm] (error) ..\Src\fips\crypto\aes\asm\aes_armv4.arm 374:
> expected a register sub r10 , r3 , fips_aes_set_encrypt_key - AES_Te - 1024
>
> Green Hills support says:
> From what I'm seeing the form of the instruction you are using
> requires that the constant fit in an 8-bit sized field.
This is a bit misleading. It's not actual constant value that has to fit
into 8 bits, but *non-zero bits* of the value. For example, 0xff000 is
fine, 0x1fe0 is fine, 0x1ff0000 is not.
> The constant expression:
>
> fips_aes_set_encrypt_key-AES_Te-1024
>
> currently resolves to:
>
> 0xb6c-0-0x400 = 0x76c
^^^^^ This should not end with 'c', but with '0'. How do I know? There
is '.align 5' prior AES_set_encrypt_key, which means "align this point
at 2**5=32 bytes." This allows for maximum value of 0xFF<<5=8192-32 for
such constants.
> which does not fit in an 8 bit field.
>
>
> Could I have made an error in my port which could explain this?
It's possible that your assembler doesn't interpret it as 2**5, but as
just 5, naturally rounding somehow. On the other hand wouldn't it more
appropriate for your assembler to fail with "inappropriate align value"?
One can argue that one should have used .p2align in order to avoid
disambiguity. Well, initial programming starts with looking at compiler
output and assuming conservative approach, i.e. if compiler uses .align
X and means 2**X, then we better stick to it, they might know something
we don't, e.g. that there is supported assembler that doesn't implement
.p2align... BTW, also, the value of 0xb6c is too high, I get 0x780 here
with 0x380 as final value.
> If
> this file was successfully built using some ARM compiler, which one
> was it?
GNU toolchain of course. Earliest ARM binutils I have is 2.15.
What is executable format for this platform?
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [email protected]