Wipe the last salsa20 block in the reduced rounds versions

This commit is contained in:
Frank Denis 2015-01-13 19:18:50 +01:00
parent ab4171e37f
commit 0fef202b37
4 changed files with 12 additions and 0 deletions

View File

@ -6,6 +6,7 @@ Public domain.
#include "api.h"
#include "crypto_core_salsa2012.h"
#include "utils.h"
typedef unsigned int uint32;
@ -47,5 +48,7 @@ int crypto_stream(
crypto_core_salsa2012(block,in,k,sigma);
for (i = 0;i < clen;++i) c[i] = block[i];
}
sodium_memzero(block, sizeof block);
return 0;
}

View File

@ -6,6 +6,7 @@ Public domain.
#include "api.h"
#include "crypto_core_salsa2012.h"
#include "utils.h"
typedef unsigned int uint32;
@ -50,5 +51,7 @@ int crypto_stream_xor(
crypto_core_salsa2012(block,in,k,sigma);
for (i = 0;i < mlen;++i) c[i] = m[i] ^ block[i];
}
sodium_memzero(block, sizeof block);
return 0;
}

View File

@ -6,6 +6,7 @@ Public domain.
#include "api.h"
#include "crypto_core_salsa208.h"
#include "utils.h"
typedef unsigned int uint32;
@ -47,5 +48,7 @@ int crypto_stream(
crypto_core_salsa208(block,in,k,sigma);
for (i = 0;i < clen;++i) c[i] = block[i];
}
sodium_memzero(block, sizeof block);
return 0;
}

View File

@ -6,6 +6,7 @@ Public domain.
#include "api.h"
#include "crypto_core_salsa208.h"
#include "utils.h"
typedef unsigned int uint32;
@ -50,5 +51,7 @@ int crypto_stream_xor(
crypto_core_salsa208(block,in,k,sigma);
for (i = 0;i < mlen;++i) c[i] = m[i] ^ block[i];
}
sodium_memzero(block, sizeof block);
return 0;
}