xchacha20 test: initialize the full nonce

Spotted by @FiloSottile, thanks!

Fixes #742
This commit is contained in:
Frank Denis 2018-08-03 23:23:53 +02:00
parent 2052cc7847
commit 49f112da5d
2 changed files with 52 additions and 52 deletions

View File

@ -24,7 +24,7 @@ tv(void)
unsigned char *m = (unsigned char *) sodium_malloc(MLEN); unsigned char *m = (unsigned char *) sodium_malloc(MLEN);
static const unsigned char nonce[crypto_aead_xchacha20poly1305_ietf_NPUBBYTES] static const unsigned char nonce[crypto_aead_xchacha20poly1305_ietf_NPUBBYTES]
= { 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, = { 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b }; 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53 };
static const unsigned char ad[ADLEN] static const unsigned char ad[ADLEN]
= { 0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7 }; = { 0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7 };
unsigned char *c = (unsigned char *) sodium_malloc(CLEN); unsigned char *c = (unsigned char *) sodium_malloc(CLEN);

View File

@ -1,51 +1,51 @@
,0x45,0x3c,0x06,0x93,0xa7,0x40,0x7f,0x04 ,0xf8,0xeb,0xea,0x48,0x75,0x04,0x40,0x66
,0xff,0x4c,0x56,0xae,0xdb,0x17,0xa3,0xc0 ,0xfc,0x16,0x2a,0x06,0x04,0xe1,0x71,0xfe
,0xa1,0xaf,0xff,0x01,0x17,0x49,0x30,0xfc ,0xec,0xfb,0x3d,0x20,0x42,0x52,0x48,0x56
,0x22,0x28,0x7c,0x33,0xdb,0xcf,0x0a,0xc8 ,0x3b,0xcf,0xd5,0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