#include "present128.h"
static
-void key_update_128(uint8_t* buffer, uint8_t round){
+void key_update_128(uint8_t *buffer, uint8_t round){
uint8_t j;
uint8_t t8;
union __attribute__((packed)){
static
-void key_update_128_inv(uint8_t* buffer, uint8_t round){
+void key_update_128_inv(uint8_t *buffer, uint8_t round){
uint8_t j;
uint8_t t8;
union __attribute__((packed)){
}while(j--);
}
-void present128_init(const uint8_t* key, uint8_t keysize_b, present128_ctx_t* ctx){
+void present128_init(const uint8_t *key, uint8_t keysize_b, present128_ctx_t *ctx){
uint8_t i;
memcpy(ctx->fwd_key, key, 16);
memcpy(ctx->rev_key, key, 16);
}
}
-void present128_enc(void* buffer, present128_ctx_t* ctx){
+void present128_enc(void *buffer, present128_ctx_t *ctx){
present_generic_enc(buffer, (uint8_t*)ctx, 16, key_update_128);
}
-void present128_dec(void* buffer, present128_ctx_t* ctx){
+void present128_dec(void *buffer, present128_ctx_t *ctx){
present_generic_dec(buffer, (uint8_t*)ctx, 16, key_update_128_inv);
}
/*
-void present128_enc(void* buffer, present128_ctx_t* ctx){
+void present128_enc(void *buffer, present128_ctx_t *ctx){
uint8_t i,j,tmp[8], k[16];
memcpy(k, ctx->fwd_key, 16);
memxor(buffer, k, 8);
}
}
-void present128_dec(void* buffer, present128_ctx_t* ctx){
+void present128_dec(void *buffer, present128_ctx_t *ctx){
uint8_t j,tmp[8], k[16];
uint8_t i;
memcpy(k, ctx->rev_key, 16);