- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Is there any example on how to use HMAC SHA1 and PBKDF2 SHA1 under oneAPI in SYCL? I found just the basic HMAC description here.
AI generated for me:
Generate C++ HMAC SHA1 fucntion by using oneAPI functions: HMAC_GetSize , HMAC_Init, HMAC_Update , HMAC_GetTag , HMAC_Final.
#include <iostream>
#include <cstring>
#include <oneapi/tbb.h>
#include <oneapi/crypto.h>
int main()
{
const char* key = "my-secret-key";
const char* data = "data-to-hash";
oneapi::crypto::key_256bit hmac_key;
std::memcpy(hmac_key.data(), key, std::min(sizeof(hmac_key), strlen(key)));
int hash_size = oneapi::crypto::HMAC_GetSize(oneapi::crypto::algorithm::sha1);
std::vector<uint8_t> result(hash_size);
oneapi::crypto::HMAC_Init hmac_init(oneapi::crypto::algorithm::sha1, hmac_key);
oneapi::crypto::HMAC_Update hmac_update(hmac_init, data, strlen(data));
oneapi::crypto::HMAC_Final hmac_final(hmac_update, result.data(), result.size());
for (int i = 0; i < hash_size; ++i)
{
printf("%02x", result[i]);
}
std::cout << std::endl;
return 0;
}
Generate C++ PBKDF2 SHA1 function by using oneAPI libraries.
#include <iostream>
#include <oneapi/crypto.h>
#include <oneapi/tbb.h>
int main()
{
const char* password = "my-strong-password";
const uint8_t* salt = (uint8_t*)"my-random-salt";
int salt_len = strlen((const char*)salt);
int iterations = 4096;
int key_len = 32;
std::vector<uint8_t> key(key_len);
oneapi::crypto::PBKDF2_HMAC_SHA1(password, strlen(password),
salt, salt_len,
iterations,
key.data(), key_len);
std::cout << "Derived Key: ";
for (int i = 0; i < key_len; i++) {
printf("%02x", key[i]);
}
std::cout << std::endl;
return 0;
}
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi Dan,
Thanks for posting in Intel communities.
SYCL based IPP cryptography isn’t implemented yet and hence we cannot provide you with an example on how to use HMAC SHA1 and PBKDF2 SHA1 in SYCL.
Please let us know if we can close this at our end.
Thanks and Regards,
Praneeth Achanta
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi Dan, could you confirm the name of the Intel® tool you are using from the Toolkit? Based on that info, we will move the query to the relevant forum.
We would like to know.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Yes, I am using Intel® oneAPI Base Toolkit installed over VisualStudio 2022 on my W10 notebook.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Dan, thank you for the information.
We will move your thread to the relevant forum.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi Dan,
Thanks for posting in Intel communities.
SYCL based IPP cryptography isn’t implemented yet and hence we cannot provide you with an example on how to use HMAC SHA1 and PBKDF2 SHA1 in SYCL.
Please let us know if we can close this at our end.
Thanks and Regards,
Praneeth Achanta
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi Praneeth,
Thank you for letting me know.
Dan
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi Dan,
Thanks for accepting as a solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.
Thanks and Regards,
Praneeth Achanta
