@@ -96,7 +96,7 @@ public static void RegisterWithCryptoConfig()
9696 public XmssParameterSet ParameterSet { get ; private set ; } = XmssParameterSet . None ;
9797
9898 bool IsDisposed ;
99- XmssPrivateKey ? PrivateKey ;
99+ PrivateKey ? PrivateKey ;
100100 XmssPublicKey PublicKey ;
101101
102102 void ResetState ( )
@@ -167,7 +167,7 @@ void ThrowIfNoPublicKey()
167167 #endregion
168168
169169 #region Private Key
170- static void VerifyNoPrivateState ( StateManagerWrapper wrappedStateManager )
170+ static void VerifyNoPrivateState ( WrappedStateManager wrappedStateManager )
171171 {
172172 var partExists = false ;
173173
@@ -202,13 +202,11 @@ static void VerifyNoPrivateState(StateManagerWrapper wrappedStateManager)
202202 /// <param name="stateManager">TODO</param>
203203 /// <param name="parameterSet">TODO</param>
204204 /// <param name="enableIndexObfuscation">TODO</param>
205- public void GeneratePrivateKey ( IXmssStateManager stateManager , XmssParameterSet parameterSet , bool enableIndexObfuscation )
205+ public void GeneratePrivateKey ( IXmssStateManager ? stateManager , XmssParameterSet parameterSet , bool enableIndexObfuscation )
206206 {
207- ArgumentNullException . ThrowIfNull ( stateManager ) ;
208-
209207 ObjectDisposedException . ThrowIf ( IsDisposed , this ) ;
210208
211- var wrappedStateManager = new StateManagerWrapper ( stateManager ) ;
209+ var wrappedStateManager = new WrappedStateManager ( stateManager ) ;
212210
213211 // Step 1: Verify that no (possibly valid) private parts exist for the new state.
214212
@@ -282,7 +280,7 @@ public void ImportPrivateKey(IXmssStateManager stateManager)
282280 ArgumentNullException . ThrowIfNull ( stateManager ) ;
283281 ObjectDisposedException . ThrowIf ( IsDisposed , this ) ;
284282
285- var wrappedStateManager = new StateManagerWrapper ( stateManager ) ;
283+ var wrappedStateManager = new WrappedStateManager ( stateManager ) ;
286284
287285 XmssError result ;
288286
@@ -360,8 +358,9 @@ public void SplitPrivateKey(IXmssStateManager newPartition, int newPartitionSize
360358
361359 ObjectDisposedException . ThrowIf ( IsDisposed , this ) ;
362360 ThrowIfNoPrivateKey ( ) ;
361+ PrivateKey . WrappedStateManager . ThrowIfEphemeralKey ( ) ;
363362
364- var wrappedNewPartition = new StateManagerWrapper ( newPartition ) ;
363+ var wrappedNewPartition = new WrappedStateManager ( newPartition ) ;
365364
366365 // Step 1: Verify that no (possibly valid) private parts exist for the new state.
367366
@@ -457,8 +456,9 @@ public void MergePartition(IXmssStateManager consumedPartition)
457456
458457 ObjectDisposedException . ThrowIf ( IsDisposed , this ) ;
459458 ThrowIfNoPrivateKey ( ) ;
459+ PrivateKey . WrappedStateManager . ThrowIfEphemeralKey ( ) ;
460460
461- var wrappedConsumedPartition = new StateManagerWrapper ( consumedPartition ) ;
461+ var wrappedConsumedPartition = new WrappedStateManager ( consumedPartition ) ;
462462
463463 using var consumedKeyStatefulBlob = CriticalXmssPrivateKeyStatefulBlobHandle . Alloc ( ) ;
464464 wrappedConsumedPartition . Load ( XmssKeyPart . PrivateStateful , consumedKeyStatefulBlob . Data ) ;
0 commit comments