X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=bertos%2Fsec%2Fcipher%2Fblowfish.h;fp=bertos%2Fsec%2Fcipher%2Fblowfish.h;h=ac7d57bc21ddc866b2598a17dd91b1ce6c1a0dce;hb=8a968ab3ef07a8065ae6f3398f1d44d30f7273d1;hp=0000000000000000000000000000000000000000;hpb=42621a35d4428a3e73441fe91ccfd502992233ec;p=bertos.git diff --git a/bertos/sec/cipher/blowfish.h b/bertos/sec/cipher/blowfish.h new file mode 100644 index 00000000..ac7d57bc --- /dev/null +++ b/bertos/sec/cipher/blowfish.h @@ -0,0 +1,63 @@ +/** + * \file + * + * + * \brief Blowfish implementation + * + * \author Giovanni Bajo + * + * + */ + +#ifndef SEC_CIPHER_BLOWFISH_H +#define SEC_CIPHER_BLOWFISH_H + +#include +#include + +typedef struct BlowfishContext +{ + BlockCipher c; + uint32_t S[4][256]; + uint32_t P[18]; + +} BlowfishContext; + +void blowfish_init(BlowfishContext *ctx); +#if 0 +#define blowfish_stackinit(...) \ + ({ BlowfishContext *ctx = alloca(sizeof(BlowfishContext)); blowfish_init(ctx, ##__VA_ARGS__); &ctx->c; }) +#endif +int blowfish_testSetup(void); +int blowfish_testRun(void); +int blowfish_testTearDown(void); + +#endif /* SEC_CIPHER_BLOWFISH_H */