]> git.cryptolib.org Git - arm-crypto-lib.git/blobdiff - test_src/main-rsa_oaep-test.c
a lot of fixing ...
[arm-crypto-lib.git] / test_src / main-rsa_oaep-test.c
index c49e4d7ac9730c1027c2b243516bdaaed7ed71a5..c6613e758c7b371c42bb7a8fe92baab29d00e249 100644 (file)
@@ -202,6 +202,39 @@ const uint8_t encrypted3[] = {
 
 /**********************************************************************************************/
 
+/* ---------------------------------
+ * RSAES-OAEP Encryption Example 2.4
+ * --------------------------------- */
+
+/* Message to be encrypted: */
+const uint8_t message4[] = {
+0xa7, 0xeb, 0x2a, 0x50, 0x36, 0x93, 0x1d, 0x27, 0xd4, 0xe8, 0x91, 0x32, 0x6d, 0x99, 0x69, 0x2f,
+0xfa, 0xdd, 0xa9, 0xbf, 0x7e, 0xfd, 0x3e, 0x34, 0xe6, 0x22, 0xc4, 0xad, 0xc0, 0x85, 0xf7, 0x21,
+0xdf, 0xe8, 0x85, 0x07, 0x2c, 0x78, 0xa2, 0x03, 0xb1, 0x51, 0x73, 0x9b, 0xe5, 0x40, 0xfa, 0x8c,
+0x15, 0x3a, 0x10, 0xf0, 0x0a
+};
+
+/* Seed: */
+const uint8_t seed4[] = {
+0x9a, 0x7b, 0x3b, 0x0e, 0x70, 0x8b, 0xd9, 0x6f, 0x81, 0x90, 0xec, 0xab, 0x4f, 0xb9, 0xb2, 0xb3,
+0x80, 0x5a, 0x81, 0x56
+};
+
+/* Encryption: */
+const uint8_t encrypted4[] = {
+0x00, 0xa4, 0x57, 0x8c, 0xbc, 0x17, 0x63, 0x18, 0xa6, 0x38, 0xfb, 0xa7, 0xd0, 0x1d, 0xf1, 0x57,
+0x46, 0xaf, 0x44, 0xd4, 0xf6, 0xcd, 0x96, 0xd7, 0xe7, 0xc4, 0x95, 0xcb, 0xf4, 0x25, 0xb0, 0x9c,
+0x64, 0x9d, 0x32, 0xbf, 0x88, 0x6d, 0xa4, 0x8f, 0xba, 0xf9, 0x89, 0xa2, 0x11, 0x71, 0x87, 0xca,
+0xfb, 0x1f, 0xb5, 0x80, 0x31, 0x76, 0x90, 0xe3, 0xcc, 0xd4, 0x46, 0x92, 0x0b, 0x7a, 0xf8, 0x2b,
+0x31, 0xdb, 0x58, 0x04, 0xd8, 0x7d, 0x01, 0x51, 0x4a, 0xcb, 0xfa, 0x91, 0x56, 0xe7, 0x82, 0xf8,
+0x67, 0xf6, 0xbe, 0xd9, 0x44, 0x9e, 0x0e, 0x9a, 0x2c, 0x09, 0xbc, 0xec, 0xc6, 0xaa, 0x08, 0x76,
+0x36, 0x96, 0x5e, 0x34, 0xb3, 0xec, 0x76, 0x6f, 0x2f, 0xe2, 0xe4, 0x30, 0x18, 0xa2, 0xfd, 0xde,
+0xb1, 0x40, 0x61, 0x6a, 0x0e, 0x9d, 0x82, 0xe5, 0x33, 0x10, 0x24, 0xee, 0x06, 0x52, 0xfc, 0x76,
+0x41
+};
+
+/**********************************************************************************************/
+
 /* RSA modulus n: */
 const uint8_t modulus2[] = {
 0x01, 0x94, 0x7c, 0x7f, 0xce, 0x90, 0x42, 0x5f, 0x47, 0x27, 0x9e, 0x70, 0x85, 0x1f, 0x25, 0xd5,
@@ -295,9 +328,9 @@ rsa_privatekey_t priv_key;
   #define DQ dq
   #define QINV qinv
 #else
-       #define MSG       message3
-       #define SEED      seed3
-       #define ENCRYPTED encrypted3
+       #define MSG       message4
+       #define SEED      seed4
+       #define ENCRYPTED encrypted4
        #define MODULUS modulus2
        #define PUB_EXPONENT public_exponent2
        #define PRIV_EXPONENT private_exponent2