Skip to content

Commit df2e5e0

Browse files
committed
fix fixed, have it also run in pipeline
1 parent 333ff58 commit df2e5e0

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/memorais.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- main
8+
- fixed
89
pull_request:
910
branches:
1011
- main

service/backend/Controllers/UsersController.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,15 @@ public async Task<IActionResult> ClientChallenge([FromBody] ClientChallengeMessa
113113
var secureDerivedKey = await handshakeService.DeriveSecureSessionKey(secureMessage.ClientChallenge, secureRandomServerBytes, secureMessage.UserId);
114114
if (secureDerivedKey.Length == 0)
115115
return BadRequest("Failed to compute session key.");
116+
117+
var iv = handshakeService.GenerateSecureCryptographicBytes(16);
116118

117119
var secureTempSessionId = Convert.ToBase64String(handshakeService.GenerateSecureCryptographicBytes(8));
118120
memoryCache.Set($"sessionKey_{secureTempSessionId}", secureDerivedKey, TimeSpan.FromSeconds(seconds: 5));
119121
memoryCache.Set($"clientChallenge_{secureTempSessionId}", secureMessage.ClientChallenge, TimeSpan.FromSeconds(seconds: 5));
120122
memoryCache.Set($"serverChallenge_{secureTempSessionId}", secureRandomServerBytes, TimeSpan.FromSeconds(seconds: 5));
121-
memoryCache.Set($"iv_{secureTempSessionId}", new byte[16], TimeSpan.FromSeconds(seconds: 5));
122-
return Ok(new { serverChallenge = secureRandomServerBytes, memoryKey = secureTempSessionId, iv = new byte[16] });
123+
memoryCache.Set($"iv_{secureTempSessionId}", iv, TimeSpan.FromSeconds(seconds: 5));
124+
return Ok(new { serverChallenge = secureRandomServerBytes, memoryKey = secureTempSessionId, iv = iv });
123125
}
124126

125127
[HttpPost("client-credentials")]

service/backend/Services/EmbeddingService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ namespace backend.Services;
88
public class EmbeddingService : IEmbeddingService
99
{
1010
private int _embeddingSizeFirstLayer;
11-
private int _embeddingSizeHiddenLayer;
1211
private int _windowSize;
1312
private int _minCount;
1413
private int _negativeSamples;
@@ -186,7 +185,7 @@ private float Dot(float[] a, float[] b)
186185
{
187186
if (_word2Idx.TryGetValue(tokenUnit, out int vocabularyIndex))
188187
{
189-
extractedVectors.Add(GetRow(_w1!, idx));
188+
extractedVectors.Add(GetRow(_w1!, vocabularyIndex));
190189
}
191190
}
192191

0 commit comments

Comments
 (0)