Not sure what you mean by "library part of the gem". TUF defines its own file formats and digital signature scheme. Hashing files (not just gems but all TUF metadata) is only a small part of this.