From c44880635c6c6f8b7b026c79ae5ec1e49e38541c Mon Sep 17 00:00:00 2001 From: areviu Date: Sun, 25 Mar 2018 09:16:57 +0000 Subject: added gcm for sama crypto git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11851 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- test/crypto/source/testref/ref_gcm.h | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 test/crypto/source/testref/ref_gcm.h (limited to 'test/crypto/source/testref/ref_gcm.h') diff --git a/test/crypto/source/testref/ref_gcm.h b/test/crypto/source/testref/ref_gcm.h new file mode 100644 index 000000000..cc2d43544 --- /dev/null +++ b/test/crypto/source/testref/ref_gcm.h @@ -0,0 +1,82 @@ +#ifndef TEST_REF_GCM_H_ +#define TEST_REF_GCM_H_ + + + +#define K3_LEN 16 +#define P3_LEN 16 +#define IV3_LEN (12+4) +#define AAD3_LEN 16 +#define C3_LEN 16 +#define T3_LEN 16 + +extern const uint8_t K3[K3_LEN]; +extern const uint8_t IV3[IV3_LEN]; +extern const uint8_t P3[P3_LEN]; +extern const uint8_t A3[AAD3_LEN]; +extern const uint8_t C3[C3_LEN]; +extern const uint8_t T3[T3_LEN]; + +/////// +// http://csrc.nist.gov/groups/STM/cavp/gcmtestvectors.zip gcmEncryptExtIV128.rsp +// [Keylen = 128] +// [IVlen = 96] +// [PTlen = 256] +// [AADlen = 128] +// [Taglen = 128] +// Count = 0 +// K = 298efa1ccf29cf62ae6824bfc19557fc +// IV = 6f58a93fe1d207fae4ed2f6d +// P = cc38bccd6bc536ad919b1395f5d63801f99f8068d65ca5ac63872daf16b93901 +// AAD = 021fafd238463973ffe80256e5b1c6b1 +// C = dfce4e9cd291103d7fe4e63351d9e79d3dfd391e3267104658212da96521b7db +// T = 542465ef599316f73a7a560509a2d9f2 +/////// +#define K4_LEN 16 +#define P4_LEN 32 +#define IV4_LEN (12+4) +#define AAD4_LEN 16 +#define C4_LEN 32 +#define T4_LEN 16 + +extern const uint8_t K4[K4_LEN] ; +extern const uint8_t IV4[IV4_LEN]; +extern const uint8_t P4[P4_LEN] ; +extern const uint8_t A4[AAD4_LEN] ; +extern const uint8_t C4[C4_LEN] ; +extern const uint8_t T4[T4_LEN] ; + +/////// +// http://csrc.nist.gov/groups/STM/cavp/gcmtestvectors.zip gcmEncryptExtIV128.rsp +// [Keylen = 128] +// [IVlen = 96] +// [PTlen = 256] +// [AADlen = 128] +// [Taglen = 128] +// Count = 0 +// K = 298efa1ccf29cf62ae6824bfc19557fc +// IV = 6f58a93fe1d207fae4ed2f6d +// P = cc38bccd6bc536ad919b1395f5d63801f99f8068d65ca5ac63872daf16b93901 +// AAD = 021fafd238463973ffe80256e5b1c6b1 +// C = dfce4e9cd291103d7fe4e63351d9e79d3dfd391e3267104658212da96521b7db +// T = 542465ef599316f73a7a560509a2d9f2 +/////// +#define K5_LEN 16 +#define P5_LEN 32 +#define IV5_LEN (12+4) +#define AAD5_LEN 16 +#define C5_LEN 32 +#define T5_LEN 16 + +extern const uint8_t K5[K5_LEN] ; +extern const uint8_t IV5[IV5_LEN]; +extern const uint8_t P5[P5_LEN] ; +extern const uint8_t A5[AAD5_LEN] ; +extern const uint8_t C5[C5_LEN] ; +extern const uint8_t T5[T5_LEN] ; + + + + + +#endif //TEST_REF_GCM_H_ -- cgit v1.2.3