viperleed.calc.lib.checksums
Checksums for TensErLEED Fortran source code files.
Contains basic information about TensErLEED files and code to check their checksums before run time compilation. This is supposed to help avoid security vulnerabilities.
This module can be executed with argument -p “path/to/tensorleed/folder” to generate the file _checksums.dat which contains an encoded version of checksums for all TensErLEED Fortran source code files.
We use the common SHA-256 hashing algorithm as available from Pythons hashlib. The check is toggled by parameter TL_IGNORE_CHECKSUM.
Functions
|
Return a dict of source_file_checksums from its encoded form. |
|
Return a base-64 encoded version of source_file_checksums. |
|
Return the SHA256 hash of the file at file_path. |
|
Return a tuple of TLSourceFile instances for a given version. |
|
Return checksums read from encoded_file_path. |
|
Compare checksum for filename with known checksums. |
|
Validate multiple files by calling validate_checksum on each. |
Classes
|
Class that holds information of TensErLEED source files. |
Exceptions
Exception for invalid checksums. |
|
Exception for invalid checksum file. |
|
|
Exception for invalid TensErLEED version. |