Lines Matching refs:buf
433 boot_decrypt_key(const uint8_t *buf, uint8_t *enckey) in boot_decrypt_key() argument
484 rc = bootutil_rsa_oaep_decrypt(&rsa, &olen, buf, enckey, BOOT_ENC_KEY_SIZE); in boot_decrypt_key()
495 rc = key_unwrap(buf, enckey, bootutil_enc_key); in boot_decrypt_key()
518 rc = bootutil_ecdh_p256_shared_secret(&ecdh_p256, &buf[EC_PUBK_INDEX], private_key, shared); in boot_decrypt_key()
546 rc = bootutil_ecdh_x25519_shared_secret(&ecdh_x25519, &buf[EC_PUBK_INDEX], private_key, shared); in boot_decrypt_key()
579 rc = bootutil_hmac_sha256_update(&hmac, &buf[EC_CIPHERKEY_INDEX], BOOT_ENC_KEY_SIZE); in boot_decrypt_key()
592 if (bootutil_constant_time_compare(tag, &buf[EC_TAG_INDEX], 32) != 0) { in boot_decrypt_key()
616 …rc = bootutil_aes_ctr_decrypt(&aes_ctr, counter, &buf[EC_CIPHERKEY_INDEX], BOOTUTIL_CRYPTO_AES_CTR… in boot_decrypt_key()
648 uint8_t *buf; in boot_enc_load() local
650 uint8_t buf[EXPECTED_ENC_LEN]; in boot_enc_load() local
685 buf = bs->enctlv[slot]; in boot_enc_load()
686 memset(buf, 0xff, BOOT_ENC_TLV_ALIGN_SIZE); in boot_enc_load()
689 rc = flash_area_read(fap, off, buf, EXPECTED_ENC_LEN); in boot_enc_load()
694 return boot_decrypt_key(buf, bs->enckey[slot]); in boot_enc_load()
705 uint32_t sz, uint32_t blk_off, uint8_t *buf) in boot_enc_encrypt() argument
723 bootutil_aes_ctr_encrypt(&enc->aes_ctr, nonce, buf, sz, blk_off, buf); in boot_enc_encrypt()
728 uint32_t sz, uint32_t blk_off, uint8_t *buf) in boot_enc_decrypt() argument
746 bootutil_aes_ctr_decrypt(&enc->aes_ctr, nonce, buf, sz, blk_off, buf); in boot_enc_decrypt()