From 2cc2e986fb59d40ac4baa73c18b0906aa0b2105c Mon Sep 17 00:00:00 2001 From: Peter Torelli Date: Thu, 12 Jan 2023 21:51:56 -0800 Subject: [PATCH 1/8] Fixed sign/verify inconsistencies. The signatures for RSA were incorrect per PCKS#1. Generated new keys and signatures for EcDSA, Ed25519, and RSA. Re-did the code for wolfSSL sign and verify as well to use wc_SignatureVerify and wc_SignatureGenerate. --- .clang-format | 136 ++++++ examples/selfhosted/keys.h | 393 ++++++++++-------- examples/selfhosted/main.c | 56 +-- .../profile/wolfssl_th_api/th_ecdsa.c | 35 +- .../profile/wolfssl_th_api/th_rsa.c | 36 +- 5 files changed, 426 insertions(+), 230 deletions(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..01b2ef9 --- /dev/null +++ b/.clang-format @@ -0,0 +1,136 @@ +--- +Language: Cpp +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: true +AlignConsecutiveAssignments: true +AlignConsecutiveDeclarations: true +AlignEscapedNewlines: Left +AlignOperands: true +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: TopLevel +AlwaysBreakAfterReturnType: TopLevelDefinitions +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: false +BinPackParameters: false +BraceWrapping: + AfterCaseLabel: false + AfterClass: true + AfterControlStatement: true + AfterEnum: true + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: true + AfterStruct: true + AfterUnion: true + AfterExternBlock: true + BeforeCatch: true + BeforeElse: true + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: All +BreakBeforeBraces: Custom +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeComma +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeComma +BreakAfterJavaFieldAnnotations: true +BreakStringLiterals: true +ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: false +DeriveLineEnding: true +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: false +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + SortPriority: 0 + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + SortPriority: 0 + - Regex: '.*' + Priority: 1 + SortPriority: 0 +IncludeIsMainRegex: '(Test)?$' +IncludeIsMainSourceRegex: '' +IndentCaseLabels: true +IndentGotoLabels: true +IndentPPDirectives: None +IndentWidth: 4 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 4 +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: false +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Right +ReflowComments: true +SortIncludes: false +SortUsingDeclarations: false +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: true +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: false +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpaceBeforeSquareBrackets: false +Standard: Latest +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 8 +UseCRLF: false +UseTab: Never +... + diff --git a/examples/selfhosted/keys.h b/examples/selfhosted/keys.h index 3d10f63..8909231 100644 --- a/examples/selfhosted/keys.h +++ b/examples/selfhosted/keys.h @@ -1,5 +1,38 @@ #include +/* +Tips for generating RSA keys and signatures with openssl... + +openssl3 genrsa -out pri.pem 4096 +openssl3 rsa -in pri.pem -pubout -out pub.pem + +openssl3 rsa -in pri.pem -inform pem -out pri.der -outform der +openssl3 rsa -pubin -inform pem -in pub.pem -outform der -out pub.der + +openssl3 dgst -sha256 -sign pri.der -out sig.dat msg.txt + +xxd -i pub.der | grep 0x | sed 's/ //g' +xxd -i sig.dat | grep 0x | sed 's/ //g' + +prime256v1 -> p256r1 +secp384r1 -> p384r1 + +openssl3 ecparam -name secp384r1 -genkey -noout -out pri.der -outform der +openssl3 ec -in pri.der -inform der -pubout -out pub.der -outform der +openssl3 dgst -sha256 -sign pri.der -out sig.dat msg.txt + +xxd -i sig.dat | grep 0x | sed 's/ //g' + +OpenSSL creates ASN.1 encoded keys with OID, but we need uncompressed so +just extract from the 04 on. + + +openssl3 genpkey -algorithm ed25519 -out pri.der -outform der +openssl3 pkey -inform der -in pri.der -pubout -out pub.der -outform der +openssl3 pkeyutl -sign -inkey pri.der -out sig.dat -rawin -in msg.txt + + +*/ /** * @brief These are pre-made keys for the self-hosted version of the benchmark * in order to generate the proper CRC final checks. In the official version @@ -14,21 +47,21 @@ uint8_t g_ecc_public_key_p256r1[] = { 0x04, -0x75,0x64,0xfd,0x3f,0x96,0xe8,0x79,0x84,0x9b,0xf9,0x7c,0xc8,0xbb,0x28,0x5d,0xa1, -0x27,0x01,0xfb,0x4f,0xd5,0xff,0x4b,0xab,0x7e,0x52,0x17,0xbf,0x09,0x15,0xe9,0x48, -0xb0,0x54,0xbe,0x64,0x70,0xe5,0x28,0xd9,0xe1,0x45,0xfc,0xbc,0xdc,0x01,0x6f,0x6a, -0x4a,0xa1,0x55,0x8b,0x89,0xc8,0xe1,0x6f,0x90,0x1e,0xe1,0xc3,0xd4,0x60,0xa8,0xcc, +0xbd,0xae,0x1f,0xb6,0xf5,0x2f,0x59,0x0a,0x28,0x66,0xea,0xd9,0x05,0x32,0xba,0x16, +0xa7,0xc9,0x6d,0x99,0xc2,0xab,0x48,0xa9,0x8c,0xd4,0x98,0x22,0xcd,0x2d,0x77,0x09, +0xa1,0x9e,0xfa,0xb9,0xf3,0x4c,0x39,0x9e,0x4f,0x17,0xc5,0x82,0x4c,0x93,0x19,0x46, +0xcf,0x7d,0xa6,0x2c,0x98,0x7f,0xc0,0x79,0xce,0x35,0x31,0xf7,0x89,0x29,0x1f,0x20, }; uint8_t g_ecc_public_key_p384[] = { 0x04, -0xee,0x98,0xe9,0xaa,0x26,0x71,0xe8,0x72,0xcd,0x80,0xa9,0x6b,0x26,0x1f,0xb5,0x8d, -0xcf,0x8d,0xe8,0x21,0xd9,0xf8,0x51,0x50,0x3e,0xdc,0x5a,0xa8,0xf6,0x50,0xee,0x7e, -0x11,0xc2,0x24,0x9b,0xe6,0xde,0xe1,0xf3,0x43,0x1d,0x44,0x43,0xd9,0xd7,0x24,0xbf, -0xb3,0xd9,0xea,0xd8,0xd7,0x57,0x4c,0xbc,0x8e,0x6b,0xfa,0x5d,0xb8,0xda,0x9e,0xe6, -0x10,0x91,0x99,0x5d,0x73,0xd4,0x0e,0x4b,0x12,0xa5,0x42,0x9f,0xdc,0xff,0x2b,0x52, -0x55,0xa3,0xf9,0x9f,0x00,0xec,0x9b,0x1b,0x25,0x2d,0xb3,0xaa,0xd7,0x50,0x8b,0x36, +0xb6,0x74,0xcd,0x6c,0x5a,0x8e,0x35,0x1e,0x11,0xfd,0xdf,0x0c,0x5c,0x6b,0xfa,0xc1, +0xf9,0x1c,0xb6,0x87,0xfd,0xe8,0xb4,0xe4,0xe9,0x18,0x6c,0x75,0xa1,0xd2,0x70,0x0c, +0x65,0xd8,0x2f,0xfa,0x17,0xe9,0xb1,0x78,0x62,0xc2,0x66,0x36,0x3d,0x4f,0xbc,0x4b, +0x42,0x48,0x73,0xe8,0xc8,0xcd,0x69,0x50,0xee,0xd7,0x43,0xa7,0x79,0xdd,0xf6,0x02, +0xa2,0xb1,0xfc,0x00,0xd8,0x79,0x33,0x77,0xa1,0xda,0x29,0x10,0xeb,0x66,0xb0,0x95, +0x96,0x65,0x7c,0x2d,0x3a,0x66,0x8d,0x95,0xae,0xcb,0x91,0x8b,0xac,0xad,0x16,0x77, }; uint8_t g_ecc_public_key_c25519[] = @@ -41,8 +74,8 @@ uint8_t g_ecc_public_key_c25519[] = uint8_t g_ecc_public_key_ed25519[] = { // LITTLE-ENDIAN -0x77,0xee,0xaf,0x7f,0x13,0x65,0xcc,0x5f,0x60,0xcf,0x3d,0x7e,0x08,0xa6,0x2f,0xf0, -0xf8,0x18,0x1a,0xc8,0x1c,0x21,0x29,0xe8,0xf9,0x12,0x7f,0x44,0x26,0xfe,0x58,0x32, +0x75,0x1e,0x47,0xd5,0xfd,0x1f,0x46,0xf2,0x65,0x4c,0x94,0xae,0xfe,0xab,0x32,0xab, +0xca,0x14,0xb3,0x7d,0x4f,0x6b,0xa4,0x85,0xbd,0xc2,0x90,0x51,0x6d,0xe3,0x4c,0xb9, }; uint8_t g_rsa_public_key_2048[] = @@ -50,23 +83,23 @@ uint8_t g_rsa_public_key_2048[] = // ASN.1/DER 0x30,0x82,0x01,0x22,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01, 0x01,0x05,0x00,0x03,0x82,0x01,0x0f,0x00,0x30,0x82,0x01,0x0a,0x02,0x82,0x01,0x01, -0x00,0xc0,0xa3,0x67,0x5d,0xd5,0x76,0xa3,0x9f,0xc7,0x53,0x3a,0x6b,0x83,0x76,0x5f, -0xf7,0x1d,0x0d,0xe3,0x55,0x19,0xaa,0x95,0x71,0x09,0x22,0x88,0x11,0x5d,0x17,0x73, -0x7b,0xcf,0x09,0xb1,0xe0,0xff,0xee,0xe4,0x6b,0x1e,0x72,0x23,0xeb,0x36,0x68,0x05, -0xbb,0xdf,0x0e,0x17,0x29,0xc0,0x9e,0x07,0x8c,0xb9,0xf7,0x79,0x32,0x79,0x73,0x67, -0x19,0x35,0x17,0xe4,0xd9,0x3d,0x8e,0x95,0x95,0xcb,0xc4,0xa6,0x0b,0x78,0x48,0x1b, -0xf7,0x11,0x48,0xbc,0xfd,0x57,0xd7,0x57,0xbd,0x19,0x2d,0x0e,0x31,0x50,0xef,0x00, -0xfa,0x20,0xe6,0xf1,0xfb,0xef,0x10,0xae,0x37,0x83,0x4a,0x19,0x4c,0x58,0xc3,0xce, -0x7e,0xc5,0xeb,0xe0,0xbd,0x5a,0x36,0x49,0xa5,0xda,0x46,0x68,0x3e,0x3e,0x6b,0x40, -0x5b,0x60,0xd8,0x84,0x19,0xf1,0xc9,0xb2,0xe8,0x4e,0x10,0x07,0x5e,0xed,0xb9,0xad, -0x6d,0x30,0xd7,0x16,0x51,0xa9,0xdf,0xe9,0x40,0xc9,0x89,0xfc,0x78,0x81,0xbe,0x94, -0x51,0x6a,0x04,0x9d,0xff,0x5d,0xc1,0xab,0x4a,0xa2,0x3f,0x7d,0xb9,0x1f,0x98,0xbc, -0xa1,0xc0,0xf2,0xee,0xe1,0x90,0x28,0xff,0xab,0x86,0xec,0x05,0x3c,0xe6,0x6b,0x31, -0x02,0x59,0xf6,0xab,0x65,0x42,0x25,0x5b,0xfb,0xea,0x11,0x2a,0xc4,0x10,0xc7,0xca, -0x85,0xe2,0x74,0x19,0x2a,0xd5,0x9d,0x9d,0x5d,0xee,0x84,0xce,0x8b,0xe8,0x28,0x68, -0xcb,0x16,0xe2,0xde,0xfb,0x04,0x81,0x58,0x0d,0x01,0xfa,0x09,0xc2,0x09,0x69,0x1d, -0xf3,0x67,0x40,0x17,0xe3,0xb3,0xb1,0x1c,0xdc,0xfe,0xb7,0xa5,0xde,0x3a,0xa4,0x01, -0xc9,0x02,0x03,0x01,0x00,0x01, +0x00,0x8c,0x48,0xa3,0xa3,0xad,0xe4,0x8b,0x15,0xa7,0x46,0xa1,0xaf,0x62,0x99,0x23, +0x71,0xd6,0xbe,0x07,0x11,0x13,0x9e,0x2c,0x2b,0x16,0xe9,0xb1,0xd7,0x1a,0xbd,0x18, +0x44,0xf8,0xd5,0x69,0x42,0x25,0x36,0x89,0xf9,0x90,0x25,0x89,0xac,0x2a,0xa2,0xb7, +0x49,0x18,0xa2,0xe2,0x4b,0x6f,0xd8,0xe0,0x7b,0x0f,0xd1,0xb8,0x7c,0x19,0xc5,0x69, +0x23,0x52,0x56,0xf0,0x1c,0x3f,0x1e,0x63,0x07,0xff,0xea,0xee,0x77,0xac,0x46,0x7e, +0x99,0x20,0xd5,0xbf,0xb3,0x28,0x41,0x07,0xb1,0x2c,0xda,0x90,0x51,0x71,0xfa,0x15, +0x1d,0x30,0xaa,0x9b,0x33,0x40,0x17,0x5b,0xfa,0xfe,0xb8,0xd2,0x9c,0xbc,0x3d,0x9f, +0xaf,0x7e,0xe9,0x47,0xd6,0x4b,0xe2,0x87,0x9f,0x70,0x80,0xa0,0x28,0xe7,0x52,0xeb, +0x06,0x90,0xd2,0x21,0xe1,0x71,0x02,0xb6,0x94,0xca,0x47,0xb2,0x59,0x5d,0xf7,0x80, +0x8b,0x08,0x30,0xab,0x4d,0x2f,0x17,0x11,0x89,0x8e,0xb7,0xc3,0x6d,0x3c,0xe4,0xe4, +0x7d,0xab,0x05,0x1a,0xf2,0x46,0x5c,0xc4,0x64,0x3f,0xec,0x05,0xb6,0xef,0x55,0x22, +0x11,0xab,0xc1,0x70,0xec,0x4c,0x4d,0x08,0xc0,0x45,0xe4,0x60,0x71,0xfe,0x7e,0x67, +0xfc,0x8c,0x19,0x95,0xd7,0xd7,0xb8,0xe2,0x41,0xa7,0x77,0xfb,0x8c,0x80,0xa6,0xc0, +0x28,0x4c,0x58,0x61,0x4f,0xef,0x9d,0xe3,0x94,0x95,0xf1,0xd5,0x2e,0xd8,0x78,0x51, +0x93,0x2b,0x95,0x4e,0x3a,0x6a,0xad,0x33,0x69,0x09,0x4d,0x5b,0xf0,0xf0,0x4d,0x3f, +0x8a,0x1f,0x66,0xff,0x8d,0x7b,0x06,0xc0,0x0e,0xae,0x6e,0x72,0x35,0xda,0x4f,0x42, +0xaf,0x02,0x03,0x01,0x00,0x01, }; uint8_t g_rsa_public_key_3072[] = @@ -74,31 +107,31 @@ uint8_t g_rsa_public_key_3072[] = // ASN.1/DER 0x30,0x82,0x01,0xa2,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01, 0x01,0x05,0x00,0x03,0x82,0x01,0x8f,0x00,0x30,0x82,0x01,0x8a,0x02,0x82,0x01,0x81, -0x00,0x9a,0xf8,0x55,0xb6,0x91,0x97,0x09,0x5f,0x3d,0x76,0x8f,0x8d,0x1f,0x9d,0x18, -0x34,0x61,0x04,0x8b,0x2c,0x7f,0x77,0xf0,0x98,0xc4,0xf1,0x8d,0xc3,0xd1,0x8a,0x92, -0x26,0x01,0xb8,0xba,0x54,0xfb,0xc8,0x53,0x4f,0x99,0xed,0x30,0x0f,0xd5,0x5d,0xc8, -0x4c,0x50,0x66,0x18,0xa2,0xad,0xc8,0x22,0xb4,0x49,0x68,0xc1,0x3a,0x4b,0xaf,0x7a, -0xd0,0xae,0x21,0x70,0xba,0xd0,0xed,0xa5,0x58,0x56,0xeb,0x9c,0x69,0x13,0x1f,0xd5, -0x10,0xf2,0x35,0xff,0xf9,0xac,0x79,0xb4,0x10,0x6d,0xef,0xed,0x21,0xe6,0xf0,0x25, -0x0d,0xec,0xe7,0xc7,0x61,0x34,0xb0,0xec,0xe9,0x67,0x43,0x3a,0x8f,0x70,0xa3,0x05, -0x0c,0xb5,0x3a,0x3a,0xb7,0x12,0x31,0xbb,0x85,0xad,0x77,0x47,0xc1,0xb8,0xcd,0x06, -0xf6,0x9b,0xee,0x1f,0x61,0x8a,0xb5,0x7c,0x7a,0x1a,0x62,0x52,0xfe,0x84,0x1d,0x9a, -0x1f,0x8a,0x72,0x10,0x03,0xd1,0xca,0x85,0xff,0x35,0x56,0x07,0x3c,0xc9,0x9e,0x9e, -0x3f,0x8d,0xee,0x13,0xce,0xf1,0xac,0x1a,0xdf,0x30,0xce,0xc2,0x10,0xab,0x0c,0x61, -0x17,0x74,0xf3,0xf6,0x11,0x4f,0xd0,0x1b,0x90,0x7f,0x55,0x52,0x94,0x30,0xf4,0xb8, -0x12,0xd3,0x41,0xe5,0x9c,0x8a,0x8d,0x06,0x55,0xe9,0x96,0xf6,0x6c,0x27,0x56,0x32, -0x40,0xbd,0x84,0xe7,0xe3,0xbd,0x92,0x30,0x18,0x00,0xf2,0xf9,0xd1,0xdc,0xcf,0xe8, -0x6b,0x85,0x9e,0x07,0x7b,0x60,0xda,0x40,0xf6,0x3b,0x93,0x5e,0x09,0xec,0xd8,0x21, -0x40,0x88,0xd1,0x82,0x34,0x3a,0xef,0x21,0x49,0x52,0x37,0x89,0xc6,0x81,0x84,0x37, -0x84,0x2f,0x56,0x6a,0x37,0xb6,0x66,0x31,0xf2,0xce,0xcd,0x8d,0x30,0xfb,0xe3,0x0b, -0x88,0xa8,0xcc,0x11,0xea,0x0b,0x20,0xfc,0x97,0x91,0x1f,0x97,0xce,0xb4,0xf1,0x32, -0xff,0x3e,0xcd,0xed,0xd7,0xf7,0x70,0x0b,0x23,0x4a,0x50,0x63,0x0e,0x10,0x12,0x2f, -0xae,0x0e,0x9f,0x51,0x25,0x90,0x89,0x22,0x8e,0x2a,0x08,0x86,0x96,0xfe,0x89,0x25, -0x7f,0xa2,0x1e,0xd8,0xeb,0xcd,0xf5,0x07,0x2c,0x50,0x2d,0xb5,0x51,0xbf,0x9e,0x6c, -0x57,0xea,0x0f,0x01,0x3c,0x8c,0x9e,0x32,0x48,0xc3,0x4b,0xd9,0x1a,0xa8,0xe9,0x25, -0xf9,0xc7,0xda,0xd7,0x16,0x12,0x06,0x33,0x1d,0xfc,0xfa,0x34,0x74,0x48,0x2f,0x0e, -0x70,0x3a,0x94,0xff,0x3c,0xe2,0x7a,0x20,0x3d,0xc5,0x79,0x81,0x0a,0x7f,0xb0,0x4d, -0xfd,0x02,0x03,0x01,0x00,0x01, +0x00,0x9e,0x3d,0x37,0x72,0x89,0x7f,0xe6,0x6a,0xa7,0xfa,0x45,0x84,0xfb,0x32,0x0c, +0x55,0x6b,0x0e,0x85,0xd5,0x98,0xe2,0xf4,0x0a,0xa9,0x26,0xac,0x63,0x45,0x77,0xe7, +0xe9,0x90,0xa6,0x43,0xbb,0x20,0x0d,0xc0,0xd5,0xed,0xd7,0x38,0x89,0x21,0x99,0x9c, +0x54,0xf2,0x3b,0xf4,0x2e,0x41,0x63,0xa1,0x94,0x24,0xf1,0x3d,0x19,0x12,0xb3,0x66, +0x55,0x24,0x8a,0x58,0x1c,0x9e,0x9e,0xfe,0xfd,0xf6,0x01,0x37,0x01,0xbf,0x86,0x06, +0x63,0xc1,0xce,0x36,0x2e,0x9d,0xbd,0x89,0x82,0x5d,0x11,0xc7,0x4a,0xbf,0xfd,0x6f, +0x60,0x13,0x58,0xe3,0x20,0x90,0xff,0xcd,0xb7,0x28,0xa8,0xa4,0x1c,0x4e,0x86,0xfe, +0xa6,0xd0,0x28,0xdd,0x29,0x94,0x45,0x39,0x93,0x14,0xb7,0x7a,0xa9,0x83,0x58,0x52, +0x39,0x78,0xc0,0xf8,0xb6,0xaf,0x00,0xc7,0x0f,0xa5,0x18,0x68,0x7b,0x08,0x30,0x0d, +0xcf,0x8d,0xcc,0xc9,0xc0,0x52,0x83,0x84,0x26,0x4c,0xcd,0x1a,0xeb,0x5e,0x5b,0x61, +0xb2,0x07,0x62,0xf3,0xd0,0x3d,0x96,0x35,0x21,0xaa,0x63,0x99,0xd0,0xbf,0x04,0x3e, +0x6e,0xe7,0xd6,0xa2,0x7c,0xf5,0x1d,0xab,0x36,0x20,0x56,0x70,0xe9,0xc8,0x9f,0x8b, +0x79,0x64,0x6e,0x58,0x2d,0xf0,0x05,0x94,0x2b,0xfe,0x0f,0x5b,0xde,0xcf,0x47,0x73, +0x4b,0xf9,0x0f,0x35,0xcb,0x67,0x07,0x86,0x5e,0x15,0xd6,0xe2,0xcc,0xcb,0xc8,0x66, +0xca,0x2c,0x2a,0xf9,0xeb,0xdd,0x4b,0x36,0x5c,0x6d,0x17,0xc5,0xa2,0x01,0x7d,0xb9, +0x05,0x18,0x0b,0xa1,0x55,0x24,0x3b,0xda,0xa5,0xa0,0x42,0x59,0x54,0xae,0x70,0xed, +0x07,0x0b,0x86,0x0e,0xb8,0xae,0x13,0x10,0xc0,0x0f,0x90,0xb5,0x2f,0x10,0x97,0x4f, +0x02,0xf0,0x9e,0xe8,0xfd,0x60,0x2b,0x12,0xae,0x07,0xec,0x53,0x5a,0x48,0x12,0xb9, +0x76,0x83,0xf2,0xe6,0x96,0x6b,0xba,0xb1,0x31,0xf5,0x60,0xd5,0x47,0xdd,0x46,0xfb, +0x4b,0xf9,0x87,0xbb,0x2c,0xf0,0xfb,0x99,0x9c,0xbd,0xd8,0x18,0xf5,0x8d,0xb1,0xef, +0xfa,0x1e,0x6e,0x4b,0xd4,0x02,0x36,0x52,0x70,0x30,0xd1,0x36,0x89,0xdf,0x20,0x66, +0x65,0x97,0xe1,0x31,0x3a,0x86,0x86,0x05,0x1f,0x4f,0xe0,0x2d,0x9f,0x93,0x21,0x28, +0xcc,0x12,0xbc,0x04,0x7b,0x30,0x38,0x24,0x3d,0xcb,0xaa,0x2d,0x74,0x55,0x1e,0xa5, +0xe6,0xca,0xe3,0xca,0x87,0x67,0x76,0x99,0xdb,0xf2,0x02,0x5d,0x76,0x5e,0x5d,0xc7, +0x6b,0x02,0x03,0x01,0x00,0x01, }; uint8_t g_rsa_public_key_4096[] = @@ -106,165 +139,164 @@ uint8_t g_rsa_public_key_4096[] = // ASN.1/DER 0x30,0x82,0x02,0x22,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01, 0x01,0x05,0x00,0x03,0x82,0x02,0x0f,0x00,0x30,0x82,0x02,0x0a,0x02,0x82,0x02,0x01, -0x00,0xc3,0x3d,0x92,0x63,0x9d,0x26,0x28,0x16,0x42,0x15,0xec,0xcd,0xd9,0x48,0xd5, -0x33,0x78,0xf2,0x33,0x05,0x8d,0x3b,0x10,0x1b,0x9e,0x4c,0x9d,0xda,0x00,0x97,0xa8, -0x9c,0xcb,0x95,0xf5,0x70,0x68,0x66,0xed,0xa0,0x07,0xcf,0x00,0xde,0x37,0x0d,0xef, -0x17,0xa6,0x33,0x96,0xcb,0x6c,0x2e,0x96,0xc4,0x58,0x64,0x45,0x27,0x54,0xee,0x0d, -0xaf,0xac,0x80,0xfe,0x51,0x7a,0x5c,0x2e,0x0c,0xea,0xef,0xea,0xeb,0xc3,0xd1,0x0b, -0x60,0xe2,0x46,0xfe,0x50,0x01,0x01,0xa7,0xf8,0x11,0x12,0xf7,0xc2,0xdc,0x71,0xb7, -0x32,0xd5,0x6a,0x09,0xf7,0x3c,0x11,0x91,0xda,0xf0,0x52,0xaa,0x9b,0x78,0x50,0xf8, -0x45,0xd0,0xd6,0xf5,0xf8,0x61,0xef,0x0c,0xda,0x9e,0x46,0x34,0xc5,0x33,0x81,0x16, -0xf0,0x4f,0xda,0x9d,0x9a,0x2b,0xc1,0x38,0x84,0x31,0x41,0x66,0xe0,0x64,0x40,0x14, -0x6a,0x1f,0xba,0x0e,0x73,0xec,0xe0,0x61,0xd0,0x7a,0x81,0x10,0x9e,0x2a,0x35,0xcc, -0x92,0x14,0x58,0xda,0x83,0x65,0xc2,0x28,0x44,0xe8,0xc6,0x4f,0x0a,0x31,0xac,0x74, -0x0c,0x59,0x2d,0x4a,0x59,0x2a,0xf2,0x20,0x84,0xc3,0xd1,0x13,0x5a,0x04,0x87,0x78, -0xf4,0xee,0xef,0xf9,0xe2,0xd2,0xe0,0x6a,0x1c,0x67,0x92,0xf0,0x59,0x9a,0x55,0x95, -0x3d,0x30,0x14,0xeb,0x2e,0xdc,0x78,0x3e,0xf5,0xe3,0x1d,0x37,0xd1,0x6c,0xd8,0x41, -0xb2,0x39,0x53,0x98,0xa7,0x60,0xf8,0x18,0xb9,0x73,0x54,0xa3,0x49,0x4a,0xfa,0x00, -0x00,0xf8,0x68,0x3c,0x4f,0xd1,0xad,0xdb,0xbe,0x46,0xfe,0x7c,0x25,0xf6,0xb7,0x1d, -0xaf,0xfe,0xf6,0xb0,0xec,0x1a,0x14,0x22,0xbd,0x34,0x85,0xad,0x32,0xef,0x92,0x40, -0xb3,0x4e,0x07,0x53,0xc6,0xc4,0xa1,0xac,0xaa,0x4c,0x7c,0xa7,0xe4,0x47,0xf0,0xaf, -0xb6,0xd9,0x3f,0xd1,0x34,0xb4,0x08,0x3e,0x74,0xb9,0xa9,0xb3,0x02,0xb9,0x57,0x80, -0x20,0x8f,0x37,0x55,0x39,0xe2,0xbd,0x4b,0x85,0xe7,0x3a,0x73,0xb9,0x2d,0x5e,0xd6, -0xfb,0x50,0x8e,0x80,0xa7,0x79,0xd8,0x4a,0x09,0xc9,0x1c,0xf6,0xd6,0x82,0xea,0x55, -0x87,0xe2,0x38,0x53,0x31,0xda,0x7c,0x0f,0x49,0xc5,0xca,0xad,0xc4,0x05,0x2b,0x41, -0x76,0x1f,0x81,0xc6,0x3d,0x6e,0x67,0xc7,0x06,0x22,0x0f,0xd9,0x72,0x80,0xad,0x87, -0x20,0x7b,0x52,0xe4,0x6b,0xa9,0xb9,0x08,0xf4,0x55,0x4e,0x06,0xfc,0x02,0xc9,0xc8, -0x4c,0xf7,0x59,0x4b,0x61,0xe4,0x40,0xda,0xc3,0x29,0x27,0x62,0x2b,0xed,0x04,0xb9, -0x8d,0x75,0x03,0xe0,0x1c,0xa3,0x27,0x7e,0x58,0x3b,0x29,0x3d,0xae,0xd7,0x59,0xad, -0xba,0x54,0x62,0xba,0x95,0xaf,0xfa,0x9d,0x3e,0xe7,0x96,0xa9,0x46,0xc9,0x39,0xf3, -0xef,0x26,0xab,0x46,0xdf,0x6f,0x79,0x3e,0x93,0xff,0x8b,0x6a,0x27,0xa7,0x54,0x90, -0xe6,0x49,0xdb,0xec,0x74,0x9e,0x2e,0xae,0x5f,0x7b,0xdb,0x9c,0x20,0x38,0x9f,0x84, -0x4a,0x53,0x96,0xc1,0x1b,0xec,0xd6,0x4e,0xad,0xdd,0x84,0xae,0x90,0x78,0xa4,0xc1, -0xf2,0xa3,0x6e,0x4c,0x4a,0xd1,0x98,0xcc,0xf9,0x76,0x7f,0x8a,0x3e,0xa5,0x60,0xeb, -0x55,0x4d,0xa5,0x36,0x1d,0x24,0x8a,0x9b,0x3f,0x3e,0xfb,0xe9,0xd7,0xdb,0x29,0xfb, -0x9b,0x02,0x03,0x01,0x00,0x01, +0x00,0xa2,0xcd,0x53,0x24,0x7b,0x38,0x28,0x29,0x0f,0x25,0x20,0x9b,0xc6,0xa3,0x0b, +0xd8,0x99,0x97,0xfb,0x81,0x76,0x31,0x3f,0x13,0x9f,0x90,0x82,0xca,0x72,0x56,0xf8, +0xf5,0x50,0x41,0x4f,0x69,0x46,0x4a,0xb6,0xb3,0x2b,0xdc,0x14,0x8b,0x13,0xd0,0xec, +0x40,0x83,0x52,0x08,0x72,0x15,0x75,0xd7,0x79,0xd0,0xde,0x82,0xff,0xea,0xc6,0xeb, +0xcc,0x7c,0xcf,0xb8,0xaa,0x21,0x13,0xbf,0x6c,0xc7,0xa5,0xae,0x04,0x22,0x96,0xb9, +0x4e,0x83,0xab,0xc0,0xb4,0xa6,0x80,0x4c,0xc3,0x50,0x7a,0x2e,0x6c,0x01,0xfc,0x36, +0xd9,0xd8,0x9b,0xc1,0xfe,0x13,0xf5,0x16,0xe1,0x57,0xad,0x6d,0xcc,0xb5,0xdd,0xf2, +0x9d,0xbd,0x3f,0x45,0xb6,0x9f,0xf5,0x05,0x1c,0x2c,0x8f,0x4c,0xd3,0xe6,0x94,0x0c, +0x45,0x89,0x9a,0x31,0x08,0x4f,0x47,0xc5,0x75,0x17,0xe6,0xfd,0x3c,0x26,0x51,0x06, +0x23,0x97,0x48,0xaf,0x80,0x70,0xd8,0xe5,0xab,0x19,0x42,0x34,0x96,0x5d,0x2a,0x2a, +0x5c,0x5d,0x21,0x10,0x17,0xeb,0xef,0x70,0xa3,0x71,0x74,0xd9,0x5a,0xe0,0x4c,0x20, +0x84,0x9f,0x8d,0x03,0x56,0x3a,0x58,0x7c,0x8f,0x49,0xc5,0xc8,0xca,0x0f,0x45,0xf8, +0xb4,0xd7,0x72,0x34,0x33,0xca,0xc9,0xc6,0xb7,0x19,0x16,0xaa,0xff,0x37,0x52,0x62, +0x7a,0x34,0x30,0x55,0xd5,0x64,0xb0,0xb5,0x45,0x27,0xf2,0x54,0x02,0xe4,0xfc,0x1f, +0x3a,0x79,0x11,0xb6,0x5d,0xb6,0x6d,0x6b,0x94,0x23,0x49,0xba,0xb1,0x6b,0x34,0x68, +0x47,0x1a,0x32,0x71,0x83,0x5c,0x20,0x47,0x80,0x40,0xed,0xf5,0xc8,0x20,0x75,0x31, +0x71,0x4e,0x50,0x06,0x10,0xed,0x27,0x01,0xa6,0x39,0x61,0x96,0xa4,0x1e,0x71,0xfd, +0xbf,0x55,0x3c,0x04,0x48,0x2a,0x3c,0x70,0x80,0x29,0x76,0xf5,0xfc,0x50,0x59,0x12, +0xa6,0x18,0x46,0xba,0xa2,0x10,0x45,0x2a,0x5e,0xc6,0xc9,0x5f,0x37,0x14,0x7a,0x35, +0x59,0x85,0xe6,0xcb,0x28,0xbd,0xcf,0x0c,0xf1,0xb2,0xf1,0x50,0xea,0x26,0x05,0x3d, +0x89,0x50,0x23,0x77,0x78,0x93,0xfd,0xca,0xcf,0x53,0xc3,0x34,0x59,0x73,0xad,0x72, +0x2e,0x59,0x45,0xd5,0x04,0x5a,0x59,0x47,0x37,0x8e,0x93,0xe4,0xa2,0x48,0x3a,0xca, +0xe7,0x7c,0x5c,0x98,0xa7,0xda,0x8e,0x88,0x03,0xda,0xff,0xd9,0x82,0x17,0xf3,0x76, +0x2b,0xb0,0x6b,0x47,0x1d,0xf3,0x46,0x99,0x6b,0x7c,0xea,0xd9,0xce,0xc7,0x1d,0x87, +0x22,0x08,0x9c,0x21,0xd8,0x2a,0x1e,0x8b,0x39,0x13,0x43,0xa2,0x8c,0xb4,0xf8,0x68, +0xc0,0xa3,0xbb,0x34,0xc7,0xf7,0xaf,0xea,0xbf,0x5e,0xc0,0x24,0xc3,0x8a,0x2e,0x53, +0x11,0x7a,0x71,0x1e,0x58,0x0f,0xd6,0xfe,0x9b,0xd1,0xc3,0xec,0x8a,0x0a,0xb6,0x90, +0xda,0x8d,0x18,0x96,0xf6,0x28,0xe7,0xbb,0xf1,0x36,0xec,0xb6,0xe3,0x48,0x03,0x8d, +0x49,0xf0,0xe2,0xac,0x89,0x5e,0x02,0x36,0x6a,0xf2,0xba,0xcd,0x31,0x33,0xe3,0x3d, +0x48,0xe6,0xfd,0xdf,0x51,0xbe,0xa0,0x8a,0x40,0x81,0xda,0xfd,0x48,0x15,0xbd,0x43, +0xf0,0x1e,0x95,0x1d,0x60,0x97,0x3d,0xec,0xe5,0x50,0xd7,0x82,0xd2,0x92,0x5e,0xf7, +0x1d,0x4f,0xfb,0xaf,0xfb,0x19,0xd4,0x49,0xcc,0xf3,0xc7,0xf6,0x20,0xf3,0xbd,0x6e, +0x61,0x02,0x03,0x01,0x00,0x01, }; uint8_t g_dsa_message[] = { -/* SHA256 of "Tempus unum hominem manet." */ -0xb7,0x03,0xb9,0xc0,0x84,0xbe,0xe8,0xa2,0x78,0xa9,0x56,0x53,0x48,0x44,0xd7,0xfa, -0x40,0x10,0xa5,0x86,0x8c,0x0c,0x82,0xa4,0x50,0x6b,0xf8,0x1c,0x36,0x21,0x8d,0xe1, +/* `Tempus unum hominem manet.` */ +0x54,0x65,0x6d,0x70,0x75,0x73,0x20,0x75,0x6e,0x75,0x6d,0x20,0x68,0x6f,0x6d,0x69, +0x6e,0x65,0x6d,0x20,0x6d,0x61,0x6e,0x65,0x74,0x2e, }; // Signed with g_ecc_private_key_p256r1 DetK, HMAC_SHA256, ASN.1 uint8_t g_ecc_signature_p256r1[] = { -0x30,0x45,0x02,0x21,0x00,0xaa,0x14,0x5c,0xc9,0x9f,0xc3,0x7b,0x77,0xa5,0xb8,0x54, -0xd8,0xe7,0xab,0x5e,0x92,0x52,0xcf,0xf2,0x5f,0xf6,0x12,0x7b,0x55,0x68,0xd7,0x1e, -0x06,0xbe,0x00,0xe6,0x01,0x02,0x20,0x64,0x58,0x99,0x0c,0xdd,0x99,0x9f,0x06,0x21, -0xb7,0x98,0x12,0x05,0x86,0x42,0xa4,0x11,0x89,0x28,0xd5,0x91,0x6a,0xf6,0x4b,0x0e, -0x0d,0x22,0xdb,0x73,0x3a,0xef,0x6e, +0x30,0x45,0x02,0x20,0x01,0x2a,0xeb,0x1a,0xff,0x3c,0x2e,0xc5,0x3d,0x8b,0x9d,0xff, +0xb1,0x96,0xc1,0xb4,0x13,0xbd,0xb5,0x1b,0x7b,0xf0,0xe7,0xcc,0xe0,0x3d,0x0f,0xd8, +0x67,0xf9,0x06,0xf2,0x02,0x21,0x00,0xb7,0xc3,0xde,0x0b,0x20,0x39,0x2f,0x68,0x2e, +0xd3,0x7b,0xa1,0xe2,0x04,0xd3,0xd0,0xc5,0xac,0x5b,0xa4,0x6a,0xf1,0x76,0x59,0xf1, +0x23,0x84,0x61,0x69,0xdb,0x7e,0xdd, }; // Signed with g_ecc_private_key_p384r1 DetK, HMAC_SHA256 [sic], ASN.1 uint8_t g_ecc_signature_p384[] = { -0x30,0x66,0x02,0x31,0x00,0xe3,0x4b,0xad,0x5d,0x67,0xda,0x72,0x57,0x84,0xec,0xb4, -0x04,0xd3,0xf2,0x49,0xd8,0xaf,0xf5,0x07,0x67,0xb3,0xc0,0x89,0xd8,0xc6,0x6c,0x70, -0x6d,0x44,0x8e,0xc1,0x70,0x30,0x62,0x18,0x17,0x9f,0x20,0xcd,0x76,0xbd,0x7b,0x7d, -0x46,0xca,0x0b,0x4a,0x9e,0x02,0x31,0x00,0xb4,0x91,0x58,0xdf,0x87,0xeb,0x9f,0x3b, -0xb1,0x85,0xf7,0x13,0x58,0x51,0xc4,0x09,0x0e,0x93,0xd3,0x06,0x3a,0x94,0x15,0x9c, -0x34,0x16,0x69,0x2b,0xeb,0x42,0x04,0xf4,0x16,0x0b,0x58,0xc8,0xe4,0xf9,0xa4,0x42, -0xe7,0x1b,0x9a,0xff,0xcc,0x7d,0x82,0xef, +0x30,0x65,0x02,0x31,0x00,0xf5,0x32,0x2a,0x23,0xd1,0xa4,0x48,0xed,0x4a,0x71,0x8c, +0x9c,0x3c,0x7a,0x3b,0x5a,0xd9,0xc6,0x73,0xad,0xd9,0x70,0xb8,0x6a,0x8c,0xe3,0x47, +0x9d,0x9d,0xc8,0xf5,0x59,0x4f,0xe6,0x3f,0x5e,0x17,0xac,0x79,0x3c,0x4c,0x45,0xd4, +0x97,0x5c,0xc9,0x27,0xc9,0x02,0x30,0x2c,0x81,0x31,0x77,0xa6,0x98,0x89,0x81,0x01, +0xd3,0x00,0xc5,0xae,0x38,0x92,0x6b,0xca,0x06,0x77,0xb9,0xd4,0xbf,0x51,0xb2,0x82, +0xda,0x07,0xf3,0x0d,0xd3,0xd1,0x0f,0x78,0xf7,0xae,0xc4,0xb6,0x0c,0x2f,0xe6,0xb4, +0x14,0x0d,0x50,0x4a,0x13,0xcd,0xe9, }; // Signed with g_ecc_private_key_ed25519, Raw { R | S } little endian uint8_t g_ecc_signature_ed25519[] = { -0xdf,0x49,0x7d,0x8d,0xf9,0xfe,0x67,0x89,0x58,0x5d,0x4c,0xed,0x09,0x61,0x7d,0x38, -0x17,0xda,0xb8,0xcc,0x16,0x0a,0x79,0xbd,0x72,0x60,0x3d,0x56,0xaa,0x87,0x21,0x2e, -0x0f,0x3d,0x7c,0xb2,0xc2,0xb5,0x58,0xc3,0x9f,0xc9,0xe4,0x49,0x22,0x8d,0x78,0xf7, -0xbf,0x96,0x8a,0x3f,0xba,0xa8,0xf0,0x15,0xe8,0x5b,0xce,0xce,0xca,0x01,0x1d,0x0f, +0x8f,0x57,0xa4,0x5d,0x6a,0x0b,0x0c,0x94,0x7a,0x7b,0x0f,0xec,0x83,0x72,0xf6,0xf2, +0x1e,0x7d,0xd0,0xce,0x70,0x91,0x7f,0xbb,0xce,0x9d,0x0f,0x1a,0xbc,0x8d,0x57,0x0c, +0xd9,0x1c,0xa3,0x4f,0xd7,0x89,0x16,0xce,0xb7,0x0e,0x29,0x9c,0xc1,0x00,0x7b,0xf0, +0xa5,0xe2,0x13,0x4c,0x86,0xe3,0xef,0x48,0x6e,0xd1,0x9b,0x76,0xbf,0x0d,0xe5,0x01, }; - // Always 256 bytes uint8_t g_rsa_sig_2048[] = { -0x94,0x57,0xc5,0x10,0x90,0x14,0xc6,0x5b,0x59,0xbb,0x8c,0x17,0xb7,0x27,0xde,0xe5, -0xbe,0x45,0x93,0x7c,0x00,0xfa,0xd1,0x7e,0xe7,0x6d,0x7e,0x88,0x28,0x0c,0x55,0x70, -0x95,0x3e,0xaa,0xbe,0x68,0x2f,0x77,0x1e,0x0a,0xb0,0x3d,0xba,0xa7,0x15,0x7c,0x6e, -0xa4,0xa2,0xb3,0xe3,0x43,0x8a,0x23,0x1e,0xf2,0x39,0xb7,0xcf,0x69,0xa9,0xf0,0xd2, -0x24,0x93,0x52,0xdb,0xa3,0x74,0x49,0xf4,0x7c,0x45,0xcc,0xe9,0x7c,0xdc,0x66,0xdb, -0xa3,0x68,0x03,0xcd,0xb8,0x92,0x2d,0xfa,0x78,0x52,0xe7,0x2c,0x6c,0xd2,0x60,0x46, -0x53,0x28,0x81,0x6e,0x1c,0xdf,0x0f,0x7a,0x23,0xa7,0xdc,0x8f,0xb8,0xb1,0x7c,0x1f, -0x61,0x8f,0x1e,0x69,0xaa,0x4a,0x7e,0x90,0x50,0x27,0x62,0xa2,0x5f,0xd0,0x54,0xb3, -0xc8,0x0b,0xa2,0xa0,0x27,0xfb,0xd6,0xf4,0x71,0xab,0x55,0x5c,0xae,0x2d,0x20,0x4a, -0x34,0xa2,0x6c,0x13,0x84,0xe3,0xfb,0x94,0x39,0xdd,0x43,0x7e,0x5d,0xf9,0xb0,0xfb, -0x89,0x85,0x50,0x43,0xd4,0x9d,0xeb,0x32,0x42,0xac,0x79,0x28,0x3d,0xac,0xff,0xde, -0xc4,0xd8,0xd2,0x29,0x37,0x2f,0xc0,0xf4,0x31,0xf4,0x6b,0xce,0x10,0xd6,0xc7,0xed, -0x2c,0x6f,0xd1,0x41,0x32,0xbf,0xfb,0xca,0x88,0xfb,0x8d,0x25,0x8d,0x60,0xe2,0x06, -0xb5,0x4b,0xf9,0xe3,0xa3,0xf5,0xeb,0x52,0x24,0x0c,0x6e,0xd7,0x85,0xb7,0x27,0x68, -0x86,0x19,0x14,0x24,0x2f,0xc7,0xd2,0x65,0x2e,0x0c,0x1c,0x1f,0xd2,0x4b,0x2b,0x49, -0xbe,0x5f,0x5e,0x72,0xa1,0x3f,0x47,0xd8,0x90,0x37,0xa4,0xaf,0x56,0x65,0x51,0x9e, +0x6d,0x51,0xd7,0x61,0xce,0xcf,0x85,0x1c,0x0e,0x36,0x0c,0xe1,0x80,0x08,0x3a,0x5c, +0x73,0x49,0xb6,0x56,0xae,0x8b,0x69,0x4e,0x3a,0x9b,0x41,0x57,0xf8,0x43,0x42,0x20, +0x0b,0x8a,0x60,0xc0,0xe4,0x9d,0xc3,0x00,0x1c,0xeb,0xff,0x27,0x10,0x1f,0x79,0x6b, +0xd3,0xc6,0x8c,0x66,0xa8,0x61,0x8f,0x6e,0xf1,0x79,0x68,0x6c,0x78,0xda,0x76,0x26, +0x3f,0xbe,0x40,0xd0,0x39,0x2e,0xbb,0x01,0xe7,0x43,0xab,0xfa,0x5d,0x2c,0xa6,0xa6, +0xe8,0x41,0xd7,0x8f,0x8a,0x34,0xac,0x18,0xa0,0x3b,0x4e,0xb1,0x55,0x41,0x5d,0xaf, +0x68,0x45,0x23,0x1b,0x67,0x87,0x7f,0x12,0xbe,0xca,0x81,0xe5,0xcb,0x2c,0x1f,0x96, +0x78,0xc2,0x7f,0x0c,0x88,0xf0,0xca,0xe8,0x63,0xa9,0x90,0x99,0x25,0x15,0x38,0x58, +0xcd,0x7c,0x1c,0xb0,0x0d,0xc2,0xb4,0x8d,0x98,0x52,0xf2,0x64,0xfe,0xd8,0xbc,0x9b, +0x83,0x13,0x97,0xa5,0xfa,0xbf,0x26,0x17,0xaa,0x9f,0xcc,0xe1,0x5d,0xb0,0x41,0x75, +0x97,0xd6,0x8d,0x2a,0x02,0xaf,0x3f,0xb0,0xff,0x10,0x6f,0xac,0xf0,0x8c,0xd2,0x38, +0x38,0x0b,0xf1,0x65,0x24,0xca,0x08,0x43,0x2c,0xc2,0x2f,0x4a,0x87,0xfa,0xf9,0xbd, +0x98,0x40,0xfd,0xb9,0x3f,0x81,0x76,0xb3,0x34,0x9d,0xd8,0x34,0x21,0x7c,0xe2,0x22, +0x18,0x03,0xc3,0x98,0x83,0x3e,0xd0,0x80,0xd2,0x6f,0x47,0x13,0x25,0x7a,0xe5,0xfb, +0x70,0x72,0x7e,0x63,0xe9,0x14,0x99,0xfc,0x14,0xae,0xa1,0x6b,0x6f,0xa2,0x0e,0x5c, +0x09,0x66,0x9c,0x91,0xdb,0xec,0xd8,0x05,0x90,0xdb,0x2b,0x75,0xe1,0x6e,0x32,0x04, }; // Always 384 bytes uint8_t g_rsa_sig_3072[] = { -0x2d,0x26,0x39,0xb1,0x3c,0x5b,0xe5,0x12,0xf4,0x07,0x87,0x69,0xc8,0xec,0xfc,0xef, -0x19,0x0d,0x87,0xed,0x6c,0x72,0x42,0xa1,0xc2,0x09,0x0d,0x17,0x4a,0xbb,0xd8,0x81, -0x16,0xe9,0x80,0x86,0x95,0x5f,0x96,0x48,0x65,0xfd,0x27,0xe0,0x7e,0x5c,0xfa,0x3e, -0x42,0x96,0x2c,0x43,0x81,0x41,0x71,0xc1,0xd1,0x58,0xb8,0xb6,0x87,0x04,0xfc,0x37, -0x45,0x50,0xa6,0x3d,0xff,0x9c,0xb1,0xff,0x83,0xd5,0x33,0xd3,0x0c,0xce,0xc8,0x3f, -0xcc,0x51,0x00,0x50,0xdf,0xfa,0xe1,0x0a,0x10,0x7f,0xaf,0xae,0x63,0x9f,0xcc,0x47, -0xea,0x8e,0x19,0x38,0x6e,0xbc,0xde,0xec,0x01,0x6c,0x13,0xb9,0xdf,0x06,0xb8,0x69, -0x5a,0xea,0xad,0x52,0x0a,0xcc,0xb3,0xf1,0xe2,0xbb,0x91,0x74,0xf2,0x80,0x00,0xf1, -0xc9,0xe5,0x95,0xd1,0x6a,0x0a,0xbc,0x31,0x5e,0x6d,0x31,0x2c,0x08,0x3e,0xf2,0x63, -0x2c,0x19,0x23,0x09,0x25,0xab,0x49,0x01,0x3a,0x4c,0xb8,0x2b,0xde,0xa7,0x7c,0xad, -0x8a,0x64,0x36,0x56,0x29,0x0a,0x0d,0xed,0x8a,0xd7,0xe5,0xd5,0x22,0xe1,0xe9,0xcb, -0xbf,0xb0,0x6c,0x13,0x6b,0xce,0x4b,0x52,0xa6,0x77,0x84,0x4f,0x4e,0x3b,0xec,0x92, -0x68,0xd5,0x37,0x37,0x4f,0xba,0xe6,0x9d,0x4a,0xf1,0x2c,0xdc,0xa4,0x58,0x0f,0x99, -0xfa,0x1b,0x7a,0x50,0xcc,0x71,0x1c,0xac,0x43,0xfe,0x5d,0x66,0xa4,0x30,0x45,0x61, -0x7b,0x5e,0xc9,0x3f,0xa9,0x12,0xfc,0x71,0x2c,0xf6,0x1a,0x0b,0xf6,0x19,0x87,0x0a, -0x28,0x70,0x3d,0xfa,0x93,0x00,0xea,0x79,0x47,0x9e,0x4a,0x03,0xfa,0xb8,0xcf,0x34, -0xe7,0x96,0xc2,0x8a,0x20,0x21,0x4e,0xfc,0x03,0xff,0x4a,0xc7,0xa8,0xf4,0xff,0x4f, -0x56,0xda,0x6b,0xf2,0x80,0x19,0x43,0x41,0x58,0xe1,0x5f,0x25,0xe9,0x9f,0x0d,0x0f, -0xb6,0x63,0xf9,0xad,0x89,0xa5,0x95,0xab,0x89,0x60,0xe7,0xda,0x7a,0xac,0xd4,0x7c, -0x06,0x2d,0xcf,0x61,0x6c,0x99,0x8e,0xf2,0x84,0x08,0x30,0x3a,0xff,0x8c,0x1c,0x5b, -0xca,0xd5,0x75,0x25,0x2f,0x76,0x1d,0x4f,0x23,0xe2,0x0d,0x30,0x24,0xef,0x85,0x7b, -0x46,0x85,0x65,0xaa,0x4e,0xd3,0x21,0x50,0x0a,0x25,0x7f,0xb4,0x82,0x7e,0xf7,0x27, -0x37,0x8f,0xb7,0x94,0xe7,0x07,0x0b,0x81,0xa4,0x13,0xa4,0x31,0x2f,0xc1,0xf2,0x9a, -0x29,0x70,0x05,0x67,0xa5,0xeb,0x09,0xf4,0x5c,0xdd,0x45,0x85,0xe4,0xda,0x60,0xe1, +0x79,0xa7,0xe8,0xa1,0x70,0xdd,0x7a,0x33,0xc7,0xb5,0x36,0x33,0x61,0x8f,0xa0,0x99, +0x0c,0x54,0x0d,0xe2,0x10,0x54,0x67,0x0f,0xc5,0xf2,0x83,0x08,0x81,0x0a,0x8e,0x72, +0x73,0x4d,0x4d,0x34,0x9c,0x1b,0xd5,0xf7,0xa1,0x9e,0x64,0x35,0x74,0xf2,0x0c,0x95, +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0x75,0x1e,0xab,0x7f,0x8f, +0xb5,0xeb,0x62,0x06,0x39,0xf1,0xa1,0x30,0x4a,0x5a,0x90,0x93,0xad,0x6b,0x88,0xa7, +0xeb,0x7d,0x84,0x23,0xaa,0x7c,0x05,0xcc,0xfa,0xf3,0xf8,0x95,0x2d,0x87,0x95,0x56, +0xf7,0x70,0x84,0x96,0xf9,0x9d,0xa2,0xb3,0x3c,0xab,0x77,0x9d,0x21,0x83,0x8d,0x03, +0x8f,0x61,0x82,0xf8,0x9e,0xf5,0xe2,0x36,0x2b,0x54,0x23,0xc1,0xdf,0x30,0x4d,0xa6, +0x17,0x35,0xcf,0x40,0xd2,0x68,0x8c,0x97,0xc0,0x86,0x82,0x29,0xc9,0x65,0x34,0x9f, +0xb1,0x84,0x1d,0x76,0xb7,0x62,0xd4,0x5d,0xed,0xc5,0x98,0xe5,0x6c,0x98,0x03,0x16, +0x42,0x3c,0x31,0x9b,0x29,0x5a,0xde,0x55,0xa5,0x84,0xc5,0x2b,0x7d,0x66,0x4e,0xfa, }; // Always 512 bytes uint8_t g_rsa_sig_4096[] = { -0x9f,0x30,0xd3,0xe2,0xba,0x89,0x5a,0x43,0x99,0x7b,0x84,0x6f,0x7b,0x26,0x33,0x1f, -0xb2,0x52,0x74,0x79,0x45,0x49,0xe6,0x82,0x33,0xa3,0x19,0x24,0x14,0x20,0x61,0xd3, -0x6f,0x89,0x76,0xb2,0x28,0x7f,0xf0,0x03,0x5e,0x12,0x75,0x13,0x81,0x32,0x2e,0xb5, -0x6a,0x60,0x2b,0xcd,0xe1,0x5c,0xc9,0x9e,0xe0,0xee,0x44,0xb8,0xee,0x50,0x74,0x80, -0xfc,0x68,0x60,0x6a,0xcf,0xf9,0x10,0x4e,0x97,0xaf,0xf4,0x42,0xcb,0x71,0x84,0x98, -0x55,0x8b,0x61,0x65,0xfd,0x9b,0x99,0xbe,0xd3,0xf9,0xc7,0x19,0x3c,0x15,0x3a,0xa4, -0x3d,0x7a,0xeb,0x0b,0x81,0x8b,0x86,0x5a,0xb4,0x25,0x68,0xe5,0x40,0x64,0xa7,0x2e, -0xc3,0x5e,0x6c,0x72,0xba,0x7f,0xcb,0xfd,0x91,0x9c,0x69,0x20,0x46,0xef,0xc5,0xd2, -0x73,0x30,0x43,0x6d,0x89,0x91,0xbf,0x41,0x99,0x81,0xfb,0xbc,0xcb,0xe1,0x9c,0xb1, -0x62,0x5a,0x41,0x3f,0xd6,0xb9,0xe2,0xd1,0x90,0xe1,0xd2,0x77,0xf4,0xde,0xcf,0xc1, -0xf0,0x62,0xf8,0x46,0x7e,0x8e,0xfc,0x43,0xe4,0xa3,0x75,0x49,0x1c,0xd7,0x02,0x72, -0x17,0xb8,0x7b,0x71,0x50,0x1c,0xda,0xef,0x4c,0x3d,0x85,0x7b,0xd1,0x27,0x25,0x60, -0x3a,0xb2,0x0f,0x2b,0x7b,0xc2,0x65,0x9b,0xef,0x63,0x25,0xe2,0xfe,0x42,0x70,0xc7, -0x8d,0x40,0xb0,0xd9,0xba,0x94,0xd3,0x9b,0x1c,0x33,0x7d,0x54,0x3d,0xf8,0x30,0xaf, -0x98,0x11,0x6e,0x2d,0x8a,0x21,0xd6,0x1a,0xa7,0x22,0x1e,0x05,0xde,0xb3,0x66,0x04, -0x2c,0x20,0xf6,0xc6,0xb5,0xf7,0x40,0x58,0x50,0xe5,0xf8,0x9b,0xf9,0x11,0x1a,0x2e, -0x41,0x61,0x40,0xa9,0xca,0x3f,0x4e,0xe0,0xee,0x1c,0x3b,0xae,0x73,0x10,0xaa,0xdf, -0x94,0xd4,0xd8,0x49,0x30,0xc7,0x61,0x5b,0x67,0x80,0x5b,0x2b,0xa2,0x14,0x46,0x67, -0xe7,0x8c,0x11,0xc4,0xfc,0x00,0xd5,0xf3,0x99,0xfb,0x00,0x04,0x12,0x72,0x0c,0x23, -0xf5,0xc6,0xa1,0xaf,0xfa,0x27,0x7a,0xb8,0xb8,0xef,0x5c,0x05,0x95,0x9c,0x09,0xa5, -0xf5,0x90,0x56,0x70,0x4f,0xf9,0x17,0x06,0xa4,0xad,0x65,0x91,0x14,0x20,0x46,0x39, -0x2a,0xe0,0xaf,0xbe,0xab,0x14,0xf4,0x14,0x6d,0xa6,0x34,0xfc,0x5c,0xd7,0x9e,0xad, -0x59,0x8e,0x84,0xfc,0xe2,0x99,0x0c,0x7f,0x46,0xfd,0x28,0x50,0xa0,0x55,0x51,0x74, -0xc8,0x2f,0x47,0x00,0x7a,0x24,0x31,0x97,0x74,0xdd,0xb6,0x06,0x8b,0xce,0xcf,0x20, -0x35,0x2e,0x2b,0x9d,0x28,0x7c,0x8a,0xf5,0x02,0x0f,0xb3,0xb8,0x71,0x9d,0xc3,0xed, -0x97,0x2b,0xf7,0x88,0x87,0xa9,0x91,0xd4,0x26,0x38,0xdc,0x04,0xfb,0x2b,0x6e,0xae, -0xc4,0x1e,0x14,0x75,0xa3,0xa4,0xb5,0xd9,0xa6,0xe2,0xf0,0xb5,0xdb,0xab,0xa3,0x56, -0x6d,0x21,0xb4,0x71,0xd4,0x20,0xf3,0xfe,0x82,0xfb,0x09,0x5d,0x6d,0xc3,0x22,0x87, -0x7e,0xa9,0x92,0x62,0xf3,0x49,0x8c,0x88,0x17,0x7e,0xf3,0x76,0x12,0x7d,0x36,0x09, -0x97,0xdc,0x28,0x2a,0x73,0xe6,0x91,0xcb,0x0b,0xbc,0x4d,0xe3,0x7f,0x91,0xad,0x8c, -0x99,0x47,0x51,0x70,0x12,0x6f,0x58,0x55,0x5b,0xc2,0x43,0xa8,0xf8,0xc8,0xa3,0xb2, -0x63,0x59,0xa6,0x36,0xd8,0x53,0x1c,0x2a,0xa0,0x94,0xb4,0x0e,0x36,0x0d,0x5a,0x68, +0x2a,0x91,0x3a,0xd9,0x8c,0xd3,0x2d,0xff,0x6e,0xa0,0x5d,0x20,0x3b,0x9b,0x4a,0x94, +0xa7,0x2a,0xfe,0x4f,0xdc,0xe5,0x92,0x87,0x38,0xde,0x7b,0x37,0xc3,0x37,0xe3,0x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x70,0xc3,0x62,0xfb,0xf8,0x15, +0x5d,0x97,0x80,0x9a,0x21,0xe8,0x6b,0x32,0xbd,0x99,0xdf,0xa1,0x3e,0xec,0xad,0x20, +0x44,0xcb,0xf7,0xd2,0x1b,0x8c,0x42,0x55,0x40,0xe9,0xb5,0x2e,0xed,0x00,0x82,0xfc, +0x2f,0xe6,0xa1,0xc3,0x5d,0x8b,0x4d,0x15,0xfc,0xd3,0x06,0x56,0x95,0x5a,0xff,0x8b, +0xeb,0x0e,0xeb,0x05,0x01,0x8d,0x04,0x1e,0xfc,0x5a,0xb1,0x2e,0xcb,0x96,0x8a,0xe1, +0x5b,0xf0,0xe3,0x2c,0xc0,0xdb,0x43,0x9a,0x8a,0x54,0x3a,0xed,0x1c,0xb0,0xf8,0x26, +0x68,0x41,0x61,0x6d,0x80,0xe0,0x04,0xd1,0xc0,0x7f,0xcb,0x37,0x46,0xf5,0x60,0x2e, +0xbe,0x08,0x1e,0x99,0x08,0x22,0x26,0xab,0x17,0x36,0x1f,0xab,0x9a,0xc2,0x81,0xa0, +0x6c,0x54,0x27,0x0d,0x77,0xe2,0xce,0x0e,0x7d,0xf8,0xe5,0xf6,0x6d,0x90,0xd5,0x78, +0x42,0x5a,0x1f,0xf0,0x81,0x05,0x7e,0x3f,0x39,0x65,0x03,0x6e,0x1f,0x46,0xed,0xbf, +0xad,0x0a,0x24,0x30,0x01,0xa9,0x71,0xd1,0x91,0x16,0xa6,0xa7,0x21,0xdc,0x26,0xae, +0x48,0xcf,0x9c,0x63,0x52,0x5d,0xf0,0x85,0x99,0xd6,0x11,0xdc,0xde,0xea,0x56,0x5a, +0x3b,0xee,0x31,0xa9,0x5c,0xd4,0xb3,0xe4,0x16,0x13,0xab,0x4a,0x35,0x1f,0xa4,0x12, +0xcd,0x45,0xa7,0xfd,0x6b,0x42,0x92,0xec,0xc8,0x7e,0xbe,0x52,0x21,0x0c,0x62,0x04, +0xa2,0xb9,0x0b,0xac,0xfc,0x75,0xf5,0xa5,0xc1,0xd3,0x71,0x40,0xd1,0xbf,0xea,0x2f, +0x1f,0xa5,0x90,0xd1,0x3e,0x29,0xed,0x09,0x3b,0x3c,0xf4,0x4a,0x95,0x93,0x63,0x01, +0xe3,0x20,0xf9,0xef,0x8e,0xab,0xae,0x29,0x37,0xc0,0x98,0x66,0xad,0xab,0xd6,0x46, }; /* see ee_dsa_alg_t in ee_bench.h */ @@ -284,7 +316,6 @@ uint32_t g_public_key_sizes[] = { 96 + 1, 32, 32, - /* Yes, these are ASN.1 so we could extract size, but this is quicker. */ 294, 422, 550, @@ -304,7 +335,7 @@ uint8_t *g_dsa_signatures[] = { /* see ee_dsa_alg_t in ee_bench.h */ uint32_t g_dsa_signature_sizes[] = { 71, - 104, + 103, 0, 64, 256, diff --git a/examples/selfhosted/main.c b/examples/selfhosted/main.c index 67e82ee..5102ca8 100644 --- a/examples/selfhosted/main.c +++ b/examples/selfhosted/main.c @@ -670,8 +670,8 @@ static task_entry_t g_task[] = TASK(aes128_ccm_encrypt , 52, 1.0f, 0xd82d) TASK(aes128_ccm_decrypt , 168, 1.0f, 0x9a42) TASK(ecdh_p256r1 , 0, 1.0f, 0) - TASK(ecdsa_sign_p256r1 , 32, 1.0f, 0) - TASK(ecdsa_verify_p256r1 , 32, 1.0f, 1) + TASK(ecdsa_sign_p256r1 , 0, 1.0f, 0) + TASK(ecdsa_verify_p256r1 , 0, 1.0f, 1) TASK(sha256 , 23, 3.0f, 0x2151) TASK(sha256 , 57, 1.0f, 0x3b3c) TASK(sha256 , 384, 1.0f, 0x1d3f) @@ -687,8 +687,8 @@ static task_entry_t g_task[] = TASKEX(sha256 , 1.0f, 0x5c37, &g_sha_digest_l) TASKEX(chachapoly_encrypt , 1.0f, 0xb645, &g_aead_e_multi_l) TASKEX(chachapoly_decrypt , 1.0f, 0x7b1a, &g_aead_d_multi_l) - TASK(ecdsa_sign_ed25519 , 130, 1.0f, 0) - TASK(ecdsa_verify_ed25519 , 64, 2.0f, 1) + TASK(ecdsa_sign_ed25519 , 0, 1.0f, 0) + TASK(ecdsa_verify_ed25519 , 0, 2.0f, 1) TASK(ecdh_x25519 , 0, 1.0f, 0) TASK(nop , 0, 0.0f, 0) /* sic. DSA SHA placeholder */ /* Secure Boot, RSA */ @@ -707,8 +707,8 @@ static task_entry_t g_task[] = TASKEX(sha256 , 3.0f, 0xa23c, &g_sha_digest_m) TASKEX(aes128_ccm_encrypt , 1.0f, 0xb9d9, &g_aead_e_multi_m) TASKEX(aes128_ccm_decrypt , 1.0f, 0x7b96, &g_aead_d_multi_m) - TASK(ecdsa_sign_p256r1 , 32, 1.0f, 0) - TASK(ecdsa_verify_p256r1 , 32, 2.0f, 1) + TASK(ecdsa_sign_p256r1 , 0, 1.0f, 0) + TASK(ecdsa_verify_p256r1 , 0, 2.0f, 1) TASK(ecdh_p256r1 , 0, 1.0f, 0) TASK(sha256 , 152, 8.0f, 0xd3ea) /* TLS1.3/GCM */ @@ -718,18 +718,18 @@ static task_entry_t g_task[] = TASKEX(sha256 , 1.0f, 0xa23c, &g_sha_digest_m) TASKEX(aes128_gcm_encrypt , 1.0f, 0x954b, &g_aead_e_multi_m) TASKEX(aes128_gcm_decrypt , 1.0f, 0x7b96, &g_aead_d_multi_m) - TASK(ecdsa_sign_p256r1 , 32, 1.0f, 0) - TASK(ecdsa_verify_p256r1 , 32, 2.0f, 1) + TASK(ecdsa_sign_p256r1 , 0, 1.0f, 0) + TASK(ecdsa_verify_p256r1 , 0, 2.0f, 1) TASK(ecdh_p256r1 , 0, 1.0f, 0) TASK(sha256 , 152, 8.0f, 0xd3ea) /* Secure Boot, RSA */ TASK(nop , 0, 0.0f, 0) /* math placeholder */ TASK(sha256 , 2048, 20.0f, 0x39ec) - TASK(rsa_verify_2048 , 32, 1.0f, 1) + TASK(rsa_verify_2048 , 0, 1.0f, 1) /* Secure Boot, ECC */ TASK(nop , 0, 0.0f, 0) /* math placeholder */ TASK(sha256 , 2048, 20.0f, 0x39ec) - TASK(ecdsa_verify_p256r1 , 32, 1.0f, 1) + TASK(ecdsa_verify_p256r1 , 0, 1.0f, 1) /* High */ /* TLS1.3/CCM */ TASK(sha384 , 182, 10.0f, 0x4505) @@ -738,8 +738,8 @@ static task_entry_t g_task[] = TASKEX(sha384 , 1.0f, 0xa6b6, &g_sha_digest_h) TASKEX(aes256_ccm_encrypt , 1.0f, 0xf16d, &g_aead_e_multi_h) TASKEX(aes256_ccm_decrypt , 1.0f, 0x56f1, &g_aead_d_multi_h) - TASK(ecdsa_sign_p384r1 , 48, 1.0f, 0) - TASK(ecdsa_verify_p384r1 , 48, 2.0f, 1) + TASK(ecdsa_sign_p384r1 , 0, 1.0f, 0) + TASK(ecdsa_verify_p384r1 , 0, 2.0f, 1) TASK(ecdh_p384r1 , 0, 1.0f, 0) TASK(sha384 , 173, 1.0f, 0x7bf9) /* TLS1.3/GCM */ @@ -749,18 +749,18 @@ static task_entry_t g_task[] = TASKEX(sha384 , 1.0f, 0xa6b6, &g_sha_digest_h) TASKEX(aes256_gcm_encrypt , 1.0f, 0x9f97, &g_aead_e_multi_h) TASKEX(aes256_gcm_decrypt , 1.0f, 0x56f1, &g_aead_d_multi_h) - TASK(ecdsa_sign_p384r1 , 48, 1.0f, 0) - TASK(ecdsa_verify_p384r1 , 48, 2.0f, 1) + TASK(ecdsa_sign_p384r1 , 0, 1.0f, 0) + TASK(ecdsa_verify_p384r1 , 0, 2.0f, 1) TASK(ecdh_p384r1 , 0, 1.0f, 0) TASK(sha384 , 173, 1.0f, 0x7bf9) /* Secure Boot, RSA */ TASK(aes256_ctr_decrypt , 2048, 20.0f, 0xd203) TASK(sha384 , 2048, 20.0f, 0xff90) - TASK(rsa_verify_4096 , 32, 1.0f, 1) + TASK(rsa_verify_4096 , 0, 1.0f, 1) /* Secure Boot, ECC */ TASK(aes256_ctr_decrypt , 2048, 20.0f, 0xd203) TASK(sha384 , 2048, 20.0f, 0xff90) - TASK(ecdsa_verify_p384r1 , 32, 1.0f, 1) + TASK(ecdsa_verify_p384r1 , 0, 1.0f, 1) }; static const size_t g_numtasks = sizeof(g_task) / sizeof(task_entry_t); /* This is how we scale the final score for each group*/ @@ -771,18 +771,18 @@ static struct scalar_tuples unsigned int scalar; float score; } g_scalars[] = { - { "TLSv1.2", 14, 1000, 0.0f }, - { "TLSv1.3_Light", 10, 10, 0.0f }, - { "Boot_Light", 3, 1, 0.0f }, - { "", 3, 0, 0.0f }, - { "TLSv1.3_Med_CCM", 10, 10, 0.0f }, - { "TLSv1.3_Med_GCM", 10, 10, 0.0f }, + { "TLSv1.2", 14, 1000, 0.0f }, + { "TLSv1.3_Light", 10, 10, 0.0f }, + { "Boot_Light", 3, 1, 0.0f }, + { "", 3, 0, 0.0f }, + { "TLSv1.3_Med_CCM", 10, 10, 0.0f }, + { "TLSv1.3_Med_GCM", 10, 10, 0.0f }, { "Boot_Med_RSA", 3, 1, 0.0f }, - { "Boot_Med_ECC", 3, 1, 0.0f }, + { "Boot_Med_ECC", 3, 1, 0.0f }, { "TLSv1.3_Heavy_CCM", 10, 10, 0.0f }, - { "TLSv1.3_Heavy_GCM", 10, 10, 0.0f }, - { "Boot_Heavy_RSA", 3, 1, 0.0f }, - { "Boot_Heavy_ECC", 3, 1, 0.0f }, + { "TLSv1.3_Heavy_GCM", 10, 10, 0.0f }, + { "Boot_Heavy_RSA", 3, 1, 0.0f }, + { "Boot_Heavy_ECC", 3, 1, 0.0f }, { NULL, 0, 0, 0.0f } /* Done */ }; // clang-format on @@ -877,10 +877,10 @@ main(void) g_task[i].expected_crc, g_task[i].actual_crc); } -#if DEBUG_VERIFY == 0 && CRC_ONLY == 0 printf("\n"); -#endif +#if DEBUG_VERIFY == 0 } +#endif } #if DEBUG_VERIFY == 0 && CRC_ONLY == 0 printf("\nComputing suite scores...\n\n"); diff --git a/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c b/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c index 52fa4e4..1d1752f 100644 --- a/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c +++ b/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c @@ -15,6 +15,7 @@ #include #include #include +#include /* can be set for static memory use */ #define HEAP_HINT NULL @@ -104,8 +105,17 @@ th_ecdsa_sign(void *p_context, { case ECC_SECP256R1: case ECC_SECP384R1: - CHK1(wc_ecc_sign_hash( - p_msg, msglen, p_sig, p_siglen, &(c->rng), &(c->key.ecc))); + CHK1(wc_SignatureGenerate( + WC_HASH_TYPE_SHA256, + WC_SIGNATURE_TYPE_ECC, + p_msg, + msglen, + p_sig, + p_siglen, + &(c->key.ecc), + sizeof(ecc_key), + &(c->rng) + )); break; case ECC_X25519: CHK1(wc_ed25519_sign_msg( @@ -138,8 +148,25 @@ th_ecdsa_verify(void *p_context, { case ECC_SECP256R1: case ECC_SECP384R1: - CHK1(wc_ecc_verify_hash( - p_sig, siglen, p_msg, msglen, &verify, &(c->key.ecc))); + ret = wc_SignatureVerify( + WC_HASH_TYPE_SHA256, + WC_SIGNATURE_TYPE_ECC, + p_msg, + msglen, + p_sig, + siglen, + &(c->key.ecc), + sizeof(ecc_key) + ); + if (ret != 0 && ret != SIG_VERIFY_E) + { + th_printf("e-[wc_SignatureVerify: %d]\r\n", ret); + return EE_STATUS_ERROR; + } + if (ret == 0) + { + verify = 1; + } break; case ECC_X25519: ret = wc_ed25519_verify_msg( diff --git a/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c b/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c index 182ae15..4a69397 100644 --- a/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c +++ b/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c @@ -14,6 +14,8 @@ #include #include #include +#include +#include /* can be set for static memory use */ #define HEAP_HINT NULL @@ -98,32 +100,32 @@ th_rsa_verify(void *p_context, bool *p_pass) { rsa_context_t *ctx = (rsa_context_t *)p_context; - ee_status_t status = EE_STATUS_ERROR; int ret = 0; - uint32_t diglen = msglen; - uint8_t *p_digest = NULL; *p_pass = false; - p_digest = XMALLOC(msglen, HEAP_HINT, DYNAMIC_TYPE_RSA_BUFFER); - if (!p_digest) + + ret = wc_SignatureVerify( + WC_HASH_TYPE_SHA256, + WC_SIGNATURE_TYPE_RSA_W_ENC, + p_msg, + msglen, + p_sig, + siglen, + ctx->pubkey, + sizeof(RsaKey)); + + if (ret != 0 && ret != SIG_VERIFY_E) { - th_printf("e-[th_rsa_verify: XMALLOC failed]\r\n"); + th_printf("e-[wc_SignatureVerify: %d]\r\n", ret); return EE_STATUS_ERROR; } - ret = wc_RsaSSL_Verify(p_sig, siglen, p_digest, diglen, ctx->pubkey); - if (ret < 0) - { - th_printf("e-[wc_RsaSSL_Verify: %d]\r\n", ret); - goto exit; - } - if (!XMEMCMP(p_msg, p_digest, msglen) && ret == msglen) + + if (ret == 0) { *p_pass = true; } - status = EE_STATUS_OK; -exit: - XFREE(p_digest, HEAP_HINT, DYNAMIC_TYPE_RSA_BUFFER); - return status; + + return EE_STATUS_OK; } void From ea6bf3c1924fa0dbcfa410066edfb1091f609933 Mon Sep 17 00:00:00 2001 From: Peter Torelli Date: Fri, 13 Jan 2023 16:59:05 -0800 Subject: [PATCH 2/8] Signatures are now of the hash, not PT. --- examples/selfhosted/keys.h | 624 +++++++++++++++++++------------------ 1 file changed, 315 insertions(+), 309 deletions(-) diff --git a/examples/selfhosted/keys.h b/examples/selfhosted/keys.h index 8909231..b4226c6 100644 --- a/examples/selfhosted/keys.h +++ b/examples/selfhosted/keys.h @@ -1,38 +1,5 @@ #include -/* -Tips for generating RSA keys and signatures with openssl... - -openssl3 genrsa -out pri.pem 4096 -openssl3 rsa -in pri.pem -pubout -out pub.pem - -openssl3 rsa -in pri.pem -inform pem -out pri.der -outform der -openssl3 rsa -pubin -inform pem -in pub.pem -outform der -out pub.der - -openssl3 dgst -sha256 -sign pri.der -out sig.dat msg.txt - -xxd -i pub.der | grep 0x | sed 's/ //g' -xxd -i sig.dat | grep 0x | sed 's/ //g' - -prime256v1 -> p256r1 -secp384r1 -> p384r1 - -openssl3 ecparam -name secp384r1 -genkey -noout -out pri.der -outform der -openssl3 ec -in pri.der -inform der -pubout -out pub.der -outform der -openssl3 dgst -sha256 -sign pri.der -out sig.dat msg.txt - -xxd -i sig.dat | grep 0x | sed 's/ //g' - -OpenSSL creates ASN.1 encoded keys with OID, but we need uncompressed so -just extract from the 04 on. - - -openssl3 genpkey -algorithm ed25519 -out pri.der -outform der -openssl3 pkey -inform der -in pri.der -pubout -out pub.der -outform der -openssl3 pkeyutl -sign -inkey pri.der -out sig.dat -rawin -in msg.txt - - -*/ /** * @brief These are pre-made keys for the self-hosted version of the benchmark * in order to generate the proper CRC final checks. In the official version @@ -42,307 +9,346 @@ openssl3 pkeyutl -sign -inkey pri.der -out sig.dat -rawin -in msg.txt #ifndef __KEYS_H #define __KEYS_H -// clang-format off - -uint8_t g_ecc_public_key_p256r1[] = -{ -0x04, -0xbd,0xae,0x1f,0xb6,0xf5,0x2f,0x59,0x0a,0x28,0x66,0xea,0xd9,0x05,0x32,0xba,0x16, -0xa7,0xc9,0x6d,0x99,0xc2,0xab,0x48,0xa9,0x8c,0xd4,0x98,0x22,0xcd,0x2d,0x77,0x09, -0xa1,0x9e,0xfa,0xb9,0xf3,0x4c,0x39,0x9e,0x4f,0x17,0xc5,0x82,0x4c,0x93,0x19,0x46, -0xcf,0x7d,0xa6,0x2c,0x98,0x7f,0xc0,0x79,0xce,0x35,0x31,0xf7,0x89,0x29,0x1f,0x20, -}; - -uint8_t g_ecc_public_key_p384[] = -{ -0x04, -0xb6,0x74,0xcd,0x6c,0x5a,0x8e,0x35,0x1e,0x11,0xfd,0xdf,0x0c,0x5c,0x6b,0xfa,0xc1, -0xf9,0x1c,0xb6,0x87,0xfd,0xe8,0xb4,0xe4,0xe9,0x18,0x6c,0x75,0xa1,0xd2,0x70,0x0c, -0x65,0xd8,0x2f,0xfa,0x17,0xe9,0xb1,0x78,0x62,0xc2,0x66,0x36,0x3d,0x4f,0xbc,0x4b, -0x42,0x48,0x73,0xe8,0xc8,0xcd,0x69,0x50,0xee,0xd7,0x43,0xa7,0x79,0xdd,0xf6,0x02, -0xa2,0xb1,0xfc,0x00,0xd8,0x79,0x33,0x77,0xa1,0xda,0x29,0x10,0xeb,0x66,0xb0,0x95, -0x96,0x65,0x7c,0x2d,0x3a,0x66,0x8d,0x95,0xae,0xcb,0x91,0x8b,0xac,0xad,0x16,0x77, -}; - -uint8_t g_ecc_public_key_c25519[] = -{ -// LITTLE-ENDIAN -0xf8,0x5d,0x06,0x5d,0xd7,0xa4,0xe2,0xb8,0x72,0x27,0xf2,0x38,0x2b,0x44,0x4b,0xf5, -0xd2,0x29,0x60,0x70,0x3c,0xdc,0x86,0xc0,0xef,0xd2,0xd3,0x4d,0x5d,0xe1,0xdb,0x26, -}; - -uint8_t g_ecc_public_key_ed25519[] = -{ -// LITTLE-ENDIAN -0x75,0x1e,0x47,0xd5,0xfd,0x1f,0x46,0xf2,0x65,0x4c,0x94,0xae,0xfe,0xab,0x32,0xab, -0xca,0x14,0xb3,0x7d,0x4f,0x6b,0xa4,0x85,0xbd,0xc2,0x90,0x51,0x6d,0xe3,0x4c,0xb9, -}; - -uint8_t g_rsa_public_key_2048[] = -{ -// ASN.1/DER -0x30,0x82,0x01,0x22,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01, -0x01,0x05,0x00,0x03,0x82,0x01,0x0f,0x00,0x30,0x82,0x01,0x0a,0x02,0x82,0x01,0x01, -0x00,0x8c,0x48,0xa3,0xa3,0xad,0xe4,0x8b,0x15,0xa7,0x46,0xa1,0xaf,0x62,0x99,0x23, -0x71,0xd6,0xbe,0x07,0x11,0x13,0x9e,0x2c,0x2b,0x16,0xe9,0xb1,0xd7,0x1a,0xbd,0x18, -0x44,0xf8,0xd5,0x69,0x42,0x25,0x36,0x89,0xf9,0x90,0x25,0x89,0xac,0x2a,0xa2,0xb7, -0x49,0x18,0xa2,0xe2,0x4b,0x6f,0xd8,0xe0,0x7b,0x0f,0xd1,0xb8,0x7c,0x19,0xc5,0x69, -0x23,0x52,0x56,0xf0,0x1c,0x3f,0x1e,0x63,0x07,0xff,0xea,0xee,0x77,0xac,0x46,0x7e, -0x99,0x20,0xd5,0xbf,0xb3,0x28,0x41,0x07,0xb1,0x2c,0xda,0x90,0x51,0x71,0xfa,0x15, -0x1d,0x30,0xaa,0x9b,0x33,0x40,0x17,0x5b,0xfa,0xfe,0xb8,0xd2,0x9c,0xbc,0x3d,0x9f, -0xaf,0x7e,0xe9,0x47,0xd6,0x4b,0xe2,0x87,0x9f,0x70,0x80,0xa0,0x28,0xe7,0x52,0xeb, -0x06,0x90,0xd2,0x21,0xe1,0x71,0x02,0xb6,0x94,0xca,0x47,0xb2,0x59,0x5d,0xf7,0x80, -0x8b,0x08,0x30,0xab,0x4d,0x2f,0x17,0x11,0x89,0x8e,0xb7,0xc3,0x6d,0x3c,0xe4,0xe4, -0x7d,0xab,0x05,0x1a,0xf2,0x46,0x5c,0xc4,0x64,0x3f,0xec,0x05,0xb6,0xef,0x55,0x22, -0x11,0xab,0xc1,0x70,0xec,0x4c,0x4d,0x08,0xc0,0x45,0xe4,0x60,0x71,0xfe,0x7e,0x67, -0xfc,0x8c,0x19,0x95,0xd7,0xd7,0xb8,0xe2,0x41,0xa7,0x77,0xfb,0x8c,0x80,0xa6,0xc0, -0x28,0x4c,0x58,0x61,0x4f,0xef,0x9d,0xe3,0x94,0x95,0xf1,0xd5,0x2e,0xd8,0x78,0x51, -0x93,0x2b,0x95,0x4e,0x3a,0x6a,0xad,0x33,0x69,0x09,0x4d,0x5b,0xf0,0xf0,0x4d,0x3f, -0x8a,0x1f,0x66,0xff,0x8d,0x7b,0x06,0xc0,0x0e,0xae,0x6e,0x72,0x35,0xda,0x4f,0x42, -0xaf,0x02,0x03,0x01,0x00,0x01, -}; - -uint8_t g_rsa_public_key_3072[] = -{ -// ASN.1/DER -0x30,0x82,0x01,0xa2,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01, -0x01,0x05,0x00,0x03,0x82,0x01,0x8f,0x00,0x30,0x82,0x01,0x8a,0x02,0x82,0x01,0x81, -0x00,0x9e,0x3d,0x37,0x72,0x89,0x7f,0xe6,0x6a,0xa7,0xfa,0x45,0x84,0xfb,0x32,0x0c, -0x55,0x6b,0x0e,0x85,0xd5,0x98,0xe2,0xf4,0x0a,0xa9,0x26,0xac,0x63,0x45,0x77,0xe7, -0xe9,0x90,0xa6,0x43,0xbb,0x20,0x0d,0xc0,0xd5,0xed,0xd7,0x38,0x89,0x21,0x99,0x9c, -0x54,0xf2,0x3b,0xf4,0x2e,0x41,0x63,0xa1,0x94,0x24,0xf1,0x3d,0x19,0x12,0xb3,0x66, -0x55,0x24,0x8a,0x58,0x1c,0x9e,0x9e,0xfe,0xfd,0xf6,0x01,0x37,0x01,0xbf,0x86,0x06, -0x63,0xc1,0xce,0x36,0x2e,0x9d,0xbd,0x89,0x82,0x5d,0x11,0xc7,0x4a,0xbf,0xfd,0x6f, -0x60,0x13,0x58,0xe3,0x20,0x90,0xff,0xcd,0xb7,0x28,0xa8,0xa4,0x1c,0x4e,0x86,0xfe, -0xa6,0xd0,0x28,0xdd,0x29,0x94,0x45,0x39,0x93,0x14,0xb7,0x7a,0xa9,0x83,0x58,0x52, -0x39,0x78,0xc0,0xf8,0xb6,0xaf,0x00,0xc7,0x0f,0xa5,0x18,0x68,0x7b,0x08,0x30,0x0d, -0xcf,0x8d,0xcc,0xc9,0xc0,0x52,0x83,0x84,0x26,0x4c,0xcd,0x1a,0xeb,0x5e,0x5b,0x61, -0xb2,0x07,0x62,0xf3,0xd0,0x3d,0x96,0x35,0x21,0xaa,0x63,0x99,0xd0,0xbf,0x04,0x3e, -0x6e,0xe7,0xd6,0xa2,0x7c,0xf5,0x1d,0xab,0x36,0x20,0x56,0x70,0xe9,0xc8,0x9f,0x8b, -0x79,0x64,0x6e,0x58,0x2d,0xf0,0x05,0x94,0x2b,0xfe,0x0f,0x5b,0xde,0xcf,0x47,0x73, -0x4b,0xf9,0x0f,0x35,0xcb,0x67,0x07,0x86,0x5e,0x15,0xd6,0xe2,0xcc,0xcb,0xc8,0x66, -0xca,0x2c,0x2a,0xf9,0xeb,0xdd,0x4b,0x36,0x5c,0x6d,0x17,0xc5,0xa2,0x01,0x7d,0xb9, -0x05,0x18,0x0b,0xa1,0x55,0x24,0x3b,0xda,0xa5,0xa0,0x42,0x59,0x54,0xae,0x70,0xed, -0x07,0x0b,0x86,0x0e,0xb8,0xae,0x13,0x10,0xc0,0x0f,0x90,0xb5,0x2f,0x10,0x97,0x4f, -0x02,0xf0,0x9e,0xe8,0xfd,0x60,0x2b,0x12,0xae,0x07,0xec,0x53,0x5a,0x48,0x12,0xb9, -0x76,0x83,0xf2,0xe6,0x96,0x6b,0xba,0xb1,0x31,0xf5,0x60,0xd5,0x47,0xdd,0x46,0xfb, -0x4b,0xf9,0x87,0xbb,0x2c,0xf0,0xfb,0x99,0x9c,0xbd,0xd8,0x18,0xf5,0x8d,0xb1,0xef, -0xfa,0x1e,0x6e,0x4b,0xd4,0x02,0x36,0x52,0x70,0x30,0xd1,0x36,0x89,0xdf,0x20,0x66, -0x65,0x97,0xe1,0x31,0x3a,0x86,0x86,0x05,0x1f,0x4f,0xe0,0x2d,0x9f,0x93,0x21,0x28, -0xcc,0x12,0xbc,0x04,0x7b,0x30,0x38,0x24,0x3d,0xcb,0xaa,0x2d,0x74,0x55,0x1e,0xa5, -0xe6,0xca,0xe3,0xca,0x87,0x67,0x76,0x99,0xdb,0xf2,0x02,0x5d,0x76,0x5e,0x5d,0xc7, -0x6b,0x02,0x03,0x01,0x00,0x01, -}; - -uint8_t g_rsa_public_key_4096[] = -{ -// ASN.1/DER -0x30,0x82,0x02,0x22,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01, -0x01,0x05,0x00,0x03,0x82,0x02,0x0f,0x00,0x30,0x82,0x02,0x0a,0x02,0x82,0x02,0x01, -0x00,0xa2,0xcd,0x53,0x24,0x7b,0x38,0x28,0x29,0x0f,0x25,0x20,0x9b,0xc6,0xa3,0x0b, -0xd8,0x99,0x97,0xfb,0x81,0x76,0x31,0x3f,0x13,0x9f,0x90,0x82,0xca,0x72,0x56,0xf8, -0xf5,0x50,0x41,0x4f,0x69,0x46,0x4a,0xb6,0xb3,0x2b,0xdc,0x14,0x8b,0x13,0xd0,0xec, -0x40,0x83,0x52,0x08,0x72,0x15,0x75,0xd7,0x79,0xd0,0xde,0x82,0xff,0xea,0xc6,0xeb, -0xcc,0x7c,0xcf,0xb8,0xaa,0x21,0x13,0xbf,0x6c,0xc7,0xa5,0xae,0x04,0x22,0x96,0xb9, -0x4e,0x83,0xab,0xc0,0xb4,0xa6,0x80,0x4c,0xc3,0x50,0x7a,0x2e,0x6c,0x01,0xfc,0x36, -0xd9,0xd8,0x9b,0xc1,0xfe,0x13,0xf5,0x16,0xe1,0x57,0xad,0x6d,0xcc,0xb5,0xdd,0xf2, -0x9d,0xbd,0x3f,0x45,0xb6,0x9f,0xf5,0x05,0x1c,0x2c,0x8f,0x4c,0xd3,0xe6,0x94,0x0c, -0x45,0x89,0x9a,0x31,0x08,0x4f,0x47,0xc5,0x75,0x17,0xe6,0xfd,0x3c,0x26,0x51,0x06, -0x23,0x97,0x48,0xaf,0x80,0x70,0xd8,0xe5,0xab,0x19,0x42,0x34,0x96,0x5d,0x2a,0x2a, -0x5c,0x5d,0x21,0x10,0x17,0xeb,0xef,0x70,0xa3,0x71,0x74,0xd9,0x5a,0xe0,0x4c,0x20, -0x84,0x9f,0x8d,0x03,0x56,0x3a,0x58,0x7c,0x8f,0x49,0xc5,0xc8,0xca,0x0f,0x45,0xf8, -0xb4,0xd7,0x72,0x34,0x33,0xca,0xc9,0xc6,0xb7,0x19,0x16,0xaa,0xff,0x37,0x52,0x62, -0x7a,0x34,0x30,0x55,0xd5,0x64,0xb0,0xb5,0x45,0x27,0xf2,0x54,0x02,0xe4,0xfc,0x1f, -0x3a,0x79,0x11,0xb6,0x5d,0xb6,0x6d,0x6b,0x94,0x23,0x49,0xba,0xb1,0x6b,0x34,0x68, -0x47,0x1a,0x32,0x71,0x83,0x5c,0x20,0x47,0x80,0x40,0xed,0xf5,0xc8,0x20,0x75,0x31, -0x71,0x4e,0x50,0x06,0x10,0xed,0x27,0x01,0xa6,0x39,0x61,0x96,0xa4,0x1e,0x71,0xfd, -0xbf,0x55,0x3c,0x04,0x48,0x2a,0x3c,0x70,0x80,0x29,0x76,0xf5,0xfc,0x50,0x59,0x12, -0xa6,0x18,0x46,0xba,0xa2,0x10,0x45,0x2a,0x5e,0xc6,0xc9,0x5f,0x37,0x14,0x7a,0x35, -0x59,0x85,0xe6,0xcb,0x28,0xbd,0xcf,0x0c,0xf1,0xb2,0xf1,0x50,0xea,0x26,0x05,0x3d, -0x89,0x50,0x23,0x77,0x78,0x93,0xfd,0xca,0xcf,0x53,0xc3,0x34,0x59,0x73,0xad,0x72, -0x2e,0x59,0x45,0xd5,0x04,0x5a,0x59,0x47,0x37,0x8e,0x93,0xe4,0xa2,0x48,0x3a,0xca, -0xe7,0x7c,0x5c,0x98,0xa7,0xda,0x8e,0x88,0x03,0xda,0xff,0xd9,0x82,0x17,0xf3,0x76, -0x2b,0xb0,0x6b,0x47,0x1d,0xf3,0x46,0x99,0x6b,0x7c,0xea,0xd9,0xce,0xc7,0x1d,0x87, -0x22,0x08,0x9c,0x21,0xd8,0x2a,0x1e,0x8b,0x39,0x13,0x43,0xa2,0x8c,0xb4,0xf8,0x68, -0xc0,0xa3,0xbb,0x34,0xc7,0xf7,0xaf,0xea,0xbf,0x5e,0xc0,0x24,0xc3,0x8a,0x2e,0x53, -0x11,0x7a,0x71,0x1e,0x58,0x0f,0xd6,0xfe,0x9b,0xd1,0xc3,0xec,0x8a,0x0a,0xb6,0x90, -0xda,0x8d,0x18,0x96,0xf6,0x28,0xe7,0xbb,0xf1,0x36,0xec,0xb6,0xe3,0x48,0x03,0x8d, -0x49,0xf0,0xe2,0xac,0x89,0x5e,0x02,0x36,0x6a,0xf2,0xba,0xcd,0x31,0x33,0xe3,0x3d, -0x48,0xe6,0xfd,0xdf,0x51,0xbe,0xa0,0x8a,0x40,0x81,0xda,0xfd,0x48,0x15,0xbd,0x43, -0xf0,0x1e,0x95,0x1d,0x60,0x97,0x3d,0xec,0xe5,0x50,0xd7,0x82,0xd2,0x92,0x5e,0xf7, -0x1d,0x4f,0xfb,0xaf,0xfb,0x19,0xd4,0x49,0xcc,0xf3,0xc7,0xf6,0x20,0xf3,0xbd,0x6e, -0x61,0x02,0x03,0x01,0x00,0x01, -}; - -uint8_t g_dsa_message[] = -{ -/* `Tempus unum hominem manet.` */ -0x54,0x65,0x6d,0x70,0x75,0x73,0x20,0x75,0x6e,0x75,0x6d,0x20,0x68,0x6f,0x6d,0x69, -0x6e,0x65,0x6d,0x20,0x6d,0x61,0x6e,0x65,0x74,0x2e, +static const unsigned char g_ecc_public_key_prime256v1_der[] + = { 0x04, 0x11, 0xca, 0x9a, 0xff, 0xb3, 0xae, 0x07, 0xf1, 0xdd, 0x4d, + 0xf2, 0x4f, 0x2c, 0xe7, 0x82, 0x00, 0x2e, 0x4b, 0x20, 0xe2, 0x46, + 0xd1, 0x25, 0x89, 0x0c, 0x2b, 0xc0, 0x08, 0xa0, 0xdd, 0x28, 0x71, + 0xdd, 0xea, 0xff, 0xa4, 0x48, 0xcb, 0xfb, 0x50, 0xcc, 0xc9, 0x37, + 0xcb, 0x33, 0xb8, 0xd5, 0x36, 0xec, 0x2e, 0x73, 0xb1, 0x51, 0xe8, + 0x2f, 0xc8, 0xdb, 0xb0, 0x68, 0x10, 0x88, 0x93, 0x4b, 0x77 }; +static const unsigned int g_ecc_public_key_prime256v1_der_len = 65; + +static const unsigned char g_ecc_signature_prime256v1_sig[] + = { 0x30, 0x44, 0x02, 0x20, 0x7e, 0x49, 0x2b, 0x00, 0x19, 0x72, 0xf5, 0xcd, + 0xcd, 0x58, 0xab, 0x99, 0x59, 0x16, 0x03, 0x29, 0x68, 0x01, 0xb9, 0xc4, + 0x23, 0x6c, 0xb7, 0x22, 0x5a, 0x46, 0x4d, 0x0c, 0x6d, 0x3b, 0xdc, 0x66, + 0x02, 0x20, 0x30, 0x5e, 0xfe, 0x30, 0xfd, 0x22, 0xc0, 0x83, 0xbc, 0x72, + 0x18, 0x06, 0x2d, 0x4e, 0xfb, 0x4a, 0x47, 0x9d, 0x07, 0xc4, 0x8c, 0x1c, + 0xe7, 0xd6, 0xc0, 0x7c, 0xb0, 0xf3, 0x08, 0xc7, 0x7c, 0x5b }; +static const unsigned int g_ecc_signature_prime256v1_sig_len = 70; + +static const unsigned char g_ecc_public_key_secp384r1_der[] + = { 0x04, 0x70, 0x6a, 0x87, 0x82, 0x9c, 0x8c, 0x92, 0x31, 0x8d, 0xf7, + 0xec, 0x73, 0xbd, 0x80, 0xf3, 0xfa, 0xca, 0x65, 0x00, 0x41, 0x66, + 0x8a, 0x6f, 0x14, 0x94, 0x1a, 0x48, 0xb1, 0x5a, 0x12, 0x51, 0x44, + 0x42, 0xe4, 0xf5, 0x22, 0x9d, 0x08, 0x8f, 0x43, 0xe5, 0x0e, 0xa4, + 0xfc, 0x5d, 0x49, 0xf3, 0x15, 0x8c, 0x0d, 0x7e, 0x12, 0x13, 0x62, + 0x61, 0xea, 0x8b, 0x32, 0xc1, 0x72, 0x32, 0xf1, 0x76, 0x8a, 0x77, + 0x7d, 0x2d, 0xef, 0xa6, 0x62, 0xbe, 0x11, 0xf2, 0xb5, 0x94, 0x33, + 0x6d, 0xe2, 0x87, 0xa4, 0x2f, 0x5d, 0x5d, 0x93, 0xb8, 0x2d, 0xad, + 0xe2, 0xca, 0x43, 0x5f, 0x87, 0x1f, 0x3c, 0x85, 0xd2 }; +static const unsigned int g_ecc_public_key_secp384r1_der_len = 97; + +static const unsigned char g_ecc_signature_secp384r1_sig[] + = { 0x30, 0x66, 0x02, 0x31, 0x00, 0x99, 0x08, 0xb4, 0xf3, 0xc2, 0x8b, 0x9c, + 0x75, 0xb8, 0x5e, 0xdb, 0x5e, 0x58, 0x04, 0xf4, 0x84, 0x6f, 0xce, 0xdb, + 0x52, 0x57, 0x25, 0xf1, 0xc2, 0xb3, 0xd4, 0x77, 0xb9, 0xcc, 0xe5, 0xff, + 0x4a, 0xcd, 0x23, 0x50, 0x85, 0x9b, 0x8f, 0x1b, 0x0f, 0xcb, 0x40, 0xea, + 0x48, 0xa9, 0x52, 0xbc, 0x07, 0x02, 0x31, 0x00, 0xdb, 0xdd, 0x8c, 0x4d, + 0xa6, 0x53, 0x6d, 0x3f, 0xb1, 0x1d, 0x14, 0x7d, 0x65, 0x02, 0xca, 0x80, + 0x77, 0x59, 0x53, 0x6d, 0xc0, 0x42, 0xac, 0xa3, 0xa1, 0x7a, 0x96, 0xf0, + 0xc6, 0x86, 0x3f, 0x3f, 0xa2, 0x7c, 0x82, 0xb1, 0x32, 0xe7, 0x8d, 0xf4, + 0x0f, 0xe0, 0xe6, 0x16, 0x99, 0x53, 0x23, 0x4c }; +static const unsigned int g_ecc_signature_secp384r1_sig_len = 104; + +static const unsigned char g_ecc_public_key_ed25519_der[] + = { 0xf4, 0x53, 0x8c, 0xa7, 0xfa, 0x01, 0x69, 0xd0, 0x50, 0xb4, 0x57, + 0x3d, 0x72, 0x7a, 0x32, 0x14, 0xe7, 0x6b, 0x9e, 0xc1, 0x31, 0x96, + 0x97, 0xdd, 0xc0, 0x04, 0xae, 0xa6, 0xbe, 0xb2, 0xdd, 0x75 }; +static const unsigned int g_ecc_public_key_ed25519_der_len = 32; + +static const unsigned char g_ecc_signature_ed25519_sig[] + = { 0xf8, 0x10, 0x10, 0x7d, 0x54, 0x8e, 0x66, 0xcf, 0xf4, 0x89, 0x7f, + 0xa4, 0x31, 0x57, 0x8c, 0xff, 0xea, 0x76, 0xc5, 0xdc, 0x1d, 0x7a, + 0x57, 0x0a, 0x45, 0x97, 0xa7, 0x64, 0x7f, 0x16, 0xe9, 0x49, 0xe8, + 0x76, 0x2b, 0xc2, 0x77, 0x59, 0x79, 0x2b, 0x20, 0x67, 0xc5, 0x23, + 0x92, 0x6f, 0x55, 0x16, 0xb1, 0x8c, 0xe1, 0x2d, 0x57, 0x4c, 0x82, + 0xb9, 0x80, 0x53, 0xa4, 0xa4, 0x37, 0x8d, 0x29, 0x05 }; +static const unsigned int g_ecc_signature_ed25519_sig_len = 64; + +static const unsigned char g_rsa_public_key_2048_der[] = { + 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, + 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, + 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xac, 0xd3, 0xf5, + 0x48, 0xed, 0xe2, 0x14, 0xda, 0x54, 0x09, 0xe7, 0xcc, 0xc1, 0xc0, 0xbf, + 0xc5, 0x50, 0x33, 0x78, 0x49, 0x5b, 0xb1, 0x03, 0x2f, 0x4f, 0xcb, 0x03, + 0x81, 0xe9, 0x33, 0x7f, 0xbe, 0xcd, 0x5a, 0x4d, 0x6a, 0x3c, 0xaa, 0x12, + 0xe4, 0x98, 0xf2, 0xe4, 0x37, 0x72, 0x38, 0x69, 0x47, 0x12, 0xa7, 0xbf, + 0x7e, 0x66, 0xec, 0xbd, 0x4b, 0xa1, 0x0b, 0x52, 0xfd, 0xa5, 0xff, 0x62, + 0x3f, 0x35, 0xc7, 0x96, 0x3f, 0x5c, 0xe2, 0xb0, 0xde, 0x16, 0x44, 0xdd, + 0x00, 0xae, 0x74, 0xfe, 0xd1, 0xb0, 0x2f, 0x15, 0xd7, 0x4a, 0x6a, 0xcb, + 0xff, 0x99, 0x56, 0xdb, 0x46, 0xbc, 0x86, 0xaf, 0x6b, 0xb9, 0xdd, 0x93, + 0xf5, 0xa8, 0xd1, 0x98, 0xe5, 0xd7, 0x11, 0xf6, 0x99, 0x79, 0x8c, 0xe3, + 0x32, 0xa8, 0x72, 0xf8, 0x5c, 0xff, 0x45, 0x3d, 0xcf, 0x52, 0x48, 0xa3, + 0xb8, 0x5e, 0x71, 0xf1, 0x09, 0x3a, 0x97, 0xcb, 0x33, 0x14, 0xac, 0x75, + 0xd3, 0xaa, 0xd6, 0x84, 0x07, 0x1a, 0x6c, 0x16, 0x97, 0x60, 0xac, 0xf9, + 0xf8, 0xeb, 0xe6, 0xea, 0xe7, 0xd6, 0x3a, 0xb8, 0xf3, 0x83, 0xe4, 0x3c, + 0x0d, 0x99, 0x79, 0xd5, 0x5b, 0x1a, 0x77, 0xee, 0x7f, 0xf3, 0x92, 0xac, + 0x9f, 0x20, 0x9d, 0x3e, 0x60, 0x66, 0xae, 0xdb, 0xda, 0xb8, 0x99, 0x27, + 0x66, 0xe5, 0xb1, 0xd7, 0x15, 0xa5, 0x01, 0x97, 0xd2, 0x74, 0x29, 0xae, + 0x10, 0x21, 0xad, 0x4a, 0x15, 0x9b, 0xbe, 0x8b, 0x19, 0xd8, 0x97, 0x0d, + 0x9c, 0xa2, 0x4a, 0x5e, 0xc0, 0xa7, 0x3f, 0xb4, 0x05, 0xd9, 0xbd, 0xdf, + 0x14, 0x7c, 0xbe, 0xa2, 0x68, 0x3b, 0xc1, 0x70, 0x12, 0xa8, 0x0c, 0xf2, + 0x18, 0xe0, 0x48, 0xb7, 0x9c, 0x7c, 0x3e, 0xab, 0x5c, 0xfa, 0x43, 0x05, + 0x0e, 0x65, 0x06, 0x50, 0x72, 0x94, 0xa7, 0x4b, 0x9c, 0xa2, 0x9e, 0x5a, + 0x0f, 0x02, 0x03, 0x01, 0x00, 0x01, }; +static const unsigned int g_rsa_public_key_2048_der_len = 294; + +static const unsigned char g_rsa_sig_2048_der[] = { + 0x27, 0x75, 0x84, 0x27, 0x13, 0xee, 0x8e, 0x0a, 0x3e, 0xb5, 0x52, 0x9b, + 0xe3, 0x3a, 0x8f, 0xd6, 0x1f, 0x60, 0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, 0xcb, 0xa5, 0x4d, 0x8d, + 0x87, 0x5e, 0x71, 0xb4, 0x8b, 0xf6, 0x5d, 0xef, 0x12, 0xbb, 0xd5, 0x79, + 0xc1, 0xd9, 0x02, 0xea, 0x45, 0x0f, 0x5b, 0xad, 0x17, 0x3b, 0x2d, 0x9e, + 0x9f, 0x0f, 0x64, 0xec, 0x0e, 0xb5, 0x73, 0xbc, 0xa9, 0x90, 0xc8, 0x38, + 0x73, 0xc8, 0x08, 0xf0, 0xb4, 0x62, 0x63, 0x97, 0x94, 0x6f, 0xb0, 0x3a, + 0xe0, 0xac, 0xe9, 0xa8, -// Signed with g_ecc_private_key_p256r1 DetK, HMAC_SHA256, ASN.1 -uint8_t g_ecc_signature_p256r1[] = -{ -0x30,0x45,0x02,0x20,0x01,0x2a,0xeb,0x1a,0xff,0x3c,0x2e,0xc5,0x3d,0x8b,0x9d,0xff, -0xb1,0x96,0xc1,0xb4,0x13,0xbd,0xb5,0x1b,0x7b,0xf0,0xe7,0xcc,0xe0,0x3d,0x0f,0xd8, -0x67,0xf9,0x06,0xf2,0x02,0x21,0x00,0xb7,0xc3,0xde,0x0b,0x20,0x39,0x2f,0x68,0x2e, -0xd3,0x7b,0xa1,0xe2,0x04,0xd3,0xd0,0xc5,0xac,0x5b,0xa4,0x6a,0xf1,0x76,0x59,0xf1, -0x23,0x84,0x61,0x69,0xdb,0x7e,0xdd, }; - -// Signed with g_ecc_private_key_p384r1 DetK, HMAC_SHA256 [sic], ASN.1 -uint8_t g_ecc_signature_p384[] = -{ -0x30,0x65,0x02,0x31,0x00,0xf5,0x32,0x2a,0x23,0xd1,0xa4,0x48,0xed,0x4a,0x71,0x8c, -0x9c,0x3c,0x7a,0x3b,0x5a,0xd9,0xc6,0x73,0xad,0xd9,0x70,0xb8,0x6a,0x8c,0xe3,0x47, -0x9d,0x9d,0xc8,0xf5,0x59,0x4f,0xe6,0x3f,0x5e,0x17,0xac,0x79,0x3c,0x4c,0x45,0xd4, -0x97,0x5c,0xc9,0x27,0xc9,0x02,0x30,0x2c,0x81,0x31,0x77,0xa6,0x98,0x89,0x81,0x01, -0xd3,0x00,0xc5,0xae,0x38,0x92,0x6b,0xca,0x06,0x77,0xb9,0xd4,0xbf,0x51,0xb2,0x82, -0xda,0x07,0xf3,0x0d,0xd3,0xd1,0x0f,0x78,0xf7,0xae,0xc4,0xb6,0x0c,0x2f,0xe6,0xb4, -0x14,0x0d,0x50,0x4a,0x13,0xcd,0xe9, +static const unsigned int g_rsa_sig_2048_der_len = 256; + +static const unsigned char g_rsa_public_key_3072_der[] = { + 0x30, 0x82, 0x01, 0xa2, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, + 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x8f, 0x00, + 0x30, 0x82, 0x01, 0x8a, 0x02, 0x82, 0x01, 0x81, 0x00, 0xb0, 0x4e, 0x2f, + 0xf6, 0x4d, 0xaf, 0x2f, 0xb0, 0x80, 0x99, 0xff, 0xfa, 0x23, 0x26, 0xeb, + 0xd1, 0xee, 0x43, 0x6e, 0x6a, 0x10, 0xce, 0xcf, 0x8d, 0x65, 0x79, 0xc0, + 0xc7, 0xa3, 0xf2, 0xa4, 0x9a, 0x54, 0xd4, 0xb8, 0xdc, 0xd3, 0xb7, 0x23, + 0x72, 0xec, 0xd3, 0x97, 0x6f, 0x0b, 0x5f, 0xe8, 0xdc, 0x37, 0xec, 0xca, + 0x73, 0xf8, 0x5e, 0x2b, 0xea, 0x95, 0x60, 0xab, 0x20, 0x1a, 0xb9, 0xf9, + 0x60, 0xbd, 0x66, 0x6b, 0x5f, 0xd8, 0x12, 0xda, 0x10, 0xcc, 0x1a, 0xb7, + 0xe8, 0xab, 0xf6, 0x8d, 0xd5, 0xb2, 0xa9, 0xda, 0x78, 0xea, 0xa3, 0xe5, + 0x74, 0xab, 0xa9, 0x9b, 0x14, 0x08, 0x3c, 0x9e, 0xae, 0xf7, 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0xd4, + 0x7a, 0x21, 0x69, 0xf8, 0x98, 0xd0, 0x12, 0x56, 0xef, 0x1d, 0x07, 0x3f, + 0xcb, 0x53, 0x46, 0xc6, 0x65, 0x9e, 0x57, 0x06, 0x54, 0xb4, 0x98, 0x05, + 0x12, 0x54, 0xf4, 0xd3, 0x69, 0x26, 0x7a, 0x08, 0x35, 0xc2, 0x22, 0xc6, + 0xcd, 0x34, 0x3a, 0x3a, 0x1e, 0xa7, 0xa7, 0x0b, 0x5e, 0x53, 0xf2, 0x07, + 0x02, 0x33, 0xed, 0x45, 0x2b, 0xff, 0x9a, 0x81, 0xe3, 0x5b, 0xf9, 0x49, + 0x24, 0x2d, 0xf0, 0x55, 0x3d, 0x89, 0xdc, 0x42, 0xe9, 0x41, 0x72, 0xf7, + 0x2a, 0x19, 0x04, 0xb3, 0xc1, 0x1e, 0x50, 0x52, 0x12, 0xd1, 0x51, 0x57, + 0xc1, 0x0c, 0x58, 0x7c, 0x06, 0x88, 0x72, 0x5e, 0x35, 0x87, 0x3a, 0xff, + 0x66, 0x2d, 0x1c, 0x25, 0x4d, 0xb8, 0x91, 0xa9, 0xb7, 0x02, 0x03, 0x01, + 0x00, 0x01, }; +static const unsigned int g_rsa_public_key_3072_der_len = 422; + +static const unsigned char g_rsa_sig_3072_der[] = { + 0x91, 0x7f, 0xd4, 0x7d, 0x93, 0x17, 0xb1, 0xd7, 0xb7, 0xcc, 0xb8, 0x93, + 0x89, 0x80, 0x65, 0x3b, 0xc6, 0x7a, 0x2c, 0x8c, 0xb8, 0x66, 0x5a, 0x98, + 0xa1, 0xc1, 0x18, 0x9a, 0xee, 0x20, 0xa6, 0x45, 0x2d, 0x40, 0xbb, 0x97, + 0xea, 0x84, 0xfd, 0xa9, 0xb4, 0x2f, 0x81, 0xa4, 0x41, 0x79, 0xf7, 0x1e, + 0x62, 0xe0, 0x04, 0x4e, 0x79, 0x15, 0xfa, 0x15, 0x56, 0x18, 0xc1, 0x77, + 0xe9, 0xc6, 0x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 0x4a, 0x82, 0x58, 0xbe, 0x9f, 0xd0, 0x8d, 0x18, + 0x4d, 0x05, 0x15, 0x0d, 0x6c, 0x54, 0x88, 0x47, 0x6d, 0x9d, 0x24, 0x59, + 0x99, 0x64, 0x66, 0xd2, 0x05, 0x84, 0x46, 0x21, 0x5d, 0x0e, 0xe8, 0x61, + 0x60, 0x01, 0x03, 0x19, 0x13, 0x19, 0x96, 0x59, 0x50, 0x84, 0x5f, 0xf7, + 0xae, 0x49, 0xa2, 0xa0, 0x1c, 0x21, 0xc3, 0x05, 0x5e, 0xb3, 0xde, 0x57, + 0xad, 0x31, 0x45, 0x85, 0xd3, 0x3f, 0x88, 0x3a, 0x4e, 0x49, 0x14, 0x00, + 0xc9, 0x1a, 0xf8, 0x4e, 0x3e, 0x8f, 0x10, 0xae, 0xaa, 0x7a, 0x3e, 0xfc, + 0x47, 0x87, 0x82, 0x8f, 0x1d, 0xa0, 0xfe, 0xd4, 0x40, 0x03, 0xf5, 0xe2, + 0xfc, 0xd7, 0x86, 0x7c, 0x6c, 0x46, 0xd1, 0x28, 0x20, 0xe7, 0xc3, 0x58, + 0x1b, 0x8b, 0xe7, 0x34, 0x66, 0xbb, 0xf1, 0xe7, 0x2d, 0x0d, 0xba, 0x1d, + 0x85, 0xc7, 0x9d, 0x13, 0x1f, 0x2f, 0x5b, 0xda, 0xde, 0x0f, 0x9e, 0x54, + 0x38, 0x55, 0xff, 0x69, 0xc3, 0xc8, 0x94, 0xdd, 0xb0, 0x69, 0x67, 0x96, -// Signed with g_ecc_private_key_ed25519, Raw { R | S } little endian -uint8_t g_ecc_signature_ed25519[] = -{ -0x8f,0x57,0xa4,0x5d,0x6a,0x0b,0x0c,0x94,0x7a,0x7b,0x0f,0xec,0x83,0x72,0xf6,0xf2, -0x1e,0x7d,0xd0,0xce,0x70,0x91,0x7f,0xbb,0xce,0x9d,0x0f,0x1a,0xbc,0x8d,0x57,0x0c, -0xd9,0x1c,0xa3,0x4f,0xd7,0x89,0x16,0xce,0xb7,0x0e,0x29,0x9c,0xc1,0x00,0x7b,0xf0, -0xa5,0xe2,0x13,0x4c,0x86,0xe3,0xef,0x48,0x6e,0xd1,0x9b,0x76,0xbf,0x0d,0xe5,0x01, }; - -// Always 256 bytes -uint8_t g_rsa_sig_2048[] = -{ -0x6d,0x51,0xd7,0x61,0xce,0xcf,0x85,0x1c,0x0e,0x36,0x0c,0xe1,0x80,0x08,0x3a,0x5c, -0x73,0x49,0xb6,0x56,0xae,0x8b,0x69,0x4e,0x3a,0x9b,0x41,0x57,0xf8,0x43,0x42,0x20, -0x0b,0x8a,0x60,0xc0,0xe4,0x9d,0xc3,0x00,0x1c,0xeb,0xff,0x27,0x10,0x1f,0x79,0x6b, -0xd3,0xc6,0x8c,0x66,0xa8,0x61,0x8f,0x6e,0xf1,0x79,0x68,0x6c,0x78,0xda,0x76,0x26, -0x3f,0xbe,0x40,0xd0,0x39,0x2e,0xbb,0x01,0xe7,0x43,0xab,0xfa,0x5d,0x2c,0xa6,0xa6, -0xe8,0x41,0xd7,0x8f,0x8a,0x34,0xac,0x18,0xa0,0x3b,0x4e,0xb1,0x55,0x41,0x5d,0xaf, -0x68,0x45,0x23,0x1b,0x67,0x87,0x7f,0x12,0xbe,0xca,0x81,0xe5,0xcb,0x2c,0x1f,0x96, -0x78,0xc2,0x7f,0x0c,0x88,0xf0,0xca,0xe8,0x63,0xa9,0x90,0x99,0x25,0x15,0x38,0x58, -0xcd,0x7c,0x1c,0xb0,0x0d,0xc2,0xb4,0x8d,0x98,0x52,0xf2,0x64,0xfe,0xd8,0xbc,0x9b, -0x83,0x13,0x97,0xa5,0xfa,0xbf,0x26,0x17,0xaa,0x9f,0xcc,0xe1,0x5d,0xb0,0x41,0x75, -0x97,0xd6,0x8d,0x2a,0x02,0xaf,0x3f,0xb0,0xff,0x10,0x6f,0xac,0xf0,0x8c,0xd2,0x38, -0x38,0x0b,0xf1,0x65,0x24,0xca,0x08,0x43,0x2c,0xc2,0x2f,0x4a,0x87,0xfa,0xf9,0xbd, -0x98,0x40,0xfd,0xb9,0x3f,0x81,0x76,0xb3,0x34,0x9d,0xd8,0x34,0x21,0x7c,0xe2,0x22, -0x18,0x03,0xc3,0x98,0x83,0x3e,0xd0,0x80,0xd2,0x6f,0x47,0x13,0x25,0x7a,0xe5,0xfb, -0x70,0x72,0x7e,0x63,0xe9,0x14,0x99,0xfc,0x14,0xae,0xa1,0x6b,0x6f,0xa2,0x0e,0x5c, -0x09,0x66,0x9c,0x91,0xdb,0xec,0xd8,0x05,0x90,0xdb,0x2b,0x75,0xe1,0x6e,0x32,0x04, +static const unsigned int g_rsa_sig_3072_der_len = 384; + +static const unsigned char g_rsa_public_key_4096_der[] = { + 0x30, 0x82, 0x02, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, + 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x02, 0x0f, 0x00, + 0x30, 0x82, 0x02, 0x0a, 0x02, 0x82, 0x02, 0x01, 0x00, 0xb7, 0x1c, 0x76, + 0x66, 0xd6, 0x15, 0x00, 0xa8, 0xa5, 0xe3, 0xc4, 0xf5, 0x45, 0x08, 0x68, + 0xa6, 0xa2, 0xb5, 0xb1, 0x11, 0xf5, 0x07, 0x12, 0xb4, 0xac, 0xd5, 0x06, + 0xa9, 0x6e, 0x11, 0x06, 0x10, 0x3d, 0x90, 0x62, 0x8b, 0xd6, 0x25, 0xe5, + 0x6d, 0xbd, 0x9d, 0xdd, 0x29, 0x8d, 0xa2, 0xc0, 0xa2, 0xda, 0x8c, 0x0b, + 0x16, 0x4b, 0x8c, 0x13, 0x62, 0xcd, 0x98, 0xb7, 0xfd, 0xad, 0x63, 0x53, + 0x2b, 0x7b, 0xa4, 0xa0, 0x7d, 0x87, 0xee, 0xd9, 0xa6, 0xb2, 0xf2, 0xc2, + 0x98, 0xe7, 0x02, 0x3c, 0x44, 0x61, 0x79, 0x40, 0x32, 0x1c, 0x52, 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3, 0x78, 0x62, 0x1c, 0xe5, 0xf5, 0x1c, 0xc4, 0x7b, + 0x1d, 0xfe, 0x59, 0x3c, 0xeb, 0xe9, 0xe9, 0xf2, 0xa3, 0xa1, 0x0b, 0x3c, + 0xd2, 0xec, 0x1e, 0x13, 0x77, 0xb8, 0x7d, 0xaa, 0x90, 0x9c, 0x42, 0x10, + 0x0c, 0x40, 0x6f, 0xd2, 0x9e, 0x0d, 0xdb, 0x65, 0x62, 0x1b, 0xa5, 0xf4, + 0xb2, 0x22, 0x3c, 0xc3, 0xea, 0x40, 0xcd, 0xe7, 0x85, 0x4a, 0xc0, 0x56, + 0xd3, 0xff, 0xa6, 0xa4, 0x37, 0x02, 0x03, 0x01, 0x00, 0x01, }; - -// Always 384 bytes -uint8_t g_rsa_sig_3072[] = -{ -0x79,0xa7,0xe8,0xa1,0x70,0xdd,0x7a,0x33,0xc7,0xb5,0x36,0x33,0x61,0x8f,0xa0,0x99, -0x0c,0x54,0x0d,0xe2,0x10,0x54,0x67,0x0f,0xc5,0xf2,0x83,0x08,0x81,0x0a,0x8e,0x72, -0x73,0x4d,0x4d,0x34,0x9c,0x1b,0xd5,0xf7,0xa1,0x9e,0x64,0x35,0x74,0xf2,0x0c,0x95, -0x5f,0x84,0x01,0xe4,0x73,0x96,0x4a,0xf5,0x6a,0x01,0x7e,0x8a,0x7e,0x62,0xd5,0xf2, -0xc2,0x5b,0xd4,0x54,0x5e,0xf6,0xb6,0xb3,0x23,0xe1,0x1a,0x0b,0x00,0x30,0xad,0xe4, -0x49,0xe8,0xf6,0x1a,0x5c,0x30,0x2c,0x71,0x03,0x60,0xfb,0xa1,0xd2,0xfc,0xbc,0xe7, -0x91,0xe4,0xc5,0x2f,0x9d,0x9e,0x61,0x55,0xde,0x56,0x0c,0x5a,0x62,0xc3,0x84,0x47, -0x9e,0x9c,0x63,0x3b,0x70,0xfa,0x6c,0xeb,0x27,0x57,0x04,0x7a,0x03,0xab,0x83,0xcc, -0xc8,0xa2,0xcd,0x1d,0xf3,0x1b,0xd6,0xb3,0xbc,0x3e,0xcb,0x67,0x91,0x96,0xa8,0xd2, -0xe2,0x3b,0x89,0x9c,0x7c,0x0f,0x75,0xc5,0x61,0xc8,0x4e,0x27,0x9b,0xdf,0x06,0xc6, -0x9d,0x94,0xe1,0xaf,0xab,0x33,0x71,0xde,0x5f,0x79,0xd6,0x47,0xed,0xeb,0xaf,0xa3, -0xcf,0x68,0x67,0xb4,0x31,0x04,0x5e,0xd6,0x70,0x93,0x17,0x8b,0x29,0x63,0xc5,0xf5, -0x35,0x1f,0x2e,0xa4,0x16,0x7a,0xb2,0xe7,0xd4,0x82,0xc2,0x06,0xdb,0xc5,0x64,0x3b, -0x06,0x9a,0xc9,0xd4,0x92,0xce,0xe3,0xed,0xe3,0x9d,0x5e,0xb0,0xcb,0x0d,0xfb,0xf0, -0x73,0xfc,0xa1,0x98,0xe1,0xc4,0xe1,0x3f,0xef,0x14,0x25,0x2c,0xe2,0x30,0xfb,0x1a, -0x3e,0x1a,0x94,0xf2,0x65,0xd9,0xf1,0xfb,0x58,0xec,0xb5,0x27,0x7c,0x05,0x0b,0xf9, -0xbd,0x22,0x43,0xb8,0xc9,0x29,0xb2,0xff,0x50,0x65,0x1c,0x75,0x1e,0xab,0x7f,0x8f, -0xb5,0xeb,0x62,0x06,0x39,0xf1,0xa1,0x30,0x4a,0x5a,0x90,0x93,0xad,0x6b,0x88,0xa7, -0xeb,0x7d,0x84,0x23,0xaa,0x7c,0x05,0xcc,0xfa,0xf3,0xf8,0x95,0x2d,0x87,0x95,0x56, -0xf7,0x70,0x84,0x96,0xf9,0x9d,0xa2,0xb3,0x3c,0xab,0x77,0x9d,0x21,0x83,0x8d,0x03, -0x8f,0x61,0x82,0xf8,0x9e,0xf5,0xe2,0x36,0x2b,0x54,0x23,0xc1,0xdf,0x30,0x4d,0xa6, -0x17,0x35,0xcf,0x40,0xd2,0x68,0x8c,0x97,0xc0,0x86,0x82,0x29,0xc9,0x65,0x34,0x9f, -0xb1,0x84,0x1d,0x76,0xb7,0x62,0xd4,0x5d,0xed,0xc5,0x98,0xe5,0x6c,0x98,0x03,0x16, -0x42,0x3c,0x31,0x9b,0x29,0x5a,0xde,0x55,0xa5,0x84,0xc5,0x2b,0x7d,0x66,0x4e,0xfa, +static const unsigned int g_rsa_public_key_4096_der_len = 550; + +static const unsigned char g_rsa_sig_4096_der[] = { + 0x3a, 0x62, 0x63, 0x55, 0x0e, 0x07, 0x18, 0xc5, 0xbc, 0x43, 0xe0, 0xfd, + 0x44, 0x25, 0x11, 0x6e, 0x15, 0xf0, 0xa5, 0x7b, 0x67, 0xe2, 0x48, 0x69, + 0x04, 0x6a, 0x90, 0xfc, 0x5d, 0xa0, 0x5f, 0xfa, 0xc1, 0x7a, 0x40, 0x5a, + 0xb9, 0xcb, 0x1b, 0x95, 0xbb, 0xb1, 0xa0, 0x25, 0x0e, 0xb1, 0x21, 0xa6, + 0xe0, 0x29, 0xfd, 0xb9, 0xc9, 0xd7, 0x2d, 0x04, 0x8c, 0x52, 0x12, 0xd4, + 0xb0, 0x04, 0x93, 0xea, 0xf5, 0x4d, 0x07, 0x8a, 0xb6, 0x1f, 0x1a, 0xce, + 0xbc, 0x3b, 0xc2, 0x11, 0xba, 0xe3, 0x56, 0xb5, 0x74, 0xb9, 0x8b, 0xb5, + 0x38, 0x80, 0x84, 0xe1, 0x2a, 0x8d, 0xc3, 0x96, 0x88, 0x2e, 0xbc, 0x37, + 0x24, 0xf7, 0xc6, 0x07, 0x59, 0x78, 0x62, 0x0d, 0x31, 0x01, 0xee, 0x17, + 0x4e, 0x07, 0xe7, 0x8f, 0xe6, 0xaf, 0x4d, 0xfd, 0xa7, 0xb8, 0xbc, 0xf6, + 0x0e, 0x3a, 0xeb, 0x13, 0xdf, 0xb4, 0x5f, 0xd8, 0x9d, 0x7a, 0x08, 0xb5, + 0xbb, 0xec, 0xcf, 0xa5, 0xac, 0xc3, 0x67, 0x0f, 0xb9, 0x90, 0xe7, 0x7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x76, 0xff, 0x00, 0xe4, 0x01, 0xa5, }; +static const unsigned int g_rsa_sig_4096_der_len = 512; -// Always 512 bytes -uint8_t g_rsa_sig_4096[] = -{ -0x2a,0x91,0x3a,0xd9,0x8c,0xd3,0x2d,0xff,0x6e,0xa0,0x5d,0x20,0x3b,0x9b,0x4a,0x94, -0xa7,0x2a,0xfe,0x4f,0xdc,0xe5,0x92,0x87,0x38,0xde,0x7b,0x37,0xc3,0x37,0xe3,0x3a, -0xb9,0x2e,0x1e,0x11,0x21,0x95,0x67,0x49,0x05,0x83,0x07,0xe5,0xbc,0x49,0xb6,0x91, -0xc1,0x45,0x70,0xd9,0xc9,0x76,0x08,0x07,0xf8,0x32,0xa0,0xb3,0x0a,0x2b,0x15,0xcd, -0x53,0xa5,0x27,0xef,0x2a,0xfc,0x83,0xbd,0x17,0x97,0xc6,0xe9,0x93,0x9b,0xb6,0x5a, -0xef,0xe0,0x90,0xe7,0x76,0x14,0x0e,0x54,0x3f,0x7a,0xdf,0xdd,0x7f,0x3a,0x90,0xba, -0x4e,0xa7,0x48,0x3d,0xc1,0x0f,0xcd,0x0c,0x11,0xed,0xfa,0x05,0xd9,0xd4,0xa4,0x26, -0xa4,0xcf,0x3f,0x02,0x53,0xe6,0xb0,0xad,0x01,0x40,0x8d,0xd2,0x5d,0x2d,0x2f,0x3a, -0x96,0x63,0x1c,0x4a,0x5a,0x9d,0x6f,0x90,0x29,0x31,0xb4,0x50,0x1a,0x89,0xc1,0xf2, -0xa2,0xe3,0xc9,0x7e,0x1c,0xbb,0xd9,0x19,0xcf,0x4d,0x61,0xbb,0x91,0x99,0xd9,0x99, -0x4f,0xb5,0x43,0xe2,0xa1,0xb8,0x91,0x71,0x72,0xbf,0x8c,0xa5,0xd6,0x4e,0xe6,0xd1, -0xb4,0xdd,0x9d,0xf4,0xa9,0x40,0xc3,0xe6,0xf2,0x4e,0xe8,0x4f,0x7d,0xf6,0x83,0x5b, -0x08,0xcd,0xc9,0xe6,0x6a,0x1c,0xc2,0x5b,0xb9,0x15,0xa7,0xf8,0xf0,0x7b,0xdf,0xfc, -0xb0,0xe3,0x67,0x9e,0x99,0x21,0x77,0x5b,0xd9,0x93,0x05,0xe1,0xeb,0x68,0xdb,0x39, -0x76,0xd9,0x27,0x38,0x20,0x45,0x3b,0x38,0x3e,0x90,0x38,0xe6,0xe0,0xff,0x73,0xa5, -0x28,0x59,0x5b,0x1a,0x77,0xc1,0x42,0xcd,0xab,0xc4,0x70,0xc3,0x62,0xfb,0xf8,0x15, -0x5d,0x97,0x80,0x9a,0x21,0xe8,0x6b,0x32,0xbd,0x99,0xdf,0xa1,0x3e,0xec,0xad,0x20, -0x44,0xcb,0xf7,0xd2,0x1b,0x8c,0x42,0x55,0x40,0xe9,0xb5,0x2e,0xed,0x00,0x82,0xfc, -0x2f,0xe6,0xa1,0xc3,0x5d,0x8b,0x4d,0x15,0xfc,0xd3,0x06,0x56,0x95,0x5a,0xff,0x8b, -0xeb,0x0e,0xeb,0x05,0x01,0x8d,0x04,0x1e,0xfc,0x5a,0xb1,0x2e,0xcb,0x96,0x8a,0xe1, -0x5b,0xf0,0xe3,0x2c,0xc0,0xdb,0x43,0x9a,0x8a,0x54,0x3a,0xed,0x1c,0xb0,0xf8,0x26, -0x68,0x41,0x61,0x6d,0x80,0xe0,0x04,0xd1,0xc0,0x7f,0xcb,0x37,0x46,0xf5,0x60,0x2e, -0xbe,0x08,0x1e,0x99,0x08,0x22,0x26,0xab,0x17,0x36,0x1f,0xab,0x9a,0xc2,0x81,0xa0, -0x6c,0x54,0x27,0x0d,0x77,0xe2,0xce,0x0e,0x7d,0xf8,0xe5,0xf6,0x6d,0x90,0xd5,0x78, -0x42,0x5a,0x1f,0xf0,0x81,0x05,0x7e,0x3f,0x39,0x65,0x03,0x6e,0x1f,0x46,0xed,0xbf, -0xad,0x0a,0x24,0x30,0x01,0xa9,0x71,0xd1,0x91,0x16,0xa6,0xa7,0x21,0xdc,0x26,0xae, -0x48,0xcf,0x9c,0x63,0x52,0x5d,0xf0,0x85,0x99,0xd6,0x11,0xdc,0xde,0xea,0x56,0x5a, -0x3b,0xee,0x31,0xa9,0x5c,0xd4,0xb3,0xe4,0x16,0x13,0xab,0x4a,0x35,0x1f,0xa4,0x12, -0xcd,0x45,0xa7,0xfd,0x6b,0x42,0x92,0xec,0xc8,0x7e,0xbe,0x52,0x21,0x0c,0x62,0x04, -0xa2,0xb9,0x0b,0xac,0xfc,0x75,0xf5,0xa5,0xc1,0xd3,0x71,0x40,0xd1,0xbf,0xea,0x2f, -0x1f,0xa5,0x90,0xd1,0x3e,0x29,0xed,0x09,0x3b,0x3c,0xf4,0x4a,0x95,0x93,0x63,0x01, -0xe3,0x20,0xf9,0xef,0x8e,0xab,0xae,0x29,0x37,0xc0,0x98,0x66,0xad,0xab,0xd6,0x46, +uint8_t g_ecc_public_key_c25519[] = { + // LITTLE-ENDIAN + 0xf8, 0x5d, 0x06, 0x5d, 0xd7, 0xa4, 0xe2, 0xb8, 0x72, 0x27, 0xf2, + 0x38, 0x2b, 0x44, 0x4b, 0xf5, 0xd2, 0x29, 0x60, 0x70, 0x3c, 0xdc, + 0x86, 0xc0, 0xef, 0xd2, 0xd3, 0x4d, 0x5d, 0xe1, 0xdb, 0x26, }; /* see ee_dsa_alg_t in ee_bench.h */ -uint8_t *g_public_keys[] = { - g_ecc_public_key_p256r1, - g_ecc_public_key_p384, - g_ecc_public_key_c25519, - g_ecc_public_key_ed25519, - g_rsa_public_key_2048, - g_rsa_public_key_3072, - g_rsa_public_key_4096, +const uint8_t *g_public_keys[] = { + g_ecc_public_key_prime256v1_der, g_ecc_public_key_secp384r1_der, + g_ecc_public_key_c25519, g_ecc_public_key_ed25519_der, + g_rsa_public_key_2048_der, g_rsa_public_key_3072_der, + g_rsa_public_key_4096_der, }; /* see ee_dsa_alg_t in ee_bench.h */ -uint32_t g_public_key_sizes[] = { - 64 + 1, - 96 + 1, +const uint32_t g_public_key_sizes[] = { + g_ecc_public_key_prime256v1_der_len, + g_ecc_public_key_secp384r1_der_len, 32, - 32, - 294, - 422, - 550, + g_ecc_public_key_ed25519_der_len, + g_rsa_public_key_2048_der_len, + g_rsa_public_key_3072_der_len, + g_rsa_public_key_4096_der_len, }; /* see ee_dsa_alg_t in ee_bench.h */ -uint8_t *g_dsa_signatures[] = { - g_ecc_signature_p256r1, - g_ecc_signature_p384, +const uint8_t *g_dsa_signatures[] = { + g_ecc_signature_prime256v1_sig, + g_ecc_signature_secp384r1_sig, 0, - g_ecc_signature_ed25519, - g_rsa_sig_2048, - g_rsa_sig_3072, - g_rsa_sig_4096, + g_ecc_signature_ed25519_sig, + g_rsa_sig_2048_der, + g_rsa_sig_3072_der, + g_rsa_sig_4096_der, }; /* see ee_dsa_alg_t in ee_bench.h */ -uint32_t g_dsa_signature_sizes[] = { - 71, - 103, +const uint32_t g_dsa_signature_sizes[] = { + g_ecc_signature_prime256v1_sig_len, + g_ecc_signature_secp384r1_sig_len, 0, - 64, - 256, - 384, - 512 + g_ecc_signature_ed25519_sig_len, + g_rsa_sig_2048_der_len, + g_rsa_sig_3072_der_len, + g_rsa_sig_4096_der_len, }; -// clang-format on +uint8_t g_dsa_message[] = { + /* SHA256(`Tempus unum hominem manet.`) */ + 0xb7, 0x03, 0xb9, 0xc0, 0x84, 0xbe, 0xe8, 0xa2, 0x78, 0xa9, 0x56, + 0x53, 0x48, 0x44, 0xd7, 0xfa, 0x40, 0x10, 0xa5, 0x86, 0x8c, 0x0c, + 0x82, 0xa4, 0x50, 0x6b, 0xf8, 0x1c, 0x36, 0x21, 0x8d, 0xe1, +}; #endif /* __KEYS_H */ From ccb98c4230e9d683c4644d698b98750e0223877f Mon Sep 17 00:00:00 2001 From: Peter Torelli Date: Fri, 13 Jan 2023 16:59:48 -0800 Subject: [PATCH 3/8] var_01 wasn't running 1 iter during CRC check. --- examples/selfhosted/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/selfhosted/main.c b/examples/selfhosted/main.c index 5102ca8..98060b2 100644 --- a/examples/selfhosted/main.c +++ b/examples/selfhosted/main.c @@ -612,7 +612,7 @@ wrap_variation_001(void *ex, uint32_t n, uint32_t i, wres_t *res) { ee_bench_result_t bres; n = 0; /* unused */ - ee_bench_var01(0, &bres); + ee_bench_var01(i, &bres); res->iter = bres.iter; res->dt = bres.dt; /** From ca9540aac3c233807f51df9d0e2b79bd5cfdb076 Mon Sep 17 00:00:00 2001 From: Peter Torelli Date: Fri, 13 Jan 2023 17:00:32 -0800 Subject: [PATCH 4/8] Switched to pre-hashed versions of Sign/Verify --- .../profile/wolfssl_th_api/th_ecdsa.c | 40 +++++++++---------- .../profile/wolfssl_th_api/th_rsa.c | 25 ++++++------ 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c b/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c index 1d1752f..8ab2559 100644 --- a/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c +++ b/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c @@ -105,17 +105,15 @@ th_ecdsa_sign(void *p_context, { case ECC_SECP256R1: case ECC_SECP384R1: - CHK1(wc_SignatureGenerate( - WC_HASH_TYPE_SHA256, - WC_SIGNATURE_TYPE_ECC, - p_msg, - msglen, - p_sig, - p_siglen, - &(c->key.ecc), - sizeof(ecc_key), - &(c->rng) - )); + CHK1(wc_SignatureGenerateHash(WC_HASH_TYPE_SHA256, + WC_SIGNATURE_TYPE_ECC, + p_msg, + msglen, + p_sig, + p_siglen, + &(c->key.ecc), + sizeof(ecc_key), + &(c->rng))); break; case ECC_X25519: CHK1(wc_ed25519_sign_msg( @@ -148,19 +146,17 @@ th_ecdsa_verify(void *p_context, { case ECC_SECP256R1: case ECC_SECP384R1: - ret = wc_SignatureVerify( - WC_HASH_TYPE_SHA256, - WC_SIGNATURE_TYPE_ECC, - p_msg, - msglen, - p_sig, - siglen, - &(c->key.ecc), - sizeof(ecc_key) - ); + ret = wc_SignatureVerifyHash(WC_HASH_TYPE_SHA256, + WC_SIGNATURE_TYPE_ECC, + p_msg, + msglen, + p_sig, + siglen, + &(c->key.ecc), + sizeof(ecc_key)); if (ret != 0 && ret != SIG_VERIFY_E) { - th_printf("e-[wc_SignatureVerify: %d]\r\n", ret); + th_printf("e-[wc_SignatureVerifyHash: %d]\r\n", ret); return EE_STATUS_ERROR; } if (ret == 0) diff --git a/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c b/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c index 4a69397..74a98af 100644 --- a/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c +++ b/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c @@ -99,24 +99,23 @@ th_rsa_verify(void *p_context, uint32_t siglen, bool *p_pass) { - rsa_context_t *ctx = (rsa_context_t *)p_context; - int ret = 0; + rsa_context_t *ctx = (rsa_context_t *)p_context; + int ret = 0; - *p_pass = false; + *p_pass = false; - ret = wc_SignatureVerify( - WC_HASH_TYPE_SHA256, - WC_SIGNATURE_TYPE_RSA_W_ENC, - p_msg, - msglen, - p_sig, - siglen, - ctx->pubkey, - sizeof(RsaKey)); + ret = wc_SignatureVerifyHash(WC_HASH_TYPE_SHA256, + WC_SIGNATURE_TYPE_RSA_W_ENC, + p_msg, + msglen, + p_sig, + siglen, + ctx->pubkey, + sizeof(RsaKey)); if (ret != 0 && ret != SIG_VERIFY_E) { - th_printf("e-[wc_SignatureVerify: %d]\r\n", ret); + th_printf("e-[wc_SignatureVerifyHash: %d]\r\n", ret); return EE_STATUS_ERROR; } From 921377302286293fc6a1cf21cbc4d08f4e133db9 Mon Sep 17 00:00:00 2001 From: Peter Torelli Date: Sun, 15 Jan 2023 15:13:27 -0800 Subject: [PATCH 5/8] Comments refer to hash instead of msg --- .../profile/wolfssl_th_api/th_ecdsa.c | 20 ++++++++-------- .../profile/wolfssl_th_api/th_rsa.c | 8 +++---- profile/ee_ecdsa.h | 23 ++++++++++++------- profile/ee_rsa.h | 14 +++++++---- profile/th_api/th_ecdsa.c | 8 +++---- profile/th_api/th_rsa.c | 6 ++--- 6 files changed, 45 insertions(+), 34 deletions(-) diff --git a/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c b/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c index 8ab2559..c3d857c 100644 --- a/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c +++ b/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c @@ -93,8 +93,8 @@ th_ecdsa_create(void **pp_context, ee_ecc_group_t group) ee_status_t th_ecdsa_sign(void *p_context, - uint8_t *p_msg, - uint32_t msglen, + uint8_t *p_hash, + uint32_t hashlen, uint8_t *p_sig, uint32_t *p_siglen) { @@ -107,8 +107,8 @@ th_ecdsa_sign(void *p_context, case ECC_SECP384R1: CHK1(wc_SignatureGenerateHash(WC_HASH_TYPE_SHA256, WC_SIGNATURE_TYPE_ECC, - p_msg, - msglen, + p_hash, + hashlen, p_sig, p_siglen, &(c->key.ecc), @@ -117,7 +117,7 @@ th_ecdsa_sign(void *p_context, break; case ECC_X25519: CHK1(wc_ed25519_sign_msg( - p_msg, msglen, p_sig, p_siglen, &(c->key.ed25519))); + p_hash, hashlen, p_sig, p_siglen, &(c->key.ed25519))); break; default: th_printf("e-[th_ecdsa_sign: invalid curve %d]\r\n", c->curve); @@ -131,8 +131,8 @@ th_ecdsa_sign(void *p_context, ee_status_t th_ecdsa_verify(void *p_context, - uint8_t *p_msg, - uint32_t msglen, + uint8_t *p_hash, + uint32_t hashlen, uint8_t *p_sig, uint32_t siglen, bool *p_pass) @@ -148,8 +148,8 @@ th_ecdsa_verify(void *p_context, case ECC_SECP384R1: ret = wc_SignatureVerifyHash(WC_HASH_TYPE_SHA256, WC_SIGNATURE_TYPE_ECC, - p_msg, - msglen, + p_hash, + hashlen, p_sig, siglen, &(c->key.ecc), @@ -166,7 +166,7 @@ th_ecdsa_verify(void *p_context, break; case ECC_X25519: ret = wc_ed25519_verify_msg( - p_sig, siglen, p_msg, msglen, &verify, &(c->key.ed25519)); + p_sig, siglen, p_hash, hashlen, &verify, &(c->key.ed25519)); if (ret != 0 && ret != SIG_VERIFY_E) { th_printf("e-[wc_ed25519_verify_msg: %d]\r\n", ret); diff --git a/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c b/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c index 74a98af..764fc4c 100644 --- a/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c +++ b/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c @@ -93,8 +93,8 @@ th_rsa_set_public_key(void *p_context, const uint8_t *p_pub, uint32_t publen) ee_status_t th_rsa_verify(void *p_context, - uint8_t *p_msg, - uint32_t msglen, + uint8_t *p_hash, + uint32_t hashlen, uint8_t *p_sig, uint32_t siglen, bool *p_pass) @@ -106,8 +106,8 @@ th_rsa_verify(void *p_context, ret = wc_SignatureVerifyHash(WC_HASH_TYPE_SHA256, WC_SIGNATURE_TYPE_RSA_W_ENC, - p_msg, - msglen, + p_hash, + hashlen, p_sig, siglen, ctx->pubkey, diff --git a/profile/ee_ecdsa.h b/profile/ee_ecdsa.h index cbb6efb..269c73f 100644 --- a/profile/ee_ecdsa.h +++ b/profile/ee_ecdsa.h @@ -42,37 +42,44 @@ ee_status_t th_ecdsa_create(void **pp_context, ee_ecc_group_t group); * contain the length of the signature. * * @param p_context - The context from the `create` function - * @param p_msg - The hashed buffer to sign - * @param msglen - Length of the hashed buffer + * @param p_hash - The hashed buffer to sign + * @param hashlen - Length of the hashed buffer * @param p_sig - The output signature buffer (provided) * @param p_siglen - The number of bytes used in the output signature buffer. * @return ee_status_t - EE_STATUS_OK or EE_STATUS_ERROR */ ee_status_t th_ecdsa_sign(void *p_context, - uint8_t *p_msg, - uint32_t msglen, + uint8_t *p_hash, + uint32_t hashlen, uint8_t *p_sig, uint32_t *p_siglen); /** * @brief Verify a message (hash) with the public key. + * + * For EcDSA, the signature format is the ASN.1 DER of R and S. For Ed25519, + * the signature is the raw, little endian encoding of R and S, padded to 256 + * bits. * + * Note that even if the message is a hash, Ed25519 will perform another SHA- + * 512 operation on it, as this is part of RFC 8032. + * * It will return EE_STATUS_OK on message verify, and EE_STATUS_ERROR if the * message does not verify, or if there is some other error (which shall * be reported with `th_printf("e-[....]r\n");`. * * @param p_context - The context from the `create` function * @param group - See the `ee_ecc_group_t` enum - * @param p_msg - The message buffer to verify - * @param msglen - Length of the message buffer + * @param p_hash - The message buffer to verify + * @param hashlen - Length of the message buffer * @param p_sig - The input signature buffer * @param siglen - Length of the input signature buffer * @param p_pass - Did the message verify? * @return ee_status_t - see above. */ ee_status_t th_ecdsa_verify(void *p_context, - uint8_t *p_msg, - uint32_t msglen, + uint8_t *p_hash, + uint32_t hashlen, uint8_t *p_sig, uint32_t siglen, bool *p_pass); diff --git a/profile/ee_rsa.h b/profile/ee_rsa.h index d60dd3f..cf55b5a 100644 --- a/profile/ee_rsa.h +++ b/profile/ee_rsa.h @@ -46,12 +46,16 @@ ee_status_t th_rsa_set_public_key(void *p_context, uint32_t publen); /** - * @brief Verify a message (hash) with the public key. The message will - * be in ASN.1 format as OID || SHA256(m) + * @brief Verify a message (hash) with the public key. The signature will + * be in ASN.1 padded OID || SHA256(m). + * + * It will return EE_STATUS_OK on message verify, and EE_STATUS_ERROR if the + * message does not verify, or if there is some other error (which shall + * be reported with `th_printf("e-[....]r\n");`. * * @param p_context - The context from the `create` function - * @param p_sig - The input message buffer - * @param msglen - Length of the input message buffer + * @param p_hash - The input message buffer + * @param hashlen - Length of the input message buffer * @param p_sig - The output signature buffer * @param siglen - Length of the output signature buffer * @param p_pass - Did the message verify? @@ -59,7 +63,7 @@ ee_status_t th_rsa_set_public_key(void *p_context, */ ee_status_t th_rsa_verify(void *p_context, uint8_t *p_msg, - uint32_t msglen, + uint32_t hashlen, uint8_t *p_sig, uint32_t siglen, bool *p_pass); diff --git a/profile/th_api/th_ecdsa.c b/profile/th_api/th_ecdsa.c index 59838ba..053df71 100644 --- a/profile/th_api/th_ecdsa.c +++ b/profile/th_api/th_ecdsa.c @@ -28,8 +28,8 @@ th_ecdsa_get_public_key(void *p_context, uint8_t *p_out, uint32_t *p_outlen) ee_status_t th_ecdsa_verify(void *p_context, - uint8_t *p_msg, - uint32_t msglen, + uint8_t *p_hash, + uint32_t hashlen, uint8_t *p_sig, uint32_t siglen, bool *p_pass) @@ -40,8 +40,8 @@ th_ecdsa_verify(void *p_context, ee_status_t th_ecdsa_sign(void *p_context, - uint8_t *p_msg, - uint32_t msglen, + uint8_t *p_hash, + uint32_t hashlen, uint8_t *p_sig, uint32_t *p_siglen) { diff --git a/profile/th_api/th_rsa.c b/profile/th_api/th_rsa.c index 96ec841..051713d 100644 --- a/profile/th_api/th_rsa.c +++ b/profile/th_api/th_rsa.c @@ -31,10 +31,10 @@ th_rsa_set_public_key(void *p_context, const uint8_t *p_pub, uint32_t publen) ee_status_t th_rsa_verify(void *p_context, - uint8_t *p_msg, - uint32_t mlen, + uint8_t *p_hash, + uint32_t hashlen, uint8_t *p_sig, - uint32_t slen, + uint32_t siglen, bool *p_pass) { #warning "th_rsa_sign not implemented" From b552f0922e9586c6ec9f99bf3c952aa9e0aaee05 Mon Sep 17 00:00:00 2001 From: Peter Torelli Date: Mon, 16 Jan 2023 17:17:45 -0800 Subject: [PATCH 6/8] Unused label removal --- examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c b/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c index c3d857c..b1e370a 100644 --- a/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c +++ b/examples/selfhosted/profile/wolfssl_th_api/th_ecdsa.c @@ -179,9 +179,6 @@ th_ecdsa_verify(void *p_context, } *p_pass = verify == 1; return EE_STATUS_OK; -error: - th_printf("e-[th_ecdsa_verify: error: %d]\r\n", ret); - return EE_STATUS_ERROR; } ee_status_t From 26fa0e437fbb48176ff6b6c09997b5ca3bff9d6c Mon Sep 17 00:00:00 2001 From: Peter Torelli Date: Mon, 16 Jan 2023 17:18:03 -0800 Subject: [PATCH 7/8] RSA sigs are now ASN1 encoded --- examples/selfhosted/keys.h | 415 +++++++++++++++++++------------------ 1 file changed, 209 insertions(+), 206 deletions(-) diff --git a/examples/selfhosted/keys.h b/examples/selfhosted/keys.h index b4226c6..c3dd74b 100644 --- a/examples/selfhosted/keys.h +++ b/examples/selfhosted/keys.h @@ -67,232 +67,230 @@ static const unsigned char g_ecc_signature_ed25519_sig[] static const unsigned int g_ecc_signature_ed25519_sig_len = 64; static const unsigned char g_rsa_public_key_2048_der[] = { - 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, - 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, - 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xac, 0xd3, 0xf5, - 0x48, 0xed, 0xe2, 0x14, 0xda, 0x54, 0x09, 0xe7, 0xcc, 0xc1, 0xc0, 0xbf, - 0xc5, 0x50, 0x33, 0x78, 0x49, 0x5b, 0xb1, 0x03, 0x2f, 0x4f, 0xcb, 0x03, - 0x81, 0xe9, 0x33, 0x7f, 0xbe, 0xcd, 0x5a, 0x4d, 0x6a, 0x3c, 0xaa, 0x12, - 0xe4, 0x98, 0xf2, 0xe4, 0x37, 0x72, 0x38, 0x69, 0x47, 0x12, 0xa7, 0xbf, - 0x7e, 0x66, 0xec, 0xbd, 0x4b, 0xa1, 0x0b, 0x52, 0xfd, 0xa5, 0xff, 0x62, - 0x3f, 0x35, 0xc7, 0x96, 0x3f, 0x5c, 0xe2, 0xb0, 0xde, 0x16, 0x44, 0xdd, - 0x00, 0xae, 0x74, 0xfe, 0xd1, 0xb0, 0x2f, 0x15, 0xd7, 0x4a, 0x6a, 0xcb, - 0xff, 0x99,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 0x48, 0x86, + 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, + 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xd0, 0x84, 0x16, + 0x1e, 0x7f, 0x06, 0x9f, 0xef, 0xee, 0x25, 0x0a, 0x9e, 0x9b, 0x80, 0x79, + 0xcd, 0x8b, 0x74, 0x71, 0x75, 0xe5, 0x57, 0x6a, 0xb4, 0x83, 0xb3, 0x7e, + 0x01, 0xbf, 0x1d, 0xe2, 0x63, 0xec, 0xf3, 0x96, 0x28, 0x81, 0xdd, 0xab, + 0xa4, 0xfe, 0xb8, 0x61, 0x44, 0x65, 0x83, 0x8e, 0xb2, 0x19, 0x47, 0xdc, + 0x6e, 0x4d, 0xc9, 0x96, 0x12, 0x1d, 0x13, 0xd7, 0x89, 0xec, 0x67, 0x1a, + 0x8b, 0x03, 0x2b, 0x9d, 0xa9, 0x4c, 0xec, 0x69, 0x17, 0xf3, 0x70, 0x56, + 0xfa, 0xbe, 0x22, 0x14, 0x39, 0x50, 0xaf, 0x93, 0xd2, 0x26, 0xf4, 0x78, + 0x22, 0x2f, 0x22, 0xab, 0xdf, 0x6e, 0x43, 0x7c, 0xfe, 0xd4, 0x5a, 0x79, + 0x36, 0xb1, 0xfe, 0xe4, 0xcf, 0x60, 0x06, 0xb3, 0x28, 0x2f, 0x21, 0xaf, + 0xbb, 0xeb, 0x95, 0xa7, 0xcd, 0x87, 0xa8, 0x9d, 0x68, 0x35, 0x8a, 0xd1, + 0x7f, 0x13, 0xde, 0x4c, 0x29, 0x2a, 0xa2, 0x34, 0x27, 0x14, 0xcd, 0xb4, + 0x2e, 0x81, 0xea, 0xeb, 0x32, 0x81, 0x21, 0x67, 0x21, 0x1b, 0xd2, 0x02, + 0x9c, 0x21, 0x4c, 0x9b, 0xe2, 0x30, 0x03, 0x9c, 0xf8, 0xeb, 0x99, 0x7f, + 0x40, 0x36, 0x74, 0xd7, 0x42, 0x71, 0x5a, 0x3f, 0xd3, 0xa2, 0x9a, 0x06, + 0x21, 0xbb, 0x5e, 0x7d, 0xd9, 0x0c, 0x88, 0xec, 0x80, 0x8f, 0xe4, 0x5e, + 0x31, 0x04, 0x10, 0x94, 0x0f, 0x96, 0xc8, 0xc7, 0x72, 0xf4, 0xc6, 0xcd, + 0x98, 0x8f, 0x30, 0x1f, 0x79, 0x2d, 0x9b, 0x43, 0xaf, 0x8c, 0xd6, 0x55, + 0xb7, 0xd8, 0x9a, 0xd3, 0xa4, 0x6c, 0x70, 0xd8, 0xbc, 0xc6, 0x63, 0x60, + 0xf4, 0xbe, 0xb4, 0x73, 0x56, 0x93, 0xe9, 0x74, 0x2f, 0xd5, 0x36, 0x36, + 0x91, 0x70, 0x1c, 0xd3, 0x8d, 0xc5, 0x20, 0x20, 0x51, 0xab, 0xbb, 0x46, + 0xf4, 0xc5, 0x3a, 0x59, 0x77, 0x55, 0x68, 0x83, 0x6c, 0xdb, 0x4a, 0x21, + 0x47, 0x02, 0x03, 0x01, 0x00, 0x01 }; static const unsigned int g_rsa_public_key_2048_der_len = 294; static const unsigned char g_rsa_sig_2048_der[] = { - 0x27, 0x75, 0x84, 0x27, 0x13, 0xee, 0x8e, 0x0a, 0x3e, 0xb5, 0x52, 0x9b, - 0xe3, 0x3a, 0x8f, 0xd6, 0x1f, 0x60, 0xe8, 0x68, 0x80, 0xcf, 0xcd, 0x25, - 0x0f, 0x6d, 0xe5, 0xf8, 0xb5, 0xef, 0x16, 0x93, 0x63, 0xbb, 0xe2, 0xea, - 0xc6, 0x3a, 0x94, 0x36, 0x94, 0x2b, 0x55, 0x07, 0x88, 0x86, 0x6c, 0x93, - 0x69, 0x0a, 0x37, 0xe7, 0x45, 0x14, 0x46, 0x9b, 0xa3, 0x66, 0x15, 0x75, - 0xfb, 0xe1, 0x7f, 0xaf, 0x54, 0x43, 0xea, 0x85, 0x45, 0xae, 0xd9, 0x75, - 0xcd, 0x6c,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 0xe9, 0xa8, - + 0x07, 0x07, 0x82, 0x11, 0xc7, 0x2d, 0xc4, 0x84, 0x1d, 0x32, 0xc5, 0x78, + 0x83, 0xdc, 0x50, 0x02, 0x97, 0xf7, 0x58, 0xa5, 0xde, 0x02, 0x03, 0x5f, + 0xb8, 0xba, 0x35, 0x4d, 0xa1, 0xb5, 0xce, 0xa3, 0x82, 0x15, 0xb2, 0x2c, + 0xd6, 0x12, 0x32, 0x43, 0x27, 0xec, 0x86, 0x25, 0x7c, 0xc3, 0x0d, 0x04, + 0x8c, 0xb2, 0x0c, 0x13, 0x64, 0x5d, 0x11, 0x64, 0x36, 0x6a, 0x62, 0x0a, + 0x88, 0xe7, 0x9f, 0x98, 0x3a, 0x56, 0x3d, 0x79, 0xba, 0x4a, 0x69, 0xe0, + 0x35, 0xf4, 0xc9, 0x01, 0xff, 0xec, 0xd3, 0x5b, 0x8e, 0x83, 0x0d, 0x7b, + 0x13, 0x9e, 0x56, 0xd4, 0xbc, 0x0c, 0xee, 0x55, 0x94, 0x42, 0xae, 0xda, + 0xf6, 0x4a, 0xd4, 0xa6, 0x0c, 0xd2, 0x0b, 0x0c, 0x69, 0xb9, 0x7a, 0x2a, + 0x7d, 0x02, 0x86, 0x77, 0x3b, 0xa4, 0x4d, 0x2b, 0x74, 0x5a, 0xb8, 0x44, + 0x7d, 0x20, 0x6b, 0x07, 0x56, 0x54, 0x73, 0x13, 0xd8, 0xa1, 0xa6, 0x9a, + 0x5f, 0x1d, 0x81, 0x9f, 0x69, 0xe0, 0x49, 0x1b, 0x03, 0x4d, 0x72, 0x31, + 0xab, 0x04, 0x5b, 0x70, 0xb5, 0xdf, 0x3e, 0x80, 0x46, 0x56, 0x39, 0xf1, + 0xd3, 0x44, 0xca, 0xae, 0xa5, 0x3d, 0x10, 0x71, 0x7f, 0x58, 0xb7, 0xaa, + 0x58, 0x3c, 0xc1, 0x43, 0x0a, 0xa6, 0x28, 0xc1, 0x18, 0xee, 0x87, 0xdf, + 0xa9, 0x42, 0xa1, 0x1b, 0x60, 0xa6, 0x45, 0x23, 0x4a, 0x47, 0xc6, 0xdf, + 0x4a, 0x48, 0x7f, 0xce, 0x99, 0xb7, 0xf7, 0x44, 0x64, 0x29, 0xc7, 0xa7, + 0xe0, 0x4d, 0x36, 0x46, 0xa8, 0x62, 0xe1, 0x92, 0xee, 0x68, 0x56, 0x5a, + 0xf0, 0xb3, 0xd0, 0x47, 0x10, 0x1b, 0x32, 0x7c, 0x4f, 0x02, 0x27, 0x9c, + 0x4a, 0x8b, 0x86, 0x82, 0xb8, 0x88, 0x4a, 0xc5, 0xed, 0xff, 0x3d, 0x4b, + 0x40, 0xda, 0xe0, 0xe4, 0xd3, 0xf8, 0xf5, 0xfe, 0x05, 0xfe, 0xd1, 0x7f, + 0x7d, 0xee, 0xea, 0xef }; static const unsigned int g_rsa_sig_2048_der_len = 256; static const unsigned char g_rsa_public_key_3072_der[] = { - 0x30, 0x82, 0x01, 0xa2, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, - 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x8f, 0x00, - 0x30, 0x82, 0x01, 0x8a, 0x02, 0x82, 0x01, 0x81, 0x00, 0xb0, 0x4e, 0x2f, - 0xf6, 0x4d, 0xaf, 0x2f, 0xb0, 0x80, 0x99, 0xff, 0xfa, 0x23, 0x26, 0xeb, - 0xd1, 0xee, 0x43, 0x6e, 0x6a, 0x10, 0xce, 0xcf, 0x8d, 0x65, 0x79, 0xc0, - 0xc7, 0xa3, 0xf2, 0xa4, 0x9a, 0x54, 0xd4, 0xb8, 0xdc, 0xd3, 0xb7, 0x23, - 0x72, 0xec, 0xd3, 0x97, 0x6f, 0x0b, 0x5f, 0xe8, 0xdc, 0x37, 0xec, 0xca, - 0x73, 0xf8, 0x5e, 0x2b, 0xea, 0x95, 0x60, 0xab, 0x20, 0x1a, 0xb9, 0xf9, - 0x60, 0xbd, 0x66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0xba, 0xa5, 0x48, 0x75, 0xb0, 0xb7, 0x33, 0x3a, - 0x51, 0x62, 0xc7, 0xcb, 0x54, 0x4d, 0x5e, 0x1a, 0xa5, 0xe7, 0x4e, 0x8f, - 0x74, 0xf0, 0x19, 0x27, 0xb7, 0x6c, 0xe6, 0xa1, 0x4d, 0xd9, 0x3e, 0xd4, - 0x7a, 0x21, 0x69, 0xf8, 0x98, 0xd0, 0x12, 0x56, 0xef, 0x1d, 0x07, 0x3f, - 0xcb, 0x53, 0x46, 0xc6, 0x65, 0x9e, 0x57, 0x06, 0x54, 0xb4, 0x98, 0x05, - 0x12, 0x54, 0xf4, 0xd3, 0x69, 0x26, 0x7a, 0x08, 0x35, 0xc2, 0x22, 0xc6, - 0xcd, 0x34, 0x3a, 0x3a, 0x1e, 0xa7, 0xa7, 0x0b, 0x5e, 0x53, 0xf2, 0x07, - 0x02, 0x33, 0xed, 0x45, 0x2b, 0xff, 0x9a, 0x81, 0xe3, 0x5b, 0xf9, 0x49, - 0x24, 0x2d, 0xf0, 0x55, 0x3d, 0x89, 0xdc, 0x42, 0xe9, 0x41, 0x72, 0xf7, - 0x2a, 0x19, 0x04, 0xb3, 0xc1, 0x1e, 0x50, 0x52, 0x12, 0xd1, 0x51, 0x57, - 0xc1, 0x0c, 0x58, 0x7c, 0x06, 0x88, 0x72, 0x5e, 0x35, 0x87, 0x3a, 0xff, - 0x66, 0x2d, 0x1c, 0x25, 0x4d, 0xb8, 0x91, 0xa9, 0xb7, 0x02, 0x03, 0x01, - 0x00, 0x01, + 0x30, 0x82, 0x01, 0xa2, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, + 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x8f, 0x00, + 0x30, 0x82, 0x01, 0x8a, 0x02, 0x82, 0x01, 0x81, 0x00, 0xc9, 0x8a, 0xf8, + 0x70, 0xac, 0x35, 0x9c, 0xab, 0x99, 0xc0, 0x93, 0x24, 0x00, 0xd6, 0xbf, + 0x42, 0xf0, 0x71, 0xb3, 0x20, 0x6d, 0x41, 0x5b, 0xea, 0x0a, 0x20, 0x08, + 0xf6, 0xdf, 0xac, 0x67, 0x75, 0x61, 0xda, 0x42, 0x3a, 0x8e, 0x02, 0x07, + 0x1b, 0xaa, 0xa8, 0xc6, 0x8f, 0x76, 0x09, 0x59, 0xac, 0x46, 0x9f, 0xae, + 0xe6, 0xb0, 0x0f, 0x10, 0x32, 0x8f, 0x69, 0xe9, 0x72, 0x50, 0x18, 0x8b, + 0xdc, 0xc9, 0x07, 0x22, 0x71, 0x29, 0x17, 0x77, 0xc0, 0x8b, 0x65, 0xc5, + 0xb7, 0xb5, 0x25, 0x05, 0x77, 0x28, 0x1f, 0x23, 0xef, 0xe0, 0xc1, 0x87, + 0x33, 0x16, 0xba, 0xa4, 0xa5, 0xff, 0x47, 0x30, 0x23, 0x8f, 0x36, 0x53, + 0x59, 0x50, 0x77, 0xd6, 0xf9, 0x3d, 0x66, 0xdd, 0xfc, 0xf3, 0xf7, 0xc5, + 0x7a, 0x7c, 0x48, 0x76, 0xe3, 0x37, 0xa3, 0x7a, 0x57, 0x1e, 0xeb, 0xa4, + 0x2a, 0xf5, 0x2f, 0x40, 0xff, 0x08, 0x5a, 0xc0, 0x5b, 0x30, 0x66, 0x99, + 0x72, 0x05, 0xa5, 0x8d, 0xc9, 0x04, 0xf2, 0x89, 0x81, 0xcd, 0x16, 0x70, + 0x25, 0xf1, 0x83, 0x91, 0xad, 0xd6, 0x50, 0x6e, 0x1e, 0xd3, 0x67, 0xbb, + 0xc3, 0xe0, 0xa5, 0x39, 0x37, 0xc2, 0x26, 0x83, 0x04, 0xe6, 0xcc, 0xa1, + 0x75, 0x46, 0xe3, 0x38, 0x1f, 0xb6, 0xcf, 0x18, 0x04, 0xeb, 0x5b, 0xec, + 0x0f, 0x52, 0x0e, 0x3d, 0xa3, 0x2b, 0x9b, 0xec, 0x7b, 0xfb, 0x74, 0x82, + 0xc3, 0x09, 0xaa, 0x54, 0xef, 0xd3, 0xa6, 0xe1, 0x91, 0xf0, 0x73, 0x15, + 0x3b, 0xd6, 0x82, 0x6c, 0x1b, 0x7d, 0x01, 0x8a, 0x06, 0xcb, 0x78, 0x18, + 0x51, 0xcf, 0x61, 0xdb, 0x05, 0xba, 0x7b, 0x37, 0x5e, 0x8b, 0x6b, 0x90, + 0xa0, 0x8b, 0xc2, 0x18, 0x8f, 0x47, 0x02, 0x50, 0xca, 0x4e, 0x4e, 0xde, + 0x26, 0x55, 0x65, 0x6c, 0x9d, 0x93, 0x20, 0x21, 0xcd, 0x9f, 0x29, 0x68, + 0xd5, 0x55, 0x88, 0x45, 0xd8, 0x34, 0xcd, 0x11, 0x74, 0x52, 0x81, 0x57, + 0x61, 0x57, 0x4a, 0xef, 0xd3, 0x63, 0x4a, 0x0a, 0x82, 0xc1, 0x4e, 0x25, + 0xb3, 0x21, 0x7f, 0x86, 0x01, 0x27, 0x20, 0xa0, 0x13, 0x21, 0x5e, 0x70, + 0xbf, 0xce, 0xce, 0xa6, 0x3a, 0xc0, 0xbd, 0xfd, 0x2c, 0x1e, 0x1f, 0x43, + 0xe8, 0xb4, 0xe9, 0x96, 0xcf, 0x23, 0x97, 0xe6, 0x94, 0xe1, 0x66, 0xea, + 0x17, 0x75, 0x0f, 0x2e, 0x0c, 0x87, 0xc3, 0x3d, 0x78, 0xdd, 0x57, 0x40, + 0xf5, 0x6b, 0x4d, 0xe6, 0x06, 0xe5, 0xa0, 0x7b, 0x64, 0x6d, 0xcc, 0xfd, + 0x26, 0x42, 0x66, 0x3c, 0x9a, 0x14, 0xcd, 0xac, 0xf1, 0xca, 0x31, 0x53, + 0x21, 0xe2, 0xed, 0x82, 0x11, 0xc5, 0xf6, 0xcc, 0xe3, 0x84, 0xd9, 0xce, + 0xa9, 0xf3, 0x6f, 0x05, 0xa0, 0x81, 0x56, 0x24, 0x4b, 0x15, 0x04, 0xbf, + 0xb9, 0x89, 0x7d, 0x4f, 0x2d, 0x32, 0xff, 0xa9, 0x01, 0x02, 0x03, 0x01, + 0x00, 0x01 }; static const unsigned int g_rsa_public_key_3072_der_len = 422; static const unsigned char g_rsa_sig_3072_der[] = { - 0x91, 0x7f, 0xd4, 0x7d, 0x93, 0x17, 0xb1, 0xd7, 0xb7, 0xcc, 0xb8, 0x93, - 0x89, 0x80, 0x65, 0x3b, 0xc6, 0x7a, 0x2c, 0x8c, 0xb8, 0x66, 0x5a, 0x98, - 0xa1, 0xc1, 0x18, 0x9a, 0xee, 0x20, 0xa6, 0x45, 0x2d, 0x40, 0xbb, 0x97, - 0xea, 0x84, 0xfd, 0xa9, 0xb4, 0x2f, 0x81, 0xa4, 0x41, 0x79, 0xf7, 0x1e, - 0x62, 0xe0, 0x04, 0x4e, 0x79, 0x15, 0xfa, 0x15, 0x56, 0x18, 0xc1, 0x77, - 0xe9, 0xc6, 0x90, 0x76, 0x1a, 0xaa, 0x4a, 0xd7, 0x60, 0x9b, 0x6b, 0xb5, - 0xf6, 0x0e, 0x60, 0xf9, 0xc7, 0xfe, 0x12, 0x6b, 0x08, 0x09, 0xd8, 0x28, - 0xed, 0x60, 0xad, 0xdf, 0x34, 0xa9, 0xea, 0xdc, 0xfa, 0xcf, 0xa3, 0x03, - 0xe8, 0xd7, 0xd0, 0x5e, 0xd1, 0xf5, 0x2a, 0xf7, 0x63, 0xe0, 0xed, 0x20, - 0x0c, 0x3f, 0xf7, 0x78, 0x20, 0xf8, 0x0a, 0x60, 0x3c, 0x24, 0xbe, 0x53, - 0xc9, 0x55, 0x53, 0x92, 0x04, 0x07, 0x10, 0x7b, 0x0b, 0x2b, 0x2a, 0xca, - 0x11, 0x56, 0x61, 0x16, 0x9c, 0xdd, 0xbc, 0xbb, 0xad, 0x6d, 0xed, 0x66, - 0x87, 0xb1, 0x5a, 0xfc, 0xf2, 0xbe, 0x00, 0xc4, 0x40, 0x53, 0xd4, 0xb6, - 0x1b, 0x62, 0xec, 0x15, 0xb5, 0xa9, 0x69, 0xaf, 0x0d, 0x20, 0xd0, 0xeb, - 0xf4, 0x3c, 0xaa, 0xc5, 0x81, 0x5a, 0xaf, 0x99, 0xd5, 0x2e, 0x04, 0x6d, - 0x42, 0xc4, 0x67, 0x21, 0xfc, 0x9d, 0x66, 0xdb, 0xc5, 0x91, 0xcc, 0xca, - 0x17, 0x1b, 0x05, 0x0a, 0xba, 0xf5, 0xff, 0xe0, 0x6b, 0xe7, 0x2a, 0x20, - 0x7a, 0xaf, 0x16, 0x0f, 0xda, 0x48, 0x24, 0x77, 0x99, 0x5a, 0x1e, 0x6d, - 0x84, 0x2d, 0x07, 0x30, 0x46, 0x18, 0x10, 0x78, 0x26, 0x58, 0xb7, 0xc1, - 0xe2, 0x43, 0x44, 0xaa, 0x5d, 0x37, 0xfa, 0x45, 0x4d, 0x17, 0xc8, 0x5a, - 0x4a, 0x6c, 0x00, 0x1a, 0x4a, 0x82, 0x58, 0xbe, 0x9f, 0xd0, 0x8d, 0x18, - 0x4d, 0x05, 0x15, 0x0d, 0x6c, 0x54, 0x88, 0x47, 0x6d, 0x9d, 0x24, 0x59, - 0x99, 0x64, 0x66, 0xd2, 0x05, 0x84, 0x46, 0x21, 0x5d, 0x0e, 0xe8, 0x61, - 0x60, 0x01, 0x03, 0x19, 0x13, 0x19, 0x96, 0x59, 0x50, 0x84, 0x5f, 0xf7, - 0xae, 0x49, 0xa2, 0xa0, 0x1c, 0x21, 0xc3, 0x05, 0x5e, 0xb3, 0xde, 0x57, - 0xad, 0x31, 0x45, 0x85, 0xd3, 0x3f, 0x88, 0x3a, 0x4e, 0x49, 0x14, 0x00, - 0xc9, 0x1a, 0xf8, 0x4e, 0x3e, 0x8f, 0x10, 0xae, 0xaa, 0x7a, 0x3e, 0xfc, - 0x47, 0x87, 0x82, 0x8f, 0x1d, 0xa0, 0xfe, 0xd4, 0x40, 0x03, 0xf5, 0xe2, - 0xfc, 0xd7, 0x86, 0x7c, 0x6c, 0x46, 0xd1, 0x28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, 0x13, 0x18, + 0x3f, 0x26, 0x06, 0x89, 0x3d, 0x51, 0x42, 0xa0, 0xa5, 0x49, 0xe0, 0xb4, + 0x97, 0x20, 0x0c, 0x44, 0x62, 0x60, 0xe5, 0xeb, 0xa8, 0x79, 0xca, 0x52, + 0x2d, 0x28, 0x5c, 0x3d, 0x06, 0x34, 0x72, 0x7c, 0xf5, 0xc8, 0x4c, 0x53, + 0x37, 0xef, 0x70, 0xb2, 0x58, 0xe6, 0x55, 0x14, 0x4d, 0xc2, 0x9e, 0xbb, + 0xea, 0xe2, 0xb4, 0x71, 0x8f, 0x51, 0x0d, 0xfc, 0xfb, 0xbf, 0x95, 0x5d }; static const unsigned int g_rsa_sig_3072_der_len = 384; static const unsigned char g_rsa_public_key_4096_der[] = { - 0x30, 0x82, 0x02, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, - 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x02, 0x0f, 0x00, - 0x30, 0x82, 0x02, 0x0a, 0x02, 0x82, 0x02, 0x01, 0x00, 0xb7, 0x1c, 0x76, - 0x66, 0xd6, 0x15, 0x00, 0xa8, 0xa5, 0xe3, 0xc4, 0xf5, 0x45, 0x08, 0x68, - 0xa6, 0xa2, 0xb5, 0xb1, 0x11, 0xf5, 0x07, 0x12, 0xb4, 0xac, 0xd5, 0x06, - 0xa9, 0x6e, 0x11, 0x06, 0x10, 0x3d, 0x90, 0x62, 0x8b, 0xd6, 0x25, 0xe5, - 0x6d, 0xbd, 0x9d, 0xdd, 0x29, 0x8d, 0xa2, 0xc0, 0xa2, 0xda, 0x8c, 0x0b, - 0x16, 0x4b, 0x8c, 0x13, 0x62, 0xcd, 0x98, 0xb7, 0xfd, 0xad, 0x63, 0x53, - 0x2b, 0x7b, 0xa4, 0xa0, 0x7d, 0x87, 0xee, 0xd9, 0xa6, 0xb2, 0xf2, 0xc2, - 0x98, 0xe7, 0x02, 0x3c, 0x44, 0x61, 0x79, 0x40, 0x32, 0x1c, 0x52, 0xa6, - 0x27, 0x67, 0xce, 0x99, 0x6b, 0x3f, 0xdd, 0x56, 0x90, 0xe5, 0x7e, 0xef, - 0x5d, 0x13, 0xaf, 0x2b, 0x35, 0xf4, 0x00, 0xb5, 0x86, 0x3b, 0xd3, 0x2b, - 0x39, 0xf6, 0xe7, 0xe0, 0xbb, 0xb5, 0x86, 0xfb, 0xfe, 0xb9, 0x5d, 0x37, - 0xd2, 0xa6, 0xde, 0x3f, 0xba, 0xea, 0x71, 0x4f, 0x25, 0xaf, 0x8b, 0x33, - 0x66, 0x9a, 0x64, 0x20, 0x88, 0x02, 0x8a, 0x5d, 0xc2, 0x25, 0x56, 0xaa, - 0xed, 0x60, 0x1d, 0x9e, 0xf0, 0x58, 0x44, 0x31, 0xd4, 0x86, 0x02, 0x32, - 0x1e, 0x56, 0xed, 0x8e, 0xcb, 0x79, 0x64, 0x12, 0xf9, 0x79, 0x96, 0xb8, - 0x68, 0x0f, 0xba, 0xf8, 0xd9, 0x6d, 0x48, 0x88, 0x5b, 0xa2, 0x48, 0x12, - 0xac, 0xb8, 0x5c, 0xc7, 0xf7, 0x0d, 0x8e, 0x92, 0x75, 0x42, 0xa4, 0x66, - 0x50, 0x02, 0x78, 0xb1, 0x3f, 0x31, 0xbb, 0xed, 0xe5, 0x2c, 0xb3, 0xc6, - 0x20, 0xa8, 0x66, 0x29, 0xeb, 0x80, 0xc4, 0xf8, 0x2d, 0xc4, 0x26, 0x79, - 0xde, 0x73, 0x99, 0x3b, 0xa7, 0xa0, 0x7e, 0x2d, 0x2e, 0x27, 0x59, 0xc7, - 0x27, 0xc7, 0x4f, 0x08, 0x4e, 0xbd, 0x70, 0x98, 0x31, 0x1f, 0x9a, 0x57, - 0x5c, 0x0a, 0x4a, 0x72, 0xcd, 0x10, 0x1f, 0x41, 0x2e, 0x49, 0x56, 0x5e, - 0xa5, 0x03, 0x95, 0x6d, 0x28, 0xb1, 0x4b, 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0x36, 0x9d, 0x33, - 0xb9, 0x47, 0x51, 0xc3, 0x78, 0x62, 0x1c, 0xe5, 0xf5, 0x1c, 0xc4, 0x7b, - 0x1d, 0xfe, 0x59, 0x3c, 0xeb, 0xe9, 0xe9, 0xf2, 0xa3, 0xa1, 0x0b, 0x3c, - 0xd2, 0xec, 0x1e, 0x13, 0x77, 0xb8, 0x7d, 0xaa, 0x90, 0x9c, 0x42, 0x10, - 0x0c, 0x40, 0x6f, 0xd2, 0x9e, 0x0d, 0xdb, 0x65, 0x62, 0x1b, 0xa5, 0xf4, - 0xb2, 0x22, 0x3c, 0xc3, 0xea, 0x40, 0xcd, 0xe7, 0x85, 0x4a, 0xc0, 0x56, - 0xd3, 0xff, 0xa6, 0xa4, 0x37, 0x02, 0x03, 0x01, 0x00, 0x01, + 0x30, 0x82, 0x02, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, + 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x02, 0x0f, 0x00, + 0x30, 0x82, 0x02, 0x0a, 0x02, 0x82, 0x02, 0x01, 0x00, 0xe7, 0x72, 0x31, + 0xf3, 0x13, 0xa3, 0xde, 0x32, 0x99, 0x7b, 0x4f, 0x62, 0x48, 0x46, 0xfb, + 0x26, 0x4b, 0x8e, 0x79, 0xb8, 0x3d, 0xf2, 0xc6, 0x29, 0xa2, 0xb9, 0xd9, + 0xaf, 0x8c, 0xa2, 0x0c, 0x0c, 0x8e, 0x39, 0x6c, 0x30, 0xc7, 0x9e, 0x19, + 0xa1, 0x1f, 0x73, 0xa2, 0x39, 0x81, 0x21, 0x9c, 0xd9, 0x49, 0xcb, 0xff, + 0xf3, 0xa6, 0xa0, 0x19, 0x7c, 0x93, 0xff, 0xd5, 0x52, 0x64, 0xb9, 0xf2, + 0xee, 0xbe, 0xe2, 0xb1, 0xa1, 0x3d, 0x28, 0x23, 0x41, 0x42, 0x12, 0x3f, + 0x94, 0xcd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45, 0x9c, 0xe8, 0x56, 0x6a, 0xdc, 0x33, + 0xf5, 0x95, 0xeb, 0xf7, 0xa9, 0xb5, 0x7a, 0xb7, 0xe1, 0x41, 0x05, 0xeb, + 0x5d, 0x7b, 0xaa, 0x97, 0xfa, 0xd8, 0x75, 0xd9, 0xdb, 0x3e, 0xf6, 0xba, + 0x98, 0xd0, 0x0b, 0xf9, 0x65, 0x1c, 0x59, 0xae, 0x78, 0x64, 0xa9, 0x19, + 0x0e, 0x8e, 0x42, 0x19, 0xe7, 0x9f, 0xc4, 0xc4, 0x16, 0xfc, 0x34, 0x5a, + 0x8e, 0x65, 0xd7, 0x5f, 0x85, 0x88, 0x58, 0xa1, 0x4c, 0x0a, 0xff, 0x8e, + 0x49, 0xd8, 0xa3, 0x86, 0x03, 0x02, 0x03, 0x01, 0x00, 0x01 }; static const unsigned int g_rsa_public_key_4096_der_len = 550; static const unsigned char g_rsa_sig_4096_der[] = { - 0x3a, 0x62, 0x63, 0x55, 0x0e, 0x07, 0x18, 0xc5, 0xbc, 0x43, 0xe0, 0xfd, - 0x44, 0x25, 0x11, 0x6e, 0x15, 0xf0, 0xa5, 0x7b, 0x67, 0xe2, 0x48, 0x69, - 0x04, 0x6a, 0x90, 0xfc, 0x5d, 0xa0, 0x5f, 0xfa, 0xc1, 0x7a, 0x40, 0x5a, - 0xb9, 0xcb, 0x1b, 0x95, 0xbb, 0xb1, 0xa0, 0x25, 0x0e, 0xb1, 0x21, 0xa6, - 0xe0, 0x29, 0xfd, 0xb9, 0xc9, 0xd7, 0x2d, 0x04, 0x8c, 0x52, 0x12, 0xd4, - 0xb0, 0x04, 0x93, 0xea, 0xf5, 0x4d, 0x07, 0x8a, 0xb6, 0x1f, 0x1a, 0xce, - 0xbc, 0x3b, 0xc2, 0x11, 0xba, 0xe3, 0x56, 0xb5, 0x74, 0xb9, 0x8b, 0xb5, - 0x38, 0x80, 0x84, 0xe1, 0x2a, 0x8d, 0xc3, 0x96, 0x88, 0x2e, 0xb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x26, 0xdd, 0x7a, 0x70, 0x60, 0xdc, 0x5f, 0xfb, 0x6b, 0xdd, 0x52, 0x20, - 0x14, 0xa9, 0xcd, 0x1b, 0x8f, 0x18, 0x8a, 0x30, 0x3e, 0x4d, 0x95, 0xe2, - 0x5e, 0xac, 0xd6, 0x83, 0xd4, 0x92, 0x43, 0xa6, 0xb6, 0x8a, 0x8e, 0x06, - 0xcf, 0x01, 0x50, 0x91, 0x54, 0x3c, 0x12, 0x0c, 0x03, 0xc0, 0x62, 0x93, - 0xf9, 0x56, 0x76, 0xff, 0x00, 0xe4, 0x01, 0xa5, + 0x43, 0xe7, 0xff, 0xad, 0x32, 0x0f, 0xc7, 0x60, 0x96, 0xe4, 0xd4, 0xca, + 0x48, 0x84, 0xd7, 0xaf, 0xad, 0x91, 0x2e, 0x18, 0xfe, 0xfe, 0x93, 0xad, + 0xd9, 0x31, 0x03, 0xaf, 0xef, 0x05, 0x97, 0x45, 0xdf, 0xf4, 0x96, 0x51, + 0x50, 0xb3, 0x86, 0x7a, 0xb8, 0xfa, 0x59, 0x36, 0x2f, 0x97, 0x46, 0x41, + 0x65, 0x33, 0x36, 0x62, 0x58, 0xed, 0x2b, 0xaa, 0x63, 0x16, 0x09, 0x68, + 0xcc, 0x0d, 0xc3, 0xc1, 0x55, 0x4b, 0xc5, 0x1a, 0x58, 0x25, 0x6e, 0xed, + 0x20, 0xce, 0x80, 0x0b, 0xed, 0x68, 0x93, 0xe3, 0x01, 0xa4, 0xa0, 0x42, + 0xcf, 0x62, 0xe9, 0xdb, 0x1d, 0xcf, 0xe8, 0x8c, 0x6f, 0x4e, 0x2d, 0x9a, + 0xaa, 0x08, 0x75, 0x5d, 0x24, 0x2e, 0x43, 0x00, 0xb9, 0x3d, 0x0c, 0x63, + 0xc9, 0xd9, 0x46, 0xc3, 0xe1, 0x61, 0x40, 0x19, 0xfa, 0x33, 0xf9, 0x12, + 0x08, 0x02, 0x64, 0x01, 0x12, 0xd7, 0x4f, 0x45, 0x44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 0x11, + 0x9c, 0x93, 0xd7, 0x6c, 0x19, 0xe9, 0x5a, 0xb2, 0xc4, 0xdc, 0x8b, 0x90, + 0x0b, 0x03, 0x55, 0xa0, 0x33, 0x43, 0x63, 0x4f }; static const unsigned int g_rsa_sig_4096_der_len = 512; @@ -345,10 +343,15 @@ const uint32_t g_dsa_signature_sizes[] = { }; uint8_t g_dsa_message[] = { +#if 1 /* SHA256(`Tempus unum hominem manet.`) */ 0xb7, 0x03, 0xb9, 0xc0, 0x84, 0xbe, 0xe8, 0xa2, 0x78, 0xa9, 0x56, 0x53, 0x48, 0x44, 0xd7, 0xfa, 0x40, 0x10, 0xa5, 0x86, 0x8c, 0x0c, 0x82, 0xa4, 0x50, 0x6b, 0xf8, 0x1c, 0x36, 0x21, 0x8d, 0xe1, +#else + 0x54,0x65,0x6d,0x70,0x75,0x73,0x20,0x75,0x6e,0x75,0x6d,0x20,0x68,0x6f,0x6d,0x69, + 0x6e,0x65,0x6d,0x20,0x6d,0x61,0x6e,0x65,0x74,0x2e, +#endif }; #endif /* __KEYS_H */ From e462febd6048d122c751ffdf2a21699e880d4e46 Mon Sep 17 00:00:00 2001 From: Peter Torelli Date: Tue, 17 Jan 2023 20:30:47 -0800 Subject: [PATCH 8/8] wolfSSL needed ASN/OID encoding --- .../profile/wolfssl_th_api/th_rsa.c | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c b/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c index 764fc4c..a6bb7a0 100644 --- a/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c +++ b/examples/selfhosted/profile/wolfssl_th_api/th_rsa.c @@ -101,13 +101,31 @@ th_rsa_verify(void *p_context, { rsa_context_t *ctx = (rsa_context_t *)p_context; int ret = 0; + uint8_t encoded_hash[100]; /* should be around 50 bytes */ + uint32_t encoded_size; *p_pass = false; + /* Add ASN digest info header */ + ret = wc_EncodeSignature( + encoded_hash, + p_hash, + hashlen, + SHA256h + ); + + if (ret < 0) + { + th_printf("e-[wc_EncodeSignature: %d]\r\n", ret); + return EE_STATUS_ERROR; + } + + encoded_size = (uint32_t)ret; + ret = wc_SignatureVerifyHash(WC_HASH_TYPE_SHA256, WC_SIGNATURE_TYPE_RSA_W_ENC, - p_hash, - hashlen, + encoded_hash, + encoded_size, p_sig, siglen, ctx->pubkey,