mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-02 22:42:46 +02:00
Update to v101r19 release.
byuu says: Changelog: - added \~130 new PAL games to icarus (courtesy of Smarthuman and aquaman) - added all three Korean-localized games to icarus - sfc: removed SuperDisc emulation (it was going nowhere) - sfc: fixed MSU1 regression where the play/repeat flags were not being cleared on track select - nall: cryptography support added; will be used to sign future databases (validation will always be optional) - minor shims to fix compilation issues due to nall changes The real magic is that we now have 25-30% of the PAL SNES library in icarus! Signing will be tricky. Obviously if I put the public key inside the higan archive, then all anyone has to do is change that public key for their own releases. And if you download from my site (which is now over HTTPS), then you don't need the signing to verify integrity. I may just put the public key on my site on my site and leave it at that, we'll see.
This commit is contained in:
@@ -1,45 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <nall/range.hpp>
|
||||
#include <nall/string.hpp>
|
||||
#include <nall/hash/hash.hpp>
|
||||
|
||||
namespace nall { namespace Hash {
|
||||
|
||||
struct CRC32 {
|
||||
CRC32() { reset(); }
|
||||
CRC32(const void* values, uint size) : CRC32() { data(values, size); }
|
||||
CRC32(const vector<uint8_t>& values) : CRC32() { data(values); }
|
||||
CRC32(const string& values) : CRC32() { data(values); }
|
||||
struct CRC32 : Hash {
|
||||
nallHash(CRC32)
|
||||
|
||||
auto reset() -> void {
|
||||
auto reset() -> void override {
|
||||
checksum = ~0;
|
||||
}
|
||||
|
||||
auto data(uint8_t value) -> void {
|
||||
auto input(uint8_t value) -> void override {
|
||||
checksum = (checksum >> 8) ^ table(checksum ^ value);
|
||||
}
|
||||
|
||||
auto data(const void* values, uint size) -> void {
|
||||
auto p = (const uint8_t*)values;
|
||||
while(size--) data(*p++);
|
||||
}
|
||||
|
||||
auto data(const vector<uint8_t>& values) -> void {
|
||||
for(auto value : values) data(value);
|
||||
}
|
||||
|
||||
auto data(const string& values) -> void {
|
||||
for(auto value : values) data(value);
|
||||
auto output() const -> vector<uint8_t> {
|
||||
vector<uint8_t> result;
|
||||
for(auto n : rrange(4)) result.append(~checksum >> n * 8);
|
||||
return result;
|
||||
}
|
||||
|
||||
auto value() const -> uint32_t {
|
||||
return ~checksum;
|
||||
}
|
||||
|
||||
inline auto digest() const -> string {
|
||||
return hex(value(), 8L);
|
||||
}
|
||||
|
||||
private:
|
||||
static auto table(uint8_t index) -> uint32_t {
|
||||
static uint32_t table[256] = {0};
|
||||
@@ -59,7 +44,7 @@ private:
|
||||
return table[index];
|
||||
}
|
||||
|
||||
uint32_t checksum;
|
||||
uint32_t checksum = 0;
|
||||
};
|
||||
|
||||
}}
|
||||
|
Reference in New Issue
Block a user