/* present.c */
/*
This file is part of the AVR-Crypto-Lib.
- Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de)
+ Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
* present.c
* a implementation of the PRESENT block-cipher
* author: Daniel Otte
- * email: daniel.otte@rub.de
+ * email: bg@nerilex.org
* license: GPLv3
*
* */
#include "present_speed.h"
static
-void key_update(uint8_t* buffer, uint8_t round){
+void key_update(uint8_t *buffer, uint8_t round){
uint8_t j;
union __attribute__((packed)){
uint8_t v8[2];
buffer[7] ^= round >> 1;
}
-void present_init(const uint8_t* key, uint8_t keysize_b, present_ctx_t* ctx){
+void present_init(const uint8_t *key, uint8_t keysize_b, present_ctx_t *ctx){
uint8_t i,key_buffer[10];
memcpy(key_buffer, key, 10);
memcpy(&(ctx->k[0]), key_buffer, 8);
}
-void present_enc(void* buffer, present_ctx_t* ctx){
+void present_enc(void *buffer, present_ctx_t *ctx){
uint8_t i,j,tmp[8];
for(i=0; i<31; ++i){
*((uint64_t*)buffer) ^= ctx->k[i];
}
-void present_dec(void* buffer, present_ctx_t* ctx){
+void present_dec(void *buffer, present_ctx_t *ctx){
uint8_t j,tmp[8];
uint8_t i;
memxor(buffer, &ctx->k[31], 8);