/*
This file is part of Pretty Curved Privacy (pcp1).
Copyright (C) 2013 T.Linden.
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
You can contact me by mail: .
*/
#include "pad.h"
void pcp_pad_prepend(unsigned char **padded, unsigned char *unpadded,
size_t padlen, size_t unpadlen) {
*padded = ucmalloc(unpadlen + padlen);
unsigned char *tmp = ucmalloc(unpadlen + padlen);
/* pcp_append orig */
int i;
for(i=0; i= 2) {
size_t unpadlen;
int padlen = strtol(argv[2], NULL, 0);
unpadlen = strlen(argv[1]);
unsigned char *dst;
pcp_pad_prepend(&dst, argv[1], padlen, unpadlen);
/* printf(" prev: %s\n after: %s\n", argv[1], dst); */
unsigned char *reverse;
pcp_pad_remove(&reverse, dst, padlen, unpadlen);
/* printf("reverse: %s\n", reverse); */
return 0;
}
/* fprintf(stderr, "Usage: pad \n"); */
return -1;
}
#endif