2018-08-07 07:17:51 +00:00
|
|
|
#include <nn/hac/AesKeygen.h>
|
2018-04-15 02:40:03 +00:00
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
void nn::hac::AesKeygen::generateKey(byte_t* dst, const byte_t* src, const byte_t* src_key)
|
2018-04-15 02:40:03 +00:00
|
|
|
{
|
|
|
|
crypto::aes::AesEcbDecrypt(src, sizeof(crypto::aes::sAes128Key), src_key, dst);
|
|
|
|
}
|
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
void nn::hac::AesKeygen::generateKey(byte_t* dst, const byte_t* src1, const byte_t* src2, const byte_t* src1_key)
|
2018-04-15 02:40:03 +00:00
|
|
|
{
|
|
|
|
crypto::aes::sAes128Key src2_key;
|
|
|
|
generateKey(src2_key.key, src1, src1_key);
|
|
|
|
generateKey(dst, src2, src2_key.key);
|
|
|
|
}
|
2018-08-07 07:17:51 +00:00
|
|
|
void nn::hac::AesKeygen::generateKey(byte_t* dst, const byte_t* src1, const byte_t* src2, const byte_t* src3, const byte_t* src1_key)
|
2018-04-15 02:40:03 +00:00
|
|
|
{
|
|
|
|
crypto::aes::sAes128Key src3_key;
|
|
|
|
generateKey(src3_key.key, src1, src2, src1_key);
|
|
|
|
generateKey(dst, src3, src3_key.key);
|
|
|
|
}
|