Hi Mathias,

yes I forgot to mention the CFLAG.
If you use AES I suggest to use:
CFLAGS += -DCRYPTO_AES
and not:
CFLAGS += -DCRYPTO_THREEDES
then the appropriate CIPHER_MAX_CONTEXT_SIZE for AES will be defined [1].

Best regards,
Martin

[1] https://github.com/RIOT-OS/RIOT/blob/master/sys/include/crypto/ciphers.h#L56
________________________________________
Von: users [[email protected]]" im Auftrag von "Tausig 
Mathias [[email protected]]
Gesendet: Donnerstag, 11. Februar 2016 12:34
An: [email protected]
Betreff: Re: [riot-users] Using AES encryption

I did use the USEMODULE clause, but without the addtional CFLAGS
setting, it won't work. aes_init/cipher_init will return 0 because
CIPHER_MAX_CONTEXT_SIZE is set to 1 in sys/include/crypto/ciphers.h.
The unit test you referenced works, because it adds a "CFLAGS +=
-DCRYPTO_THREEDES" (which enables aes, too, because the
CIPHER_MAX_CONTEXT_SIZE set for 3DES is larger then the one for AES) in
the Makefile.include, too.

cheers
Mathias

Am Donnerstag, den 11.02.2016, 10:33 +0000 schrieb Landsmann, Martin:
> Hi Mathias,
>
> You need to add:
> USEMODULE += crypto
> to your Makefile to enable the AES cypher in your implementation.
> This line includes the crypto module which includes AES.
> Just head over to the RIOT wiki to learn more about modules [1] and
> how to use them.
>
> You can also have a look into the crypto unittests [2] to get some
> hints how to use the AES implementation.
>
> Best Regards,
> Martin
>
> [1]
> https://github.com/RIOT-OS/RIOT/wiki/Introduction#including-modules
> [2] https://github.com/RIOT-OS/RIOT/tree/master/tests/unittests/tests
> -crypto
> ________________________________________
> Von: users [[email protected]]" im Auftrag von
> "Tausig Mathias [[email protected]]
> Gesendet: Donnerstag, 11. Februar 2016 11:17
> An: [email protected]
> Betreff: [riot-users] Using AES encryption
>
> Hy!
>
> I am trying to write a litle RIOT-OS project which uses AES
> encryption.
> After some fiddling around, I made it work by adding a "CFLAGS +=
> -DCRYPTO_AES" line to my Makefile.
> Is this the recommended way to do it? I am asking, because I could
> not
> find any reference to it in the documentations.
>
> cheers
> Mathias
> _______________________________________________
> users mailing list
> [email protected]
> https://lists.riot-os.org/mailman/listinfo/users
--
DI Mathias Tausig,Kompetenzzentrum für IT-Security,
FH Campus Wien,Informationstechnologien und Telekommunikation.
Favoritenstrasse 226, Raum B.3.07a,1100 Wien, Austria.T: +43 1 606 68 77-2142, 
F: +43 1 606 68 [email protected]
_______________________________________________
users mailing list
[email protected]
https://lists.riot-os.org/mailman/listinfo/users

Reply via email to