apache-mynewt-bot removed a comment on issue #2238: Donot Merge: Debug Only: Dialog crypto driver debug URL: https://github.com/apache/mynewt-core/pull/2238#issuecomment-598018693 <!-- style-bot --> ## Style check summary ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md) #### hw/drivers/crypto/crypto_da1469x/src/crypto_da1469x.c <details> ```diff @@ -122,10 +122,10 @@ } ctrl_reg = (AES_HASH_CRYPTO_CTRL_REG_CRYPTO_AES_KEXP_Msk | - AES_HASH_CRYPTO_CTRL_REG_CRYPTO_OUT_MD_Msk | - key_len_mask | - enc_mode_msk - ); + AES_HASH_CRYPTO_CTRL_REG_CRYPTO_OUT_MD_Msk | + key_len_mask | + enc_mode_msk + ); if (op == CRYPTO_OP_ENCRYPT) { ctrl_reg |= AES_HASH_CRYPTO_CTRL_REG_CRYPTO_ENCDEC_Msk; } else { @@ -157,7 +157,7 @@ AES_HASH->CRYPTO_MREG3_REG = (*keyp32); keyp32++; } - assert((AES_HASH->CRYPTO_STATUS_REG & 0x01) == 1); + assert((AES_HASH->CRYPTO_STATUS_REG & 0x01) == 1); keyreg = (uint32_t *)&AES_HASH->CRYPTO_KEYS_START; keyp32 = (uint32_t *)local_key; @@ -165,11 +165,11 @@ case 256: *keyreg++ = __builtin_bswap32(*keyp32); keyp32++; *keyreg++ = __builtin_bswap32(*keyp32); keyp32++; - /* fallthrough */ + /* fallthrough */ case 192: *keyreg++ = __builtin_bswap32(*keyp32); keyp32++; *keyreg++ = __builtin_bswap32(*keyp32); keyp32++; - /* fallthrough */ + /* fallthrough */ case 128: default: *keyreg++ = __builtin_bswap32(*keyp32); keyp32++; ``` </details> #### apps/crypto_test/src/main.c <details> ```diff @@ -54,8 +54,10 @@ .algo = CRYPTO_ALGO_AES, .mode = CRYPTO_MODE_ECB, .key = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - //.key = "\x16\x15\x7e\x2b\xa6\xd2\xae\x28\x88\x15\xf7\xab\x3c\x4f\xcf\x09", // swapped - //.key = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + /* + .key = "\x16\x15\x7e\x2b\xa6\xd2\xae\x28\x88\x15\xf7\xab\x3c\x4f\xcf\x09", // swapped + .key = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + */ .keylen = 128, .iv = NULL, .len = 4, @@ -63,11 +65,11 @@ /*{ .plain = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", .cipher = "\x66\xe9\x4b\xd4\xef\x8a\x2c\x3b\x88\x4c\xfa\x59\xca\x34\x2b\x2e", - },*/ + },*/ { .plain = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a", .cipher = "\x3a\xd7\x7b\xb4\x0d\x7a\x36\x60\xa8\x9e\xca\xf3\x24\x66\xef\x97", - }, + }, { .plain = "\xae\x2d\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51", .cipher = "\xf5\xd3\xd5\x85\x03\xb9\x69\x9d\xe7\x85\x89\x5a\x96\xfd\xba\xaf", @@ -120,41 +122,45 @@ .algo = CRYPTO_ALGO_AES, .mode = CRYPTO_MODE_CTR, .key = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6\xab\xf7\x15\x88\x09\xcf\x4f\x3c", - //.key = "\x16\x15\x7e\x2b\xa6\xd2\xae\x28\x88\x15\xf7\xab\x3c\x4f\xcf\x09", // swapped - //.key = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + /* + .key = "\x16\x15\x7e\x2b\xa6\xd2\xae\x28\x88\x15\xf7\xab\x3c\x4f\xcf\x09", // swapped + .key = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + */ .keylen = 128, .iv = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", - //.iv = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", - //.iv = "\xf3\xf2\xf1\xf0\xf7\xf6\xf5\xf4\xfb\xfa\xf9\xf8\xff\xfe\xfd\xfc", + /* + .iv = "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff", + .iv = "\xf3\xf2\xf1\xf0\xf7\xf6\xf5\xf4\xfb\xfa\xf9\xf8\xff\xfe\xfd\xfc", + */ .len = 1, .vectors = { - //.cipher = "\x77\xf8\x5a\xc5\xfe\x9b\x3d\x2a\x99\x5d\xeb\x48\xdb\x25\x3a\x3f", /* cipher for all 1s with 0 key and 0 iv */ + /*.cipher = "\x77\xf8\x5a\xc5\xfe\x9b\x3d\x2a\x99\x5d\xeb\x48\xdb\x25\x3a\x3f", / * cipher for all 1s with 0 key and 0 iv * / */ /*{ .plain = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", .cipher = "\x66\xe9\x4b\xd4\xef\x8a\x2c\x3b\x88\x4c\xfa\x59\xca\x34\x2b\x2e", .sz = AES_BLOCK_LEN, - },*/ //All zero key, iv, text and it's cipher. + },*//*All zero key, iv, text and it's cipher. */ { .plain = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96\xe9\x3d\x7e\x11\x73\x93\x17\x2a", - .cipher = "\x16\x36\xd5\xee\x34\xf8\x06\x25\xd7\x7f\x8e\x56\xca\x88\x43\x45", // cipher for all zero iv - //.cipher = "\x87\x4d\x61\x91\xb6\x20\xe3\x26\x1b\xef\x68\x64\x99\x0d\xb6\xce", + .cipher = "\x16\x36\xd5\xee\x34\xf8\x06\x25\xd7\x7f\x8e\x56\xca\x88\x43\x45", /* cipher for all zero iv */ + /*.cipher = "\x87\x4d\x61\x91\xb6\x20\xe3\x26\x1b\xef\x68\x64\x99\x0d\xb6\xce", */ .sz = AES_BLOCK_LEN, }, /*{ .plain = "\xae\x2d\x8a\x57\x1e\x03\xac\x9c\x9e\xb7\x6f\xac\x45\xaf\x8e\x51", .cipher = "\x98\x06\xf6\x6b\x79\x70\xfd\xff\x86\x17\x18\x7b\xb9\xff\xfd\xff", .sz = AES_BLOCK_LEN, - }, - { + }, + { .plain = "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11", .cipher = "\x5a\xe4\xdf\x3e\xdb\xd5\xd3\x5e", .sz = 8, - }, - { + }, + { .plain = "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17\xad\x2b\x41\x7b\xe6\x6c\x37\x10", .cipher = "\x1e\x03\x1d\xda\x2f\xbe\x03\xd1\x79\x21\x70\xa0\xf3\x00\x9c\xee", .sz = AES_BLOCK_LEN, - },*/ + },*/ }, }; #endif /* MYNEWT_VAL(CRYPTOTEST_VECTORS_CTR) */ @@ -182,7 +188,7 @@ uint16_t keylen; uint8_t outbuf[AES_BLOCK_LEN]; uint8_t iv[AES_BLOCK_LEN] = {0}; - //uint8_t blank[AES_BLOCK_LEN]; + /*uint8_t blank[AES_BLOCK_LEN]; */ uint8_t *ivp; struct vector_data *vectors; struct vector_data *vector; @@ -196,7 +202,7 @@ algo = test_mode->algo; mode = test_mode->mode; memcpy(keybuf_ram, test_mode->key, 16); - //key = (uint8_t *)test_mode->key; + /*key = (uint8_t *)test_mode->key; */ key = keybuf_ram; keylen = test_mode->keylen; if (test_mode->iv) { @@ -250,7 +256,7 @@ vector = &vectors[i]; memcpy(inbuf_ram, vector->cipher, AES_BLOCK_LEN); inbuf = inbuf_ram; - + memset(outbuf, 0, AES_BLOCK_LEN); asksz = AES_BLOCK_LEN; if (mode == CRYPTO_MODE_CTR) { ``` </details>
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services