test-milenage.c 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. #include "includes.h"
  2. #include "common.h"
  3. #include "crypto/aes_wrap.h"
  4. #include "crypto/milenage.h"
  5. /**
  6. * milenage_opc - Determine OPc from OP and K
  7. * @op: OP = 128-bit operator variant algorithm configuration field
  8. * @k: K = 128-bit subscriber key
  9. * @opc: Buffer for OPc = 128-bit value derived from OP and K
  10. */
  11. static int milenage_opc(const u8 *op, const u8 *k, u8 *opc)
  12. {
  13. int i;
  14. /* OP_C = OP XOR E_K(OP) */
  15. if (aes_128_encrypt_block(k, op, opc) < 0)
  16. return -1;
  17. for (i = 0; i < 16; i++)
  18. opc[i] ^= op[i];
  19. return 0;
  20. }
  21. struct gsm_milenage_test_set {
  22. u8 ki[16];
  23. u8 rand[16];
  24. u8 opc[16];
  25. u8 sres1[4];
  26. u8 sres2[4];
  27. u8 kc[8];
  28. };
  29. static const struct gsm_milenage_test_set gsm_test_sets[] =
  30. {
  31. {
  32. /* 3GPP TS 55.205 v6.0.0 - Test Set 1 */
  33. { 0x46, 0x5b, 0x5c, 0xe8, 0xb1, 0x99, 0xb4, 0x9f,
  34. 0xaa, 0x5f, 0x0a, 0x2e, 0xe2, 0x38, 0xa6, 0xbc },
  35. { 0x23, 0x55, 0x3c, 0xbe, 0x96, 0x37, 0xa8, 0x9d,
  36. 0x21, 0x8a, 0xe6, 0x4d, 0xae, 0x47, 0xbf, 0x35 },
  37. { 0xcd, 0x63, 0xcb, 0x71, 0x95, 0x4a, 0x9f, 0x4e,
  38. 0x48, 0xa5, 0x99, 0x4e, 0x37, 0xa0, 0x2b, 0xaf },
  39. { 0x46, 0xf8, 0x41, 0x6a },
  40. { 0xa5, 0x42, 0x11, 0xd5 },
  41. { 0xea, 0xe4, 0xbe, 0x82, 0x3a, 0xf9, 0xa0, 0x8b }
  42. }, {
  43. /* 3GPP TS 55.205 v6.0.0 - Test Set 2 */
  44. { 0xfe, 0xc8, 0x6b, 0xa6, 0xeb, 0x70, 0x7e, 0xd0,
  45. 0x89, 0x05, 0x75, 0x7b, 0x1b, 0xb4, 0x4b, 0x8f },
  46. { 0x9f, 0x7c, 0x8d, 0x02, 0x1a, 0xcc, 0xf4, 0xdb,
  47. 0x21, 0x3c, 0xcf, 0xf0, 0xc7, 0xf7, 0x1a, 0x6a },
  48. { 0x10, 0x06, 0x02, 0x0f, 0x0a, 0x47, 0x8b, 0xf6,
  49. 0xb6, 0x99, 0xf1, 0x5c, 0x06, 0x2e, 0x42, 0xb3 },
  50. { 0x8c, 0x30, 0x8a, 0x5e },
  51. { 0x80, 0x11, 0xc4, 0x8c },
  52. { 0xaa, 0x01, 0x73, 0x9b, 0x8c, 0xaa, 0x97, 0x6d }
  53. }, {
  54. /* 3GPP TS 55.205 v6.0.0 - Test Set 3 */
  55. { 0x9e, 0x59, 0x44, 0xae, 0xa9, 0x4b, 0x81, 0x16,
  56. 0x5c, 0x82, 0xfb, 0xf9, 0xf3, 0x2d, 0xb7, 0x51 },
  57. { 0xce, 0x83, 0xdb, 0xc5, 0x4a, 0xc0, 0x27, 0x4a,
  58. 0x15, 0x7c, 0x17, 0xf8, 0x0d, 0x01, 0x7b, 0xd6 },
  59. { 0xa6, 0x4a, 0x50, 0x7a, 0xe1, 0xa2, 0xa9, 0x8b,
  60. 0xb8, 0x8e, 0xb4, 0x21, 0x01, 0x35, 0xdc, 0x87 },
  61. { 0xcf, 0xbc, 0xe3, 0xfe },
  62. { 0xf3, 0x65, 0xcd, 0x68 },
  63. { 0x9a, 0x8e, 0xc9, 0x5f, 0x40, 0x8c, 0xc5, 0x07 }
  64. }, {
  65. /* 3GPP TS 55.205 v6.0.0 - Test Set 4 */
  66. { 0x4a, 0xb1, 0xde, 0xb0, 0x5c, 0xa6, 0xce, 0xb0,
  67. 0x51, 0xfc, 0x98, 0xe7, 0x7d, 0x02, 0x6a, 0x84 },
  68. { 0x74, 0xb0, 0xcd, 0x60, 0x31, 0xa1, 0xc8, 0x33,
  69. 0x9b, 0x2b, 0x6c, 0xe2, 0xb8, 0xc4, 0xa1, 0x86 },
  70. { 0xdc, 0xf0, 0x7c, 0xbd, 0x51, 0x85, 0x52, 0x90,
  71. 0xb9, 0x2a, 0x07, 0xa9, 0x89, 0x1e, 0x52, 0x3e },
  72. { 0x96, 0x55, 0xe2, 0x65 },
  73. { 0x58, 0x60, 0xfc, 0x1b },
  74. { 0xcd, 0xc1, 0xdc, 0x08, 0x41, 0xb8, 0x1a, 0x22 }
  75. }, {
  76. /* 3GPP TS 55.205 v6.0.0 - Test Set 5 */
  77. { 0x6c, 0x38, 0xa1, 0x16, 0xac, 0x28, 0x0c, 0x45,
  78. 0x4f, 0x59, 0x33, 0x2e, 0xe3, 0x5c, 0x8c, 0x4f },
  79. { 0xee, 0x64, 0x66, 0xbc, 0x96, 0x20, 0x2c, 0x5a,
  80. 0x55, 0x7a, 0xbb, 0xef, 0xf8, 0xba, 0xbf, 0x63 },
  81. { 0x38, 0x03, 0xef, 0x53, 0x63, 0xb9, 0x47, 0xc6,
  82. 0xaa, 0xa2, 0x25, 0xe5, 0x8f, 0xae, 0x39, 0x34 },
  83. { 0x13, 0x68, 0x8f, 0x17 },
  84. { 0x16, 0xc8, 0x23, 0x3f },
  85. { 0xdf, 0x75, 0xbc, 0x5e, 0xa8, 0x99, 0x87, 0x9f }
  86. }, {
  87. /* 3GPP TS 55.205 v6.0.0 - Test Set 6 */
  88. { 0x2d, 0x60, 0x9d, 0x4d, 0xb0, 0xac, 0x5b, 0xf0,
  89. 0xd2, 0xc0, 0xde, 0x26, 0x70, 0x14, 0xde, 0x0d },
  90. { 0x19, 0x4a, 0xa7, 0x56, 0x01, 0x38, 0x96, 0xb7,
  91. 0x4b, 0x4a, 0x2a, 0x3b, 0x0a, 0xf4, 0x53, 0x9e },
  92. { 0xc3, 0x5a, 0x0a, 0xb0, 0xbc, 0xbf, 0xc9, 0x25,
  93. 0x2c, 0xaf, 0xf1, 0x5f, 0x24, 0xef, 0xbd, 0xe0 },
  94. { 0x55, 0x3d, 0x00, 0xb3 },
  95. { 0x8c, 0x25, 0xa1, 0x6c },
  96. { 0x84, 0xb4, 0x17, 0xae, 0x3a, 0xea, 0xb4, 0xf3 }
  97. }, {
  98. /* 3GPP TS 55.205 v6.0.0 - Test Set 7 */
  99. { 0xa5, 0x30, 0xa7, 0xfe, 0x42, 0x8f, 0xad, 0x10,
  100. 0x82, 0xc4, 0x5e, 0xdd, 0xfc, 0xe1, 0x38, 0x84 },
  101. { 0x3a, 0x4c, 0x2b, 0x32, 0x45, 0xc5, 0x0e, 0xb5,
  102. 0xc7, 0x1d, 0x08, 0x63, 0x93, 0x95, 0x76, 0x4d },
  103. { 0x27, 0x95, 0x3e, 0x49, 0xbc, 0x8a, 0xf6, 0xdc,
  104. 0xc6, 0xe7, 0x30, 0xeb, 0x80, 0x28, 0x6b, 0xe3 },
  105. { 0x59, 0xf1, 0xa4, 0x4a },
  106. { 0xa6, 0x32, 0x41, 0xe1 },
  107. { 0x3b, 0x4e, 0x24, 0x4c, 0xdc, 0x60, 0xce, 0x03 }
  108. }, {
  109. /* 3GPP TS 55.205 v6.0.0 - Test Set 8 */
  110. { 0xd9, 0x15, 0x1c, 0xf0, 0x48, 0x96, 0xe2, 0x58,
  111. 0x30, 0xbf, 0x2e, 0x08, 0x26, 0x7b, 0x83, 0x60 },
  112. { 0xf7, 0x61, 0xe5, 0xe9, 0x3d, 0x60, 0x3f, 0xeb,
  113. 0x73, 0x0e, 0x27, 0x55, 0x6c, 0xb8, 0xa2, 0xca },
  114. { 0xc4, 0xc9, 0x3e, 0xff, 0xe8, 0xa0, 0x81, 0x38,
  115. 0xc2, 0x03, 0xd4, 0xc2, 0x7c, 0xe4, 0xe3, 0xd9 },
  116. { 0x50, 0x58, 0x88, 0x61 },
  117. { 0x4a, 0x90, 0xb2, 0x17 },
  118. { 0x8d, 0x4e, 0xc0, 0x1d, 0xe5, 0x97, 0xac, 0xfe }
  119. }, {
  120. /* 3GPP TS 55.205 v6.0.0 - Test Set 9 */
  121. { 0xa0, 0xe2, 0x97, 0x1b, 0x68, 0x22, 0xe8, 0xd3,
  122. 0x54, 0xa1, 0x8c, 0xc2, 0x35, 0x62, 0x4e, 0xcb },
  123. { 0x08, 0xef, 0xf8, 0x28, 0xb1, 0x3f, 0xdb, 0x56,
  124. 0x27, 0x22, 0xc6, 0x5c, 0x7f, 0x30, 0xa9, 0xb2 },
  125. { 0x82, 0xa2, 0x6f, 0x22, 0xbb, 0xa9, 0xe9, 0x48,
  126. 0x8f, 0x94, 0x9a, 0x10, 0xd9, 0x8e, 0x9c, 0xc4 },
  127. { 0xcd, 0xe6, 0xb0, 0x27 },
  128. { 0x4b, 0xc2, 0x21, 0x2d },
  129. { 0xd8, 0xde, 0xbc, 0x4f, 0xfb, 0xcd, 0x60, 0xaa }
  130. }, {
  131. /* 3GPP TS 55.205 v6.0.0 - Test Set 10 */
  132. { 0x0d, 0xa6, 0xf7, 0xba, 0x86, 0xd5, 0xea, 0xc8,
  133. 0xa1, 0x9c, 0xf5, 0x63, 0xac, 0x58, 0x64, 0x2d },
  134. { 0x67, 0x9a, 0xc4, 0xdb, 0xac, 0xd7, 0xd2, 0x33,
  135. 0xff, 0x9d, 0x68, 0x06, 0xf4, 0x14, 0x9c, 0xe3 },
  136. { 0x0d, 0xb1, 0x07, 0x1f, 0x87, 0x67, 0x56, 0x2c,
  137. 0xa4, 0x3a, 0x0a, 0x64, 0xc4, 0x1e, 0x8d, 0x08 },
  138. { 0x02, 0xd1, 0x3a, 0xcd },
  139. { 0x6f, 0xc3, 0x0f, 0xee },
  140. { 0xf0, 0xea, 0xa5, 0x0a, 0x1e, 0xdc, 0xeb, 0xb7 }
  141. }, {
  142. /* 3GPP TS 55.205 v6.0.0 - Test Set 11 */
  143. { 0x77, 0xb4, 0x58, 0x43, 0xc8, 0x8e, 0x58, 0xc1,
  144. 0x0d, 0x20, 0x26, 0x84, 0x51, 0x5e, 0xd4, 0x30 },
  145. { 0x4c, 0x47, 0xeb, 0x30, 0x76, 0xdc, 0x55, 0xfe,
  146. 0x51, 0x06, 0xcb, 0x20, 0x34, 0xb8, 0xcd, 0x78 },
  147. { 0xd4, 0x83, 0xaf, 0xae, 0x56, 0x24, 0x09, 0xa3,
  148. 0x26, 0xb5, 0xbb, 0x0b, 0x20, 0xc4, 0xd7, 0x62 },
  149. { 0x44, 0x38, 0x9d, 0x01 },
  150. { 0xae, 0xfa, 0x35, 0x7b },
  151. { 0x82, 0xdb, 0xab, 0x7f, 0x83, 0xf0, 0x63, 0xda }
  152. }, {
  153. /* 3GPP TS 55.205 v6.0.0 - Test Set 12 */
  154. { 0x72, 0x9b, 0x17, 0x72, 0x92, 0x70, 0xdd, 0x87,
  155. 0xcc, 0xdf, 0x1b, 0xfe, 0x29, 0xb4, 0xe9, 0xbb },
  156. { 0x31, 0x1c, 0x4c, 0x92, 0x97, 0x44, 0xd6, 0x75,
  157. 0xb7, 0x20, 0xf3, 0xb7, 0xe9, 0xb1, 0xcb, 0xd0 },
  158. { 0x22, 0x8c, 0x2f, 0x2f, 0x06, 0xac, 0x32, 0x68,
  159. 0xa9, 0xe6, 0x16, 0xee, 0x16, 0xdb, 0x4b, 0xa1 },
  160. { 0x03, 0xe0, 0xfd, 0x84 },
  161. { 0x98, 0xdb, 0xbd, 0x09 },
  162. { 0x3c, 0x66, 0xcb, 0x98, 0xca, 0xb2, 0xd3, 0x3d }
  163. }, {
  164. /* 3GPP TS 55.205 v6.0.0 - Test Set 13 */
  165. { 0xd3, 0x2d, 0xd2, 0x3e, 0x89, 0xdc, 0x66, 0x23,
  166. 0x54, 0xca, 0x12, 0xeb, 0x79, 0xdd, 0x32, 0xfa },
  167. { 0xcf, 0x7d, 0x0a, 0xb1, 0xd9, 0x43, 0x06, 0x95,
  168. 0x0b, 0xf1, 0x20, 0x18, 0xfb, 0xd4, 0x68, 0x87 },
  169. { 0xd2, 0x2a, 0x4b, 0x41, 0x80, 0xa5, 0x32, 0x57,
  170. 0x08, 0xa5, 0xff, 0x70, 0xd9, 0xf6, 0x7e, 0xc7 },
  171. { 0xbe, 0x73, 0xb3, 0xdc },
  172. { 0xaf, 0x4a, 0x41, 0x1e },
  173. { 0x96, 0x12, 0xb5, 0xd8, 0x8a, 0x41, 0x30, 0xbb }
  174. }, {
  175. /* 3GPP TS 55.205 v6.0.0 - Test Set 14 */
  176. { 0xaf, 0x7c, 0x65, 0xe1, 0x92, 0x72, 0x21, 0xde,
  177. 0x59, 0x11, 0x87, 0xa2, 0xc5, 0x98, 0x7a, 0x53 },
  178. { 0x1f, 0x0f, 0x85, 0x78, 0x46, 0x4f, 0xd5, 0x9b,
  179. 0x64, 0xbe, 0xd2, 0xd0, 0x94, 0x36, 0xb5, 0x7a },
  180. { 0xa4, 0xcf, 0x5c, 0x81, 0x55, 0xc0, 0x8a, 0x7e,
  181. 0xff, 0x41, 0x8e, 0x54, 0x43, 0xb9, 0x8e, 0x55 },
  182. { 0x8f, 0xe0, 0x19, 0xc7 },
  183. { 0x7b, 0xff, 0xa5, 0xc2 },
  184. { 0x75, 0xa1, 0x50, 0xdf, 0x3c, 0x6a, 0xed, 0x08 }
  185. }, {
  186. /* 3GPP TS 55.205 v6.0.0 - Test Set 15 */
  187. { 0x5b, 0xd7, 0xec, 0xd3, 0xd3, 0x12, 0x7a, 0x41,
  188. 0xd1, 0x25, 0x39, 0xbe, 0xd4, 0xe7, 0xcf, 0x71 },
  189. { 0x59, 0xb7, 0x5f, 0x14, 0x25, 0x1c, 0x75, 0x03,
  190. 0x1d, 0x0b, 0xcb, 0xac, 0x1c, 0x2c, 0x04, 0xc7 },
  191. { 0x76, 0x08, 0x9d, 0x3c, 0x0f, 0xf3, 0xef, 0xdc,
  192. 0x6e, 0x36, 0x72, 0x1d, 0x4f, 0xce, 0xb7, 0x47 },
  193. { 0x27, 0x20, 0x2b, 0x82 },
  194. { 0x7e, 0x3f, 0x44, 0xc7 },
  195. { 0xb7, 0xf9, 0x2e, 0x42, 0x6a, 0x36, 0xfe, 0xc5 }
  196. }, {
  197. /* 3GPP TS 55.205 v6.0.0 - Test Set 16 */
  198. { 0x6c, 0xd1, 0xc6, 0xce, 0xb1, 0xe0, 0x1e, 0x14,
  199. 0xf1, 0xb8, 0x23, 0x16, 0xa9, 0x0b, 0x7f, 0x3d },
  200. { 0xf6, 0x9b, 0x78, 0xf3, 0x00, 0xa0, 0x56, 0x8b,
  201. 0xce, 0x9f, 0x0c, 0xb9, 0x3c, 0x4b, 0xe4, 0xc9 },
  202. { 0xa2, 0x19, 0xdc, 0x37, 0xf1, 0xdc, 0x7d, 0x66,
  203. 0x73, 0x8b, 0x58, 0x43, 0xc7, 0x99, 0xf2, 0x06 },
  204. { 0xdd, 0xd7, 0xef, 0xe6 },
  205. { 0x70, 0xf6, 0xbd, 0xb9 },
  206. { 0x88, 0xd9, 0xde, 0x10, 0xa2, 0x20, 0x04, 0xc5 }
  207. }, {
  208. /* 3GPP TS 55.205 v6.0.0 - Test Set 17 */
  209. { 0xb7, 0x3a, 0x90, 0xcb, 0xcf, 0x3a, 0xfb, 0x62,
  210. 0x2d, 0xba, 0x83, 0xc5, 0x8a, 0x84, 0x15, 0xdf },
  211. { 0xb1, 0x20, 0xf1, 0xc1, 0xa0, 0x10, 0x2a, 0x2f,
  212. 0x50, 0x7d, 0xd5, 0x43, 0xde, 0x68, 0x28, 0x1f },
  213. { 0xdf, 0x0c, 0x67, 0x86, 0x8f, 0xa2, 0x5f, 0x74,
  214. 0x8b, 0x70, 0x44, 0xc6, 0xe7, 0xc2, 0x45, 0xb8 },
  215. { 0x67, 0xe4, 0xff, 0x3f },
  216. { 0x47, 0x9d, 0xd2, 0x5c },
  217. { 0xa8, 0x19, 0xe5, 0x77, 0xa8, 0xd6, 0x17, 0x5b }
  218. }, {
  219. /* 3GPP TS 55.205 v6.0.0 - Test Set 18 */
  220. { 0x51, 0x22, 0x25, 0x02, 0x14, 0xc3, 0x3e, 0x72,
  221. 0x3a, 0x5d, 0xd5, 0x23, 0xfc, 0x14, 0x5f, 0xc0 },
  222. { 0x81, 0xe9, 0x2b, 0x6c, 0x0e, 0xe0, 0xe1, 0x2e,
  223. 0xbc, 0xeb, 0xa8, 0xd9, 0x2a, 0x99, 0xdf, 0xa5 },
  224. { 0x98, 0x1d, 0x46, 0x4c, 0x7c, 0x52, 0xeb, 0x6e,
  225. 0x50, 0x36, 0x23, 0x49, 0x84, 0xad, 0x0b, 0xcf },
  226. { 0x8a, 0x3b, 0x8d, 0x17 },
  227. { 0x28, 0xd7, 0xb0, 0xf2 },
  228. { 0x9a, 0x8d, 0x0e, 0x88, 0x3f, 0xf0, 0x88, 0x7a }
  229. }, {
  230. /* 3GPP TS 55.205 v6.0.0 - Test Set 19 */
  231. { 0x90, 0xdc, 0xa4, 0xed, 0xa4, 0x5b, 0x53, 0xcf,
  232. 0x0f, 0x12, 0xd7, 0xc9, 0xc3, 0xbc, 0x6a, 0x89 },
  233. { 0x9f, 0xdd, 0xc7, 0x20, 0x92, 0xc6, 0xad, 0x03,
  234. 0x6b, 0x6e, 0x46, 0x47, 0x89, 0x31, 0x5b, 0x78 },
  235. { 0xcb, 0x9c, 0xcc, 0xc4, 0xb9, 0x25, 0x8e, 0x6d,
  236. 0xca, 0x47, 0x60, 0x37, 0x9f, 0xb8, 0x25, 0x81 },
  237. { 0xdf, 0x58, 0x52, 0x2f },
  238. { 0xa9, 0x51, 0x00, 0xe2 },
  239. { 0xed, 0x29, 0xb2, 0xf1, 0xc2, 0x7f, 0x9f, 0x34 }
  240. }
  241. };
  242. #define NUM_GSM_TESTS ARRAY_SIZE(gsm_test_sets)
  243. struct milenage_test_set {
  244. u8 k[16];
  245. u8 rand[16];
  246. u8 sqn[6];
  247. u8 amf[2];
  248. u8 op[16];
  249. u8 opc[16];
  250. u8 f1[8];
  251. u8 f1star[8];
  252. u8 f2[8];
  253. u8 f3[16];
  254. u8 f4[16];
  255. u8 f5[6];
  256. u8 f5star[6];
  257. };
  258. static const struct milenage_test_set test_sets[] =
  259. {
  260. {
  261. /* 3GPP TS 35.208 v6.0.0 - 4.3.1 Test Set 1 */
  262. { 0x46, 0x5b, 0x5c, 0xe8, 0xb1, 0x99, 0xb4, 0x9f,
  263. 0xaa, 0x5f, 0x0a, 0x2e, 0xe2, 0x38, 0xa6, 0xbc },
  264. { 0x23, 0x55, 0x3c, 0xbe, 0x96, 0x37, 0xa8, 0x9d,
  265. 0x21, 0x8a, 0xe6, 0x4d, 0xae, 0x47, 0xbf, 0x35 },
  266. { 0xff, 0x9b, 0xb4, 0xd0, 0xb6, 0x07 },
  267. { 0xb9, 0xb9 },
  268. { 0xcd, 0xc2, 0x02, 0xd5, 0x12, 0x3e, 0x20, 0xf6,
  269. 0x2b, 0x6d, 0x67, 0x6a, 0xc7, 0x2c, 0xb3, 0x18 },
  270. { 0xcd, 0x63, 0xcb, 0x71, 0x95, 0x4a, 0x9f, 0x4e,
  271. 0x48, 0xa5, 0x99, 0x4e, 0x37, 0xa0, 0x2b, 0xaf },
  272. { 0x4a, 0x9f, 0xfa, 0xc3, 0x54, 0xdf, 0xaf, 0xb3 },
  273. { 0x01, 0xcf, 0xaf, 0x9e, 0xc4, 0xe8, 0x71, 0xe9 },
  274. { 0xa5, 0x42, 0x11, 0xd5, 0xe3, 0xba, 0x50, 0xbf },
  275. { 0xb4, 0x0b, 0xa9, 0xa3, 0xc5, 0x8b, 0x2a, 0x05,
  276. 0xbb, 0xf0, 0xd9, 0x87, 0xb2, 0x1b, 0xf8, 0xcb },
  277. { 0xf7, 0x69, 0xbc, 0xd7, 0x51, 0x04, 0x46, 0x04,
  278. 0x12, 0x76, 0x72, 0x71, 0x1c, 0x6d, 0x34, 0x41 },
  279. { 0xaa, 0x68, 0x9c, 0x64, 0x83, 0x70 },
  280. { 0x45, 0x1e, 0x8b, 0xec, 0xa4, 0x3b }
  281. }, {
  282. /* 3GPP TS 35.208 v6.0.0 - 4.3.2 Test Set 2 */
  283. { 0x46, 0x5b, 0x5c, 0xe8, 0xb1, 0x99, 0xb4, 0x9f,
  284. 0xaa, 0x5f, 0x0a, 0x2e, 0xe2, 0x38, 0xa6, 0xbc },
  285. { 0x23, 0x55, 0x3c, 0xbe, 0x96, 0x37, 0xa8, 0x9d,
  286. 0x21, 0x8a, 0xe6, 0x4d, 0xae, 0x47, 0xbf, 0x35 },
  287. { 0xff, 0x9b, 0xb4, 0xd0, 0xb6, 0x07 },
  288. { 0xb9, 0xb9 },
  289. { 0xcd, 0xc2, 0x02, 0xd5, 0x12, 0x3e, 0x20, 0xf6,
  290. 0x2b, 0x6d, 0x67, 0x6a, 0xc7, 0x2c, 0xb3, 0x18 },
  291. { 0xcd, 0x63, 0xcb, 0x71, 0x95, 0x4a, 0x9f, 0x4e,
  292. 0x48, 0xa5, 0x99, 0x4e, 0x37, 0xa0, 0x2b, 0xaf },
  293. { 0x4a, 0x9f, 0xfa, 0xc3, 0x54, 0xdf, 0xaf, 0xb3 },
  294. { 0x01, 0xcf, 0xaf, 0x9e, 0xc4, 0xe8, 0x71, 0xe9 },
  295. { 0xa5, 0x42, 0x11, 0xd5, 0xe3, 0xba, 0x50, 0xbf },
  296. { 0xb4, 0x0b, 0xa9, 0xa3, 0xc5, 0x8b, 0x2a, 0x05,
  297. 0xbb, 0xf0, 0xd9, 0x87, 0xb2, 0x1b, 0xf8, 0xcb },
  298. { 0xf7, 0x69, 0xbc, 0xd7, 0x51, 0x04, 0x46, 0x04,
  299. 0x12, 0x76, 0x72, 0x71, 0x1c, 0x6d, 0x34, 0x41 },
  300. { 0xaa, 0x68, 0x9c, 0x64, 0x83, 0x70 },
  301. { 0x45, 0x1e, 0x8b, 0xec, 0xa4, 0x3b }
  302. }, {
  303. /* 3GPP TS 35.208 v6.0.0 - 4.3.3 Test Set 3 */
  304. { 0xfe, 0xc8, 0x6b, 0xa6, 0xeb, 0x70, 0x7e, 0xd0,
  305. 0x89, 0x05, 0x75, 0x7b, 0x1b, 0xb4, 0x4b, 0x8f },
  306. { 0x9f, 0x7c, 0x8d, 0x02, 0x1a, 0xcc, 0xf4, 0xdb,
  307. 0x21, 0x3c, 0xcf, 0xf0, 0xc7, 0xf7, 0x1a, 0x6a },
  308. { 0x9d, 0x02, 0x77, 0x59, 0x5f, 0xfc },
  309. { 0x72, 0x5c },
  310. { 0xdb, 0xc5, 0x9a, 0xdc, 0xb6, 0xf9, 0xa0, 0xef,
  311. 0x73, 0x54, 0x77, 0xb7, 0xfa, 0xdf, 0x83, 0x74 },
  312. { 0x10, 0x06, 0x02, 0x0f, 0x0a, 0x47, 0x8b, 0xf6,
  313. 0xb6, 0x99, 0xf1, 0x5c, 0x06, 0x2e, 0x42, 0xb3 },
  314. { 0x9c, 0xab, 0xc3, 0xe9, 0x9b, 0xaf, 0x72, 0x81 },
  315. { 0x95, 0x81, 0x4b, 0xa2, 0xb3, 0x04, 0x43, 0x24 },
  316. { 0x80, 0x11, 0xc4, 0x8c, 0x0c, 0x21, 0x4e, 0xd2 },
  317. { 0x5d, 0xbd, 0xbb, 0x29, 0x54, 0xe8, 0xf3, 0xcd,
  318. 0xe6, 0x65, 0xb0, 0x46, 0x17, 0x9a, 0x50, 0x98 },
  319. { 0x59, 0xa9, 0x2d, 0x3b, 0x47, 0x6a, 0x04, 0x43,
  320. 0x48, 0x70, 0x55, 0xcf, 0x88, 0xb2, 0x30, 0x7b },
  321. { 0x33, 0x48, 0x4d, 0xc2, 0x13, 0x6b },
  322. { 0xde, 0xac, 0xdd, 0x84, 0x8c, 0xc6 }
  323. }, {
  324. /* 3GPP TS 35.208 v6.0.0 - 4.3.4 Test Set 4 */
  325. { 0x9e, 0x59, 0x44, 0xae, 0xa9, 0x4b, 0x81, 0x16,
  326. 0x5c, 0x82, 0xfb, 0xf9, 0xf3, 0x2d, 0xb7, 0x51 },
  327. { 0xce, 0x83, 0xdb, 0xc5, 0x4a, 0xc0, 0x27, 0x4a,
  328. 0x15, 0x7c, 0x17, 0xf8, 0x0d, 0x01, 0x7b, 0xd6 },
  329. { 0x0b, 0x60, 0x4a, 0x81, 0xec, 0xa8 },
  330. { 0x9e, 0x09 },
  331. { 0x22, 0x30, 0x14, 0xc5, 0x80, 0x66, 0x94, 0xc0,
  332. 0x07, 0xca, 0x1e, 0xee, 0xf5, 0x7f, 0x00, 0x4f },
  333. { 0xa6, 0x4a, 0x50, 0x7a, 0xe1, 0xa2, 0xa9, 0x8b,
  334. 0xb8, 0x8e, 0xb4, 0x21, 0x01, 0x35, 0xdc, 0x87 },
  335. { 0x74, 0xa5, 0x82, 0x20, 0xcb, 0xa8, 0x4c, 0x49 },
  336. { 0xac, 0x2c, 0xc7, 0x4a, 0x96, 0x87, 0x18, 0x37 },
  337. { 0xf3, 0x65, 0xcd, 0x68, 0x3c, 0xd9, 0x2e, 0x96 },
  338. { 0xe2, 0x03, 0xed, 0xb3, 0x97, 0x15, 0x74, 0xf5,
  339. 0xa9, 0x4b, 0x0d, 0x61, 0xb8, 0x16, 0x34, 0x5d },
  340. { 0x0c, 0x45, 0x24, 0xad, 0xea, 0xc0, 0x41, 0xc4,
  341. 0xdd, 0x83, 0x0d, 0x20, 0x85, 0x4f, 0xc4, 0x6b },
  342. { 0xf0, 0xb9, 0xc0, 0x8a, 0xd0, 0x2e },
  343. { 0x60, 0x85, 0xa8, 0x6c, 0x6f, 0x63 }
  344. }, {
  345. /* 3GPP TS 35.208 v6.0.0 - 4.3.5 Test Set 5 */
  346. { 0x4a, 0xb1, 0xde, 0xb0, 0x5c, 0xa6, 0xce, 0xb0,
  347. 0x51, 0xfc, 0x98, 0xe7, 0x7d, 0x02, 0x6a, 0x84 },
  348. { 0x74, 0xb0, 0xcd, 0x60, 0x31, 0xa1, 0xc8, 0x33,
  349. 0x9b, 0x2b, 0x6c, 0xe2, 0xb8, 0xc4, 0xa1, 0x86 },
  350. { 0xe8, 0x80, 0xa1, 0xb5, 0x80, 0xb6 },
  351. { 0x9f, 0x07 },
  352. { 0x2d, 0x16, 0xc5, 0xcd, 0x1f, 0xdf, 0x6b, 0x22,
  353. 0x38, 0x35, 0x84, 0xe3, 0xbe, 0xf2, 0xa8, 0xd8 },
  354. { 0xdc, 0xf0, 0x7c, 0xbd, 0x51, 0x85, 0x52, 0x90,
  355. 0xb9, 0x2a, 0x07, 0xa9, 0x89, 0x1e, 0x52, 0x3e },
  356. { 0x49, 0xe7, 0x85, 0xdd, 0x12, 0x62, 0x6e, 0xf2 },
  357. { 0x9e, 0x85, 0x79, 0x03, 0x36, 0xbb, 0x3f, 0xa2 },
  358. { 0x58, 0x60, 0xfc, 0x1b, 0xce, 0x35, 0x1e, 0x7e },
  359. { 0x76, 0x57, 0x76, 0x6b, 0x37, 0x3d, 0x1c, 0x21,
  360. 0x38, 0xf3, 0x07, 0xe3, 0xde, 0x92, 0x42, 0xf9 },
  361. { 0x1c, 0x42, 0xe9, 0x60, 0xd8, 0x9b, 0x8f, 0xa9,
  362. 0x9f, 0x27, 0x44, 0xe0, 0x70, 0x8c, 0xcb, 0x53 },
  363. { 0x31, 0xe1, 0x1a, 0x60, 0x91, 0x18 },
  364. { 0xfe, 0x25, 0x55, 0xe5, 0x4a, 0xa9 }
  365. }, {
  366. /* 3GPP TS 35.208 v6.0.0 - 4.3.6 Test Set 6 */
  367. { 0x6c, 0x38, 0xa1, 0x16, 0xac, 0x28, 0x0c, 0x45,
  368. 0x4f, 0x59, 0x33, 0x2e, 0xe3, 0x5c, 0x8c, 0x4f },
  369. { 0xee, 0x64, 0x66, 0xbc, 0x96, 0x20, 0x2c, 0x5a,
  370. 0x55, 0x7a, 0xbb, 0xef, 0xf8, 0xba, 0xbf, 0x63 },
  371. { 0x41, 0x4b, 0x98, 0x22, 0x21, 0x81 },
  372. { 0x44, 0x64 },
  373. { 0x1b, 0xa0, 0x0a, 0x1a, 0x7c, 0x67, 0x00, 0xac,
  374. 0x8c, 0x3f, 0xf3, 0xe9, 0x6a, 0xd0, 0x87, 0x25 },
  375. { 0x38, 0x03, 0xef, 0x53, 0x63, 0xb9, 0x47, 0xc6,
  376. 0xaa, 0xa2, 0x25, 0xe5, 0x8f, 0xae, 0x39, 0x34 },
  377. { 0x07, 0x8a, 0xdf, 0xb4, 0x88, 0x24, 0x1a, 0x57 },
  378. { 0x80, 0x24, 0x6b, 0x8d, 0x01, 0x86, 0xbc, 0xf1 },
  379. { 0x16, 0xc8, 0x23, 0x3f, 0x05, 0xa0, 0xac, 0x28 },
  380. { 0x3f, 0x8c, 0x75, 0x87, 0xfe, 0x8e, 0x4b, 0x23,
  381. 0x3a, 0xf6, 0x76, 0xae, 0xde, 0x30, 0xba, 0x3b },
  382. { 0xa7, 0x46, 0x6c, 0xc1, 0xe6, 0xb2, 0xa1, 0x33,
  383. 0x7d, 0x49, 0xd3, 0xb6, 0x6e, 0x95, 0xd7, 0xb4 },
  384. { 0x45, 0xb0, 0xf6, 0x9a, 0xb0, 0x6c },
  385. { 0x1f, 0x53, 0xcd, 0x2b, 0x11, 0x13 }
  386. }, {
  387. /* 3GPP TS 35.208 v6.0.0 - 4.3.7 Test Set 7 */
  388. { 0x2d, 0x60, 0x9d, 0x4d, 0xb0, 0xac, 0x5b, 0xf0,
  389. 0xd2, 0xc0, 0xde, 0x26, 0x70, 0x14, 0xde, 0x0d },
  390. { 0x19, 0x4a, 0xa7, 0x56, 0x01, 0x38, 0x96, 0xb7,
  391. 0x4b, 0x4a, 0x2a, 0x3b, 0x0a, 0xf4, 0x53, 0x9e },
  392. { 0x6b, 0xf6, 0x94, 0x38, 0xc2, 0xe4 },
  393. { 0x5f, 0x67 },
  394. { 0x46, 0x0a, 0x48, 0x38, 0x54, 0x27, 0xaa, 0x39,
  395. 0x26, 0x4a, 0xac, 0x8e, 0xfc, 0x9e, 0x73, 0xe8 },
  396. { 0xc3, 0x5a, 0x0a, 0xb0, 0xbc, 0xbf, 0xc9, 0x25,
  397. 0x2c, 0xaf, 0xf1, 0x5f, 0x24, 0xef, 0xbd, 0xe0 },
  398. { 0xbd, 0x07, 0xd3, 0x00, 0x3b, 0x9e, 0x5c, 0xc3 },
  399. { 0xbc, 0xb6, 0xc2, 0xfc, 0xad, 0x15, 0x22, 0x50 },
  400. { 0x8c, 0x25, 0xa1, 0x6c, 0xd9, 0x18, 0xa1, 0xdf },
  401. { 0x4c, 0xd0, 0x84, 0x60, 0x20, 0xf8, 0xfa, 0x07,
  402. 0x31, 0xdd, 0x47, 0xcb, 0xdc, 0x6b, 0xe4, 0x11 },
  403. { 0x88, 0xab, 0x80, 0xa4, 0x15, 0xf1, 0x5c, 0x73,
  404. 0x71, 0x12, 0x54, 0xa1, 0xd3, 0x88, 0xf6, 0x96 },
  405. { 0x7e, 0x64, 0x55, 0xf3, 0x4c, 0xf3 },
  406. { 0xdc, 0x6d, 0xd0, 0x1e, 0x8f, 0x15 }
  407. }, {
  408. /* 3GPP TS 35.208 v6.0.0 - 4.3.8 Test Set 8 */
  409. { 0xa5, 0x30, 0xa7, 0xfe, 0x42, 0x8f, 0xad, 0x10,
  410. 0x82, 0xc4, 0x5e, 0xdd, 0xfc, 0xe1, 0x38, 0x84 },
  411. { 0x3a, 0x4c, 0x2b, 0x32, 0x45, 0xc5, 0x0e, 0xb5,
  412. 0xc7, 0x1d, 0x08, 0x63, 0x93, 0x95, 0x76, 0x4d },
  413. { 0xf6, 0x3f, 0x5d, 0x76, 0x87, 0x84 },
  414. { 0xb9, 0x0e },
  415. { 0x51, 0x1c, 0x6c, 0x4e, 0x83, 0xe3, 0x8c, 0x89,
  416. 0xb1, 0xc5, 0xd8, 0xdd, 0xe6, 0x24, 0x26, 0xfa },
  417. { 0x27, 0x95, 0x3e, 0x49, 0xbc, 0x8a, 0xf6, 0xdc,
  418. 0xc6, 0xe7, 0x30, 0xeb, 0x80, 0x28, 0x6b, 0xe3 },
  419. { 0x53, 0x76, 0x1f, 0xbd, 0x67, 0x9b, 0x0b, 0xad },
  420. { 0x21, 0xad, 0xfd, 0x33, 0x4a, 0x10, 0xe7, 0xce },
  421. { 0xa6, 0x32, 0x41, 0xe1, 0xff, 0xc3, 0xe5, 0xab },
  422. { 0x10, 0xf0, 0x5b, 0xab, 0x75, 0xa9, 0x9a, 0x5f,
  423. 0xbb, 0x98, 0xa9, 0xc2, 0x87, 0x67, 0x9c, 0x3b },
  424. { 0xf9, 0xec, 0x08, 0x65, 0xeb, 0x32, 0xf2, 0x23,
  425. 0x69, 0xca, 0xde, 0x40, 0xc5, 0x9c, 0x3a, 0x44 },
  426. { 0x88, 0x19, 0x6c, 0x47, 0x98, 0x6f },
  427. { 0xc9, 0x87, 0xa3, 0xd2, 0x31, 0x15 }
  428. }, {
  429. /* 3GPP TS 35.208 v6.0.0 - 4.3.9 Test Set 9 */
  430. { 0xd9, 0x15, 0x1c, 0xf0, 0x48, 0x96, 0xe2, 0x58,
  431. 0x30, 0xbf, 0x2e, 0x08, 0x26, 0x7b, 0x83, 0x60 },
  432. { 0xf7, 0x61, 0xe5, 0xe9, 0x3d, 0x60, 0x3f, 0xeb,
  433. 0x73, 0x0e, 0x27, 0x55, 0x6c, 0xb8, 0xa2, 0xca },
  434. { 0x47, 0xee, 0x01, 0x99, 0x82, 0x0a },
  435. { 0x91, 0x13 },
  436. { 0x75, 0xfc, 0x22, 0x33, 0xa4, 0x42, 0x94, 0xee,
  437. 0x8e, 0x6d, 0xe2, 0x5c, 0x43, 0x53, 0xd2, 0x6b },
  438. { 0xc4, 0xc9, 0x3e, 0xff, 0xe8, 0xa0, 0x81, 0x38,
  439. 0xc2, 0x03, 0xd4, 0xc2, 0x7c, 0xe4, 0xe3, 0xd9 },
  440. { 0x66, 0xcc, 0x4b, 0xe4, 0x48, 0x62, 0xaf, 0x1f },
  441. { 0x7a, 0x4b, 0x8d, 0x7a, 0x87, 0x53, 0xf2, 0x46 },
  442. { 0x4a, 0x90, 0xb2, 0x17, 0x1a, 0xc8, 0x3a, 0x76 },
  443. { 0x71, 0x23, 0x6b, 0x71, 0x29, 0xf9, 0xb2, 0x2a,
  444. 0xb7, 0x7e, 0xa7, 0xa5, 0x4c, 0x96, 0xda, 0x22 },
  445. { 0x90, 0x52, 0x7e, 0xba, 0xa5, 0x58, 0x89, 0x68,
  446. 0xdb, 0x41, 0x72, 0x73, 0x25, 0xa0, 0x4d, 0x9e },
  447. { 0x82, 0xa0, 0xf5, 0x28, 0x7a, 0x71 },
  448. { 0x52, 0x7d, 0xbf, 0x41, 0xf3, 0x5f }
  449. }, {
  450. /* 3GPP TS 35.208 v6.0.0 - 4.3.10 Test Set 10 */
  451. { 0xa0, 0xe2, 0x97, 0x1b, 0x68, 0x22, 0xe8, 0xd3,
  452. 0x54, 0xa1, 0x8c, 0xc2, 0x35, 0x62, 0x4e, 0xcb },
  453. { 0x08, 0xef, 0xf8, 0x28, 0xb1, 0x3f, 0xdb, 0x56,
  454. 0x27, 0x22, 0xc6, 0x5c, 0x7f, 0x30, 0xa9, 0xb2 },
  455. { 0xdb, 0x5c, 0x06, 0x64, 0x81, 0xe0 },
  456. { 0x71, 0x6b },
  457. { 0x32, 0x37, 0x92, 0xfa, 0xca, 0x21, 0xfb, 0x4d,
  458. 0x5d, 0x6f, 0x13, 0xc1, 0x45, 0xa9, 0xd2, 0xc1 },
  459. { 0x82, 0xa2, 0x6f, 0x22, 0xbb, 0xa9, 0xe9, 0x48,
  460. 0x8f, 0x94, 0x9a, 0x10, 0xd9, 0x8e, 0x9c, 0xc4 },
  461. { 0x94, 0x85, 0xfe, 0x24, 0x62, 0x1c, 0xb9, 0xf6 },
  462. { 0xbc, 0xe3, 0x25, 0xce, 0x03, 0xe2, 0xe9, 0xb9 },
  463. { 0x4b, 0xc2, 0x21, 0x2d, 0x86, 0x24, 0x91, 0x0a },
  464. { 0x08, 0xce, 0xf6, 0xd0, 0x04, 0xec, 0x61, 0x47,
  465. 0x1a, 0x3c, 0x3c, 0xda, 0x04, 0x81, 0x37, 0xfa },
  466. { 0xed, 0x03, 0x18, 0xca, 0x5d, 0xeb, 0x92, 0x06,
  467. 0x27, 0x2f, 0x6e, 0x8f, 0xa6, 0x4b, 0xa4, 0x11 },
  468. { 0xa2, 0xf8, 0x58, 0xaa, 0x9e, 0x5d },
  469. { 0x74, 0xe7, 0x6f, 0xbb, 0xec, 0x38 }
  470. }, {
  471. /* 3GPP TS 35.208 v6.0.0 - 4.3.11 Test Set 11 */
  472. { 0x0d, 0xa6, 0xf7, 0xba, 0x86, 0xd5, 0xea, 0xc8,
  473. 0xa1, 0x9c, 0xf5, 0x63, 0xac, 0x58, 0x64, 0x2d },
  474. { 0x67, 0x9a, 0xc4, 0xdb, 0xac, 0xd7, 0xd2, 0x33,
  475. 0xff, 0x9d, 0x68, 0x06, 0xf4, 0x14, 0x9c, 0xe3 },
  476. { 0x6e, 0x23, 0x31, 0xd6, 0x92, 0xad },
  477. { 0x22, 0x4a },
  478. { 0x4b, 0x9a, 0x26, 0xfa, 0x45, 0x9e, 0x3a, 0xcb,
  479. 0xff, 0x36, 0xf4, 0x01, 0x5d, 0xe3, 0xbd, 0xc1 },
  480. { 0x0d, 0xb1, 0x07, 0x1f, 0x87, 0x67, 0x56, 0x2c,
  481. 0xa4, 0x3a, 0x0a, 0x64, 0xc4, 0x1e, 0x8d, 0x08 },
  482. { 0x28, 0x31, 0xd7, 0xae, 0x90, 0x88, 0xe4, 0x92 },
  483. { 0x9b, 0x2e, 0x16, 0x95, 0x11, 0x35, 0xd5, 0x23 },
  484. { 0x6f, 0xc3, 0x0f, 0xee, 0x6d, 0x12, 0x35, 0x23 },
  485. { 0x69, 0xb1, 0xca, 0xe7, 0xc7, 0x42, 0x9d, 0x97,
  486. 0x5e, 0x24, 0x5c, 0xac, 0xb0, 0x5a, 0x51, 0x7c },
  487. { 0x74, 0xf2, 0x4e, 0x8c, 0x26, 0xdf, 0x58, 0xe1,
  488. 0xb3, 0x8d, 0x7d, 0xcd, 0x4f, 0x1b, 0x7f, 0xbd },
  489. { 0x4c, 0x53, 0x9a, 0x26, 0xe1, 0xfa },
  490. { 0x07, 0x86, 0x1e, 0x12, 0x69, 0x28 }
  491. }, {
  492. /* 3GPP TS 35.208 v6.0.0 - 4.3.12 Test Set 12 */
  493. { 0x77, 0xb4, 0x58, 0x43, 0xc8, 0x8e, 0x58, 0xc1,
  494. 0x0d, 0x20, 0x26, 0x84, 0x51, 0x5e, 0xd4, 0x30 },
  495. { 0x4c, 0x47, 0xeb, 0x30, 0x76, 0xdc, 0x55, 0xfe,
  496. 0x51, 0x06, 0xcb, 0x20, 0x34, 0xb8, 0xcd, 0x78 },
  497. { 0xfe, 0x1a, 0x87, 0x31, 0x00, 0x5d },
  498. { 0xad, 0x25 },
  499. { 0xbf, 0x32, 0x86, 0xc7, 0xa5, 0x14, 0x09, 0xce,
  500. 0x95, 0x72, 0x4d, 0x50, 0x3b, 0xfe, 0x6e, 0x70 },
  501. { 0xd4, 0x83, 0xaf, 0xae, 0x56, 0x24, 0x09, 0xa3,
  502. 0x26, 0xb5, 0xbb, 0x0b, 0x20, 0xc4, 0xd7, 0x62 },
  503. { 0x08, 0x33, 0x2d, 0x7e, 0x9f, 0x48, 0x45, 0x70 },
  504. { 0xed, 0x41, 0xb7, 0x34, 0x48, 0x9d, 0x52, 0x07 },
  505. { 0xae, 0xfa, 0x35, 0x7b, 0xea, 0xc2, 0xa8, 0x7a },
  506. { 0x90, 0x8c, 0x43, 0xf0, 0x56, 0x9c, 0xb8, 0xf7,
  507. 0x4b, 0xc9, 0x71, 0xe7, 0x06, 0xc3, 0x6c, 0x5f },
  508. { 0xc2, 0x51, 0xdf, 0x0d, 0x88, 0x8d, 0xd9, 0x32,
  509. 0x9b, 0xcf, 0x46, 0x65, 0x5b, 0x22, 0x6e, 0x40 },
  510. { 0x30, 0xff, 0x25, 0xcd, 0xad, 0xf6 },
  511. { 0xe8, 0x4e, 0xd0, 0xd4, 0x67, 0x7e }
  512. }, {
  513. /* 3GPP TS 35.208 v6.0.0 - 4.3.13 Test Set 13 */
  514. { 0x72, 0x9b, 0x17, 0x72, 0x92, 0x70, 0xdd, 0x87,
  515. 0xcc, 0xdf, 0x1b, 0xfe, 0x29, 0xb4, 0xe9, 0xbb },
  516. { 0x31, 0x1c, 0x4c, 0x92, 0x97, 0x44, 0xd6, 0x75,
  517. 0xb7, 0x20, 0xf3, 0xb7, 0xe9, 0xb1, 0xcb, 0xd0 },
  518. { 0xc8, 0x5c, 0x4c, 0xf6, 0x59, 0x16 },
  519. { 0x5b, 0xb2 },
  520. { 0xd0, 0x4c, 0x9c, 0x35, 0xbd, 0x22, 0x62, 0xfa,
  521. 0x81, 0x0d, 0x29, 0x24, 0xd0, 0x36, 0xfd, 0x13 },
  522. { 0x22, 0x8c, 0x2f, 0x2f, 0x06, 0xac, 0x32, 0x68,
  523. 0xa9, 0xe6, 0x16, 0xee, 0x16, 0xdb, 0x4b, 0xa1 },
  524. { 0xff, 0x79, 0x4f, 0xe2, 0xf8, 0x27, 0xeb, 0xf8 },
  525. { 0x24, 0xfe, 0x4d, 0xc6, 0x1e, 0x87, 0x4b, 0x52 },
  526. { 0x98, 0xdb, 0xbd, 0x09, 0x9b, 0x3b, 0x40, 0x8d },
  527. { 0x44, 0xc0, 0xf2, 0x3c, 0x54, 0x93, 0xcf, 0xd2,
  528. 0x41, 0xe4, 0x8f, 0x19, 0x7e, 0x1d, 0x10, 0x12 },
  529. { 0x0c, 0x9f, 0xb8, 0x16, 0x13, 0x88, 0x4c, 0x25,
  530. 0x35, 0xdd, 0x0e, 0xab, 0xf3, 0xb4, 0x40, 0xd8 },
  531. { 0x53, 0x80, 0xd1, 0x58, 0xcf, 0xe3 },
  532. { 0x87, 0xac, 0x3b, 0x55, 0x9f, 0xb6 }
  533. }, {
  534. /* 3GPP TS 35.208 v6.0.0 - 4.3.14 Test Set 14 */
  535. { 0xd3, 0x2d, 0xd2, 0x3e, 0x89, 0xdc, 0x66, 0x23,
  536. 0x54, 0xca, 0x12, 0xeb, 0x79, 0xdd, 0x32, 0xfa },
  537. { 0xcf, 0x7d, 0x0a, 0xb1, 0xd9, 0x43, 0x06, 0x95,
  538. 0x0b, 0xf1, 0x20, 0x18, 0xfb, 0xd4, 0x68, 0x87 },
  539. { 0x48, 0x41, 0x07, 0xe5, 0x6a, 0x43 },
  540. { 0xb5, 0xe6 },
  541. { 0xfe, 0x75, 0x90, 0x5b, 0x9d, 0xa4, 0x7d, 0x35,
  542. 0x62, 0x36, 0xd0, 0x31, 0x4e, 0x09, 0xc3, 0x2e },
  543. { 0xd2, 0x2a, 0x4b, 0x41, 0x80, 0xa5, 0x32, 0x57,
  544. 0x08, 0xa5, 0xff, 0x70, 0xd9, 0xf6, 0x7e, 0xc7 },
  545. { 0xcf, 0x19, 0xd6, 0x2b, 0x6a, 0x80, 0x98, 0x66 },
  546. { 0x5d, 0x26, 0x95, 0x37, 0xe4, 0x5e, 0x2c, 0xe6 },
  547. { 0xaf, 0x4a, 0x41, 0x1e, 0x11, 0x39, 0xf2, 0xc2 },
  548. { 0x5a, 0xf8, 0x6b, 0x80, 0xed, 0xb7, 0x0d, 0xf5,
  549. 0x29, 0x2c, 0xc1, 0x12, 0x1c, 0xba, 0xd5, 0x0c },
  550. { 0x7f, 0x4d, 0x6a, 0xe7, 0x44, 0x0e, 0x18, 0x78,
  551. 0x9a, 0x8b, 0x75, 0xad, 0x3f, 0x42, 0xf0, 0x3a },
  552. { 0x21, 0x7a, 0xf4, 0x92, 0x72, 0xad },
  553. { 0x90, 0x0e, 0x10, 0x1c, 0x67, 0x7e }
  554. }, {
  555. /* 3GPP TS 35.208 v6.0.0 - 4.3.15 Test Set 15 */
  556. { 0xaf, 0x7c, 0x65, 0xe1, 0x92, 0x72, 0x21, 0xde,
  557. 0x59, 0x11, 0x87, 0xa2, 0xc5, 0x98, 0x7a, 0x53 },
  558. { 0x1f, 0x0f, 0x85, 0x78, 0x46, 0x4f, 0xd5, 0x9b,
  559. 0x64, 0xbe, 0xd2, 0xd0, 0x94, 0x36, 0xb5, 0x7a },
  560. { 0x3d, 0x62, 0x7b, 0x01, 0x41, 0x8d },
  561. { 0x84, 0xf6 },
  562. { 0x0c, 0x7a, 0xcb, 0x8d, 0x95, 0xb7, 0xd4, 0xa3,
  563. 0x1c, 0x5a, 0xca, 0x6d, 0x26, 0x34, 0x5a, 0x88 },
  564. { 0xa4, 0xcf, 0x5c, 0x81, 0x55, 0xc0, 0x8a, 0x7e,
  565. 0xff, 0x41, 0x8e, 0x54, 0x43, 0xb9, 0x8e, 0x55 },
  566. { 0xc3, 0x7c, 0xae, 0x78, 0x05, 0x64, 0x20, 0x32 },
  567. { 0x68, 0xcd, 0x09, 0xa4, 0x52, 0xd8, 0xdb, 0x7c },
  568. { 0x7b, 0xff, 0xa5, 0xc2, 0xf4, 0x1f, 0xbc, 0x05 },
  569. { 0x3f, 0x8c, 0x3f, 0x3c, 0xcf, 0x76, 0x25, 0xbf,
  570. 0x77, 0xfc, 0x94, 0xbc, 0xfd, 0x22, 0xfd, 0x26 },
  571. { 0xab, 0xcb, 0xae, 0x8f, 0xd4, 0x61, 0x15, 0xe9,
  572. 0x96, 0x1a, 0x55, 0xd0, 0xda, 0x5f, 0x20, 0x78 },
  573. { 0x83, 0x7f, 0xd7, 0xb7, 0x44, 0x19 },
  574. { 0x56, 0xe9, 0x7a, 0x60, 0x90, 0xb1 }
  575. }, {
  576. /* 3GPP TS 35.208 v6.0.0 - 4.3.16 Test Set 16 */
  577. { 0x5b, 0xd7, 0xec, 0xd3, 0xd3, 0x12, 0x7a, 0x41,
  578. 0xd1, 0x25, 0x39, 0xbe, 0xd4, 0xe7, 0xcf, 0x71 },
  579. { 0x59, 0xb7, 0x5f, 0x14, 0x25, 0x1c, 0x75, 0x03,
  580. 0x1d, 0x0b, 0xcb, 0xac, 0x1c, 0x2c, 0x04, 0xc7 },
  581. { 0xa2, 0x98, 0xae, 0x89, 0x29, 0xdc },
  582. { 0xd0, 0x56 },
  583. { 0xf9, 0x67, 0xf7, 0x60, 0x38, 0xb9, 0x20, 0xa9,
  584. 0xcd, 0x25, 0xe1, 0x0c, 0x08, 0xb4, 0x99, 0x24 },
  585. { 0x76, 0x08, 0x9d, 0x3c, 0x0f, 0xf3, 0xef, 0xdc,
  586. 0x6e, 0x36, 0x72, 0x1d, 0x4f, 0xce, 0xb7, 0x47 },
  587. { 0xc3, 0xf2, 0x5c, 0xd9, 0x43, 0x09, 0x10, 0x7e },
  588. { 0xb0, 0xc8, 0xba, 0x34, 0x36, 0x65, 0xaf, 0xcc },
  589. { 0x7e, 0x3f, 0x44, 0xc7, 0x59, 0x1f, 0x6f, 0x45 },
  590. { 0xd4, 0x2b, 0x2d, 0x61, 0x5e, 0x49, 0xa0, 0x3a,
  591. 0xc2, 0x75, 0xa5, 0xae, 0xf9, 0x7a, 0xf8, 0x92 },
  592. { 0x0b, 0x3f, 0x8d, 0x02, 0x4f, 0xe6, 0xbf, 0xaf,
  593. 0xaa, 0x98, 0x2b, 0x8f, 0x82, 0xe3, 0x19, 0xc2 },
  594. { 0x5b, 0xe1, 0x14, 0x95, 0x52, 0x5d },
  595. { 0x4d, 0x6a, 0x34, 0xa1, 0xe4, 0xeb }
  596. }, {
  597. /* 3GPP TS 35.208 v6.0.0 - 4.3.17 Test Set 17 */
  598. { 0x6c, 0xd1, 0xc6, 0xce, 0xb1, 0xe0, 0x1e, 0x14,
  599. 0xf1, 0xb8, 0x23, 0x16, 0xa9, 0x0b, 0x7f, 0x3d },
  600. { 0xf6, 0x9b, 0x78, 0xf3, 0x00, 0xa0, 0x56, 0x8b,
  601. 0xce, 0x9f, 0x0c, 0xb9, 0x3c, 0x4b, 0xe4, 0xc9 },
  602. { 0xb4, 0xfc, 0xe5, 0xfe, 0xb0, 0x59 },
  603. { 0xe4, 0xbb },
  604. { 0x07, 0x8b, 0xfc, 0xa9, 0x56, 0x46, 0x59, 0xec,
  605. 0xd8, 0x85, 0x1e, 0x84, 0xe6, 0xc5, 0x9b, 0x48 },
  606. { 0xa2, 0x19, 0xdc, 0x37, 0xf1, 0xdc, 0x7d, 0x66,
  607. 0x73, 0x8b, 0x58, 0x43, 0xc7, 0x99, 0xf2, 0x06 },
  608. { 0x69, 0xa9, 0x08, 0x69, 0xc2, 0x68, 0xcb, 0x7b },
  609. { 0x2e, 0x0f, 0xdc, 0xf9, 0xfd, 0x1c, 0xfa, 0x6a },
  610. { 0x70, 0xf6, 0xbd, 0xb9, 0xad, 0x21, 0x52, 0x5f },
  611. { 0x6e, 0xda, 0xf9, 0x9e, 0x5b, 0xd9, 0xf8, 0x5d,
  612. 0x5f, 0x36, 0xd9, 0x1c, 0x12, 0x72, 0xfb, 0x4b },
  613. { 0xd6, 0x1c, 0x85, 0x3c, 0x28, 0x0d, 0xd9, 0xc4,
  614. 0x6f, 0x29, 0x7b, 0xae, 0xc3, 0x86, 0xde, 0x17 },
  615. { 0x1c, 0x40, 0x8a, 0x85, 0x8b, 0x3e },
  616. { 0xaa, 0x4a, 0xe5, 0x2d, 0xaa, 0x30 }
  617. }, {
  618. /* 3GPP TS 35.208 v6.0.0 - 4.3.18 Test Set 18 */
  619. { 0xb7, 0x3a, 0x90, 0xcb, 0xcf, 0x3a, 0xfb, 0x62,
  620. 0x2d, 0xba, 0x83, 0xc5, 0x8a, 0x84, 0x15, 0xdf },
  621. { 0xb1, 0x20, 0xf1, 0xc1, 0xa0, 0x10, 0x2a, 0x2f,
  622. 0x50, 0x7d, 0xd5, 0x43, 0xde, 0x68, 0x28, 0x1f },
  623. { 0xf1, 0xe8, 0xa5, 0x23, 0xa3, 0x6d },
  624. { 0x47, 0x1b },
  625. { 0xb6, 0x72, 0x04, 0x7e, 0x00, 0x3b, 0xb9, 0x52,
  626. 0xdc, 0xa6, 0xcb, 0x8a, 0xf0, 0xe5, 0xb7, 0x79 },
  627. { 0xdf, 0x0c, 0x67, 0x86, 0x8f, 0xa2, 0x5f, 0x74,
  628. 0x8b, 0x70, 0x44, 0xc6, 0xe7, 0xc2, 0x45, 0xb8 },
  629. { 0xeb, 0xd7, 0x03, 0x41, 0xbc, 0xd4, 0x15, 0xb0 },
  630. { 0x12, 0x35, 0x9f, 0x5d, 0x82, 0x22, 0x0c, 0x14 },
  631. { 0x47, 0x9d, 0xd2, 0x5c, 0x20, 0x79, 0x2d, 0x63 },
  632. { 0x66, 0x19, 0x5d, 0xbe, 0xd0, 0x31, 0x32, 0x74,
  633. 0xc5, 0xca, 0x77, 0x66, 0x61, 0x5f, 0xa2, 0x5e },
  634. { 0x66, 0xbe, 0xc7, 0x07, 0xeb, 0x2a, 0xfc, 0x47,
  635. 0x6d, 0x74, 0x08, 0xa8, 0xf2, 0x92, 0x7b, 0x36 },
  636. { 0xae, 0xfd, 0xaa, 0x5d, 0xdd, 0x99 },
  637. { 0x12, 0xec, 0x2b, 0x87, 0xfb, 0xb1 }
  638. }, {
  639. /* 3GPP TS 35.208 v6.0.0 - 4.3.19 Test Set 19 */
  640. { 0x51, 0x22, 0x25, 0x02, 0x14, 0xc3, 0x3e, 0x72,
  641. 0x3a, 0x5d, 0xd5, 0x23, 0xfc, 0x14, 0x5f, 0xc0 },
  642. { 0x81, 0xe9, 0x2b, 0x6c, 0x0e, 0xe0, 0xe1, 0x2e,
  643. 0xbc, 0xeb, 0xa8, 0xd9, 0x2a, 0x99, 0xdf, 0xa5 },
  644. { 0x16, 0xf3, 0xb3, 0xf7, 0x0f, 0xc2 },
  645. { 0xc3, 0xab },
  646. { 0xc9, 0xe8, 0x76, 0x32, 0x86, 0xb5, 0xb9, 0xff,
  647. 0xbd, 0xf5, 0x6e, 0x12, 0x97, 0xd0, 0x88, 0x7b },
  648. { 0x98, 0x1d, 0x46, 0x4c, 0x7c, 0x52, 0xeb, 0x6e,
  649. 0x50, 0x36, 0x23, 0x49, 0x84, 0xad, 0x0b, 0xcf },
  650. { 0x2a, 0x5c, 0x23, 0xd1, 0x5e, 0xe3, 0x51, 0xd5 },
  651. { 0x62, 0xda, 0xe3, 0x85, 0x3f, 0x3a, 0xf9, 0xd2 },
  652. { 0x28, 0xd7, 0xb0, 0xf2, 0xa2, 0xec, 0x3d, 0xe5 },
  653. { 0x53, 0x49, 0xfb, 0xe0, 0x98, 0x64, 0x9f, 0x94,
  654. 0x8f, 0x5d, 0x2e, 0x97, 0x3a, 0x81, 0xc0, 0x0f },
  655. { 0x97, 0x44, 0x87, 0x1a, 0xd3, 0x2b, 0xf9, 0xbb,
  656. 0xd1, 0xdd, 0x5c, 0xe5, 0x4e, 0x3e, 0x2e, 0x5a },
  657. { 0xad, 0xa1, 0x5a, 0xeb, 0x7b, 0xb8 },
  658. { 0xd4, 0x61, 0xbc, 0x15, 0x47, 0x5d }
  659. }, {
  660. /* 3GPP TS 35.208 v6.0.0 - 4.3.20 Test Set 20 */
  661. { 0x90, 0xdc, 0xa4, 0xed, 0xa4, 0x5b, 0x53, 0xcf,
  662. 0x0f, 0x12, 0xd7, 0xc9, 0xc3, 0xbc, 0x6a, 0x89 },
  663. { 0x9f, 0xdd, 0xc7, 0x20, 0x92, 0xc6, 0xad, 0x03,
  664. 0x6b, 0x6e, 0x46, 0x47, 0x89, 0x31, 0x5b, 0x78 },
  665. { 0x20, 0xf8, 0x13, 0xbd, 0x41, 0x41 },
  666. { 0x61, 0xdf },
  667. { 0x3f, 0xfc, 0xfe, 0x5b, 0x7b, 0x11, 0x11, 0x58,
  668. 0x99, 0x20, 0xd3, 0x52, 0x8e, 0x84, 0xe6, 0x55 },
  669. { 0xcb, 0x9c, 0xcc, 0xc4, 0xb9, 0x25, 0x8e, 0x6d,
  670. 0xca, 0x47, 0x60, 0x37, 0x9f, 0xb8, 0x25, 0x81 },
  671. { 0x09, 0xdb, 0x94, 0xea, 0xb4, 0xf8, 0x14, 0x9e },
  672. { 0xa2, 0x94, 0x68, 0xaa, 0x97, 0x75, 0xb5, 0x27 },
  673. { 0xa9, 0x51, 0x00, 0xe2, 0x76, 0x09, 0x52, 0xcd },
  674. { 0xb5, 0xf2, 0xda, 0x03, 0x88, 0x3b, 0x69, 0xf9,
  675. 0x6b, 0xf5, 0x2e, 0x02, 0x9e, 0xd9, 0xac, 0x45 },
  676. { 0xb4, 0x72, 0x13, 0x68, 0xbc, 0x16, 0xea, 0x67,
  677. 0x87, 0x5c, 0x55, 0x98, 0x68, 0x8b, 0xb0, 0xef },
  678. { 0x83, 0xcf, 0xd5, 0x4d, 0xb9, 0x13 },
  679. { 0x4f, 0x20, 0x39, 0x39, 0x2d, 0xdc }
  680. }
  681. };
  682. #define NUM_TESTS ARRAY_SIZE(test_sets)
  683. int main(int argc, char *argv[])
  684. {
  685. u8 buf[16], buf2[16], buf3[16], buf4[16], buf5[16], opc[16];
  686. u8 auts[14], sqn[6], _rand[16];
  687. int ret = 0, res, i;
  688. const struct milenage_test_set *t;
  689. size_t res_len;
  690. wpa_debug_level = 0;
  691. printf("Milenage test sets\n");
  692. for (i = 0; i < NUM_TESTS; i++) {
  693. t = &test_sets[i];
  694. printf("Test Set %d\n", i + 1);
  695. milenage_opc(t->op, t->k, opc);
  696. if (memcmp(opc, t->opc, 16) != 0) {
  697. printf("- milenage_opc failed\n");
  698. ret++;
  699. }
  700. if (milenage_f1(opc, t->k, t->rand, t->sqn, t->amf, buf, buf2)
  701. || memcmp(buf, t->f1, 8) != 0) {
  702. printf("- milenage_f1 failed\n");
  703. ret++;
  704. }
  705. if (memcmp(buf2, t->f1star, 8) != 0) {
  706. printf("- milenage_f1* failed\n");
  707. ret++;
  708. }
  709. if (milenage_f2345(opc, t->k, t->rand, buf, buf2, buf3, buf4,
  710. buf5) ||
  711. memcmp(buf, t->f2, 8) != 0) {
  712. printf("- milenage_f2 failed\n");
  713. ret++;
  714. }
  715. if (memcmp(buf2, t->f3, 16) != 0) {
  716. printf("- milenage_f3 failed\n");
  717. ret++;
  718. }
  719. if (memcmp(buf3, t->f4, 16) != 0) {
  720. printf("- milenage_f4 failed\n");
  721. ret++;
  722. }
  723. if (memcmp(buf4, t->f5, 6) != 0) {
  724. printf("- milenage_f5 failed\n");
  725. ret++;
  726. }
  727. if (memcmp(buf5, t->f5star, 6) != 0) {
  728. printf("- milenage_f5* failed\n");
  729. ret++;
  730. }
  731. }
  732. printf("milenage_auts test:\n");
  733. os_memcpy(auts, "\x4f\x20\x39\x39\x2d\xdd", 6);
  734. os_memcpy(auts + 6, "\x4b\xb4\x31\x6e\xd4\xa1\x46\x88", 8);
  735. res = milenage_auts(t->opc, t->k, t->rand, auts, buf);
  736. printf("AUTS for test set %d: %d / SQN=%02x%02x%02x%02x%02x%02x\n",
  737. i, res, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
  738. if (res)
  739. ret++;
  740. os_memset(_rand, 0xaa, sizeof(_rand));
  741. os_memcpy(auts,
  742. "\x43\x68\x1a\xd3\xda\xf0\x06\xbc\xde\x40\x5a\x20\x72\x67",
  743. 14);
  744. res = milenage_auts(t->opc, t->k, _rand, auts, buf);
  745. printf("AUTS from a test USIM: %d / SQN=%02x%02x%02x%02x%02x%02x\n",
  746. res, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
  747. if (res)
  748. ret++;
  749. printf("milenage_generate test:\n");
  750. os_memcpy(sqn, "\x00\x00\x00\x00\x40\x44", 6);
  751. os_memcpy(_rand, "\x12\x69\xb8\x23\x41\x39\x35\x66\xfb\x99\x41\xe9\x84"
  752. "\x4f\xe6\x2f", 16);
  753. res_len = 8;
  754. milenage_generate(t->opc, t->amf, t->k, sqn, _rand, buf, buf2, buf3,
  755. buf4, &res_len);
  756. wpa_hexdump(MSG_DEBUG, "SQN", sqn, 6);
  757. wpa_hexdump(MSG_DEBUG, "RAND", _rand, 16);
  758. wpa_hexdump(MSG_DEBUG, "AUTN", buf, 16);
  759. wpa_hexdump(MSG_DEBUG, "IK", buf2, 16);
  760. wpa_hexdump(MSG_DEBUG, "CK", buf3, 16);
  761. wpa_hexdump(MSG_DEBUG, "RES", buf4, res_len);
  762. printf("GSM-Milenage test sets\n");
  763. for (i = 0; i < NUM_GSM_TESTS; i++) {
  764. const struct gsm_milenage_test_set *g;
  765. u8 sres[4], kc[8];
  766. g = &gsm_test_sets[i];
  767. printf("Test Set %d\n", i + 1);
  768. gsm_milenage(g->opc, g->ki, g->rand, sres, kc);
  769. if (memcmp(g->kc, kc, 8) != 0) {
  770. printf("- gsm_milenage Kc failed\n");
  771. ret++;
  772. }
  773. #ifdef GSM_MILENAGE_ALT_SRES
  774. if (memcmp(g->sres2, sres, 4) != 0) {
  775. printf("- gsm_milenage SRES#2 failed\n");
  776. ret++;
  777. }
  778. #else /* GSM_MILENAGE_ALT_SRES */
  779. if (memcmp(g->sres1, sres, 4) != 0) {
  780. printf("- gsm_milenage SRES#1 failed\n");
  781. ret++;
  782. }
  783. #endif /* GSM_MILENAGE_ALT_SRES */
  784. }
  785. if (ret)
  786. printf("Something failed\n");
  787. else
  788. printf("OK\n");
  789. return ret;
  790. }