Differences From Artifact [aaee93f1b6]:
- File src/scrypt.h — part of check-in [c7f0229795] at 2020-01-02 01:51:34 on branch trunk — Update copyright (user: js, size: 1426) [annotate] [blame] [check-ins using] [more...]
To Artifact [2a97d56e0e]:
- File
src/scrypt.h
— part of check-in
[63f5276b33]
at
2020-06-21 22:08:00
on branch trunk
— Move parameters for of_scrypt() to a struct
This should make it more readable for such a large number of parameters. (user: js, size: 2216) [annotate] [blame] [check-ins using] [more...]
| ︙ | ︙ | |||
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
OF_ASSUME_NONNULL_BEGIN
/*! @file */
@class OFHMAC;
#ifdef __cplusplus
extern "C" {
#endif
extern void of_salsa20_8_core(uint32_t buffer[_Nonnull 16]);
extern void of_scrypt_block_mix(uint32_t *output, const uint32_t *input,
size_t blockSize);
extern void of_scrypt_romix(uint32_t *buffer, size_t blockSize,
size_t costFactor, uint32_t *tmp);
| > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | < > > > > | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
OF_ASSUME_NONNULL_BEGIN
/*! @file */
@class OFHMAC;
/*!
* @brief The parameters for @ref of_scrypt.
*/
typedef struct of_scrypt_parameters_t {
/*! @brief The block size to use. */
size_t blockSize;
/*! @brief The CPU/memory cost factor to use. */
size_t costFactor;
/*! @brief The parallelization to use. */
size_t parallelization;
/*! @brief The salt to derive a key with. */
const unsigned char *salt;
/*! @brief The length of the salt. */
size_t saltLength;
/*! @brief The password to derive a key from. */
const char *password;
/*! @brief The length of the password. */
size_t passwordLength;
/*! @brief The buffer to write the key to. */
unsigned char *key;
/*!
* @brief The desired length for the derived key.
*
* @ref key needs to have enough storage.
*/
size_t keyLength;
/*! @brief Whether data may be stored in swappable memory. */
bool allowsSwappableMemory;
} of_scrypt_parameters_t;
#ifdef __cplusplus
extern "C" {
#endif
extern void of_salsa20_8_core(uint32_t buffer[_Nonnull 16]);
extern void of_scrypt_block_mix(uint32_t *output, const uint32_t *input,
size_t blockSize);
extern void of_scrypt_romix(uint32_t *buffer, size_t blockSize,
size_t costFactor, uint32_t *tmp);
/*!
* @brief Derives a key from a password and a salt using scrypt.
*
* @param param The parameters to use
*/
extern void of_scrypt(of_scrypt_parameters_t param);
#ifdef __cplusplus
}
#endif
OF_ASSUME_NONNULL_END
|