Arcium LogoArcium TS SDK Docs

RescuePrimeHash

The Rescue-Prime hash function, as described in https://eprint.iacr.org/2020/1143.pdf. Used with fixed m = 6 and capacity = 1 (rate = 5). According to Section 2.2, this offers log2(CURVE25519_BASE_FIELD.ORDER) / 2 bits of security against collision, preimage, and second-preimage attacks. See the referenced paper for further details.

Constructors

Constructor

new RescuePrimeHash(): RescuePrimeHash

Constructs a RescuePrimeHash instance with m = 6 and capacity = 1.

Returns

RescuePrimeHash

Properties

PropertyType
descRescueDesc
ratenumber

Methods

digest()

digest(message): bigint[]

Computes the Rescue-Prime hash of a message, with padding as described in Algorithm 2 of the paper.

Parameters

ParameterTypeDescription
messagebigint[]The input message as an array of bigints.

Returns

bigint[]

The hash output as an array of bigints (length = rate).