# @helixnetwork/winternitz

> Winternitz signing functions

Latest version **1.0.0-alpha.7** (published 2019-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @helixnetwork/winternitz
pnpm add @helixnetwork/winternitz
yarn add @helixnetwork/winternitz
bun add @helixnetwork/winternitz
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-alpha.7 |
| Published | 2019-09-24 |
| First published | 2019-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 111.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | ahasikos, ajith_er, dad1x, dnck, dt93, dzlzv, fsbbn, mahi30795, netobjex, ofo42, sachushaji, shahanaspatel17, stefan-precup, tittu, tunghoang, vipindas28 |
| Keywords | helix, tangle, library, browser, javascript, nodejs, API |

## Links

- npm: https://www.npmjs.com/package/@helixnetwork/winternitz
- Repository: https://github.com/helixnetwork/helix.api.git/tree/dev/packages/crypto
- Issues: https://github.com/helixnetwork/helix.api/issues
- npm.io page: https://npm.io/package/@helixnetwork/winternitz

## Dependencies (5)

- [bcrypto](https://npm.io/package/bcrypto.md) ^2.0.0
- [@helixnetwork/pad](https://npm.io/package/@helixnetwork/pad.md) ^1.0.0-alpha.7
- [@helixnetwork/sha3](https://npm.io/package/@helixnetwork/sha3.md) ^1.0.0-alpha.7
- [@helixnetwork/converter](https://npm.io/package/@helixnetwork/converter.md) ^1.0.0-alpha.7
- [@helixnetwork/hash-module](https://npm.io/package/@helixnetwork/hash-module.md) ^1.0.0-alpha.7

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.0-alpha.7 (latest) — 2019-09-24
- 1.0.0-alpha.6 — 2019-08-15
- 1.0.0-alpha.5 — 2019-08-06
- 1.0.0-alpha.4 — 2019-07-31
- 1.0.0-alpha.3 — 2019-07-24
- 1.0.0-alpha.2 — 2019-05-09
- 1.0.0-alpha.1 — 2019-03-02
- 1.0.0-alpha.0 — 2019-02-26

## README

# @helixnetwork/winternitz
Winternitz OTS (One time signature)

## Installation

Install using [npm](https://www.npmjs.org/):
```
npm install @helixnetwork/winternitz
```

or using [yarn](https://yarnpkg.com/):

```
yarn add @helixnetwork/winternitz
```


## API Reference

    
* [winternitz](#module_winternitz)

    * [~subseed(seed, index)](#module_winternitz..subseed)
Compute subseed based on the seed with an additional index;

    * [~key(subSeed, securityLevel)](#module_winternitz..key)
Split seed in fragments and hashed them then generate from each fragment a schnore private key;

    * [~digests(key)](#module_winternitz..digests)

    * [~address(digests)](#module_winternitz..address)

    * [~digest(normalizedBundleFragment, signatureFragment)](#module_winternitz..digest)

    * [~signatureFragment(normalizeBundleFragment, keyFragment, normalizedBundleFragmentOffset, keyFragmentOffset)](#module_winternitz..signatureFragment)
   
    * [~signatureFragments(seeed, index, securityLevel, bundle)](#module_winternitz..signatureFragment)

    * [~validateSignatures(expectedAddress, signatureFragments, bundleHash)](#module_winternitz..validateSignatures)

    * [~normalizedBundleHash(bundlehash)](#module_winternitz..normalizedBundleHash)


### *winternitz*~subseed
Compute subseed based on the seed with an additional index(seed, index)

| Param | Type | Description |
| --- | --- | --- |
| seed | <code>TxBytes</code> | Seed txBytes |
| index | <code>number</code> | Private key index |

**Returns**: <code>TxBytes</code> - subseed txBytes  

<a name="module_winternitz..key Split seed in fragments and hashed them then generate from each fragment a wots-s private key;"></a>

### *winternitz*~key
Split seed in fragments and hashed them then generate from each fragment a winternitz
 private key;(subSeed, securityLevel)

| Param | Type | Description |
| --- | --- | --- |
| subseed | <code>TxBytes</code> | Subseed txBytes |
| securityLevel | <code>number</code> | Private key length |

**Returns**: <code>TxBytes</code> - Private key bytes  
<a name="module_winternitz..digests"></a>

### *winternitz*~digests(key)

| Param | Type | Description |
| --- | --- | --- |
| key | <code>TxBytes</code> | Private key txBytes |

<a name="module_winternitz..address"></a>

### *winternitz*~address(digests)

| Param | Type | Description |
| --- | --- | --- |
| digests | <code>TxBytes</code> | Digests txBytes |

**Returns**: <code>TxBytes</code> - Address hbits  
<a name="module_winternitz..digest"></a>

### *winternitz*~digest(normalizedBundleFragment, signatureFragment)

| Param | Type | Description |
| --- | --- | --- |
| normalizedBundleFragment | <code>TxBytes</code> | Normalized bundle fragment |
| signatureFragment | <code>TxBytes</code> | Signature fragment txBytes |

**Returns**: <code>TxBytes</code> - Digest txBytes  
<a name="module_winternitz..signatureFragment"></a>

### *winternitz*~signatureFragment(normalizeBundleFragment, keyFragment, normalizedBundleFragmentOffset, keyFragmentOffset)

| Param | Type | Description |
| --- | --- | --- |
| normalizeBundleFragment | <code>TxBytes</code> | normalized bundle fragment |
| keyFragment | <code>TxBytes</code> | key fragment txBytes |
| normalizedBundleFragmentOffset | <code>number</code> | normalized bundle fragment offset (default 0) |
| keyFragmentOffset | <code>number</code> | key fragment offset (default 0) |

**Returns**: <code>TxBytes</code> - Signature Fragment hbits  
<a name="module_winternitz..signatureFragments"></a>

### *winternitz*~signatureFragments(normalizeBundleFragment, keyFragment)

| Param | Type | Description |
| --- | --- | --- |
| normalizeBundleFragment | <code>TxBytes</code> | normalized bundle fragment |
| keyFragment | <code>TxBytes</code> | key fragment txBytes |

**Returns**: <code>TxBytes</code> - Signature Fragment hbits  
<a name="module_winternitz..validateSignatures"></a>

### *winternitz*~validateSignatures(expectedAddress, signatureFragments, bundleHash)

| Param | Type | Description |
| --- | --- | --- |
| expectedAddress | <code>TxBytes</code> | Expected address txs |
| signatureFragments | <code>TxBytes</code> | Array of signatureFragments txs |
| bundleHash | <code>TxHex</code> | Bundle hash txs |

<a name="module_winternitz..normalizedBundleHash"></a>

### *winternitz*~normalizedBundleHash(bundlehash)

| Param | Type | Description |
| --- | --- | --- |
| bundlehash | <code>TxBytes</code> | Bundle hash txs |

Normalizes the bundle hash, with resulting digits summing to zero.

**Returns**: <code>TxBytes</code> - Normalized bundle hash

---
_Source: https://npm.io/package/@helixnetwork/winternitz · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
