Skip to content

Commit

Permalink
Merge pull request #89 from mhchia/fix/rename-and-expose-api
Browse files Browse the repository at this point in the history
Rename function and expose more APIs
  • Loading branch information
mhchia authored Aug 31, 2023
2 parents 75a73ea + be430b4 commit 7916623
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const Fq = new ZqField(SNARK_FIELD_SIZE)

export const DEFAULT_MERKLE_TREE_DEPTH = 20

export function calculateIdentityCommitment(identity: Identity): bigint {
export function calculateIdentitySecret(identity: Identity): bigint {
return poseidon([
identity.getNullifier(),
identity.getTrapdoor(),
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ export { CachedProof, ICache, MemoryCache, Status } from './cache'
export { IMessageIDCounter } from './message-id-counter'

export * from './types'
// Expose helpers
export { calculateExternalNullifier, calculateRateCommitment, calculateSignalHash, shamirRecovery } from './common'

export { RLNFullProof, RLNSNARKProof, RLNWitness, RLNPublicSignals, RLNProver, RLNVerifier, WithdrawProver } from './circuit-wrapper'
4 changes: 2 additions & 2 deletions src/rln.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Identity } from '@semaphore-protocol/identity'
import { VerificationKey } from './types'
import { DEFAULT_MERKLE_TREE_DEPTH, calculateIdentityCommitment, calculateSignalHash } from './common'
import { DEFAULT_MERKLE_TREE_DEPTH, calculateIdentitySecret, calculateSignalHash } from './common'
import { IRLNRegistry, ContractRLNRegistry } from './registry'
import { MemoryCache, EvaluatedProof, ICache, Status } from './cache'
import { IMessageIDCounter, MemoryMessageIDCounter } from './message-id-counter'
Expand Down Expand Up @@ -349,7 +349,7 @@ export class RLN implements IRLN {
}

private get identitySecret(): bigint {
return calculateIdentityCommitment(this.identity)
return calculateIdentitySecret(this.identity)
}

/**
Expand Down

0 comments on commit 7916623

Please sign in to comment.