Commit f2422b58 authored by Diego Biurrun's avatar Diego Biurrun

testprogs: Mark some tables as static const

parent 5b1409c7
......@@ -27,23 +27,23 @@ int main(int argc, char **argv)
{
int i, j;
AVAES b;
uint8_t rkey[2][16] = {
static const uint8_t rkey[2][16] = {
{ 0 },
{ 0x10, 0xa5, 0x88, 0x69, 0xd7, 0x4b, 0xe5, 0xa3,
0x74, 0xcf, 0x86, 0x7c, 0xfb, 0x47, 0x38, 0x59 }
};
uint8_t pt[16], rpt[2][16] = {
static const uint8_t rpt[2][16] = {
{ 0x6a, 0x84, 0x86, 0x7c, 0xd7, 0x7e, 0x12, 0xad,
0x07, 0xea, 0x1b, 0xe8, 0x95, 0xc5, 0x3f, 0xa3 },
{ 0 }
};
uint8_t rct[2][16] = {
static const uint8_t rct[2][16] = {
{ 0x73, 0x22, 0x81, 0xc0, 0xa0, 0xaa, 0xb8, 0xf7,
0xa5, 0x4a, 0x0c, 0x67, 0xa0, 0xc4, 0x5e, 0xcf },
{ 0x6d, 0x25, 0x1e, 0x69, 0x44, 0xb0, 0x51, 0xe0,
0x4e, 0xaa, 0x6f, 0xb4, 0xdb, 0xf7, 0x84, 0x65 }
};
uint8_t temp[16];
uint8_t pt[16], temp[16];
int err = 0;
av_log_set_level(AV_LOG_DEBUG);
......
......@@ -25,7 +25,7 @@
int main(void)
{
int i;
const char *strings[] = {
static const char *strings[] = {
"''",
"",
":",
......
......@@ -25,7 +25,7 @@ int main(void)
{
uint8_t buf[1999];
int i;
int p[5][3] = {
static const int p[5][3] = {
{ AV_CRC_32_IEEE_LE, 0xEDB88320, 0x3D5CDD04 },
{ AV_CRC_32_IEEE, 0x04C11DB7, 0xC0F5BAE0 },
{ AV_CRC_16_ANSI_LE, 0xA001, 0xBFD8 },
......
......@@ -42,14 +42,14 @@ int main(void)
{
uint8_t key1[20], key3[131], data3[50];
enum AVHMACType i = AV_HMAC_SHA224;
const uint8_t key2[] = "Jefe";
const uint8_t data1[] = "Hi There";
const uint8_t data2[] = "what do ya want for nothing?";
const uint8_t data4[] = "Test Using Larger Than Block-Size Key - Hash Key First";
const uint8_t data5[] = "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data";
const uint8_t data6[] = "This is a test using a larger than block-size key and a larger "
"than block-size data. The key needs to be hashed before being used"
" by the HMAC algorithm.";
static const uint8_t key2[] = "Jefe";
static const uint8_t data1[] = "Hi There";
static const uint8_t data2[] = "what do ya want for nothing?";
static const uint8_t data4[] = "Test Using Larger Than Block-Size Key - Hash Key First";
static const uint8_t data5[] = "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data";
static const uint8_t data6[] = "This is a test using a larger than block-size key and a larger "
"than block-size data. The key needs to be hashed before being used"
" by the HMAC algorithm.";
AVHMAC *hmac = av_hmac_alloc(AV_HMAC_MD5);
if (!hmac)
return 1;
......
......@@ -68,7 +68,7 @@ int main(void)
{
int i;
TestContext test_ctx = { .class = &test_class };
const char *options[] = {
static const char *options[] = {
"",
":",
"=",
......
......@@ -25,7 +25,7 @@ int main(void)
int i, j, k;
AVSHA ctx;
unsigned char digest[32];
const int lengths[3] = { 160, 224, 256 };
static const int lengths[3] = { 160, 224, 256 };
for (j = 0; j < 3; j++) {
printf("Testing SHA-%d\n", lengths[j]);
......
......@@ -83,7 +83,7 @@ int main(void)
AVXTEA ctx;
uint8_t buf[16], iv[8];
int i, j;
const uint8_t src[32] = "HelloWorldHelloWorldHelloWorld";
static const uint8_t src[32] = "HelloWorldHelloWorldHelloWorld";
uint8_t ct[32];
uint8_t pl[32];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment