Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename function and expose more APIs #89

Merged
merged 3 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading