summaryrefslogtreecommitdiff
path: root/nist/TestVectorGen.zip
blob: 938d9a83ff6f7993ce0f644b6396918b4a0958c1 (plain)
ofshex dumpascii
0000 50 4b 03 04 14 00 08 08 00 00 00 8c 1b 4d 00 00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 63 72 PK...........M................cr
0020 79 70 74 6f 5f 61 65 61 64 2e 68 0a 69 6e 74 20 63 72 79 70 74 6f 5f 61 65 61 64 5f 65 6e 63 72 ypto_aead.h.int.crypto_aead_encr
0040 79 70 74 28 0a 09 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a 63 2c 20 75 6e 73 69 67 6e 65 64 ypt(..unsigned.char.*c,.unsigned
0060 20 6c 6f 6e 67 20 6c 6f 6e 67 20 2a 63 6c 65 6e 2c 0a 09 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 .long.long.*clen,..const.unsigne
0080 64 20 63 68 61 72 20 2a 6d 2c 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 6d 6c d.char.*m,.unsigned.long.long.ml
00a0 65 6e 2c 0a 09 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a 61 64 2c 20 75 6e en,..const.unsigned.char.*ad,.un
00c0 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 61 64 6c 65 6e 2c 0a 09 63 6f 6e 73 74 20 75 signed.long.long.adlen,..const.u
00e0 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a 6e 73 65 63 2c 0a 09 63 6f 6e 73 74 20 75 6e 73 69 67 nsigned.char.*nsec,..const.unsig
0100 6e 65 64 20 63 68 61 72 20 2a 6e 70 75 62 2c 0a 09 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 ned.char.*npub,..const.unsigned.
0120 63 68 61 72 20 2a 6b 0a 29 3b 0a 0a 69 6e 74 20 63 72 79 70 74 6f 5f 61 65 61 64 5f 64 65 63 72 char.*k.);..int.crypto_aead_decr
0140 79 70 74 28 0a 09 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a 6d 2c 20 75 6e 73 69 67 6e 65 64 ypt(..unsigned.char.*m,.unsigned
0160 20 6c 6f 6e 67 20 6c 6f 6e 67 20 2a 6d 6c 65 6e 2c 0a 09 75 6e 73 69 67 6e 65 64 20 63 68 61 72 .long.long.*mlen,..unsigned.char
0180 20 2a 6e 73 65 63 2c 0a 09 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a 63 2c .*nsec,..const.unsigned.char.*c,
01a0 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 63 6c 65 6e 2c 0a 09 63 6f 6e 73 74 .unsigned.long.long.clen,..const
01c0 20 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a 61 64 2c 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e .unsigned.char.*ad,.unsigned.lon
01e0 67 20 6c 6f 6e 67 20 61 64 6c 65 6e 2c 0a 09 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 63 68 g.long.adlen,..const.unsigned.ch
0200 61 72 20 2a 6e 70 75 62 2c 0a 09 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a ar.*npub,..const.unsigned.char.*
0220 6b 0a 29 3b 50 4b 07 08 48 c8 7a 4d f9 01 00 00 f9 01 00 00 50 4b 03 04 14 00 08 08 00 00 00 8c k.);PK..H.zM........PK..........
0240 1b 4d 00 00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 63 72 79 70 74 6f 5f 68 61 73 68 2e 68 0a .M................crypto_hash.h.
0260 69 6e 74 20 63 72 79 70 74 6f 5f 68 61 73 68 28 0a 09 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 int.crypto_hash(..unsigned.char.
0280 2a 6f 75 74 2c 0a 09 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a 69 6e 2c 0a *out,..const.unsigned.char.*in,.
02a0 09 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 69 6e 6c 65 6e 0a 09 29 3b 50 4b 07 .unsigned.long.long.inlen..);PK.
02c0 08 88 36 aa f1 5e 00 00 00 5e 00 00 00 50 4b 03 04 14 00 08 08 00 00 00 8c 1b 4d 00 00 00 00 00 ..6..^...^...PK...........M.....
02e0 00 00 00 00 00 00 00 0d 00 00 00 67 65 6e 6b 61 74 5f 61 65 61 64 2e 63 2f 2f 0a 2f 2f 20 4e 49 ...........genkat_aead.c//.//.NI
0300 53 54 2d 64 65 76 65 6c 6f 70 65 64 20 73 6f 66 74 77 61 72 65 20 69 73 20 70 72 6f 76 69 64 65 ST-developed.software.is.provide
0320 64 20 62 79 20 4e 49 53 54 20 61 73 20 61 20 70 75 62 6c 69 63 20 73 65 72 76 69 63 65 2e 0a 2f d.by.NIST.as.a.public.service../
0340 2f 20 59 6f 75 20 6d 61 79 20 75 73 65 2c 20 63 6f 70 79 20 61 6e 64 20 64 69 73 74 72 69 62 75 /.You.may.use,.copy.and.distribu
0360 74 65 20 63 6f 70 69 65 73 20 6f 66 20 74 68 65 20 73 6f 66 74 77 61 72 65 20 69 6e 20 61 6e 79 te.copies.of.the.software.in.any
0380 20 6d 65 64 69 75 6d 2c 0a 2f 2f 20 70 72 6f 76 69 64 65 64 20 74 68 61 74 20 79 6f 75 20 6b 65 .medium,.//.provided.that.you.ke
03a0 65 70 20 69 6e 74 61 63 74 20 74 68 69 73 20 65 6e 74 69 72 65 20 6e 6f 74 69 63 65 2e 20 59 6f ep.intact.this.entire.notice..Yo
03c0 75 20 6d 61 79 20 69 6d 70 72 6f 76 65 2c 20 0a 2f 2f 20 6d 6f 64 69 66 79 20 61 6e 64 20 63 72 u.may.improve,..//.modify.and.cr
03e0 65 61 74 65 20 64 65 72 69 76 61 74 69 76 65 20 77 6f 72 6b 73 20 6f 66 20 74 68 65 20 73 6f 66 eate.derivative.works.of.the.sof
0400 74 77 61 72 65 20 6f 72 20 61 6e 79 20 70 6f 72 74 69 6f 6e 20 6f 66 0a 2f 2f 20 74 68 65 20 73 tware.or.any.portion.of.//.the.s
0420 6f 66 74 77 61 72 65 2c 20 61 6e 64 20 79 6f 75 20 6d 61 79 20 63 6f 70 79 20 61 6e 64 20 64 69 oftware,.and.you.may.copy.and.di
0440 73 74 72 69 62 75 74 65 20 73 75 63 68 20 6d 6f 64 69 66 69 63 61 74 69 6f 6e 73 20 6f 72 0a 2f stribute.such.modifications.or./
0460 2f 20 77 6f 72 6b 73 2e 20 4d 6f 64 69 66 69 65 64 20 77 6f 72 6b 73 20 73 68 6f 75 6c 64 20 63 /.works..Modified.works.should.c
0480 61 72 72 79 20 61 20 6e 6f 74 69 63 65 20 73 74 61 74 69 6e 67 20 74 68 61 74 20 79 6f 75 20 63 arry.a.notice.stating.that.you.c
04a0 68 61 6e 67 65 64 0a 2f 2f 20 74 68 65 20 73 6f 66 74 77 61 72 65 20 61 6e 64 20 73 68 6f 75 6c hanged.//.the.software.and.shoul
04c0 64 20 6e 6f 74 65 20 74 68 65 20 64 61 74 65 20 61 6e 64 20 6e 61 74 75 72 65 20 6f 66 20 61 6e d.note.the.date.and.nature.of.an
04e0 79 20 73 75 63 68 20 63 68 61 6e 67 65 2e 0a 2f 2f 20 50 6c 65 61 73 65 20 65 78 70 6c 69 63 69 y.such.change..//.Please.explici
0500 74 6c 79 20 61 63 6b 6e 6f 77 6c 65 64 67 65 20 74 68 65 20 4e 61 74 69 6f 6e 61 6c 20 49 6e 73 tly.acknowledge.the.National.Ins
0520 74 69 74 75 74 65 20 6f 66 20 53 74 61 6e 64 61 72 64 73 20 61 6e 64 20 0a 2f 2f 20 54 65 63 68 titute.of.Standards.and..//.Tech
0540 6e 6f 6c 6f 67 79 20 61 73 20 74 68 65 20 73 6f 75 72 63 65 20 6f 66 20 74 68 65 20 73 6f 66 74 nology.as.the.source.of.the.soft
0560 77 61 72 65 2e 0a 2f 2f 0a 2f 2f 20 4e 49 53 54 2d 64 65 76 65 6c 6f 70 65 64 20 73 6f 66 74 77 ware..//.//.NIST-developed.softw
0580 61 72 65 20 69 73 20 65 78 70 72 65 73 73 6c 79 20 70 72 6f 76 69 64 65 64 20 22 41 53 20 49 53 are.is.expressly.provided."AS.IS
05a0 2e 22 20 4e 49 53 54 20 4d 41 4b 45 53 20 4e 4f 20 0a 2f 2f 20 57 41 52 52 41 4e 54 59 20 4f 46 .".NIST.MAKES.NO..//.WARRANTY.OF
05c0 20 41 4e 59 20 4b 49 4e 44 2c 20 45 58 50 52 45 53 53 2c 20 49 4d 50 4c 49 45 44 2c 20 49 4e 20 .ANY.KIND,.EXPRESS,.IMPLIED,.IN.
05e0 46 41 43 54 20 4f 52 20 41 52 49 53 49 4e 47 20 42 59 20 4f 50 45 52 41 54 49 4f 4e 0a 2f 2f 20 FACT.OR.ARISING.BY.OPERATION.//.
0600 4f 46 20 4c 41 57 2c 20 49 4e 43 4c 55 44 49 4e 47 2c 20 57 49 54 48 4f 55 54 20 4c 49 4d 49 54 OF.LAW,.INCLUDING,.WITHOUT.LIMIT
0620 41 54 49 4f 4e 2c 20 54 48 45 20 49 4d 50 4c 49 45 44 20 57 41 52 52 41 4e 54 59 20 4f 46 20 4d ATION,.THE.IMPLIED.WARRANTY.OF.M
0640 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 2c 0a 2f 2f 20 46 49 54 4e 45 53 53 20 46 4f 52 20 41 ERCHANTABILITY,.//.FITNESS.FOR.A
0660 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 50 4f 53 45 2c 20 4e 4f 4e 2d 49 4e 46 52 49 4e 47 .PARTICULAR.PURPOSE,.NON-INFRING
0680 45 4d 45 4e 54 20 41 4e 44 20 44 41 54 41 20 41 43 43 55 52 41 43 59 2e 20 4e 49 53 54 0a 2f 2f EMENT.AND.DATA.ACCURACY..NIST.//
06a0 20 4e 45 49 54 48 45 52 20 52 45 50 52 45 53 45 4e 54 53 20 4e 4f 52 20 57 41 52 52 41 4e 54 53 .NEITHER.REPRESENTS.NOR.WARRANTS
06c0 20 54 48 41 54 20 54 48 45 20 4f 50 45 52 41 54 49 4f 4e 20 4f 46 20 54 48 45 20 53 4f 46 54 57 .THAT.THE.OPERATION.OF.THE.SOFTW
06e0 41 52 45 20 57 49 4c 4c 20 42 45 20 0a 2f 2f 20 55 4e 49 4e 54 45 52 52 55 50 54 45 44 20 4f 52 ARE.WILL.BE..//.UNINTERRUPTED.OR
0700 20 45 52 52 4f 52 2d 46 52 45 45 2c 20 4f 52 20 54 48 41 54 20 41 4e 59 20 44 45 46 45 43 54 53 .ERROR-FREE,.OR.THAT.ANY.DEFECTS
0720 20 57 49 4c 4c 20 42 45 20 43 4f 52 52 45 43 54 45 44 2e 20 4e 49 53 54 20 0a 2f 2f 20 44 4f 45 .WILL.BE.CORRECTED..NIST..//.DOE
0740 53 20 4e 4f 54 20 57 41 52 52 41 4e 54 20 4f 52 20 4d 41 4b 45 20 41 4e 59 20 52 45 50 52 45 53 S.NOT.WARRANT.OR.MAKE.ANY.REPRES
0760 45 4e 54 41 54 49 4f 4e 53 20 52 45 47 41 52 44 49 4e 47 20 54 48 45 20 55 53 45 20 4f 46 20 54 ENTATIONS.REGARDING.THE.USE.OF.T
0780 48 45 20 53 4f 46 54 57 41 52 45 0a 2f 2f 20 4f 52 20 54 48 45 20 52 45 53 55 4c 54 53 20 54 48 HE.SOFTWARE.//.OR.THE.RESULTS.TH
07a0 45 52 45 4f 46 2c 20 49 4e 43 4c 55 44 49 4e 47 20 42 55 54 20 4e 4f 54 20 4c 49 4d 49 54 45 44 EREOF,.INCLUDING.BUT.NOT.LIMITED
07c0 20 54 4f 20 54 48 45 20 43 4f 52 52 45 43 54 4e 45 53 53 2c 20 41 43 43 55 52 41 43 59 2c 0a 2f .TO.THE.CORRECTNESS,.ACCURACY,./
07e0 2f 20 52 45 4c 49 41 42 49 4c 49 54 59 2c 20 4f 52 20 55 53 45 46 55 4c 4e 45 53 53 20 4f 46 20 /.RELIABILITY,.OR.USEFULNESS.OF.
0800 54 48 45 20 53 4f 46 54 57 41 52 45 2e 0a 2f 2f 0a 2f 2f 20 59 6f 75 20 61 72 65 20 73 6f 6c 65 THE.SOFTWARE..//.//.You.are.sole
0820 6c 79 20 72 65 73 70 6f 6e 73 69 62 6c 65 20 66 6f 72 20 64 65 74 65 72 6d 69 6e 69 6e 67 20 74 ly.responsible.for.determining.t
0840 68 65 20 61 70 70 72 6f 70 72 69 61 74 65 6e 65 73 73 20 6f 66 20 75 73 69 6e 67 20 61 6e 64 20 he.appropriateness.of.using.and.
0860 0a 2f 2f 20 64 69 73 74 72 69 62 75 74 69 6e 67 20 74 68 65 20 73 6f 66 74 77 61 72 65 20 61 6e .//.distributing.the.software.an
0880 64 20 79 6f 75 20 61 73 73 75 6d 65 20 61 6c 6c 20 72 69 73 6b 73 20 61 73 73 6f 63 69 61 74 65 d.you.assume.all.risks.associate
08a0 64 20 77 69 74 68 20 69 74 73 20 75 73 65 2c 20 0a 2f 2f 20 69 6e 63 6c 75 64 69 6e 67 20 62 75 d.with.its.use,..//.including.bu
08c0 74 20 6e 6f 74 20 6c 69 6d 69 74 65 64 20 74 6f 20 74 68 65 20 72 69 73 6b 73 20 61 6e 64 20 63 t.not.limited.to.the.risks.and.c
08e0 6f 73 74 73 20 6f 66 20 70 72 6f 67 72 61 6d 20 65 72 72 6f 72 73 2c 20 63 6f 6d 70 6c 69 61 6e osts.of.program.errors,.complian
0900 63 65 20 0a 2f 2f 20 77 69 74 68 20 61 70 70 6c 69 63 61 62 6c 65 20 6c 61 77 73 2c 20 64 61 6d ce..//.with.applicable.laws,.dam
0920 61 67 65 20 74 6f 20 6f 72 20 6c 6f 73 73 20 6f 66 20 64 61 74 61 2c 20 70 72 6f 67 72 61 6d 73 age.to.or.loss.of.data,.programs
0940 20 6f 72 20 65 71 75 69 70 6d 65 6e 74 2c 20 61 6e 64 20 0a 2f 2f 20 74 68 65 20 75 6e 61 76 61 .or.equipment,.and..//.the.unava
0960 69 6c 61 62 69 6c 69 74 79 20 6f 72 20 69 6e 74 65 72 72 75 70 74 69 6f 6e 20 6f 66 20 6f 70 65 ilability.or.interruption.of.ope
0980 72 61 74 69 6f 6e 2e 20 54 68 69 73 20 73 6f 66 74 77 61 72 65 20 69 73 20 6e 6f 74 20 69 6e 74 ration..This.software.is.not.int
09a0 65 6e 64 65 64 0a 2f 2f 20 74 6f 20 62 65 20 75 73 65 64 20 69 6e 20 61 6e 79 20 73 69 74 75 61 ended.//.to.be.used.in.any.situa
09c0 74 69 6f 6e 20 77 68 65 72 65 20 61 20 66 61 69 6c 75 72 65 20 63 6f 75 6c 64 20 63 61 75 73 65 tion.where.a.failure.could.cause
09e0 20 72 69 73 6b 20 6f 66 20 69 6e 6a 75 72 79 20 6f 72 20 0a 2f 2f 20 64 61 6d 61 67 65 20 74 6f .risk.of.injury.or..//.damage.to
0a00 20 70 72 6f 70 65 72 74 79 2e 20 54 68 65 20 73 6f 66 74 77 61 72 65 20 64 65 76 65 6c 6f 70 65 .property..The.software.develope
0a20 64 20 62 79 20 4e 49 53 54 20 65 6d 70 6c 6f 79 65 65 73 20 69 73 20 6e 6f 74 20 73 75 62 6a 65 d.by.NIST.employees.is.not.subje
0a40 63 74 20 74 6f 0a 2f 2f 20 63 6f 70 79 72 69 67 68 74 20 70 72 6f 74 65 63 74 69 6f 6e 20 77 69 ct.to.//.copyright.protection.wi
0a60 74 68 69 6e 20 74 68 65 20 55 6e 69 74 65 64 20 53 74 61 74 65 73 2e 0a 2f 2f 0a 0a 2f 2f 20 64 thin.the.United.States..//..//.d
0a80 69 73 61 62 6c 65 20 64 65 70 72 65 63 61 74 69 6f 6e 20 66 6f 72 20 73 70 72 69 6e 74 66 20 61 isable.deprecation.for.sprintf.a
0aa0 6e 64 20 66 6f 70 65 6e 0a 23 69 66 64 65 66 20 5f 4d 53 43 5f 56 45 52 0a 23 64 65 66 69 6e 65 nd.fopen.#ifdef._MSC_VER.#define
0ac0 20 5f 43 52 54 5f 53 45 43 55 52 45 5f 4e 4f 5f 57 41 52 4e 49 4e 47 53 0a 23 65 6e 64 69 66 0a ._CRT_SECURE_NO_WARNINGS.#endif.
0ae0 0a 23 69 6e 63 6c 75 64 65 20 3c 73 74 64 69 6f 2e 68 3e 0a 23 69 6e 63 6c 75 64 65 20 3c 73 74 .#include.<stdio.h>.#include.<st
0b00 72 69 6e 67 2e 68 3e 0a 0a 23 69 6e 63 6c 75 64 65 20 22 63 72 79 70 74 6f 5f 61 65 61 64 2e 68 ring.h>..#include."crypto_aead.h
0b20 22 0a 23 69 6e 63 6c 75 64 65 20 22 61 70 69 2e 68 22 0a 0a 23 64 65 66 69 6e 65 20 4b 41 54 5f ".#include."api.h"..#define.KAT_
0b40 53 55 43 43 45 53 53 20 20 20 20 20 20 20 20 20 20 30 0a 23 64 65 66 69 6e 65 20 4b 41 54 5f 46 SUCCESS..........0.#define.KAT_F
0b60 49 4c 45 5f 4f 50 45 4e 5f 45 52 52 4f 52 20 2d 31 0a 23 64 65 66 69 6e 65 20 4b 41 54 5f 44 41 ILE_OPEN_ERROR.-1.#define.KAT_DA
0b80 54 41 5f 45 52 52 4f 52 20 20 20 20 20 20 2d 33 0a 23 64 65 66 69 6e 65 20 4b 41 54 5f 43 52 59 TA_ERROR......-3.#define.KAT_CRY
0ba0 50 54 4f 5f 46 41 49 4c 55 52 45 20 20 2d 34 0a 0a 23 64 65 66 69 6e 65 20 4d 41 58 5f 46 49 4c PTO_FAILURE..-4..#define.MAX_FIL
0bc0 45 5f 4e 41 4d 45 09 09 09 09 32 35 36 0a 23 64 65 66 69 6e 65 20 4d 41 58 5f 4d 45 53 53 41 47 E_NAME....256.#define.MAX_MESSAG
0be0 45 5f 4c 45 4e 47 54 48 09 09 09 33 32 0a 23 64 65 66 69 6e 65 20 4d 41 58 5f 41 53 53 4f 43 49 E_LENGTH...32.#define.MAX_ASSOCI
0c00 41 54 45 44 5f 44 41 54 41 5f 4c 45 4e 47 54 48 09 33 32 0a 0a 76 6f 69 64 20 69 6e 69 74 5f 62 ATED_DATA_LENGTH.32..void.init_b
0c20 75 66 66 65 72 28 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a 62 75 66 66 65 72 2c 20 75 6e 73 uffer(unsigned.char.*buffer,.uns
0c40 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 6e 75 6d 62 79 74 65 73 29 3b 0a 0a 76 6f 69 64 igned.long.long.numbytes);..void
0c60 20 66 70 72 69 6e 74 5f 62 73 74 72 28 46 49 4c 45 20 2a 66 70 2c 20 63 6f 6e 73 74 20 63 68 61 .fprint_bstr(FILE.*fp,.const.cha
0c80 72 20 2a 6c 61 62 65 6c 2c 20 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a 64 r.*label,.const.unsigned.char.*d
0ca0 61 74 61 2c 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 6c 65 6e 67 74 68 29 3b ata,.unsigned.long.long.length);
0cc0 0a 0a 69 6e 74 20 67 65 6e 65 72 61 74 65 5f 74 65 73 74 5f 76 65 63 74 6f 72 73 28 29 3b 0a 0a ..int.generate_test_vectors();..
0ce0 69 6e 74 20 6d 61 69 6e 28 29 0a 7b 0a 09 69 6e 74 20 72 65 74 20 3d 20 67 65 6e 65 72 61 74 65 int.main().{..int.ret.=.generate
0d00 5f 74 65 73 74 5f 76 65 63 74 6f 72 73 28 29 3b 0a 0a 09 69 66 20 28 72 65 74 20 21 3d 20 4b 41 _test_vectors();...if.(ret.!=.KA
0d20 54 5f 53 55 43 43 45 53 53 29 20 7b 0a 09 09 66 70 72 69 6e 74 66 28 73 74 64 65 72 72 2c 20 22 T_SUCCESS).{...fprintf(stderr,."
0d40 74 65 73 74 20 76 65 63 74 6f 72 20 67 65 6e 65 72 61 74 69 6f 6e 20 66 61 69 6c 65 64 20 77 69 test.vector.generation.failed.wi
0d60 74 68 20 63 6f 64 65 20 25 64 5c 6e 22 2c 20 72 65 74 29 3b 0a 09 7d 0a 0a 09 72 65 74 75 72 6e th.code.%d\n",.ret);..}...return
0d80 20 72 65 74 3b 0a 7d 0a 0a 69 6e 74 20 67 65 6e 65 72 61 74 65 5f 74 65 73 74 5f 76 65 63 74 6f .ret;.}..int.generate_test_vecto
0da0 72 73 28 29 0a 7b 0a 09 46 49 4c 45 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 66 70 3b rs().{..FILE................*fp;
0dc0 0a 09 63 68 61 72 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 6c 65 4e 61 6d 65 5b 4d ..char................fileName[M
0de0 41 58 5f 46 49 4c 45 5f 4e 41 4d 45 5d 3b 0a 09 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 20 20 AX_FILE_NAME];..unsigned.char...
0e00 20 20 20 20 6b 65 79 5b 43 52 59 50 54 4f 5f 4b 45 59 42 59 54 45 53 5d 3b 0a 09 75 6e 73 69 67 ....key[CRYPTO_KEYBYTES];..unsig
0e20 6e 65 64 20 63 68 61 72 09 09 6e 6f 6e 63 65 5b 43 52 59 50 54 4f 5f 4e 50 55 42 42 59 54 45 53 ned.char..nonce[CRYPTO_NPUBBYTES
0e40 5d 3b 0a 09 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 20 20 20 20 20 20 6d 73 67 5b 4d 41 58 5f ];..unsigned.char.......msg[MAX_
0e60 4d 45 53 53 41 47 45 5f 4c 45 4e 47 54 48 5d 3b 0a 09 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 MESSAGE_LENGTH];..unsigned.char.
0e80 20 20 20 20 20 20 6d 73 67 32 5b 4d 41 58 5f 4d 45 53 53 41 47 45 5f 4c 45 4e 47 54 48 5d 3b 0a ......msg2[MAX_MESSAGE_LENGTH];.
0ea0 09 75 6e 73 69 67 6e 65 64 20 63 68 61 72 09 09 61 64 5b 4d 41 58 5f 41 53 53 4f 43 49 41 54 45 .unsigned.char..ad[MAX_ASSOCIATE
0ec0 44 5f 44 41 54 41 5f 4c 45 4e 47 54 48 5d 3b 0a 09 75 6e 73 69 67 6e 65 64 20 63 68 61 72 09 09 D_DATA_LENGTH];..unsigned.char..
0ee0 63 74 5b 4d 41 58 5f 4d 45 53 53 41 47 45 5f 4c 45 4e 47 54 48 20 2b 20 43 52 59 50 54 4f 5f 41 ct[MAX_MESSAGE_LENGTH.+.CRYPTO_A
0f00 42 59 54 45 53 5d 3b 0a 09 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 20 63 6c 65 BYTES];..unsigned.long.long..cle
0f20 6e 2c 20 6d 6c 65 6e 32 3b 0a 09 69 6e 74 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 n,.mlen2;..int.................c
0f40 6f 75 6e 74 20 3d 20 31 3b 0a 09 69 6e 74 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 ount.=.1;..int.................f
0f60 75 6e 63 5f 72 65 74 2c 20 72 65 74 5f 76 61 6c 20 3d 20 4b 41 54 5f 53 55 43 43 45 53 53 3b 0a unc_ret,.ret_val.=.KAT_SUCCESS;.
0f80 0a 09 69 6e 69 74 5f 62 75 66 66 65 72 28 6b 65 79 2c 20 73 69 7a 65 6f 66 28 6b 65 79 29 29 3b ..init_buffer(key,.sizeof(key));
0fa0 0a 09 69 6e 69 74 5f 62 75 66 66 65 72 28 6e 6f 6e 63 65 2c 20 73 69 7a 65 6f 66 28 6e 6f 6e 63 ..init_buffer(nonce,.sizeof(nonc
0fc0 65 29 29 3b 0a 09 69 6e 69 74 5f 62 75 66 66 65 72 28 6d 73 67 2c 20 73 69 7a 65 6f 66 28 6d 73 e));..init_buffer(msg,.sizeof(ms
0fe0 67 29 29 3b 0a 09 69 6e 69 74 5f 62 75 66 66 65 72 28 61 64 2c 20 73 69 7a 65 6f 66 28 61 64 29 g));..init_buffer(ad,.sizeof(ad)
1000 29 3b 0a 0a 09 73 70 72 69 6e 74 66 28 66 69 6c 65 4e 61 6d 65 2c 20 22 4c 57 43 5f 41 45 41 44 );...sprintf(fileName,."LWC_AEAD
1020 5f 4b 41 54 5f 25 64 5f 25 64 2e 74 78 74 22 2c 20 28 43 52 59 50 54 4f 5f 4b 45 59 42 59 54 45 _KAT_%d_%d.txt",.(CRYPTO_KEYBYTE
1040 53 20 2a 20 38 29 2c 20 28 43 52 59 50 54 4f 5f 4e 50 55 42 42 59 54 45 53 20 2a 20 38 29 29 3b S.*.8),.(CRYPTO_NPUBBYTES.*.8));
1060 0a 0a 09 69 66 20 28 28 66 70 20 3d 20 66 6f 70 65 6e 28 66 69 6c 65 4e 61 6d 65 2c 20 22 77 22 ...if.((fp.=.fopen(fileName,."w"
1080 29 29 20 3d 3d 20 4e 55 4c 4c 29 20 7b 0a 09 09 66 70 72 69 6e 74 66 28 73 74 64 65 72 72 2c 20 )).==.NULL).{...fprintf(stderr,.
10a0 22 43 6f 75 6c 64 6e 27 74 20 6f 70 65 6e 20 3c 25 73 3e 20 66 6f 72 20 77 72 69 74 65 5c 6e 22 "Couldn't.open.<%s>.for.write\n"
10c0 2c 20 66 69 6c 65 4e 61 6d 65 29 3b 0a 09 09 72 65 74 75 72 6e 20 4b 41 54 5f 46 49 4c 45 5f 4f ,.fileName);...return.KAT_FILE_O
10e0 50 45 4e 5f 45 52 52 4f 52 3b 0a 09 7d 0a 0a 09 66 6f 72 20 28 75 6e 73 69 67 6e 65 64 20 6c 6f PEN_ERROR;..}...for.(unsigned.lo
1100 6e 67 20 6c 6f 6e 67 20 6d 6c 65 6e 20 3d 20 30 3b 20 28 6d 6c 65 6e 20 3c 3d 20 4d 41 58 5f 4d ng.long.mlen.=.0;.(mlen.<=.MAX_M
1120 45 53 53 41 47 45 5f 4c 45 4e 47 54 48 29 20 26 26 20 28 72 65 74 5f 76 61 6c 20 3d 3d 20 4b 41 ESSAGE_LENGTH).&&.(ret_val.==.KA
1140 54 5f 53 55 43 43 45 53 53 29 3b 20 6d 6c 65 6e 2b 2b 29 20 7b 0a 0a 09 09 66 6f 72 20 28 75 6e T_SUCCESS);.mlen++).{....for.(un
1160 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 61 64 6c 65 6e 20 3d 20 30 3b 20 61 64 6c 65 signed.long.long.adlen.=.0;.adle
1180 6e 20 3c 3d 20 4d 41 58 5f 41 53 53 4f 43 49 41 54 45 44 5f 44 41 54 41 5f 4c 45 4e 47 54 48 3b n.<=.MAX_ASSOCIATED_DATA_LENGTH;
11a0 20 61 64 6c 65 6e 2b 2b 29 20 7b 0a 0a 09 09 09 66 70 72 69 6e 74 66 28 66 70 2c 20 22 43 6f 75 .adlen++).{.....fprintf(fp,."Cou
11c0 6e 74 20 3d 20 25 64 5c 6e 22 2c 20 63 6f 75 6e 74 2b 2b 29 3b 0a 0a 09 09 09 66 70 72 69 6e 74 nt.=.%d\n",.count++);.....fprint
11e0 5f 62 73 74 72 28 66 70 2c 20 22 4b 65 79 20 3d 20 22 2c 20 6b 65 79 2c 20 43 52 59 50 54 4f 5f _bstr(fp,."Key.=.",.key,.CRYPTO_
1200 4b 45 59 42 59 54 45 53 29 3b 0a 0a 09 09 09 66 70 72 69 6e 74 5f 62 73 74 72 28 66 70 2c 20 22 KEYBYTES);.....fprint_bstr(fp,."
1220 4e 6f 6e 63 65 20 3d 20 22 2c 20 6e 6f 6e 63 65 2c 20 43 52 59 50 54 4f 5f 4e 50 55 42 42 59 54 Nonce.=.",.nonce,.CRYPTO_NPUBBYT
1240 45 53 29 3b 0a 0a 09 09 09 66 70 72 69 6e 74 5f 62 73 74 72 28 66 70 2c 20 22 50 54 20 3d 20 22 ES);.....fprint_bstr(fp,."PT.=."
1260 2c 20 6d 73 67 2c 20 6d 6c 65 6e 29 3b 0a 0a 09 09 09 66 70 72 69 6e 74 5f 62 73 74 72 28 66 70 ,.msg,.mlen);.....fprint_bstr(fp
1280 2c 20 22 41 44 20 3d 20 22 2c 20 61 64 2c 20 61 64 6c 65 6e 29 3b 0a 0a 09 09 09 69 66 20 28 28 ,."AD.=.",.ad,.adlen);.....if.((
12a0 66 75 6e 63 5f 72 65 74 20 3d 20 63 72 79 70 74 6f 5f 61 65 61 64 5f 65 6e 63 72 79 70 74 28 63 func_ret.=.crypto_aead_encrypt(c
12c0 74 2c 20 26 63 6c 65 6e 2c 20 6d 73 67 2c 20 6d 6c 65 6e 2c 20 61 64 2c 20 61 64 6c 65 6e 2c 20 t,.&clen,.msg,.mlen,.ad,.adlen,.
12e0 4e 55 4c 4c 2c 20 6e 6f 6e 63 65 2c 20 6b 65 79 29 29 20 21 3d 20 30 29 20 7b 0a 09 09 09 09 66 NULL,.nonce,.key)).!=.0).{.....f
1300 70 72 69 6e 74 66 28 66 70 2c 20 22 63 72 79 70 74 6f 5f 61 65 61 64 5f 65 6e 63 72 79 70 74 20 printf(fp,."crypto_aead_encrypt.
1320 72 65 74 75 72 6e 65 64 20 3c 25 64 3e 5c 6e 22 2c 20 66 75 6e 63 5f 72 65 74 29 3b 0a 09 09 09 returned.<%d>\n",.func_ret);....
1340 09 72 65 74 5f 76 61 6c 20 3d 20 4b 41 54 5f 43 52 59 50 54 4f 5f 46 41 49 4c 55 52 45 3b 0a 09 .ret_val.=.KAT_CRYPTO_FAILURE;..
1360 09 09 09 62 72 65 61 6b 3b 0a 09 09 09 7d 0a 0a 09 09 09 66 70 72 69 6e 74 5f 62 73 74 72 28 66 ...break;....}.....fprint_bstr(f
1380 70 2c 20 22 43 54 20 3d 20 22 2c 20 63 74 2c 20 63 6c 65 6e 29 3b 0a 0a 09 09 09 66 70 72 69 6e p,."CT.=.",.ct,.clen);.....fprin
13a0 74 66 28 66 70 2c 20 22 5c 6e 22 29 3b 0a 0a 09 09 09 69 66 20 28 28 66 75 6e 63 5f 72 65 74 20 tf(fp,."\n");.....if.((func_ret.
13c0 3d 20 63 72 79 70 74 6f 5f 61 65 61 64 5f 64 65 63 72 79 70 74 28 6d 73 67 32 2c 20 26 6d 6c 65 =.crypto_aead_decrypt(msg2,.&mle
13e0 6e 32 2c 20 4e 55 4c 4c 2c 20 63 74 2c 20 63 6c 65 6e 2c 20 61 64 2c 20 61 64 6c 65 6e 2c 20 6e n2,.NULL,.ct,.clen,.ad,.adlen,.n
1400 6f 6e 63 65 2c 20 6b 65 79 29 29 20 21 3d 20 30 29 20 7b 0a 09 09 09 09 66 70 72 69 6e 74 66 28 once,.key)).!=.0).{.....fprintf(
1420 66 70 2c 20 22 63 72 79 70 74 6f 5f 61 65 61 64 5f 64 65 63 72 79 70 74 20 72 65 74 75 72 6e 65 fp,."crypto_aead_decrypt.returne
1440 64 20 3c 25 64 3e 5c 6e 22 2c 20 66 75 6e 63 5f 72 65 74 29 3b 0a 09 09 09 09 72 65 74 5f 76 61 d.<%d>\n",.func_ret);.....ret_va
1460 6c 20 3d 20 4b 41 54 5f 43 52 59 50 54 4f 5f 46 41 49 4c 55 52 45 3b 0a 09 09 09 09 62 72 65 61 l.=.KAT_CRYPTO_FAILURE;.....brea
1480 6b 3b 0a 09 09 09 7d 0a 0a 09 09 09 69 66 20 28 6d 6c 65 6e 20 21 3d 20 6d 6c 65 6e 32 29 20 7b k;....}.....if.(mlen.!=.mlen2).{
14a0 0a 09 09 09 09 66 70 72 69 6e 74 66 28 66 70 2c 20 22 63 72 79 70 74 6f 5f 61 65 61 64 5f 64 65 .....fprintf(fp,."crypto_aead_de
14c0 63 72 79 70 74 20 72 65 74 75 72 6e 65 64 20 62 61 64 20 27 6d 6c 65 6e 27 3a 20 47 6f 74 20 3c crypt.returned.bad.'mlen':.Got.<
14e0 25 6c 6c 75 3e 2c 20 65 78 70 65 63 74 65 64 20 3c 25 6c 6c 75 3e 5c 6e 22 2c 20 6d 6c 65 6e 32 %llu>,.expected.<%llu>\n",.mlen2
1500 2c 20 6d 6c 65 6e 29 3b 0a 09 09 09 09 72 65 74 5f 76 61 6c 20 3d 20 4b 41 54 5f 43 52 59 50 54 ,.mlen);.....ret_val.=.KAT_CRYPT
1520 4f 5f 46 41 49 4c 55 52 45 3b 0a 09 09 09 09 62 72 65 61 6b 3b 0a 09 09 09 7d 0a 0a 09 09 09 69 O_FAILURE;.....break;....}.....i
1540 66 20 28 6d 65 6d 63 6d 70 28 6d 73 67 2c 20 6d 73 67 32 2c 20 6d 6c 65 6e 29 29 20 7b 0a 09 09 f.(memcmp(msg,.msg2,.mlen)).{...
1560 09 09 66 70 72 69 6e 74 66 28 66 70 2c 20 22 63 72 79 70 74 6f 5f 61 65 61 64 5f 64 65 63 72 79 ..fprintf(fp,."crypto_aead_decry
1580 70 74 20 64 69 64 20 6e 6f 74 20 72 65 63 6f 76 65 72 20 74 68 65 20 70 6c 61 69 6e 74 65 78 74 pt.did.not.recover.the.plaintext
15a0 5c 6e 22 29 3b 0a 09 09 09 09 72 65 74 5f 76 61 6c 20 3d 20 4b 41 54 5f 43 52 59 50 54 4f 5f 46 \n");.....ret_val.=.KAT_CRYPTO_F
15c0 41 49 4c 55 52 45 3b 0a 09 09 09 09 62 72 65 61 6b 3b 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 0a 0a AILURE;.....break;....}...}..}..
15e0 09 66 63 6c 6f 73 65 28 66 70 29 3b 0a 0a 09 72 65 74 75 72 6e 20 72 65 74 5f 76 61 6c 3b 0a 7d .fclose(fp);...return.ret_val;.}
1600 0a 0a 0a 76 6f 69 64 20 66 70 72 69 6e 74 5f 62 73 74 72 28 46 49 4c 45 20 2a 66 70 2c 20 63 6f ...void.fprint_bstr(FILE.*fp,.co
1620 6e 73 74 20 63 68 61 72 20 2a 6c 61 62 65 6c 2c 20 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 nst.char.*label,.const.unsigned.
1640 63 68 61 72 20 2a 64 61 74 61 2c 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 6c char.*data,.unsigned.long.long.l
1660 65 6e 67 74 68 29 0a 7b 20 20 20 20 0a 20 20 20 20 66 70 72 69 6e 74 66 28 66 70 2c 20 22 25 73 ength).{.........fprintf(fp,."%s
1680 22 2c 20 6c 61 62 65 6c 29 3b 0a 20 20 20 20 20 20 20 20 0a 09 66 6f 72 20 28 75 6e 73 69 67 6e ",.label);...........for.(unsign
16a0 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 69 20 3d 20 30 3b 20 69 20 3c 20 6c 65 6e 67 74 68 3b 20 ed.long.long.i.=.0;.i.<.length;.
16c0 69 2b 2b 29 0a 09 09 66 70 72 69 6e 74 66 28 66 70 2c 20 22 25 30 32 58 22 2c 20 64 61 74 61 5b i++)...fprintf(fp,."%02X",.data[
16e0 69 5d 29 3b 0a 09 20 20 20 20 0a 20 20 20 20 66 70 72 69 6e 74 66 28 66 70 2c 20 22 5c 6e 22 29 i]);...........fprintf(fp,."\n")
1700 3b 0a 7d 0a 0a 76 6f 69 64 20 69 6e 69 74 5f 62 75 66 66 65 72 28 75 6e 73 69 67 6e 65 64 20 63 ;.}..void.init_buffer(unsigned.c
1720 68 61 72 20 2a 62 75 66 66 65 72 2c 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 har.*buffer,.unsigned.long.long.
1740 6e 75 6d 62 79 74 65 73 29 0a 7b 0a 09 66 6f 72 20 28 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 numbytes).{..for.(unsigned.long.
1760 6c 6f 6e 67 20 69 20 3d 20 30 3b 20 69 20 3c 20 6e 75 6d 62 79 74 65 73 3b 20 69 2b 2b 29 0a 09 long.i.=.0;.i.<.numbytes;.i++)..
1780 09 62 75 66 66 65 72 5b 69 5d 20 3d 20 28 75 6e 73 69 67 6e 65 64 20 63 68 61 72 29 69 3b 0a 7d .buffer[i].=.(unsigned.char)i;.}
17a0 0a 50 4b 07 08 c7 90 59 59 a9 14 00 00 a9 14 00 00 50 4b 03 04 14 00 08 08 00 00 00 8c 1b 4d 00 .PK....YY........PK...........M.
17c0 00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 67 65 6e 6b 61 74 5f 68 61 73 68 2e 63 2f 2f 0a 2f ...............genkat_hash.c//./
17e0 2f 20 4e 49 53 54 2d 64 65 76 65 6c 6f 70 65 64 20 73 6f 66 74 77 61 72 65 20 69 73 20 70 72 6f /.NIST-developed.software.is.pro
1800 76 69 64 65 64 20 62 79 20 4e 49 53 54 20 61 73 20 61 20 70 75 62 6c 69 63 20 73 65 72 76 69 63 vided.by.NIST.as.a.public.servic
1820 65 2e 0a 2f 2f 20 59 6f 75 20 6d 61 79 20 75 73 65 2c 20 63 6f 70 79 20 61 6e 64 20 64 69 73 74 e..//.You.may.use,.copy.and.dist
1840 72 69 62 75 74 65 20 63 6f 70 69 65 73 20 6f 66 20 74 68 65 20 73 6f 66 74 77 61 72 65 20 69 6e ribute.copies.of.the.software.in
1860 20 61 6e 79 20 6d 65 64 69 75 6d 2c 0a 2f 2f 20 70 72 6f 76 69 64 65 64 20 74 68 61 74 20 79 6f .any.medium,.//.provided.that.yo
1880 75 20 6b 65 65 70 20 69 6e 74 61 63 74 20 74 68 69 73 20 65 6e 74 69 72 65 20 6e 6f 74 69 63 65 u.keep.intact.this.entire.notice
18a0 2e 20 59 6f 75 20 6d 61 79 20 69 6d 70 72 6f 76 65 2c 20 0a 2f 2f 20 6d 6f 64 69 66 79 20 61 6e ..You.may.improve,..//.modify.an
18c0 64 20 63 72 65 61 74 65 20 64 65 72 69 76 61 74 69 76 65 20 77 6f 72 6b 73 20 6f 66 20 74 68 65 d.create.derivative.works.of.the
18e0 20 73 6f 66 74 77 61 72 65 20 6f 72 20 61 6e 79 20 70 6f 72 74 69 6f 6e 20 6f 66 0a 2f 2f 20 74 .software.or.any.portion.of.//.t
1900 68 65 20 73 6f 66 74 77 61 72 65 2c 20 61 6e 64 20 79 6f 75 20 6d 61 79 20 63 6f 70 79 20 61 6e he.software,.and.you.may.copy.an
1920 64 20 64 69 73 74 72 69 62 75 74 65 20 73 75 63 68 20 6d 6f 64 69 66 69 63 61 74 69 6f 6e 73 20 d.distribute.such.modifications.
1940 6f 72 0a 2f 2f 20 77 6f 72 6b 73 2e 20 4d 6f 64 69 66 69 65 64 20 77 6f 72 6b 73 20 73 68 6f 75 or.//.works..Modified.works.shou
1960 6c 64 20 63 61 72 72 79 20 61 20 6e 6f 74 69 63 65 20 73 74 61 74 69 6e 67 20 74 68 61 74 20 79 ld.carry.a.notice.stating.that.y
1980 6f 75 20 63 68 61 6e 67 65 64 0a 2f 2f 20 74 68 65 20 73 6f 66 74 77 61 72 65 20 61 6e 64 20 73 ou.changed.//.the.software.and.s
19a0 68 6f 75 6c 64 20 6e 6f 74 65 20 74 68 65 20 64 61 74 65 20 61 6e 64 20 6e 61 74 75 72 65 20 6f hould.note.the.date.and.nature.o
19c0 66 20 61 6e 79 20 73 75 63 68 20 63 68 61 6e 67 65 2e 0a 2f 2f 20 50 6c 65 61 73 65 20 65 78 70 f.any.such.change..//.Please.exp
19e0 6c 69 63 69 74 6c 79 20 61 63 6b 6e 6f 77 6c 65 64 67 65 20 74 68 65 20 4e 61 74 69 6f 6e 61 6c licitly.acknowledge.the.National
1a00 20 49 6e 73 74 69 74 75 74 65 20 6f 66 20 53 74 61 6e 64 61 72 64 73 20 61 6e 64 20 0a 2f 2f 20 .Institute.of.Standards.and..//.
1a20 54 65 63 68 6e 6f 6c 6f 67 79 20 61 73 20 74 68 65 20 73 6f 75 72 63 65 20 6f 66 20 74 68 65 20 Technology.as.the.source.of.the.
1a40 73 6f 66 74 77 61 72 65 2e 0a 2f 2f 0a 2f 2f 20 4e 49 53 54 2d 64 65 76 65 6c 6f 70 65 64 20 73 software..//.//.NIST-developed.s
1a60 6f 66 74 77 61 72 65 20 69 73 20 65 78 70 72 65 73 73 6c 79 20 70 72 6f 76 69 64 65 64 20 22 41 oftware.is.expressly.provided."A
1a80 53 20 49 53 2e 22 20 4e 49 53 54 20 4d 41 4b 45 53 20 4e 4f 20 0a 2f 2f 20 57 41 52 52 41 4e 54 S.IS.".NIST.MAKES.NO..//.WARRANT
1aa0 59 20 4f 46 20 41 4e 59 20 4b 49 4e 44 2c 20 45 58 50 52 45 53 53 2c 20 49 4d 50 4c 49 45 44 2c Y.OF.ANY.KIND,.EXPRESS,.IMPLIED,
1ac0 20 49 4e 20 46 41 43 54 20 4f 52 20 41 52 49 53 49 4e 47 20 42 59 20 4f 50 45 52 41 54 49 4f 4e .IN.FACT.OR.ARISING.BY.OPERATION
1ae0 0a 2f 2f 20 4f 46 20 4c 41 57 2c 20 49 4e 43 4c 55 44 49 4e 47 2c 20 57 49 54 48 4f 55 54 20 4c .//.OF.LAW,.INCLUDING,.WITHOUT.L
1b00 49 4d 49 54 41 54 49 4f 4e 2c 20 54 48 45 20 49 4d 50 4c 49 45 44 20 57 41 52 52 41 4e 54 59 20 IMITATION,.THE.IMPLIED.WARRANTY.
1b20 4f 46 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 2c 0a 2f 2f 20 46 49 54 4e 45 53 53 20 46 OF.MERCHANTABILITY,.//.FITNESS.F
1b40 4f 52 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 50 4f 53 45 2c 20 4e 4f 4e 2d 49 4e 46 OR.A.PARTICULAR.PURPOSE,.NON-INF
1b60 52 49 4e 47 45 4d 45 4e 54 20 41 4e 44 20 44 41 54 41 20 41 43 43 55 52 41 43 59 2e 20 4e 49 53 RINGEMENT.AND.DATA.ACCURACY..NIS
1b80 54 0a 2f 2f 20 4e 45 49 54 48 45 52 20 52 45 50 52 45 53 45 4e 54 53 20 4e 4f 52 20 57 41 52 52 T.//.NEITHER.REPRESENTS.NOR.WARR
1ba0 41 4e 54 53 20 54 48 41 54 20 54 48 45 20 4f 50 45 52 41 54 49 4f 4e 20 4f 46 20 54 48 45 20 53 ANTS.THAT.THE.OPERATION.OF.THE.S
1bc0 4f 46 54 57 41 52 45 20 57 49 4c 4c 20 42 45 20 0a 2f 2f 20 55 4e 49 4e 54 45 52 52 55 50 54 45 OFTWARE.WILL.BE..//.UNINTERRUPTE
1be0 44 20 4f 52 20 45 52 52 4f 52 2d 46 52 45 45 2c 20 4f 52 20 54 48 41 54 20 41 4e 59 20 44 45 46 D.OR.ERROR-FREE,.OR.THAT.ANY.DEF
1c00 45 43 54 53 20 57 49 4c 4c 20 42 45 20 43 4f 52 52 45 43 54 45 44 2e 20 4e 49 53 54 20 0a 2f 2f ECTS.WILL.BE.CORRECTED..NIST..//
1c20 20 44 4f 45 53 20 4e 4f 54 20 57 41 52 52 41 4e 54 20 4f 52 20 4d 41 4b 45 20 41 4e 59 20 52 45 .DOES.NOT.WARRANT.OR.MAKE.ANY.RE
1c40 50 52 45 53 45 4e 54 41 54 49 4f 4e 53 20 52 45 47 41 52 44 49 4e 47 20 54 48 45 20 55 53 45 20 PRESENTATIONS.REGARDING.THE.USE.
1c60 4f 46 20 54 48 45 20 53 4f 46 54 57 41 52 45 0a 2f 2f 20 4f 52 20 54 48 45 20 52 45 53 55 4c 54 OF.THE.SOFTWARE.//.OR.THE.RESULT
1c80 53 20 54 48 45 52 45 4f 46 2c 20 49 4e 43 4c 55 44 49 4e 47 20 42 55 54 20 4e 4f 54 20 4c 49 4d S.THEREOF,.INCLUDING.BUT.NOT.LIM
1ca0 49 54 45 44 20 54 4f 20 54 48 45 20 43 4f 52 52 45 43 54 4e 45 53 53 2c 20 41 43 43 55 52 41 43 ITED.TO.THE.CORRECTNESS,.ACCURAC
1cc0 59 2c 0a 2f 2f 20 52 45 4c 49 41 42 49 4c 49 54 59 2c 20 4f 52 20 55 53 45 46 55 4c 4e 45 53 53 Y,.//.RELIABILITY,.OR.USEFULNESS
1ce0 20 4f 46 20 54 48 45 20 53 4f 46 54 57 41 52 45 2e 0a 2f 2f 0a 2f 2f 20 59 6f 75 20 61 72 65 20 .OF.THE.SOFTWARE..//.//.You.are.
1d00 73 6f 6c 65 6c 79 20 72 65 73 70 6f 6e 73 69 62 6c 65 20 66 6f 72 20 64 65 74 65 72 6d 69 6e 69 solely.responsible.for.determini
1d20 6e 67 20 74 68 65 20 61 70 70 72 6f 70 72 69 61 74 65 6e 65 73 73 20 6f 66 20 75 73 69 6e 67 20 ng.the.appropriateness.of.using.
1d40 61 6e 64 20 0a 2f 2f 20 64 69 73 74 72 69 62 75 74 69 6e 67 20 74 68 65 20 73 6f 66 74 77 61 72 and..//.distributing.the.softwar
1d60 65 20 61 6e 64 20 79 6f 75 20 61 73 73 75 6d 65 20 61 6c 6c 20 72 69 73 6b 73 20 61 73 73 6f 63 e.and.you.assume.all.risks.assoc
1d80 69 61 74 65 64 20 77 69 74 68 20 69 74 73 20 75 73 65 2c 20 0a 2f 2f 20 69 6e 63 6c 75 64 69 6e iated.with.its.use,..//.includin
1da0 67 20 62 75 74 20 6e 6f 74 20 6c 69 6d 69 74 65 64 20 74 6f 20 74 68 65 20 72 69 73 6b 73 20 61 g.but.not.limited.to.the.risks.a
1dc0 6e 64 20 63 6f 73 74 73 20 6f 66 20 70 72 6f 67 72 61 6d 20 65 72 72 6f 72 73 2c 20 63 6f 6d 70 nd.costs.of.program.errors,.comp
1de0 6c 69 61 6e 63 65 20 0a 2f 2f 20 77 69 74 68 20 61 70 70 6c 69 63 61 62 6c 65 20 6c 61 77 73 2c liance..//.with.applicable.laws,
1e00 20 64 61 6d 61 67 65 20 74 6f 20 6f 72 20 6c 6f 73 73 20 6f 66 20 64 61 74 61 2c 20 70 72 6f 67 .damage.to.or.loss.of.data,.prog
1e20 72 61 6d 73 20 6f 72 20 65 71 75 69 70 6d 65 6e 74 2c 20 61 6e 64 20 0a 2f 2f 20 74 68 65 20 75 rams.or.equipment,.and..//.the.u
1e40 6e 61 76 61 69 6c 61 62 69 6c 69 74 79 20 6f 72 20 69 6e 74 65 72 72 75 70 74 69 6f 6e 20 6f 66 navailability.or.interruption.of
1e60 20 6f 70 65 72 61 74 69 6f 6e 2e 20 54 68 69 73 20 73 6f 66 74 77 61 72 65 20 69 73 20 6e 6f 74 .operation..This.software.is.not
1e80 20 69 6e 74 65 6e 64 65 64 0a 2f 2f 20 74 6f 20 62 65 20 75 73 65 64 20 69 6e 20 61 6e 79 20 73 .intended.//.to.be.used.in.any.s
1ea0 69 74 75 61 74 69 6f 6e 20 77 68 65 72 65 20 61 20 66 61 69 6c 75 72 65 20 63 6f 75 6c 64 20 63 ituation.where.a.failure.could.c
1ec0 61 75 73 65 20 72 69 73 6b 20 6f 66 20 69 6e 6a 75 72 79 20 6f 72 20 0a 2f 2f 20 64 61 6d 61 67 ause.risk.of.injury.or..//.damag
1ee0 65 20 74 6f 20 70 72 6f 70 65 72 74 79 2e 20 54 68 65 20 73 6f 66 74 77 61 72 65 20 64 65 76 65 e.to.property..The.software.deve
1f00 6c 6f 70 65 64 20 62 79 20 4e 49 53 54 20 65 6d 70 6c 6f 79 65 65 73 20 69 73 20 6e 6f 74 20 73 loped.by.NIST.employees.is.not.s
1f20 75 62 6a 65 63 74 20 74 6f 0a 2f 2f 20 63 6f 70 79 72 69 67 68 74 20 70 72 6f 74 65 63 74 69 6f ubject.to.//.copyright.protectio
1f40 6e 20 77 69 74 68 69 6e 20 74 68 65 20 55 6e 69 74 65 64 20 53 74 61 74 65 73 2e 0a 2f 2f 0a 0a n.within.the.United.States..//..
1f60 2f 2f 20 64 69 73 61 62 6c 65 20 64 65 70 72 65 63 61 74 69 6f 6e 20 66 6f 72 20 73 70 72 69 6e //.disable.deprecation.for.sprin
1f80 74 66 20 61 6e 64 20 66 6f 70 65 6e 0a 23 69 66 64 65 66 20 5f 4d 53 43 5f 56 45 52 0a 23 64 65 tf.and.fopen.#ifdef._MSC_VER.#de
1fa0 66 69 6e 65 20 5f 43 52 54 5f 53 45 43 55 52 45 5f 4e 4f 5f 57 41 52 4e 49 4e 47 53 0a 23 65 6e fine._CRT_SECURE_NO_WARNINGS.#en
1fc0 64 69 66 0a 0a 23 69 6e 63 6c 75 64 65 20 3c 73 74 64 69 6f 2e 68 3e 0a 23 69 6e 63 6c 75 64 65 dif..#include.<stdio.h>.#include
1fe0 20 3c 73 74 72 69 6e 67 2e 68 3e 0a 0a 23 69 6e 63 6c 75 64 65 20 22 63 72 79 70 74 6f 5f 68 61 .<string.h>..#include."crypto_ha
2000 73 68 2e 68 22 0a 23 69 6e 63 6c 75 64 65 20 22 61 70 69 2e 68 22 0a 0a 23 64 65 66 69 6e 65 20 sh.h".#include."api.h"..#define.
2020 4b 41 54 5f 53 55 43 43 45 53 53 20 20 20 20 20 20 20 20 20 20 30 0a 23 64 65 66 69 6e 65 20 4b KAT_SUCCESS..........0.#define.K
2040 41 54 5f 46 49 4c 45 5f 4f 50 45 4e 5f 45 52 52 4f 52 20 2d 31 0a 23 64 65 66 69 6e 65 20 4b 41 AT_FILE_OPEN_ERROR.-1.#define.KA
2060 54 5f 44 41 54 41 5f 45 52 52 4f 52 20 20 20 20 20 20 2d 33 0a 23 64 65 66 69 6e 65 20 4b 41 54 T_DATA_ERROR......-3.#define.KAT
2080 5f 43 52 59 50 54 4f 5f 46 41 49 4c 55 52 45 20 20 2d 34 0a 0a 23 64 65 66 69 6e 65 20 4d 41 58 _CRYPTO_FAILURE..-4..#define.MAX
20a0 5f 46 49 4c 45 5f 4e 41 4d 45 09 09 09 09 32 35 36 0a 23 64 65 66 69 6e 65 20 4d 41 58 5f 4d 45 _FILE_NAME....256.#define.MAX_ME
20c0 53 53 41 47 45 5f 4c 45 4e 47 54 48 09 09 09 31 30 32 34 0a 0a 76 6f 69 64 20 69 6e 69 74 5f 62 SSAGE_LENGTH...1024..void.init_b
20e0 75 66 66 65 72 28 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a 62 75 66 66 65 72 2c 20 75 6e 73 uffer(unsigned.char.*buffer,.uns
2100 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 6e 75 6d 62 79 74 65 73 29 3b 0a 0a 76 6f 69 64 igned.long.long.numbytes);..void
2120 20 66 70 72 69 6e 74 5f 62 73 74 72 28 46 49 4c 45 20 2a 66 70 2c 20 63 6f 6e 73 74 20 63 68 61 .fprint_bstr(FILE.*fp,.const.cha
2140 72 20 2a 6c 61 62 65 6c 2c 20 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 2a 64 r.*label,.const.unsigned.char.*d
2160 61 74 61 2c 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 6c 65 6e 67 74 68 29 3b ata,.unsigned.long.long.length);
2180 0a 0a 69 6e 74 20 67 65 6e 65 72 61 74 65 5f 74 65 73 74 5f 76 65 63 74 6f 72 73 28 29 3b 0a 0a ..int.generate_test_vectors();..
21a0 0a 69 6e 74 20 6d 61 69 6e 28 29 0a 7b 0a 09 69 6e 74 20 72 65 74 20 3d 20 67 65 6e 65 72 61 74 .int.main().{..int.ret.=.generat
21c0 65 5f 74 65 73 74 5f 76 65 63 74 6f 72 73 28 29 3b 0a 0a 09 69 66 20 28 72 65 74 20 21 3d 20 4b e_test_vectors();...if.(ret.!=.K
21e0 41 54 5f 53 55 43 43 45 53 53 29 20 7b 0a 09 09 66 70 72 69 6e 74 66 28 73 74 64 65 72 72 2c 20 AT_SUCCESS).{...fprintf(stderr,.
2200 22 74 65 73 74 20 76 65 63 74 6f 72 20 67 65 6e 65 72 61 74 69 6f 6e 20 66 61 69 6c 65 64 20 77 "test.vector.generation.failed.w
2220 69 74 68 20 63 6f 64 65 20 25 64 5c 6e 22 2c 20 72 65 74 29 3b 0a 09 7d 0a 0a 09 72 65 74 75 72 ith.code.%d\n",.ret);..}...retur
2240 6e 20 72 65 74 3b 0a 7d 0a 0a 69 6e 74 20 67 65 6e 65 72 61 74 65 5f 74 65 73 74 5f 76 65 63 74 n.ret;.}..int.generate_test_vect
2260 6f 72 73 28 29 0a 7b 0a 09 46 49 4c 45 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2a 66 70 ors().{..FILE................*fp
2280 3b 0a 09 63 68 61 72 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 6c 65 4e 61 6d 65 5b ;..char................fileName[
22a0 4d 41 58 5f 46 49 4c 45 5f 4e 41 4d 45 5d 3b 0a 09 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 20 MAX_FILE_NAME];..unsigned.char..
22c0 20 20 20 20 20 6d 73 67 5b 4d 41 58 5f 4d 45 53 53 41 47 45 5f 4c 45 4e 47 54 48 5d 3b 0a 09 75 .....msg[MAX_MESSAGE_LENGTH];..u
22e0 6e 73 69 67 6e 65 64 20 63 68 61 72 09 09 64 69 67 65 73 74 5b 43 52 59 50 54 4f 5f 42 59 54 45 nsigned.char..digest[CRYPTO_BYTE
2300 53 5d 3b 0a 09 69 6e 74 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 5f 76 61 6c S];..int.................ret_val
2320 20 3d 20 4b 41 54 5f 53 55 43 43 45 53 53 3b 0a 09 69 6e 74 09 09 09 09 09 63 6f 75 6e 74 20 3d .=.KAT_SUCCESS;..int.....count.=
2340 20 31 3b 0a 0a 09 69 6e 69 74 5f 62 75 66 66 65 72 28 6d 73 67 2c 20 73 69 7a 65 6f 66 28 6d 73 .1;...init_buffer(msg,.sizeof(ms
2360 67 29 29 3b 0a 0a 09 73 70 72 69 6e 74 66 28 66 69 6c 65 4e 61 6d 65 2c 20 22 4c 57 43 5f 48 41 g));...sprintf(fileName,."LWC_HA
2380 53 48 5f 4b 41 54 5f 25 64 2e 74 78 74 22 2c 20 28 43 52 59 50 54 4f 5f 42 59 54 45 53 20 2a 20 SH_KAT_%d.txt",.(CRYPTO_BYTES.*.
23a0 38 29 29 3b 0a 0a 09 69 66 20 28 28 66 70 20 3d 20 66 6f 70 65 6e 28 66 69 6c 65 4e 61 6d 65 2c 8));...if.((fp.=.fopen(fileName,
23c0 20 22 77 22 29 29 20 3d 3d 20 4e 55 4c 4c 29 20 7b 0a 09 09 66 70 72 69 6e 74 66 28 73 74 64 65 ."w")).==.NULL).{...fprintf(stde
23e0 72 72 2c 20 22 43 6f 75 6c 64 6e 27 74 20 6f 70 65 6e 20 3c 25 73 3e 20 66 6f 72 20 77 72 69 74 rr,."Couldn't.open.<%s>.for.writ
2400 65 5c 6e 22 2c 20 66 69 6c 65 4e 61 6d 65 29 3b 0a 09 09 72 65 74 75 72 6e 20 4b 41 54 5f 46 49 e\n",.fileName);...return.KAT_FI
2420 4c 45 5f 4f 50 45 4e 5f 45 52 52 4f 52 3b 0a 09 7d 0a 0a 09 66 6f 72 20 28 75 6e 73 69 67 6e 65 LE_OPEN_ERROR;..}...for.(unsigne
2440 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 6d 6c 65 6e 20 3d 20 30 3b 20 6d 6c 65 6e 20 3c 3d 20 4d 41 d.long.long.mlen.=.0;.mlen.<=.MA
2460 58 5f 4d 45 53 53 41 47 45 5f 4c 45 4e 47 54 48 3b 20 6d 6c 65 6e 2b 2b 29 20 7b 0a 0a 09 09 66 X_MESSAGE_LENGTH;.mlen++).{....f
2480 70 72 69 6e 74 66 28 66 70 2c 20 22 43 6f 75 6e 74 20 3d 20 25 64 5c 6e 22 2c 20 63 6f 75 6e 74 printf(fp,."Count.=.%d\n",.count
24a0 2b 2b 29 3b 0a 0a 09 09 66 70 72 69 6e 74 5f 62 73 74 72 28 66 70 2c 20 22 4d 73 67 20 3d 20 22 ++);....fprint_bstr(fp,."Msg.=."
24c0 2c 20 6d 73 67 2c 20 6d 6c 65 6e 29 3b 0a 0a 09 09 72 65 74 5f 76 61 6c 20 3d 20 63 72 79 70 74 ,.msg,.mlen);....ret_val.=.crypt
24e0 6f 5f 68 61 73 68 28 64 69 67 65 73 74 2c 20 6d 73 67 2c 20 6d 6c 65 6e 29 3b 0a 09 09 0a 09 09 o_hash(digest,.msg,.mlen);......
2500 69 66 28 72 65 74 5f 76 61 6c 20 21 3d 20 30 29 20 7b 0a 09 09 09 66 70 72 69 6e 74 66 28 66 70 if(ret_val.!=.0).{....fprintf(fp
2520 2c 20 22 63 72 79 70 74 6f 5f 68 61 73 68 20 72 65 74 75 72 6e 65 64 20 3c 25 64 3e 5c 6e 22 2c ,."crypto_hash.returned.<%d>\n",
2540 20 72 65 74 5f 76 61 6c 29 3b 0a 09 09 09 72 65 74 5f 76 61 6c 20 3d 20 4b 41 54 5f 43 52 59 50 .ret_val);....ret_val.=.KAT_CRYP
2560 54 4f 5f 46 41 49 4c 55 52 45 3b 0a 09 09 09 62 72 65 61 6b 3b 0a 09 09 7d 0a 0a 09 09 66 70 72 TO_FAILURE;....break;...}....fpr
2580 69 6e 74 5f 62 73 74 72 28 66 70 2c 20 22 4d 44 20 3d 20 22 2c 20 64 69 67 65 73 74 2c 20 43 52 int_bstr(fp,."MD.=.",.digest,.CR
25a0 59 50 54 4f 5f 42 59 54 45 53 29 3b 0a 0a 09 09 66 70 72 69 6e 74 66 28 66 70 2c 20 22 5c 6e 22 YPTO_BYTES);....fprintf(fp,."\n"
25c0 29 3b 0a 09 7d 0a 0a 09 66 63 6c 6f 73 65 28 66 70 29 3b 0a 0a 09 72 65 74 75 72 6e 20 72 65 74 );..}...fclose(fp);...return.ret
25e0 5f 76 61 6c 3b 0a 7d 0a 0a 76 6f 69 64 20 66 70 72 69 6e 74 5f 62 73 74 72 28 46 49 4c 45 20 2a _val;.}..void.fprint_bstr(FILE.*
2600 66 70 2c 20 63 6f 6e 73 74 20 63 68 61 72 20 2a 6c 61 62 65 6c 2c 20 63 6f 6e 73 74 20 75 6e 73 fp,.const.char.*label,.const.uns
2620 69 67 6e 65 64 20 63 68 61 72 20 2a 64 61 74 61 2c 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 igned.char.*data,.unsigned.long.
2640 6c 6f 6e 67 20 6c 65 6e 67 74 68 29 0a 7b 20 20 20 20 0a 20 20 20 20 66 70 72 69 6e 74 66 28 66 long.length).{.........fprintf(f
2660 70 2c 20 22 25 73 22 2c 20 6c 61 62 65 6c 29 3b 0a 20 20 20 20 20 20 20 20 0a 09 66 6f 72 20 28 p,."%s",.label);...........for.(
2680 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 6c 6f 6e 67 20 69 20 3d 20 30 3b 20 69 20 3c 20 6c 65 unsigned.long.long.i.=.0;.i.<.le
26a0 6e 67 74 68 3b 20 69 2b 2b 29 0a 09 09 66 70 72 69 6e 74 66 28 66 70 2c 20 22 25 30 32 58 22 2c ngth;.i++)...fprintf(fp,."%02X",
26c0 20 64 61 74 61 5b 69 5d 29 3b 0a 09 20 20 20 20 0a 20 20 20 20 66 70 72 69 6e 74 66 28 66 70 2c .data[i]);...........fprintf(fp,
26e0 20 22 5c 6e 22 29 3b 0a 7d 0a 0a 76 6f 69 64 20 69 6e 69 74 5f 62 75 66 66 65 72 28 75 6e 73 69 ."\n");.}..void.init_buffer(unsi
2700 67 6e 65 64 20 63 68 61 72 20 2a 62 75 66 66 65 72 2c 20 75 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 gned.char.*buffer,.unsigned.long
2720 20 6c 6f 6e 67 20 6e 75 6d 62 79 74 65 73 29 0a 7b 0a 09 66 6f 72 20 28 75 6e 73 69 67 6e 65 64 .long.numbytes).{..for.(unsigned
2740 20 6c 6f 6e 67 20 6c 6f 6e 67 20 69 20 3d 20 30 3b 20 69 20 3c 20 6e 75 6d 62 79 74 65 73 3b 20 .long.long.i.=.0;.i.<.numbytes;.
2760 69 2b 2b 29 0a 09 09 62 75 66 66 65 72 5b 69 5d 20 3d 20 28 75 6e 73 69 67 6e 65 64 20 63 68 61 i++)...buffer[i].=.(unsigned.cha
2780 72 29 69 3b 0a 7d 0a 50 4b 07 08 e9 a7 98 24 ab 0f 00 00 ab 0f 00 00 50 4b 01 02 14 00 14 00 08 r)i;.}.PK.....$........PK.......
27a0 08 00 00 00 8c 1b 4d 48 c8 7a 4d f9 01 00 00 f9 01 00 00 0d 00 00 00 00 00 00 00 00 00 00 00 00 ......MH.zM.....................
27c0 00 00 00 00 00 63 72 79 70 74 6f 5f 61 65 61 64 2e 68 50 4b 01 02 14 00 14 00 08 08 00 00 00 8c .....crypto_aead.hPK............
27e0 1b 4d 88 36 aa f1 5e 00 00 00 5e 00 00 00 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 34 02 00 00 .M.6..^...^.................4...
2800 63 72 79 70 74 6f 5f 68 61 73 68 2e 68 50 4b 01 02 14 00 14 00 08 08 00 00 00 8c 1b 4d c7 90 59 crypto_hash.hPK.............M..Y
2820 59 a9 14 00 00 a9 14 00 00 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 cd 02 00 00 67 65 6e 6b 61 Y..........................genka
2840 74 5f 61 65 61 64 2e 63 50 4b 01 02 14 00 14 00 08 08 00 00 00 8c 1b 4d e9 a7 98 24 ab 0f 00 00 t_aead.cPK.............M...$....
2860 ab 0f 00 00 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 b1 17 00 00 67 65 6e 6b 61 74 5f 68 61 73 ......................genkat_has
2880 68 2e 63 50 4b 05 06 00 00 00 00 04 00 04 00 ec 00 00 00 97 27 00 00 00 00 h.cPK...............'....