mirror of
https://github.com/zeldaret/botw
synced 2026-06-18 07:15:22 -04:00
18c60323a9
git subrepo clone https://github.com/open-ead/sead lib/sead subrepo: subdir: "lib/sead" merged: "1b66e825d" upstream: origin: "https://github.com/open-ead/sead" branch: "master" commit: "1b66e825d" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" git subrepo clone (merge) https://github.com/open-ead/nnheaders lib/NintendoSDK subrepo: subdir: "lib/NintendoSDK" merged: "9ee21399f" upstream: origin: "https://github.com/open-ead/nnheaders" branch: "master" commit: "9ee21399f" git-subrepo: version: "0.4.3" origin: "ssh://git@github.com/ingydotnet/git-subrepo" commit: "2f68596" git subrepo clone https://github.com/open-ead/agl lib/agl subrepo: subdir: "lib/agl" merged: "7c063271b" upstream: origin: "https://github.com/open-ead/agl" branch: "master" commit: "7c063271b" git-subrepo: version: "0.4.3" origin: "ssh://git@github.com/ingydotnet/git-subrepo" commit: "2f68596" git subrepo clone https://github.com/open-ead/EventFlow lib/EventFlow subrepo: subdir: "lib/EventFlow" merged: "c35d21b34" upstream: origin: "https://github.com/open-ead/EventFlow" branch: "master" commit: "c35d21b34" git-subrepo: version: "0.4.3" origin: "ssh://git@github.com/ingydotnet/git-subrepo" commit: "2f68596"
86 lines
1.7 KiB
C++
86 lines
1.7 KiB
C++
/**
|
|
* @file crypto.h
|
|
* @brief Crypto service implementation.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <nn/types.h>
|
|
|
|
namespace nn {
|
|
namespace crypto {
|
|
void GenerateSha256Hash(void*, ulong, void const*, ulong);
|
|
|
|
class Sha256Context;
|
|
|
|
void DecryptAes128Cbc(void*, u64, void const*, u64, void const*, u64, void const*, u64);
|
|
void EncryptAes128Cbc(void*, u64, void const*, u64, void const*, u64, void const*, u64);
|
|
void DecryptAes128Ccm(void*, u64, void*, u64, void const*, u64, void const*, u64, void const*, u64,
|
|
void const*, u64, u64);
|
|
|
|
namespace detail {
|
|
class Md5Impl {
|
|
public:
|
|
void Initialize();
|
|
void Update(void const*, u64 dataSize);
|
|
void ProcessBlock();
|
|
void GetHash(void*, u64 hashSize);
|
|
void ProcessLastBlock();
|
|
|
|
u32 _x0;
|
|
u32 _x4;
|
|
u32 _x8;
|
|
u32 _xC;
|
|
u8 _x10[0x50 - 0x10];
|
|
u64 _x50;
|
|
u32 _x58;
|
|
};
|
|
|
|
class Sha1Impl {
|
|
public:
|
|
void Initialize();
|
|
void Update(void const*, u64);
|
|
void ProcessBlock(void const*);
|
|
void GetHash(void* destHash, u64);
|
|
void ProcessLastBlock();
|
|
|
|
u64 _x0;
|
|
u64 _x8;
|
|
u32 _x10;
|
|
u128 _x14;
|
|
u128 _x24;
|
|
u128 _x34;
|
|
u32 _x44;
|
|
u64 _x48;
|
|
u64 _x50;
|
|
u64 _x58;
|
|
u64 _x60;
|
|
};
|
|
|
|
class Sha256Impl {
|
|
public:
|
|
void Initialize();
|
|
void Update(void const*, u64);
|
|
void ProcessBlocks(u8 const*, u64);
|
|
void GetHash(void* destHash, u64);
|
|
void ProcessLastBlock();
|
|
void InitializeWithContext(nn::crypto::Sha256Context const*);
|
|
void GetContext(nn::crypto::Sha256Context*) const;
|
|
|
|
u64 _x0;
|
|
u64 _x8;
|
|
u32 _x10;
|
|
u128 _x14;
|
|
u128 _x24;
|
|
u128 _x34;
|
|
u32 _x44;
|
|
u64 _x48;
|
|
u64 _x50;
|
|
u64 _x58;
|
|
u64 _x60;
|
|
u64 _x68;
|
|
u32 _x70;
|
|
};
|
|
}; // namespace detail
|
|
}; // namespace crypto
|
|
}; // namespace nn
|