QMK/lib/chibios/test/crypto/source/testref/ref_sha.c

104 lines
3.5 KiB
C

/*
ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "hal.h"
const uint8_t refSHA_SHA1_EMPTY[]={
0xDA,0x39,0xA3,0xEE,0x5E,0x6B,0x4B,0x0D,0x32,0x55,
0xBF,0xEF,0x95,0x60,0x18,0x90,0xAF,0xD8,0x07,0x09,
0x0D,0x0A,
};
const uint8_t refSHA_SHA1_3[]={
0xA9,0x99,0x3E,0x36,0x47,0x06,0x81,0x6A,0xBA,0x3E,
0x25,0x71,0x78,0x50,0xC2,0x6C,0x9C,0xD0,0xD8,0x9D,
};
const uint8_t refSHA_SHA1_56[]={
0x84,0x98,0x3E,0x44,0x1C,0x3B,0xD2,0x6E,0xBA,0xAE,
0x4A,0xA1,0xF9,0x51,0x29,0xE5,0xE5,0x46,0x70,0xF1,
};
const uint8_t refSHA_SHA1_64[]={
0x00,0x98,0xBA,0x82,0x4B,0x5C,0x16,0x42,0x7B,0xD7,
0xA1,0x12,0x2A,0x5A,0x44,0x2A,0x25,0xEC,0x64,0x4D,
};
const uint8_t refSHA_SHA1_128[]={
0xAD,0x5B,0x3F,0xDB,0xCB,0x52,0x67,0x78,0xC2,0x83,
0x9D,0x2F,0x15,0x1E,0xA7,0x53,0x99,0x5E,0x26,0xA0,
};
const uint8_t refSHA_SHA256_3[]={
0xBA,0x78,0x16,0xBF,0x8F,0x01,0xCF,0xEA,0x41,0x41,
0x40,0xDE,0x5D,0xAE,0x22,0x23,0xB0,0x03,0x61,0xA3,
0x96,0x17,0x7A,0x9C,0xB4,0x10,0xFF,0x61,0xF2,0x00,
0x15,0xAD,
};
const uint8_t refSHA_SHA256_56[]={
0x24,0x8D,0x6A,0x61,0xD2,0x06,0x38,0xB8,0xE5,0xC0,
0x26,0x93,0x0C,0x3E,0x60,0x39,0xA3,0x3C,0xE4,0x59,
0x64,0xFF,0x21,0x67,0xF6,0xEC,0xED,0xD4,0x19,0xDB,
0x06,0xC1,
};
const uint8_t refSHA_SHA256_64[]={
0xFF,0xE0,0x54,0xFE,0x7A,0xE0,0xCB,0x6D,0xC6,0x5C,
0x3A,0xF9,0xB6,0x1D,0x52,0x09,0xF4,0x39,0x85,0x1D,
0xB4,0x3D,0x0B,0xA5,0x99,0x73,0x37,0xDF,0x15,0x46,
0x68,0xEB,
};
const uint8_t refSHA_SHA256_128[]={
0x68,0x36,0xCF,0x13,0xBA,0xC4,0x00,0xE9,0x10,0x50,
0x71,0xCD,0x6A,0xF4,0x70,0x84,0xDF,0xAC,0xAD,0x4E,
0x5E,0x30,0x2C,0x94,0xBF,0xED,0x24,0xE0,0x13,0xAF,
0xB7,0x3E,
};
const uint8_t refSHA_SHA512_3[]={
0xDD,0xAF,0x35,0xA1,0x93,0x61,0x7A,0xBA,0xCC,0x41,
0x73,0x49,0xAE,0x20,0x41,0x31,0x12,0xE6,0xFA,0x4E,
0x89,0xA9,0x7E,0xA2,0x0A,0x9E,0xEE,0xE6,0x4B,0x55,
0xD3,0x9A,0x21,0x92,0x99,0x2A,0x27,0x4F,0xC1,0xA8,
0x36,0xBA,0x3C,0x23,0xA3,0xFE,0xEB,0xBD,0x45,0x4D,
0x44,0x23,0x64,0x3C,0xE8,0x0E,0x2A,0x9A,0xC9,0x4F,
0xA5,0x4C,0xA4,0x9F,
};
const uint8_t refSHA_SHA512_56[]={
0x20,0x4A,0x8F,0xC6,0xDD,0xA8,0x2F,0x0A,0x0C,0xED,
0x7B,0xEB,0x8E,0x08,0xA4,0x16,0x57,0xC1,0x6E,0xF4,
0x68,0xB2,0x28,0xA8,0x27,0x9B,0xE3,0x31,0xA7,0x03,
0xC3,0x35,0x96,0xFD,0x15,0xC1,0x3B,0x1B,0x07,0xF9,
0xAA,0x1D,0x3B,0xEA,0x57,0x78,0x9C,0xA0,0x31,0xAD,
0x85,0xC7,0xA7,0x1D,0xD7,0x03,0x54,0xEC,0x63,0x12,
0x38,0xCA,0x34,0x45,
};
const uint8_t refSHA_SHA512_64[]={
0x01,0xD3,0x5C,0x10,0xC6,0xC3,0x8C,0x2D,0xCF,0x48,
0xF7,0xEE,0xBB,0x32,0x35,0xFB,0x5A,0xD7,0x4A,0x65,
0xEC,0x4C,0xD0,0x16,0xE2,0x35,0x4C,0x63,0x7A,0x8F,
0xB4,0x9B,0x69,0x5E,0xF3,0xC1,0xD6,0xF7,0xAE,0x4C,
0xD7,0x4D,0x78,0xCC,0x9C,0x9B,0xCA,0xC9,0xD4,0xF2,
0x3A,0x73,0x01,0x99,0x98,0xA7,0xF7,0x30,0x38,0xA5,
0xC9,0xB2,0xDB,0xDE,
};
const uint8_t refSHA_SHA512_128[]={
0xB7,0x3D,0x19,0x29,0xAA,0x61,0x59,0x34,0xE6,0x1A,
0x87,0x15,0x96,0xB3,0xF3,0xB3,0x33,0x59,0xF4,0x2B,
0x81,0x75,0x60,0x2E,0x89,0xF7,0xE0,0x6E,0x5F,0x65,
0x8A,0x24,0x36,0x67,0x80,0x7E,0xD3,0x00,0x31,0x4B,
0x95,0xCA,0xCD,0xD5,0x79,0xF3,0xE3,0x3A,0xBD,0xFB,
0xE3,0x51,0x90,0x95,0x19,0xA8,0x46,0xD4,0x65,0xC5,
0x95,0x82,0xF3,0x21,
};