SRCDIR = src
-SOURCES := $(wildcard $(SRCDIR)/*.c)
+SOURCES := $(SRCDIR)/xchacha20.c $(SRCDIR)/test.c
INCLUDES := $(wildcard $(SRCDIR)/*.h))
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(SRCDIR)/%.o)
uint8_t plaintext[] = "My Plaintext!! My Dear plaintext!!!";
uint32_t msglen = strlen((char *)plaintext);
+ /* knock one byte off the end */
plaintext[msglen-1] = 0;
+ msglen -= 1;
xchacha_keysetup(&ctx, key, iv);
0x6C, 0x72
};
- uint8_t plaintext[] = "My Plaintext!! My Dear plaintext!!";
+ uint8_t plaintext[] = "My Plaintext!! My Dear plaintext!!!";
uint32_t msglen = strlen((char *)plaintext);
+ /* knock one byte off the end */
+ plaintext[msglen-1] = 0;
+ msglen -= 1;
+
/* Allocate a buffer to hold our calculated ciphertext */
if((buffer = malloc(50 * sizeof(uint8_t))) == NULL){
perror("malloc() error");
print ("SPRs")
simulator.spr.dump()
print ("Mem")
- simulator.mem.dump()
+ simulator.mem.dump(asciidump=True)
for fname, offs, length in write_to:
write_data(simulator.mem, fname, offs, length)